Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mobicents.slee.container.management.jmx
Class SleeManagementMBeanImpl  view SleeManagementMBeanImpl download SleeManagementMBeanImpl.java

java.lang.Object
  extended byStandardMBean
      extended byorg.mobicents.slee.container.management.jmx.SleeManagementMBeanImpl
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, SleeManagementMBeanImplMBean

public class SleeManagementMBeanImpl
extends StandardMBean
implements SleeManagementMBeanImplMBean

Implementation of the Slee Management MBean See SLEE 1.0 spec, section 14.6.2 SleeManagementMBean inteface


Field Summary
private  ServiceID[] activeServicesBeforeStop
          List of services, which were active immediately before stop.
private  javax.management.ObjectName alarmMBean
           
private  javax.management.ObjectName deploymentMBean
           
private  boolean isFullSleeStop
           
private static org.jboss.logging.Logger logger
           
private static javax.management.MBeanNotificationInfo[] MBEAN_NOTIFICATIONS
          The array of MBean notifications that this MBean broadcasts
private  javax.management.MBeanServer mbeanServer
           
private  javax.management.NotificationBroadcasterSupport notificationBroadcaster
           
private  javax.management.ObjectName objectName
           
private  javax.management.ObjectName profileProvisioningMBean
           
private  javax.management.ObjectName serviceManagementMBean
           
private  org.mobicents.slee.container.SleeContainer sleeContainer
           
private  long sleeStateChangeSequenceNumber
          counter for the number of slee state change notifications sent out
private  long startupTime
          Holds the startup time of the Mobicents SAR.
private  javax.management.ObjectName traceMBean
           
 
Constructor Summary
SleeManagementMBeanImpl()
          Default constructor
 
Method Summary
 void addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
           
private  boolean areAllServicesInvalid()
           
protected  void changeSleeState(SleeState newState)
          Changes the SLEE container state and emits JMX notifications
 void create()
           
 void destroy()
           
 javax.management.ObjectName getAlarmMBean()
          return the ObjectName of the AlarmMBean
 javax.management.ObjectName getDeploymentMBean()
          return the ObjectName of the DeploymentMBean
 javax.management.MBeanNotificationInfo[] getNotificationInfo()
           
 javax.management.ObjectName getObjectName()
           
 javax.management.ObjectName getProfileProvisioningMBean()
           
 javax.management.ObjectName getServiceManagementMBean()
          return the ObjectName of the ServiceManagementMBean
 SleeState getState()
           
 javax.management.ObjectName getTraceMBean()
           
 boolean isFullSleeStop()
          Indicates whether Mobicents SLEE is simply marked as STOPPED or all its services actually stopped.
 void postDeregister()
          This method is called by the MBeanServer after deregistration takes place.
 void postRegister(java.lang.Boolean arg0)
          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.
 javax.management.ObjectName preRegister(javax.management.MBeanServer mbs, javax.management.ObjectName oname)
          This method is called by the MBeanServer before registration takes place.
private  void rememberActiveResourceAdaptorsBeforeStop()
          Remembers in memory active Resource Adaptors so that they can be reactivated on start.
private  void rememberActiveServicesBeforeStop()
          Remembers in memory active services so that they can be reactivated on start.
 void removeNotificationListener(javax.management.NotificationListener listener)
           
private  void resumeServicesActiveBeforeStop()
          Activate services, which were active before SLEE stopped
protected  void scheduleStopped()
          Setup a polling process to wait until all ActivityContexts ended.
 void setAlarmMBean(javax.management.ObjectName newAM)
          set the ObjectName of the AlarmMBean
 void setDeploymentMBean(javax.management.ObjectName newDM)
          set the ObjectName of the DeploymentMBean
 void setFullSleeStop(boolean b)
           
 void setProfileProvisioningMBean(javax.management.ObjectName newPPM)
          set the ObjectName of the ProfileProvisioningMBean
 void setServiceManagementMBean(javax.management.ObjectName newSMM)
          set the ObjectName of the ServiceManagementMBean
 void setTraceMBean(javax.management.ObjectName newTM)
          set the ObjectName of the TraceMBean
 void shutdown()
          Shutdown the SLEE processes.
 void start()
          Start the SLEE container
protected  void startSleeContainer()
          Start the SleeContainer and initialize the necessary resources
 void stop()
          Gracefully stop the SLEE.
