|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
public class ServiceMBeanSupport
An abstract base class JBoss services can subclass to implement a
service that conforms to the ServiceMBean interface. Subclasses must
override getName()
method and should override
startService()
, and stopService()
as approriate.
ServiceMBean
Field Summary | |
---|---|
protected org.jboss.logging.Logger |
log
The instance logger for the service. |
protected MBeanServer |
server
The MBeanServer which we have been register with. |
static String[] |
SERVICE_CONTROLLER_SIG
The signature for service controller operations |
protected ObjectName |
serviceName
The object name which we are registsred under. |
Fields inherited from interface org.jboss.system.ServiceMBean |
---|
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
---|---|
ServiceMBeanSupport()
Construct a |
|
ServiceMBeanSupport(Class type)
Construct a |
|
ServiceMBeanSupport(org.jboss.logging.Logger log)
Construct a |
|
ServiceMBeanSupport(String category)
Construct a |
Method Summary | |
---|---|
void |
create()
|
protected void |
createService()
Sub-classes should override this method to provide custum 'create' logic. |
void |
destroy()
|
protected void |
destroyService()
Sub-classes should override this method to provide custum 'destroy' logic. |
DeploymentInfo |
getDeploymentInfo()
Provide access to the service DeploymentInfo. |
org.jboss.logging.Logger |
getLog()
|
String |
getName()
Use the short class name as the default for the service name. |
protected long |
getNextNotificationSequenceNumber()
The getNextNotificationSequenceNumber method returns
the next sequence number for use in notifications. |
protected ObjectName |
getObjectName(MBeanServer server,
ObjectName name)
Sub-classes should override this method if they only need to set their object name during MBean pre-registration. |
MBeanServer |
getServer()
|
ObjectName |
getServiceName()
|
int |
getState()
|
String |
getStateString()
|
protected void |
jbossInternalCreate()
|
protected String |
jbossInternalDescription()
|
protected void |
jbossInternalDestroy()
|
void |
jbossInternalLifecycle(String method)
Detyped lifecycle invocation |
protected void |
jbossInternalStart()
|
protected void |
jbossInternalStop()
|
protected void |
pojoChange(org.jboss.dependency.spi.ControllerState state)
|
void |
pojoCreate()
|
void |
pojoDestroy()
|
void |
pojoStart()
|
void |
pojoStop()
|
void |
postDeregister()
|
void |
postRegister(Boolean registrationDone)
|
void |
preDeregister()
|
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
Callback method of MBeanRegistration
before the MBean is registered at the JMX Agent. |
void |
setKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext controllerContext)
|
void |
start()
|
protected void |
startService()
Sub-classes should override this method to provide custum 'start' logic. |
void |
stop()
|
protected void |
stopService()
Sub-classes should override this method to provide custum 'stop' logic. |
void |
unsetKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext controllerContext)
|
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
---|
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String[] SERVICE_CONTROLLER_SIG
protected org.jboss.logging.Logger log
protected MBeanServer server
protected ObjectName serviceName
Constructor Detail |
---|
public ServiceMBeanSupport()
Sets up logging.
public ServiceMBeanSupport(Class type)
Sets up logging.
type
- The class type to determine category name from.public ServiceMBeanSupport(String category)
Sets up logging.
category
- The logger category name.public ServiceMBeanSupport(org.jboss.logging.Logger log)
log
- The logger to use.Method Detail |
---|
public void setKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext controllerContext) throws Exception
setKernelControllerContext
in interface org.jboss.kernel.spi.dependency.KernelControllerContextAware
Exception
public void unsetKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext controllerContext) throws Exception
unsetKernelControllerContext
in interface org.jboss.kernel.spi.dependency.KernelControllerContextAware
Exception
public String getName()
getName
in interface ServiceMBean
public ObjectName getServiceName()
public DeploymentInfo getDeploymentInfo() throws JMException
JMException
- - thrown on failure to invoke
SARDeployer.getService(ObjectName)public MBeanServer getServer()
public int getState()
getState
in interface ServiceMBean
public String getStateString()
getStateString
in interface ServiceMBean
public org.jboss.logging.Logger getLog()
public void pojoCreate() throws Exception
Exception
public void pojoStart() throws Exception
Exception
public void pojoStop() throws Exception
Exception
public void pojoDestroy() throws Exception
Exception
protected void pojoChange(org.jboss.dependency.spi.ControllerState state)
public void create() throws Exception
create
in interface Service
Exception
public void start() throws Exception
start
in interface Service
Exception
public void stop()
stop
in interface Service
public void destroy()
destroy
in interface Service
protected String jbossInternalDescription()
public void jbossInternalLifecycle(String method) throws Exception
ServiceMBean
jbossInternalLifecycle
in interface ServiceMBean
Exception
protected void jbossInternalCreate() throws Exception
Exception
protected void jbossInternalStart() throws Exception
Exception
protected void jbossInternalStop()
protected void jbossInternalDestroy()
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
MBeanRegistration
before the MBean is registered at the JMX Agent.
Attention: Always call this method when you overwrite it in a subclass because it saves the Object Name of the MBean.
preRegister
in interface MBeanRegistration
server
- Reference to the JMX Agent this MBean is registered onname
- Name specified by the creator of the MBean. Note that you can
overwrite it when the given ObjectName is null otherwise the
change is discarded (maybe a bug in JMX-RI).
Exception
- for any errorpublic void postRegister(Boolean registrationDone)
postRegister
in interface MBeanRegistration
public void preDeregister() throws Exception
preDeregister
in interface MBeanRegistration
Exception
public void postDeregister()
postDeregister
in interface MBeanRegistration
protected long getNextNotificationSequenceNumber()
getNextNotificationSequenceNumber
method returns
the next sequence number for use in notifications.
long
valueprotected ObjectName getObjectName(MBeanServer server, ObjectName name) throws MalformedObjectNameException
server
- the mbeanservername
- the suggested name, maybe null
MalformedObjectNameException
- for a bad object nameprotected void createService() throws Exception
This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
Exception
- for any errorprotected void startService() throws Exception
This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
Exception
- for any errorprotected void stopService() throws Exception
This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
Exception
- for any errorprotected void destroyService() throws Exception
This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
Exception
- for any error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |