org.apache.geronimo.monitoring
Class MasterRemoteControlJMX

java.lang.Object
  extended by org.apache.geronimo.monitoring.MasterRemoteControlJMX
All Implemented Interfaces:
GBeanLifecycle

public class MasterRemoteControlJMX
extends Object
implements GBeanLifecycle

This is the GBean that will be the bottleneck for the communication between the management node and the data in the server node.


Field Summary
static GBeanInfo GBEAN_INFO
           
 
Constructor Summary
MasterRemoteControlJMX()
           
 
Method Summary
 boolean addMBeanForSnapshot(String mbeanName)
          Adds a record of the mbean via its name to take snapshots of.
 void doFail()
          Fails the GBean.
 void doStart()
          Executes when the GBean starts up.
 void doStop()
          Executes when the GBean stops.
 HashMap<String,HashMap<String,Long>> fetchMaxSnapshotData(Integer numberOfSnapshot)
          Fetches the max amount for each statistic stored from the snapshot thread and returns it in a HashMap
 HashMap<String,HashMap<String,Long>> fetchMinSnapshotData(Integer numberOfSnapshot)
          Fetches the min amount for each statistic stored from the snapshot thread and returns it in a HashMap
 ArrayList<HashMap<String,HashMap<String,Object>>> fetchSnapshotData(Integer numberOfSnapshot, Integer everyNthSnapshot)
          Fetches the data stored from the snapshot thread and returns it in a ArrayList with each element being a HashMap of the attribute mapping to the statistic.
 Set<String> getAllMBeanNames()
          Fetches all mbean names
 HashMap<String,ArrayList<String>> getAllSnapshotStatAttributes()
           
static GBeanInfo getGBeanInfo()
           
 Long getSnapshotCount()
           
 Long getSnapshotDuration()
          Gets the elapsed time in milliseconds between each snapshot.
 Integer getSnapshotRetention()
           
 TreeMap<Long,Long> getSpecificStatistics(String mbeanName, String statsName, Integer numberOfSnapshots, Integer everyNthSnapshot, Boolean showArchived)
           
 Set<String> getStatisticsProviderMBeanNames()
          Fetches all mbean names that provide JSR-77 statistics
static HashMap getStats(String objectName)
          Looks up the JSR-77 statistics associated with this object name.
 Set<String> getTrackedMBeans()
           
 Object invoke(ObjectName name, String operationName, Object[] params, String[] signature)
           
 boolean removeMBeanForSnapshot(String mbeanName)
          Removes a record of the mbean via its name to take snapshots of.
 void setAttribute(String objectName, String attrName, Object attrValue)
          Changes the objectName's attrName's value to attrValue
 void setSnapshotDuration(Long snapshotDuration)
          Sets the elapsed time in milliseconds between each snapshot.
 void setSnapshotRetention(Integer retention)
           
 Integer SnapshotStatus()
           
 boolean startSnapshot(Long interval)
          Begins the snapshot process given the time interval between snapshots Precondition: interval is given in milli seconds
 boolean startSnapshot(Long interval, Integer retention)
          Begins the snapshot process given the time interval between snapshots Precondition: interval is given in milli seconds
 boolean stopSnapshot()
          Stops the snapshot thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GBEAN_INFO

public static final GBeanInfo GBEAN_INFO
Constructor Detail

MasterRemoteControlJMX

public MasterRemoteControlJMX()
Method Detail

getStats

public static HashMap getStats(String objectName)
                        throws Exception
Looks up the JSR-77 statistics associated with this object name.

Parameters:
objectName -
Returns:
HashMap
Throws:
Exception

setAttribute

public void setAttribute(String objectName,
                         String attrName,
                         Object attrValue)
                  throws Exception
Changes the objectName's attrName's value to attrValue

Parameters:
objectName -
attrName -
attrValue -
Throws:
Exception

stopSnapshot

public boolean stopSnapshot()
Stops the snapshot thread


fetchSnapshotData

public ArrayList<HashMap<String,HashMap<String,Object>>> fetchSnapshotData(Integer numberOfSnapshot,
                                                                           Integer everyNthSnapshot)
Fetches the data stored from the snapshot thread and returns it in a ArrayList with each element being a HashMap of the attribute mapping to the statistic. All stats will be the average of 1 - n, n+1 - 2n, ..., cn+1 - c(n+1) Grabs 'numberOfSnapshots' snapshots. Grabs one snapshot per 'everyNthsnapshot'

