24.2. Advanced Understanding

Refer to the JOnAS sources for more details about the classes mentioned in this section.

24.2.1. JOnAS built-in Services

The existing JOnAS services are the following:

Service nameService class
registryRegistryServiceImpl
ejbEJBServiceImpl
earEarServiceImpl
dbmDatabaseServiceImpl
jmsJmsServiceImpl
jmxJmxServiceImpl
jtmTransactionServiceImpl
mailMailServiceImpl
resourceResourceServiceImpl
securityJonasSecurityServiceImpl
wsAxisWSService

If all of these services are required, they will be launched in the following order: registry, jmx, security, jtm, dbm, mail, jms, resource, ejb, ws, web, ear.

jmx, security, dbm, mail, resource are optional when you are using service ejb.

registry must be launched first.

NoteNotes
 

For compatibility with previous versions of JOnAS, if registry is not set as the first service to launch, JOnAS automatically launches the registry service. Thus, the jtm service must be launched before these services.

dbm, jms, resource, and ejb depend on jtm.

ear depends on ejb and web (that provide the ejb and web containers), thus these services must be launched before the ear service.

ear and web depend on ws, thus the ws service must be launched before the ear and web services.

It is possible to launch a stand-alone Transaction Manager with only the registry and jtm services.

In this case, a jonas.properties file looks like the following:

.....

jonas.services    registry,jmx,security,jtm,dbm,mail,jms,ejb,resource,serv1 

jonas.service.registry.class  \
    org.objectweb.jonas.registry.RegistryServiceImpl
jonas.service.registry.mode        automatic

jonas.service.dbm.class       org.objectweb.jonas.dbm.DatabaseServiceImpl
jonas.service.dbm.datasources Oracle1

jonas.service.ejb.class       org.objectweb.jonas.container.EJBServiceImpl
jonas.service.ejb.descriptors ejb-jar.jar
jonas.service.ejb.parsingwithvalidation  true
jonas.service.ejb.mdbthreadpoolsize      10

jonas.service.web.class       \
   org.objectweb.jonas.web.catalina.CatalinaJWebContainerServiceImpl
jonas.service.web.descriptors        war.war
jonas.service.web.parsingwithvalidation  true

jonas.service.ear.class       org.objectweb.jonas.ear.EarServiceImpl
jonas.service.ear.descriptors j2ee-application.ear
jonas.service.ear.parsingwithvalidation  true

jonas.service.jms.class       org.objectweb.jonas.jms.JmsServiceImpl
jonas.service.jms.mom         org.objectweb.jonas_jms.JmsAdminForJoram
jonas.service.jms.collocated  true
jonas.service.jms.url         joram://localhost:16010

jonas.service.jmx.class       org.objectweb.jonas.jmx.JmxServiceImpl

jonas.service.jtm.class       \
    org.objectweb.jonas.jtm.TransactionServiceImpl
jonas.service.jtm.remote      false
jonas.service.jtm.timeout     60

jonas.service.mail.class      org.objectweb.jonas.mail.MailServiceImpl
jonas.service.mail.factories  MailSession1

jonas.service.security.class  \
    org.objectweb.jonas.security.JonasSecurityServiceImpl

jonas.service.resource.class  \
    org.objectweb.jonas.resource.ResourceServiceImpl
jonas.service.resource.resources         MyRA

jonas.service.serv1.class     a.b.MyService
jonas.service.serv1.p1        John

24.2.2. The ServiceException

The org.objectweb.jonas.service.ServiceException exception is defined for Services. Its type is java.lang.RuntimeException and it can encapsulate any java.lang.Throwable.

24.2.3. The ServiceManager

The org.objectweb.jonas.service.ServiceManager class is responsible for creating, initializing, and launching the services. It can also return a service from its name and list all the services.