jrunx.kernel
Class ConfigurableServicePartition
jrunx.kernel.ServiceAdapter
|
+--jrunx.kernel.ServicePartition
|
+--jrunx.kernel.ConfigurableServicePartition
- All Implemented Interfaces:
- ConfigurableServicePartitionMBean, javax.naming.Referenceable, java.io.Serializable, Service, ServiceMBean, ServicePartitionMBean
- Direct Known Subclasses:
- ClusterableServiceAdapter, ClusterDeployerService, ClusterManager, InstrumentationService, J2EEModule, JRunJMS, JRunServer, JRunTransactionService, LogEventHandler, LoggerService, ResourceService, ServletEngineService, ServletUsersService, SessionService
- public abstract class ConfigurableServicePartition
- extends ServicePartition
- implements ConfigurableServicePartitionMBean
Implementation of a Configurable Service Partition.
A configurable service partition is a partition whose services are
defined in jrun.xml and is fully configured via XML elements. The
server writer does not need to implement any of the service lifecycle
methods. If the service writer does override any of the lifecycle methods
(init, start, stop, destroy) the super method must be invoked.
As an example, consider the following services:
class serviceA extends ConfigurableServicePartition
class serviceB extends ServiceAdapter
class serviceC extends ConfigurableServicePartition
class serviceD extends ServiceAdapter
The following configuration is including in jrun.xml:
<service class="serviceA" name=":service=serviceA">
<service class="serviceB" name=":service=serviceB">
</service>
<service class="serviceC" name=":service=serviceC">
<service class="serviceD" name=":service=serviceD">
</service>
</service>
</service>
When serviceA (a top-level service in the default domain) is loaded,
all of the child services (serviceB and serviceC) are also loaded since serviceA is a
ConfigurableServicePartition. Since serviceC is also a ConfigurableServicePartition
its child services are also loaded (serviceD). All child services will be
initialized, started, stopped, and stopped with the top-level service.
Any number of nested partitions may be defined.
- Author:
- Karl Moss
- See Also:
- Serialized Form
| Fields inherited from class jrunx.kernel.ServiceAdapter |
DEFAULT_DEACTIVATED, DEFAULT_DOMAIN, DOMAIN_NAME_SEPARATOR, DOMAIN_NAME_SUFFIX, domainName, jndiBindable, LOGGER_CACHE_TIME, SCHEDULER_SERVICE, SECURITY_MANAGER, server, status, TRANSACTION_MANAGER |
|
Method Summary |
void |
destroy()
Every service is eventually destroyed. |
protected void |
destroyServices()
|
void |
init()
Not every service needs to init, implement it out of convenience. |
protected void |
initServices()
|
protected java.lang.Object |
loadAndInit(java.lang.String name,
java.lang.String className,
java.util.List attrList)
|
protected void |
loadChildren()
Load the child elements of this parent |
void |
setChildElements(DocumentElement parent,
java.util.Vector children)
Sets the child DocumentElement objects as parsed from jrun.xml. |
void |
start()
Every service other than mere data collections should start |
protected void |
startServices()
|
void |
stop()
Every service other than mere data collections should stop |
protected void |
stopServices()
|
| Methods inherited from class jrunx.kernel.ServiceAdapter |
bind, findObjectInstance, findObjectInstance, findObjectInstance, getBindToJNDI, getDeactivated, getDomainName, getDomainSearchPath, getJRunService, getLogger, getName, getParentService, getReference, getResourceManager, getServerName, getServerProperties, getStatus, invokeMethod, isInPartition, isPartition, lookup, postDeregister, postRegister, preDeregister, preRegister, requestServer, scheduleRunnable, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, toString, unbind, unscheduleRunnable, updateStatus |
| Methods inherited from interface jrunx.kernel.ServiceMBean |
bind, getBindToJNDI, getDeactivated, getDomainName, getJRunService, getLogger, getName, getParentService, getServerName, requestServer, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, unbind |
ConfigurableServicePartition
public ConfigurableServicePartition()
setChildElements
public void setChildElements(DocumentElement parent,
java.util.Vector children)
- Description copied from interface:
ConfigurableServicePartitionMBean
- Sets the child DocumentElement objects as parsed from jrun.xml.
This is done automatically when the service is loaded.
- Specified by:
setChildElements in interface ConfigurableServicePartitionMBean
- Following copied from interface:
jrunx.kernel.ConfigurableServicePartitionMBean
- Parameters:
parent - My parent DocumentElementchildren - A Vector of DocumentElement objects
loadChildren
protected void loadChildren()
- Load the child elements of this parent
loadAndInit
protected java.lang.Object loadAndInit(java.lang.String name,
java.lang.String className,
java.util.List attrList)
throws java.lang.Exception
init
public void init()
throws java.lang.Exception
- Description copied from class:
ServiceAdapter
- Not every service needs to init, implement it out of convenience.
- Specified by:
init in interface Service- Overrides:
init in class ServiceAdapter
start
public void start()
throws java.lang.Exception
- Description copied from class:
ServiceAdapter
- Every service other than mere data collections should start
- Specified by:
start in interface Service- Overrides:
start in class ServiceAdapter
stop
public void stop()
throws java.lang.Exception
- Description copied from class:
ServiceAdapter
- Every service other than mere data collections should stop
- Specified by:
stop in interface Service- Overrides:
stop in class ServiceAdapter
destroy
public void destroy()
throws java.lang.Exception
- Description copied from class:
ServiceAdapter
- Every service is eventually destroyed. Convenience implementation.
- Specified by:
destroy in interface Service- Overrides:
destroy in class ServiceAdapter
initServices
protected void initServices()
startServices
protected void startServices()
stopServices
protected void stopServices()
destroyServices
protected void destroyServices()
Copyright � 2002 Macromedia Corporation. All Rights Reserved.