org.jboss.management.j2ee.cluster
Class HAManagementService

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.management.j2ee.cluster.HAManagementService
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)

public class HAManagementService
extends ServiceMBeanSupport (src)

This class enables a client to get a management view (JSR-77) on a JBoss Cluster. It contains the entire logic to map all the {@link org.jboss.management.j2ee.J2EEManagedObject Managed Object (MO) of all the nodes in the cluster to one MO. The same applies to State Management and Performance Statistics.


Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
HAManagementService()
          Creates a undefined clustering management service.
 
Method Summary
 java.lang.Object _createMBean(java.lang.String pClass, ObjectName (src)  pName, java.lang.Object[] pParameters, java.lang.String[] pSignature)
           
 java.lang.Object _getAttribute(ObjectName (src)  pName, java.lang.String pAttribute)
           
 AttributeList (src) _getAttributes(ObjectName (src)  pName, java.lang.String[] pAttributes)
           
 java.lang.Object _invoke(ObjectName (src)  pName, java.lang.String pOperationName, java.lang.Object[] pParams, java.lang.String[] pSignature)
           
 java.lang.Object _setAttribute(ObjectName (src)  pName, Attribute (src)  pAttribute)
           
 java.lang.Object _setAttributes(ObjectName (src)  pName, AttributeList (src)  pAttributes)
           
 java.lang.Object _unregisterMBean(ObjectName (src)  pName)
           
 void addNotificationListener(ObjectName (src)  pBroadcaster, ObjectName (src)  pListener, NotificationFilter (src)  pFilter, java.lang.Object pHandback)
           
 ObjectInstance (src) createMBean(java.lang.String pClass, ObjectName (src)  pName, java.lang.Object[] pParameters, java.lang.String[] pSignature)
           
protected  void createService()
          Looks up the Server Config instance to figure out the temp-directory and the farm-deploy-directory
 java.lang.Object getAttribute(ObjectName (src)  pName, java.lang.String pAttribute)
           
 AttributeList (src) getAttributes(ObjectName (src)  pName, java.lang.String[] pAttributes)
           
 java.lang.String getDefaultDomain()
           
 ListenerRegistration (src) getListenerRegistry()
           
 java.lang.Integer getMBeanCount()
           
 MBeanInfo (src) getMBeanInfo(ObjectName (src)  pName)
           
 java.lang.String getName()
          Use the short class name as the default for the service name.
 java.lang.Object invoke(ObjectName (src)  pName, java.lang.String pOperationName, java.lang.Object[] pParams, java.lang.String[] pSignature)
           
 boolean isRegistered(ObjectName (src)  pName)
           
 void preDeregister()
          Removes the Notification Listener
 ObjectName (src) preRegister(MBeanServer (src)  pServer, ObjectName (src)  pName)
          Saves the MBeanServer reference
 java.util.Set queryNames(ObjectName (src)  pName, QueryExp (src)  pQuery)
           
 void removeNotificationListener(ObjectName (src)  pBroadcaster, ObjectName (src)  pListener)
           
 void setAttribute(ObjectName (src)  pName, Attribute (src)  pAttribute)
           
 AttributeList (src) setAttributes(ObjectName (src)  pName, AttributeList (src)  pAttributes)
           
protected  void startService()
          Register itself as RPC-Handler to the HA-Partition and add the farm deployment directory to the scanner
protected  void stopService()
          Remove the farm deployment directory from the scanner
 void unregisterMBean(ObjectName (src)  pName)
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, destroy, destroyService, getLog, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, start, stop
 
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
 

Constructor Detail

HAManagementService

public HAManagementService()
Creates a undefined clustering management service. Before this MBean can be started the HAPartition must be up and running.

ATTENTION: The current implemenation is a brute force one because it is retrieving the data on every hit. Later on this has to be resolved with a caching to avoid unecessary round-trips.

Method Detail

_getAttribute

public java.lang.Object _getAttribute(ObjectName (src)  pName,
                                      java.lang.String pAttribute)

getAttribute

public java.lang.Object getAttribute(ObjectName (src)  pName,
                                     java.lang.String pAttribute)
                              throws MBeanException (src) ,
                                     AttributeNotFoundException (src) ,
                                     InstanceNotFoundException (src) ,
                                     ReflectionException (src) ,
                                     java.rmi.RemoteException
Throws:
MBeanException (src)
AttributeNotFoundException (src)
InstanceNotFoundException (src)
ReflectionException (src)
java.rmi.RemoteException

_getAttributes

public AttributeList (src)  _getAttributes(ObjectName (src)  pName,
                                    java.lang.String[] pAttributes)

getAttributes

public AttributeList (src)  getAttributes(ObjectName (src)  pName,
                                   java.lang.String[] pAttributes)
                            throws InstanceNotFoundException (src) ,
                                   ReflectionException (src) ,
                                   java.rmi.RemoteException
Throws:
InstanceNotFoundException (src)
ReflectionException (src)
java.rmi.RemoteException

getDefaultDomain

public java.lang.String getDefaultDomain()
                                  throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

getMBeanCount

public java.lang.Integer getMBeanCount()
                                throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

getMBeanInfo

public MBeanInfo (src)  getMBeanInfo(ObjectName (src)  pName)
                       throws IntrospectionException (src) ,
                              InstanceNotFoundException (src) ,
                              ReflectionException (src) ,
                              java.rmi.RemoteException
Throws:
IntrospectionException (src)
InstanceNotFoundException (src)
ReflectionException (src)
java.rmi.RemoteException

getListenerRegistry

public ListenerRegistration (src)  getListenerRegistry()
                                         throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

_invoke

public java.lang.Object _invoke(ObjectName (src)  pName,
                                java.lang.String pOperationName,
                                java.lang.Object[] pParams,
                                java.lang.String[] pSignature)

invoke

public java.lang.Object invoke(ObjectName (src)  pName,
                               java.lang.String pOperationName,
                               java.lang.Object[] pParams,
                               java.lang.String[] pSignature)
                        throws InstanceNotFoundException (src) ,
                               MBeanException (src) ,
                               ReflectionException (src) ,
                               java.rmi.RemoteException
Throws:
InstanceNotFoundException (src)
MBeanException (src)
ReflectionException (src)
java.rmi.RemoteException

isRegistered

public boolean isRegistered(ObjectName (src)  pName)
                     throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

queryNames

public java.util.Set queryNames(ObjectName (src)  pName,
                                QueryExp (src)  pQuery)
                         throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

_setAttribute

public java.lang.Object _setAttribute(ObjectName (src)  pName,
                                      Attribute (src)  pAttribute)

setAttribute

public void setAttribute(ObjectName (src)  pName,
                         Attribute (src)  pAttribute)
                  throws AttributeNotFoundException (src) ,
                         InstanceNotFoundException (src) ,
                         InvalidAttributeValueException (src) ,
                         MBeanException (src) ,
                         ReflectionException (src) ,
                         java.rmi.RemoteException
Throws:
AttributeNotFoundException (src)
InstanceNotFoundException (src)
InvalidAttributeValueException (src)
MBeanException (src)
ReflectionException (src)
java.rmi.RemoteException

_setAttributes

public java.lang.Object _setAttributes(ObjectName (src)  pName,
                                       AttributeList (src)  pAttributes)

setAttributes

public AttributeList (src)  setAttributes(ObjectName (src)  pName,
                                   AttributeList (src)  pAttributes)
                            throws InstanceNotFoundException (src) ,
                                   ReflectionException (src) ,
                                   java.rmi.RemoteException
Throws:
InstanceNotFoundException (src)
ReflectionException (src)
java.rmi.RemoteException

_createMBean

public java.lang.Object _createMBean(java.lang.String pClass,
                                     ObjectName (src)  pName,
                                     java.lang.Object[] pParameters,
                                     java.lang.String[] pSignature)

createMBean

public ObjectInstance (src)  createMBean(java.lang.String pClass,
                                  ObjectName (src)  pName,
                                  java.lang.Object[] pParameters,
                                  java.lang.String[] pSignature)
                           throws InstanceAlreadyExistsException (src) ,
                                  MBeanException (src) ,
                                  MBeanRegistrationException (src) ,
                                  NotCompliantMBeanException (src) ,
                                  ReflectionException (src) ,
                                  java.rmi.RemoteException
Throws:
InstanceAlreadyExistsException (src)
MBeanException (src)
MBeanRegistrationException (src)
NotCompliantMBeanException (src)
ReflectionException (src)
java.rmi.RemoteException

_unregisterMBean

public java.lang.Object _unregisterMBean(ObjectName (src)  pName)

unregisterMBean

public void unregisterMBean(ObjectName (src)  pName)
                     throws InstanceNotFoundException (src) ,
                            MBeanRegistrationException (src) ,
                            java.rmi.RemoteException
Throws:
InstanceNotFoundException (src)
MBeanRegistrationException (src)
java.rmi.RemoteException

addNotificationListener

public void addNotificationListener(ObjectName (src)  pBroadcaster,
                                    ObjectName (src)  pListener,
                                    NotificationFilter (src)  pFilter,
                                    java.lang.Object pHandback)
                             throws InstanceNotFoundException (src) ,
                                    java.rmi.RemoteException
Throws:
InstanceNotFoundException (src)
java.rmi.RemoteException

removeNotificationListener

public void removeNotificationListener(ObjectName (src)  pBroadcaster,
                                       ObjectName (src)  pListener)
                                throws InstanceNotFoundException (src) ,
                                       ListenerNotFoundException (src) ,
                                       java.rmi.RemoteException
Throws:
InstanceNotFoundException (src)
ListenerNotFoundException (src)
java.rmi.RemoteException

preRegister

public ObjectName (src)  preRegister(MBeanServer (src)  pServer,
                              ObjectName (src)  pName)
                       throws java.lang.Exception
Saves the MBeanServer reference

Specified by:
preRegister in interface MBeanRegistration (src)
Overrides:
preRegister in class ServiceMBeanSupport (src)
Parameters:
pServer - Reference to the JMX Agent this MBean is registered on
pName - 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).
Throws:
java.lang.Exception

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Removes the Notification Listener

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

getName

public java.lang.String getName()
Description copied from class: ServiceMBeanSupport (src)
Use the short class name as the default for the service name.

Specified by:
getName in interface ServiceMBean (src)
Overrides:
getName in class ServiceMBeanSupport (src)

createService

protected void createService()
                      throws java.lang.Exception
Looks up the Server Config instance to figure out the temp-directory and the farm-deploy-directory

Overrides:
createService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

startService

protected void startService()
                     throws java.lang.Exception
Register itself as RPC-Handler to the HA-Partition and add the farm deployment directory to the scanner

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

stopService

protected void stopService()
Remove the farm deployment directory from the scanner

Overrides:
stopService in class ServiceMBeanSupport (src)