private  void stopAllProfileTableActivities()
           
private  void stopAllResourceAdaptors()
          Deactivate all active resource adaptors in preparation for moving to the STOPPED state.
private  void stopAllServices()
          Deactivate all active services in preparation for moving to the STOPPED state.
protected  void stopSleeContainer()
          Stop the service container and clean up the resources it used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mbeanServer

private javax.management.MBeanServer mbeanServer

alarmMBean

private javax.management.ObjectName alarmMBean

traceMBean

private javax.management.ObjectName traceMBean

logger

private static org.jboss.logging.Logger logger

objectName

private javax.management.ObjectName objectName

deploymentMBean

private javax.management.ObjectName deploymentMBean

sleeContainer

private org.mobicents.slee.container.SleeContainer sleeContainer

profileProvisioningMBean

private javax.management.ObjectName profileProvisioningMBean

serviceManagementMBean

private javax.management.ObjectName serviceManagementMBean

notificationBroadcaster

private javax.management.NotificationBroadcasterSupport notificationBroadcaster

sleeStateChangeSequenceNumber

private long sleeStateChangeSequenceNumber
counter for the number of slee state change notifications sent out


MBEAN_NOTIFICATIONS

private static final javax.management.MBeanNotificationInfo[] MBEAN_NOTIFICATIONS
The array of MBean notifications that this MBean broadcasts


startupTime

private long startupTime
Holds the startup time of the Mobicents SAR. Assumes that this MBean is instantiated first and started last within the scope of Mobicents.sar


isFullSleeStop

private boolean isFullSleeStop

activeServicesBeforeStop

private ServiceID[] activeServicesBeforeStop
List of services, which were active immediately before stop. They need to be remembered (TODO: persisted!) and resumed on start.

Constructor Detail

SleeManagementMBeanImpl

public SleeManagementMBeanImpl()
                        throws java.lang.Exception
Default constructor

Method Detail

getObjectName

public javax.management.ObjectName getObjectName()

getState

public SleeState getState()
                   throws ManagementException
Specified by:
getState in interface SleeManagementMBeanImplMBean

start

public void start()
           throws InvalidStateException,
                  ManagementException
Start the SLEE container

Specified by:
start in interface SleeManagementMBeanImplMBean

stop

public void stop()
          throws InvalidStateException,
                 ManagementException
Gracefully stop the SLEE. Should do it in a non-blocking manner.

Specified by:
stop in interface SleeManagementMBeanImplMBean

shutdown

public void shutdown()
              throws InvalidStateException,
                     ManagementException
Shutdown the SLEE processes. The spec requires that System.exit() be called before this methods returns. We are not convinced this is necessary yet. A trivial implementation would be to make a call to the JBoss server shutdown()

Specified by:
shutdown in interface SleeManagementMBeanImplMBean

getDeploymentMBean

public javax.management.ObjectName getDeploymentMBean()
return the ObjectName of the DeploymentMBean

Specified by:
getDeploymentMBean in interface SleeManagementMBeanImplMBean

setDeploymentMBean

public void setDeploymentMBean(javax.management.ObjectName newDM)
set the ObjectName of the DeploymentMBean

Specified by:
setDeploymentMBean in interface SleeManagementMBeanImplMBean

getServiceManagementMBean

public javax.management.ObjectName getServiceManagementMBean()
return the ObjectName of the ServiceManagementMBean

Specified by:
getServiceManagementMBean in interface SleeManagementMBeanImplMBean

setServiceManagementMBean

public void setServiceManagementMBean(javax.management.ObjectName newSMM)
set the ObjectName of the ServiceManagementMBean

Specified by:
setServiceManagementMBean in interface SleeManagementMBeanImplMBean

getProfileProvisioningMBean

public javax.management.ObjectName getProfileProvisioningMBean()
Specified by:
getProfileProvisioningMBean in interface SleeManagementMBeanImplMBean

setProfileProvisioningMBean

public void setProfileProvisioningMBean(javax.management.ObjectName newPPM)
set the ObjectName of the ProfileProvisioningMBean

Specified by:
setProfileProvisioningMBean in interface SleeManagementMBeanImplMBean

getTraceMBean

public javax.management.ObjectName getTraceMBean()
Specified by:
getTraceMBean in interface SleeManagementMBeanImplMBean

