org.jboss.system
Class ServiceController

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceController
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src)

public class ServiceController
extends JBossNotificationBroadcasterSupport (src)
implements MBeanRegistration (src)

This is the main Service Controller. A controller can deploy a service to a jboss.system It installs by delegating, it configures by delegating

See Also:
Service (src)

Nested Class Summary
 class ServiceController.ServiceProxy (src)
          An implementation of InvocationHandler used to proxy of the Service interface for mbeans.
 
Field Summary
protected  ServiceConfigurator (src) configurator
          Configurator, helper class to configure MBeans
protected  ServiceCreator (src) creator
          Creator, helper class to instantiate MBeans
static ObjectName (src) DEFAULT_LOADER_REPOSITORY
           
protected  java.util.List installedServices
          A linked list of services in the order they were created
static java.lang.String JBOSS_INTERNAL_LIFECYCLE
          The operation name for lifecycle
static java.lang.String[] JBOSS_INTERNAL_LIFECYCLE_SIG
          The signature for lifecycle operations
protected  java.util.Map nameToServiceMap
          Object Name to Service Proxy map
 
Constructor Summary
ServiceController()
           
 
Method Summary
 void create(ObjectName (src)  serviceName)
          #Description of the Method
 void create(ObjectName (src)  serviceName, java.util.Collection depends)
          #Description of the Method
 void destroy(ObjectName (src)  serviceName)
          #Description of the Method
 ServiceContext (src) getServiceContext(ObjectName (src)  serviceName)
          Lookup the ServiceContext for the given serviceName
 java.util.List install(org.w3c.dom.Element config, ObjectName (src)  loaderName)
          Deploy the beans Deploy means "instantiate and configure" so the MBean is created in the MBeanServer You must call "create" and "start" separately on the MBean to affect the service lifecycle deploy doesn't bother with service lifecycle only MBean instanciation/registration/configuration
 java.lang.String listConfiguration(ObjectName (src) [] objectNames)
          Gets the Configuration attribute of the ServiceController object
 java.util.List listDeployed()
          Lists the ServiceContexts of deployed mbeans
 java.util.List listDeployedNames()
          lists ObjectNames of deployed mbeans deployed through serviceController.
 java.util.List listIncompletelyDeployed()
          The listIncompletelyDeployed method returns the service contexts for the mbeans whose status is not CREATED, RUNNING, STOPPED or DESTROYED.
 void postDeregister()
          This method is called by the MBeanServer after deregistration takes place.
 void postRegister(java.lang.Boolean registrationDone)
          This method is called by the MBeanServer after registration takes place or when registration fails.
 void preDeregister()
          This method is called by the MBeanServer before deregistration takes place.
 ObjectName (src) preRegister(MBeanServer (src)  server, ObjectName (src)  name)
          #Description of the Method
 void register(ObjectName (src)  serviceName)
          Register the mbean against the microkernel with no dependencies.
 void register(ObjectName (src)  serviceName, java.util.Collection depends)
           
 void remove(ObjectName (src)  objectName)
          This MBean is going buh bye
 void restart(ObjectName (src)  serviceName)
          Stops and restarts the given service
 void shutdown()
          Describe shutdown method here.
 void start(ObjectName (src)  serviceName)
          Starts the indicated service
 void stop(ObjectName (src)  serviceName)
          Stop the given service
 void validateDeploymentState(DeploymentInfo (src)  di, DeploymentState (src)  state)
          Go through the mbeans of the DeploymentInfo and validate that they are in a state at least equal to that of the argument state
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LOADER_REPOSITORY

public static final ObjectName (src)  DEFAULT_LOADER_REPOSITORY

JBOSS_INTERNAL_LIFECYCLE

public static final java.lang.String JBOSS_INTERNAL_LIFECYCLE
The operation name for lifecycle

See Also:
Constant Field Values (src)

JBOSS_INTERNAL_LIFECYCLE_SIG

public static final java.lang.String[] JBOSS_INTERNAL_LIFECYCLE_SIG
The signature for lifecycle operations


creator

protected ServiceCreator (src)  creator
Creator, helper class to instantiate MBeans


configurator

protected ServiceConfigurator (src)  configurator
Configurator, helper class to configure MBeans


nameToServiceMap

protected java.util.Map nameToServiceMap
Object Name to Service Proxy map


installedServices

protected java.util.List installedServices
A linked list of services in the order they were created

Constructor Detail

ServiceController

public ServiceController()
Method Detail

listDeployed

public java.util.List listDeployed()
Lists the ServiceContexts of deployed mbeans

Returns:
the list of ServiceContexts for mbeans deployed through ServiceController.