Parameters:
numberOfSnapshot -
everyNthSnapshot -
Returns:
ArrayList

fetchMaxSnapshotData

public HashMap<String,HashMap<String,Long>> fetchMaxSnapshotData(Integer numberOfSnapshot)
Fetches the max amount for each statistic stored from the snapshot thread and returns it in a HashMap

Parameters:
numberOfSnapshot -
Returns:
HashMap

fetchMinSnapshotData

public HashMap<String,HashMap<String,Long>> fetchMinSnapshotData(Integer numberOfSnapshot)
Fetches the min amount for each statistic stored from the snapshot thread and returns it in a HashMap

Parameters:
numberOfSnapshot -
Returns:
HashMap

getSnapshotDuration

public Long getSnapshotDuration()
Gets the elapsed time in milliseconds between each snapshot.

Returns:
Long

setSnapshotDuration

public void setSnapshotDuration(Long snapshotDuration)
Sets the elapsed time in milliseconds between each snapshot.

Parameters:
snapshotDuration -

setSnapshotRetention

public void setSnapshotRetention(Integer retention)

startSnapshot

public boolean startSnapshot(Long interval)
Begins the snapshot process given the time interval between snapshots Precondition: interval is given in milli seconds

Parameters:
interval -

startSnapshot

public boolean startSnapshot(Long interval,
                             Integer retention)
Begins the snapshot process given the time interval between snapshots Precondition: interval is given in milli seconds

Parameters:
interval -

getSnapshotCount

public Long getSnapshotCount()

getStatisticsProviderMBeanNames

public Set<String> getStatisticsProviderMBeanNames()
Fetches all mbean names that provide JSR-77 statistics

Returns:
A set containing all mbean names of mbeans that provide statistics

getAllMBeanNames

public Set<String> getAllMBeanNames()
Fetches all mbean names

Returns:
A set containing all mbean names

doFail

public void doFail()
Description copied from interface: GBeanLifecycle
Fails the GBean. This informs the GBean that it is about to transition to the failed state.

Specified by:
doFail in interface GBeanLifecycle

doStart

public void doStart()
Executes when the GBean starts up. Also starts the snapshot thread.

Specified by:
doStart in interface GBeanLifecycle

doStop

public void doStop()
Executes when the GBean stops. Also stops the snapshot thread.

Specified by:
doStop in interface GBeanLifecycle

addMBeanForSnapshot

public boolean addMBeanForSnapshot(String mbeanName)
Adds a record of the mbean via its name to take snapshots of. As a result the mbeanName will be written to snapshot-config.xml

Parameters:
mbeanName -

removeMBeanForSnapshot

public boolean removeMBeanForSnapshot(String mbeanName)
Removes a record of the mbean via its name to take snapshots of. As a result the mbeanName will be removed from snapshot-config.xml

Parameters:
mbeanName -

getAllSnapshotStatAttributes

public HashMap<String,ArrayList<String>> getAllSnapshotStatAttributes()
Returns:
A map: mbeanName --> ArrayList of statistic attributes for that mbean

getTrackedMBeans

public Set<String> getTrackedMBeans()

getSnapshotRetention

public Integer getSnapshotRetention()

invoke

public Object invoke(ObjectName name,
                     String operationName,
                     Object[] params,
                     String[] signature)
              throws Exception
Parameters:
name - - object name of the mbean
operationName - - method within the class
params - - parameters for the method
signature - - types for the parameters
Returns:
Invokes the method of a class defined.
Throws:
Exception

getSpecificStatistics

public TreeMap<Long,Long> getSpecificStatistics(String mbeanName,
                                                String statsName,
                                                Integer numberOfSnapshots,
                                                Integer everyNthSnapshot,
                                                Boolean showArchived)
Parameters:
mbeanName -
statsName -
numberOfSnapshots -
everyNthSnapshot -
Returns:
HashMap which maps from a snapshot_time --> value of the mbean.statsName at that time

SnapshotStatus

public Integer SnapshotStatus()
Returns:
Returns true if snapshot is running.

getGBeanInfo

public static GBeanInfo getGBeanInfo()


Copyright © 2003-2008 The Apache Geronimo development community. All Rights Reserved.