org.apache.geronimo.monitoring
Class MasterRemoteControl

java.lang.Object
  extended by org.apache.geronimo.monitoring.MasterRemoteControl

@PermitAll
public class MasterRemoteControl
extends Object

This is a Stateful Session Bean that will be the bottleneck for the communication between the management node and the data in the server node.


Constructor Summary
MasterRemoteControl()
           
 
Method Summary
 boolean addMBeanForSnapshot(String mbeanName)
          Adds a record of the mbean via its name to take snapshots of.
 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()
           
 Long getSnapshotCount()
           
 Long getSnapshotDuration()
          Gets the elapsed time in milliseconds between each snapshot.
 String getSnapshotRetention()
           
 TreeMap<Long,Long> getSpecificStatistics(String mbeanName, String statsName, int numberOfSnapshots, int everyNthSnapshot, boolean showArchived)
           
 Set<String> getStatisticsProviderMBeanNames()
          Fetches all mbean names that provide JSR-77 statistics
static HashMap<String,Long> getStats(String objectName)
          Looks up the JSR-77 statistics associated with this object name.
 Set<String> getTrackedMBeans()
           
 void handleTimeout(Timer theTimer)
           
 Object invoke(ObjectName name, String operationName, Object[] params, String[] signature)
           
 boolean isSnapshotRunning()
           
 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(int retention)
           
 void setUpMEJB(String username, String password)
          Retrieves and instance of the MEJB and starts the snapshot process
 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, int retention)
           
 boolean stopSnapshot()
          Stops the snapshot thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MasterRemoteControl

public MasterRemoteControl()
Method Detail

setUpMEJB

@RolesAllowed(value="mejbuser")
public void setUpMEJB(String username,
                                        String password)
Retrieves and instance of the MEJB and starts the snapshot process


getStats

@RolesAllowed(value="mejbuser")
public static HashMap<String,Long> getStats(String objectName)
                                     throws Exception
Looks up the JSR-77 statistics associated with this object name.

Parameters:
objectName -
Returns:
HashMap
Throws:
Exception

setAttribute

@RolesAllowed(value="mejbadmin")
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

handleTimeout

@PermitAll
public void handleTimeout(Timer theTimer)

startSnapshot

@RolesAllowed(value="mejbuser")
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

@RolesAllowed(value="mejbuser")
public boolean startSnapshot(Long interval,
                                               int retention)

stopSnapshot

@RolesAllowed(value="mejbuser")
public boolean stopSnapshot()
Stops the snapshot thread


fetchSnapshotData

@RolesAllowed(value="mejbuser")
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

@RolesAllowed(value="mejbuser")
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

@RolesAllowed(value="mejbuser")
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

@RolesAllowed(value="mejbuser")
public Long getSnapshotDuration()
Gets the elapsed time in milliseconds between each snapshot.

Returns:
Long

setSnapshotDuration

@RolesAllowed(value="mejbuser")
public void setSnapshotDuration(Long snapshotDuration)
Sets the elapsed time in milliseconds between each snapshot. The duration will be read in each time the handleTimeout() is called. So the change will be seen when the next handleTimeout() is called.

Parameters:
snapshotDuration -

setSnapshotRetention

@RolesAllowed(value="mejbuser")
public void setSnapshotRetention(int retention)

getSnapshotRetention

@RolesAllowed(value="mejbuser")
public String getSnapshotRetention()

getSnapshotCount

@RolesAllowed(value="mejbuser")
public Long getSnapshotCount()

getStatisticsProviderMBeanNames

@RolesAllowed(value="mejbuser")
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

@RolesAllowed(value="mejbuser")
public Set<String> getAllMBeanNames()
Fetches all mbean names

Returns:
A set containing all mbean names

addMBeanForSnapshot

@RolesAllowed(value="mejbuser")
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

@RolesAllowed(value="mejbuser")
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

@RolesAllowed(value="mejbuser")
public HashMap<String,ArrayList<String>> getAllSnapshotStatAttributes()
Returns:
A map: mbeanName --> ArrayList of statistic attributes for that mbean

isSnapshotRunning

@RolesAllowed(value="mejbuser")
public boolean isSnapshotRunning()
Returns:
Returns true if snapshot is running.

invoke

@RolesAllowed(value="mejbadmin")
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

@RolesAllowed(value="mejbuser")
public TreeMap<Long,Long> getSpecificStatistics(String mbeanName,
                                                                  String statsName,
                                                                  int numberOfSnapshots,
                                                                  int everyNthSnapshot,
                                                                  boolean showArchived)
Parameters:
mbeanName -
statsName -
numberOfSnapshots -
everyNthSnapshot -
Returns:
HashMap which maps from a snapshot_time --> value of the mbean.statsName at that time

getTrackedMBeans

@RolesAllowed(value="mejbuser")
public Set<String> getTrackedMBeans()
Returns:
A set of all mbeans being tracked from the db


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