JBoss Modular Service Kernel API 1.0.0.Beta1

org.jboss.msc.services
Class MBeanService

java.lang.Object
  extended by org.jboss.msc.services.MBeanService
All Implemented Interfaces:
Service<Void>, Value<Void>

public final class MBeanService
extends Object
implements Service<Void>

A service which registers the target object as an MBean.

Author:
David M. Lloyd

Field Summary
static ServiceName JBOSS_JMX
          The service name under which JMX-related entities are registered.
static ServiceName JBOSS_JMX_MBEAN
          The service name under which mbeans for services are registered.
static ServiceName JBOSS_JMX_MBEANSERVER
          The service name under which mbean servers are registered.
 
Fields inherited from interface org.jboss.msc.service.Service
NULL, NULL_VALUE
 
Constructor Summary
MBeanService(Value<? extends MBeanServer> mbeanServer, Value<?> value, ObjectName objectName)
          Construct a new instance.
 
Method Summary
 Void getValue()
          Get the actual value.
 void start(StartContext context)
          Start the service.
 void stop(StopContext context)
          Stop the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JBOSS_JMX

public static ServiceName JBOSS_JMX
The service name under which JMX-related entities are registered.


JBOSS_JMX_MBEAN

public static ServiceName JBOSS_JMX_MBEAN
The service name under which mbeans for services are registered. The service name that was registered as an mbean will follow this part.


JBOSS_JMX_MBEANSERVER

public static ServiceName JBOSS_JMX_MBEANSERVER
The service name under which mbean servers are registered.

Constructor Detail

MBeanService

public MBeanService(Value<? extends MBeanServer> mbeanServer,
                    Value<?> value,
                    ObjectName objectName)
Construct a new instance.

Parameters:
mbeanServer - the mbean server
value - the value to install
objectName - the object name to use
Method Detail

start

public void start(StartContext context)
           throws StartException
Start the service. Do not return until the service has been fully started, unless an asynchronous service start is performed. All injections will be complete before this method is called.

Specified by:
start in interface Service<Void>
Parameters:
context - the context which can be used to trigger an asynchronous service start
Throws:
StartException - if the service could not be started for some reason

stop

public void stop(StopContext context)
Stop the service. Do not return until the service has been fully stopped, unless an asynchronous service stop is performed. All injections will remain intact until the service is fully stopped. This method should not throw an exception.

Specified by:
stop in interface Service<Void>
Parameters:
context - the context which can be used to trigger an asynchronous service stop

getValue

public Void getValue()
              throws IllegalStateException
Get the actual value.

Specified by:
getValue in interface Value<Void>
Returns:
the actual value
Throws:
IllegalStateException - if the value is time-sensitive and the current state does not allow retrieval.

JBoss Modular Service Kernel API 1.0.0.Beta1

Copyright © 2010 JBoss, a division of Red Hat, Inc.