setTraceMBean

public void setTraceMBean(javax.management.ObjectName newTM)
set the ObjectName of the TraceMBean

Specified by:
setTraceMBean in interface SleeManagementMBeanImplMBean

getAlarmMBean

public javax.management.ObjectName getAlarmMBean()
return the ObjectName of the AlarmMBean

Specified by:
getAlarmMBean in interface SleeManagementMBeanImplMBean

setAlarmMBean

public void setAlarmMBean(javax.management.ObjectName newAM)
set the ObjectName of the AlarmMBean

Specified by:
setAlarmMBean in interface SleeManagementMBeanImplMBean

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer mbs,
                                               javax.management.ObjectName oname)
                                        throws java.lang.Exception
Description copied from interface: javax.management.MBeanRegistration
This method is called by the MBeanServer before registration takes place. The MBean is passed a reference of the MBeanServer it is about to be registered with. The MBean must return the ObjectName it will be registered with. The MBeanServer can pass a suggested object depending upon how the MBean is registered.

The MBean can stop the registration by throwing an exception.The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.

Specified by:
preRegister in interface javax.management.MBeanRegistration

postRegister

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

Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Description copied from interface: javax.management.MBeanRegistration
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 javax.management.MBeanRegistration

postDeregister

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

Specified by:
postDeregister in interface javax.management.MBeanRegistration

addNotificationListener

public void addNotificationListener(javax.management.NotificationListener listener,
                                    javax.management.NotificationFilter filter,
                                    java.lang.Object handback)
                             throws java.lang.IllegalArgumentException
Specified by:
addNotificationListener in interface javax.management.NotificationBroadcaster

removeNotificationListener

public void removeNotificationListener(javax.management.NotificationListener listener)
                                throws javax.management.ListenerNotFoundException
Specified by:
removeNotificationListener in interface javax.management.NotificationBroadcaster

getNotificationInfo

public javax.management.MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface javax.management.NotificationBroadcaster

create

public void create()
            throws java.lang.Exception

destroy

public void destroy()

startSleeContainer

protected void startSleeContainer()
                           throws java.lang.Exception
Start the SleeContainer and initialize the necessary resources


resumeServicesActiveBeforeStop

private void resumeServicesActiveBeforeStop()
                                     throws UnrecognizedServiceException,
                                            InvalidStateException
Activate services, which were active before SLEE stopped


stopSleeContainer

protected void stopSleeContainer()
                          throws java.lang.Exception
Stop the service container and clean up the resources it used.


scheduleStopped

protected void scheduleStopped()
Setup a polling process to wait until all ActivityContexts ended. Then set the SLEE container in STOPPED state.


stopAllProfileTableActivities

private void stopAllProfileTableActivities()

stopAllServices

private void stopAllServices()
Deactivate all active services in preparation for moving to the STOPPED state. See SLEE #14.6.1


stopAllResourceAdaptors

private void stopAllResourceAdaptors()
Deactivate all active resource adaptors in preparation for moving to the STOPPED state. See SLEE #14.6.1


areAllServicesInvalid

private boolean areAllServicesInvalid()

rememberActiveServicesBeforeStop

private void rememberActiveServicesBeforeStop()
                                       throws java.lang.Exception
Remembers in memory active services so that they can be reactivated on start. (NOTE: the list should be persisted info according to SLEE spec #2.2.17)


rememberActiveResourceAdaptorsBeforeStop

private void rememberActiveResourceAdaptorsBeforeStop()
                                               throws java.lang.Exception
Remembers in memory active Resource Adaptors so that they can be reactivated on start. (NOTE: the list should be persisted info according to SLEE spec #14.6.1, #2.2.17)


changeSleeState

protected void changeSleeState(SleeState newState)
Changes the SLEE container state and emits JMX notifications


setFullSleeStop

public void setFullSleeStop(boolean b)
Specified by:
setFullSleeStop in interface SleeManagementMBeanImplMBean

isFullSleeStop

public boolean isFullSleeStop()
Indicates whether Mobicents SLEE is simply marked as STOPPED or all its services actually stopped. The distinction is important due to the way MBean service dependencies are handled on mobicents.sar undeploy vs. externally calling SleeManagementMBean.stop()

Specified by:
isFullSleeStop in interface SleeManagementMBeanImplMBean