Class ServiceMBeanSupport

    • Field Detail

      • log

        protected org.jboss.logging.Logger log
      • server

        protected MBeanServer server
        The MBeanServer which we have been register with.
      • serviceName

        protected ObjectName serviceName
        The object name which we are registered under.
    • Constructor Detail

      • ServiceMBeanSupport

        public ServiceMBeanSupport()
        Construct a ServiceMBeanSupport.

        Sets up logging.

      • ServiceMBeanSupport

        public ServiceMBeanSupport​(Class<?> type)
        Construct a ServiceMBeanSupport.

        Sets up logging.

        Parameters:
        type - The class type to determine category name from.
      • ServiceMBeanSupport

        public ServiceMBeanSupport​(String category)
        Construct a ServiceMBeanSupport.

        Sets up logging.

        Parameters:
        category - The logger category name.
      • ServiceMBeanSupport

        public ServiceMBeanSupport​(org.jboss.logging.Logger log)
        Construct a ServiceMBeanSupport.
        Parameters:
        log - The logger to use.
    • Method Detail

      • getName

        public String getName()
        Use the short class name as the default for the service name.
        Specified by:
        getName in interface ServiceMBean
        Returns:
        a description of the mbean
      • getServiceName

        public ObjectName getServiceName()
      • getLog

        public org.jboss.logging.Logger getLog()
      • create

        public void create()
                    throws Exception
        Description copied from interface: Service
        create the service, do expensive operations etc
        Specified by:
        create in interface Service
        Throws:
        Exception - for any error
      • start

        public void start()
                   throws Exception
        Description copied from interface: Service
        start the service, create is already called
        Specified by:
        start in interface Service
        Throws:
        Exception - for any error
      • stop

        public void stop()
        Description copied from interface: Service
        stop the service
        Specified by:
        stop in interface Service
      • destroy

        public void destroy()
        Description copied from interface: Service
        destroy the service, tear down
        Specified by:
        destroy in interface Service
      • jbossInternalDescription

        protected String jbossInternalDescription()
      • jbossInternalCreate

        protected void jbossInternalCreate()
                                    throws Exception
        Throws:
        Exception
      • jbossInternalStart

        protected void jbossInternalStart()
                                   throws Exception
        Throws:
        Exception
      • jbossInternalStop

        protected void jbossInternalStop()
      • jbossInternalDestroy

        protected void jbossInternalDestroy()
      • preRegister

        public ObjectName preRegister​(MBeanServer server,
                                      ObjectName name)
                               throws Exception
        Callback method of 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.

        Specified by:
        preRegister in interface MBeanRegistration
        Parameters:
        server - Reference to the JMX Agent this MBean is registered on
        name - 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).
        Returns:
        the ObjectName
        Throws:
        Exception - for any error
      • createService

        protected void createService()
                              throws Exception
        Sub-classes should override this method to provide custum 'create' logic.

        This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

        Throws:
        Exception - for any error
      • startService

        protected void startService()
                             throws Exception
        Sub-classes should override this method to provide custum 'start' logic.

        This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

        Throws:
        Exception - for any error
      • stopService

        protected void stopService()
                            throws Exception
        Sub-classes should override this method to provide custum 'stop' logic.

        This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

        Throws:
        Exception - for any error
      • destroyService

        protected void destroyService()
                               throws Exception
        Sub-classes should override this method to provide custum 'destroy' logic.

        This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

        Throws:
        Exception - for any error
      • nextNotificationSequenceNumber

        public long nextNotificationSequenceNumber()
        The nextNotificationSequenceNumber method returns the next sequence number for use in notifications.
        Returns:
        a long value
      • getNextNotificationSequenceNumber

        protected long getNextNotificationSequenceNumber()
        The getNextNotificationSequenceNumber method returns the next sequence number for use in notifications.
        Returns:
        a long value