Services are the atomic unit of a JRun server, and all feature components must contain a service view-whether that view is a wrapper, a helper class, a factory, or the functional class itself-in order to be plugged into JRun. All JRun components, even the bootstrap components that manage the JMX spine, are services.
Each service, regardless of its vertical functional purpose, participates in the following lifecycle stages:
When the JRun server starts, services that are externalized as XML entries in jrun.xml are automatically created, initialized, and started, and their attributes are automatically configured. The services are automatically stopped and destroyed when the JRun server shuts down. You can invoke the start and stop methods any number of times on a running server in order to restart a service. The following list contains more detail on the service lifecycle:
init methods invoked, based on the order in which the services appear in jrun.xml.
start methods invoked, based on the order in which the services appear in jrun.xml. Each service whose bindToJNDI attribute is set to true is bound to JNDI.
stop methods invoked in reverse order in which they appear in jrun.xml, and JNDI-enabled services are removed from JNDI.
destroy methods invoked in reverse order in which they appear in jrun.xml.The following figure shows the JRun service class architecture:
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/jrun/4/JRun_SDK_Guide/creatingservices2.htm