While searching for how to write a service in jboss, I have more questions.
This Page seems to give a lot of information but none for simple services.
"MBeans that are independent of JBoss services are the trival case and can be written per the JMX specification and added to a JBoss server by adding their MLET tag to the jboss.conf file." My Questions:
1. Isn't jboss.conf read just once at server start up?
2. If I add something to jboss.conf, won't it require the service class to be in classpath at that time? So, is it necessary for services to be libs?
3. How will I be able to hot deploy/redeploy the service?
4. just one stupid question .. I cant find jboss.jcml?
Does someone have any step-by-step guide to writing a "trivial" custom service in jboss? Please forward ne pointers.
Thanks in advance
Writing an MBean service would do. You'll have to manage your threads.
Have a look at the second chapter of the free JBoss documentation:
(you may have to register first).
The jboss.jcml file refers to older jboss versions 2.x, so it is not current anymore.
So, where does the service config goes if it's not the jboss.jcml?
The server/default/conf/jboss-service.xml file is the equivalent of the legacy jboss.jcml file.
I intend to write a port listener (Which will listen on lets say 7001) . The incoming data does not follow any protocol, its just a stream of bytes. After analyzing the bytes I need to call EJBs etc.
I can write this listener as an independent daemon and call EJBs on RMI. But I want it to be integerated with JBoss so i can use its infra.
After a lot of research on how to write such a servlet, I gave up. (my data is coming from NAC and only server IP and port can be configured there, not url text) It seems, the best approach wud be to copy the way WebService/NamingService etc work? Packaged as MBean and listening to another port. Is this line of thinking correct?
I had a look at org.jboss.web.WebService code, If I go with this decision, I'll be following its way of functioning/Coding. Again, is this line of thinking correct?
2 specific questions
1. It IS possible to write a custom service to listen on a port integratedw with JBoss? Right?
2. The Thread Management - Will I have to do it? Or can I use container Thread?
I'll appreciate any pointers.
Where are you in implementing your port listener using MBeans? I'm basically trying to do the same. Still struggling with using MBeans since there is no mention of the service actually running when JBoss starts up. I've done startup classes in Weblogic but cannot get definite way to do it in JBoss.