|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
jrunx.kernel.ServiceAdapter
|
+--jrunx.kernel.DeploymentService
|
+--jrunx.kernel.JRunServiceDeployer
ServiceDeployer deploys MBeans based on the jrun.xml file for a given JRun server and manages the lifecycle of all those services as well. This is the core internal service of the server, and is created and invoked programmatically by the JRun.java bootstrap class. ,br> It is itself also a JRun service, and may be manipulated via the MBeanServer or the JMC.
| Field Summary | |
static java.lang.String |
LIFECYCLE_DESTROY
|
static java.lang.String |
LIFECYCLE_INIT
|
static java.lang.String |
LIFECYCLE_START
|
static java.lang.String |
LIFECYCLE_STOP
|
static java.lang.String |
OBJECT_NAME
|
| 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 |
| Fields inherited from interface jrunx.kernel.Service |
INITIALIZED, STARTED, STARTING, STOPPED, STOPPING, UNINITIALIZED |
| Constructor Summary | |
JRunServiceDeployer()
|
|
| Method Summary | |
void |
addEventListener(ServerEventListener listener,
java.lang.Object handback)
Adds a ServerEventListener |
void |
addService(java.lang.String oname)
Add a service to the deployer that didn't exist in jrun.xml |
void |
addService(java.lang.String oname,
int pos)
Add a service in a specific position in the ordered services that didn't exist in jrun.xml. |
void |
addService(java.lang.String oname,
java.lang.Integer pos)
Necessary because JMX server invocations can only handle Objects, no primitives. |
static java.util.List |
buildAttributes(java.util.Vector attrs,
java.util.Properties serverProps,
javax.management.MBeanServer server)
Given a list of attributes, build the list of properties to set on a given object |
protected static java.lang.Object |
buildObject(DocumentElement attrElement,
java.util.Properties serverProps,
javax.management.MBeanServer server)
Builds an object using the attributes from the given DocumentElement |
void |
deployServices(DocumentElement parent,
java.util.Vector elementTree)
|
void |
deployServices(java.util.Vector elementTree)
|
void |
destroyServices()
Destroy all service in reverse order in which they appear in jrun.xml. |
java.util.Set |
findAllObjectInstances()
Retrieve an unordered Set of ObjectNames for all Services. |
Service |
findService(java.lang.String name)
|
protected void |
fireEvent(ServerEvent event)
Fires a server event to all my listeners |
static ServerEvent |
getServerStatus()
|
static int |
getServiceStatus(javax.management.MBeanServer server,
javax.management.ObjectName serviceName)
Gets the current service status for the given object |
int |
getServiceStatus(java.lang.String serviceName)
|
void |
initServices()
Init all service in the order in which they appear in jrun.xml. |
static void |
invokeOnServices(ServiceAdapter parent,
java.util.ArrayList list,
java.lang.String method)
Invokes the given method name on all of the services listed. |
static boolean |
isServiceDeactivated(javax.management.MBeanServer server,
javax.management.ObjectName serviceName)
Checks if the given service is deactivated |
void |
removedEventListener(ServerEventListener listener)
Removes a ServerEventListener |
void |
run()
Shutdown event starts the Thread, Thread is not running beforehand. |
static void |
setProperties(java.lang.Object o,
java.util.List list)
Sets the properties on an arbitrary bean. |
static void |
setServiceStatus(javax.management.MBeanServer server,
javax.management.ObjectName serviceName,
int status)
Sets the current service status for the given object |
void |
shutdownServices()
|
void |
startServices()
Start all service in the order in which they appear in jrun.xml. |
void |
stopServices()
Stop all service in reverse order in which they appear in jrun.xml. |
| Methods inherited from class jrunx.kernel.DeploymentService |
getURL, loadServices, parseDescriptorURL, setURL, start |
| Methods inherited from interface jrunx.kernel.DeploymentServiceMBean |
getURL, loadServices, setURL |
| Methods inherited from interface jrunx.kernel.ServiceMBean |
bind, getBindToJNDI, getDeactivated, getDomainName, getJRunService, getLogger, getName, getParentService, getServerName, requestServer, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, unbind |
| Methods inherited from interface jrunx.kernel.Service |
destroy, getStatus, init, start, stop, updateStatus |
| Field Detail |
public static final java.lang.String OBJECT_NAME
public static final java.lang.String LIFECYCLE_INIT
public static final java.lang.String LIFECYCLE_START
public static final java.lang.String LIFECYCLE_STOP
public static final java.lang.String LIFECYCLE_DESTROY
| Constructor Detail |
public JRunServiceDeployer()
| Method Detail |
public void deployServices(java.util.Vector elementTree)
throws java.lang.Exception
deployServices in class DeploymentServicepublic static ServerEvent getServerStatus()
public void deployServices(DocumentElement parent,
java.util.Vector elementTree)
public void addService(java.lang.String oname)
addService in interface JRunServiceDeployerMBean
public void addService(java.lang.String oname,
java.lang.Integer pos)
addService in interface JRunServiceDeployerMBean
public void addService(java.lang.String oname,
int pos)
public void run()
run in interface java.lang.Runnablepublic void shutdownServices()
shutdownServices in interface JRunServiceDeployerMBean
public void initServices()
throws java.lang.Exception
initServices in interface JRunServiceDeployerMBean
public void startServices()
throws java.lang.Exception
startServices in interface JRunServiceDeployerMBean
public void stopServices()
throws java.lang.Exception
stopServices in interface JRunServiceDeployerMBean
public void destroyServices()
throws java.lang.Exception
destroyServices in interface JRunServiceDeployerMBeanpublic int getServiceStatus(java.lang.String serviceName)
getServiceStatus in interface JRunServiceDeployerMBean
public Service findService(java.lang.String name)
throws ServiceException
public java.util.Set findAllObjectInstances()
public static void setServiceStatus(javax.management.MBeanServer server,
javax.management.ObjectName serviceName,
int status)
throws java.lang.Exception
server - The MBeanServerserviceName - The ObjectName of the servicestatus - The status to set
public static int getServiceStatus(javax.management.MBeanServer server,
javax.management.ObjectName serviceName)
throws java.lang.Exception
server - The MBeanServerserviceName - The ObjectName of the service
public static boolean isServiceDeactivated(javax.management.MBeanServer server,
javax.management.ObjectName serviceName)
throws java.lang.Exception
server - The MBeanServerserviceName - The ObjectName of the service
public static void invokeOnServices(ServiceAdapter parent,
java.util.ArrayList list,
java.lang.String method)
parent - The ServiceAdapter parent of the serviceslist - The list of servicesmethod - The name of the method to invoke. The method must have a void signature.
public static java.util.List buildAttributes(java.util.Vector attrs,
java.util.Properties serverProps,
javax.management.MBeanServer server)
throws java.lang.Exception
attr - The list of attributesserverProps - Any server properties that may be referenced as dynamic variablesserver - The current MBean server
protected static java.lang.Object buildObject(DocumentElement attrElement,
java.util.Properties serverProps,
javax.management.MBeanServer server)
throws java.lang.Exception
type - The DocumentElement that describes the objectserverProps - Any server properties that may be referenced as dynamic variablesserver - The current MBean server
public static void setProperties(java.lang.Object o,
java.util.List list)
throws java.lang.Exception
o - The object to set properties onlist - The list of AttributeHolder objects
public void addEventListener(ServerEventListener listener,
java.lang.Object handback)
JRunServiceDeployerMBeanaddEventListener in interface JRunServiceDeployerMBeanjrunx.kernel.JRunServiceDeployerMBeanlistener - The listenerhandback - An object to handback to the listener when an event occurspublic void removedEventListener(ServerEventListener listener)
JRunServiceDeployerMBeanremovedEventListener in interface JRunServiceDeployerMBeanjrunx.kernel.JRunServiceDeployerMBeanlistener - The listenerprotected void fireEvent(ServerEvent event)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||