listIncompletelyDeployed

public java.util.List listIncompletelyDeployed()
The listIncompletelyDeployed method returns the service contexts for the mbeans whose status is not CREATED, RUNNING, STOPPED or DESTROYED. An MBean that has reached one of the above states has its dependencies resolved.

Returns:
a List

listDeployedNames

public java.util.List listDeployedNames()
lists ObjectNames of deployed mbeans deployed through serviceController.

Returns:
a list of ObjectNames of deployed mbeans.

listConfiguration

public java.lang.String listConfiguration(ObjectName (src) [] objectNames)
                                   throws java.lang.Exception
Gets the Configuration attribute of the ServiceController object

Parameters:
objectNames - Description of Parameter
Returns:
The Configuration value
Throws:
java.lang.Exception - Description of Exception

validateDeploymentState

public void validateDeploymentState(DeploymentInfo (src)  di,
                                    DeploymentState (src)  state)
Go through the mbeans of the DeploymentInfo and validate that they are in a state at least equal to that of the argument state


install

public java.util.List install(org.w3c.dom.Element config,
                              ObjectName (src)  loaderName)
                       throws DeploymentException (src) 
Deploy the beans Deploy means "instantiate and configure" so the MBean is created in the MBeanServer You must call "create" and "start" separately on the MBean to affect the service lifecycle deploy doesn't bother with service lifecycle only MBean instanciation/registration/configuration

Parameters:
config -
loaderName -
Returns:
Description of the Returned Value
Throws:
DeploymentException (src)

register

public void register(ObjectName (src)  serviceName)
              throws java.lang.Exception
Register the mbean against the microkernel with no dependencies.

Throws:
java.lang.Exception
See Also:
register(ObjectName, java.util.Collection)

register

public void register(ObjectName (src)  serviceName,
                     java.util.Collection depends)
              throws java.lang.Exception
Throws:
java.lang.Exception
See Also:
#register(ServiceContext, java.util.Collection)

create

public void create(ObjectName (src)  serviceName)
            throws java.lang.Exception
#Description of the Method

Parameters:
serviceName - Description of Parameter
Throws:
java.lang.Exception - Description of Exception

create

public void create(ObjectName (src)  serviceName,
                   java.util.Collection depends)
            throws java.lang.Exception
#Description of the Method

Parameters:
serviceName - Description of Parameter
Throws:
java.lang.Exception - Description of Exception

start

public void start(ObjectName (src)  serviceName)
           throws java.lang.Exception
Starts the indicated service

Parameters:
serviceName - Description of Parameter
Throws:
java.lang.Exception - Description of Exception

restart

public void restart(ObjectName (src)  serviceName)
             throws java.lang.Exception
Stops and restarts the given service

Parameters:
serviceName - Description of Parameter
Throws:
java.lang.Exception - Description of Exception

stop

public void stop(ObjectName (src)  serviceName)
          throws java.lang.Exception
Stop the given service

Parameters:
serviceName - Description of Parameter
Throws:
java.lang.Exception - Description of Exception

destroy

public void destroy(ObjectName (src)  serviceName)
             throws java.lang.Exception
#Description of the Method

Parameters:
serviceName - Description of Parameter
Throws:
java.lang.Exception - Description of Exception

remove

public void remove(ObjectName (src)  objectName)
            throws java.lang.Exception
This MBean is going buh bye

Parameters:
objectName - Description of Parameter
Throws:
java.lang.Exception - Description of Exception

shutdown

public void shutdown()
Describe shutdown method here.


preRegister

public ObjectName (src)  preRegister(MBeanServer (src)  server,
                              ObjectName (src)  name)
                       throws java.lang.Exception
#Description of the Method

Specified by:
preRegister in interface MBeanRegistration (src)
Parameters:
server - Description of Parameter
name - Description of Parameter
Returns:
Description of the Returned Value
Throws:
java.lang.Exception - Description of Exception

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer after registration takes place or when registration fails.

Specified by:
postRegister in interface MBeanRegistration (src)
Parameters:
registrationDone - the MBeanServer passes true when the MBean was registered, false otherwise.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer before deregistration takes place.

The MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.

Specified by:
preDeregister in interface MBeanRegistration (src)
Throws:
java.lang.Exception

postDeregister

public void postDeregister()
Description copied from interface: MBeanRegistration (src)
This method is called by the MBeanServer after deregistration takes place.

Specified by:
postDeregister in interface MBeanRegistration (src)

getServiceContext

public ServiceContext (src)  getServiceContext(ObjectName (src)  serviceName)
Lookup the ServiceContext for the given serviceName