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

Quick Search    Search Deep

org.jbossmx.cluster.watchdog.util
Class HermesMachineProperties  view HermesMachineProperties download HermesMachineProperties.java

java.lang.Object
  extended byorg.jbossmx.cluster.watchdog.util.HermesMachineProperties

public class HermesMachineProperties
extends java.lang.Object

Utility class for retrieving Hermes properties from a Java Properties file


Field Summary
private static org.jboss.logging.Logger LOG
           
 
Constructor Summary
HermesMachineProperties()
           
 
Method Summary
static void enumerateProperties(java.util.Properties properties)
          Prints out all the properties in properties
private static java.lang.String getAgentName(java.lang.String key)
          Gets the substring of key which refers to the Agents RMI Binding
static java.util.Set getAgentsRunningOnMachine(java.lang.String machineName)
          Gets the RMI Bindings of all the JMX Agents running on machineName
static java.lang.String[] getAgentWatcherDetails(java.lang.String rmiAgentBinding)
          Gets the Watcher details for rmiAgentBinding
static java.lang.String getMachineName(java.lang.String rmiAgentBinding)
          Gets the machine that rmiAgentBinding is running on
static java.lang.String getMachineProperty(java.lang.String rmiAgentBinding)
          Gets the name of the property used to store the current machine running the JMX Agent bound to rmiAgentBinding
static java.lang.String getProperty(java.lang.String propertyName)
          Gets the value of the propertyName property
static java.lang.String getResolvedRmiAgentBinding(java.lang.String unresolvedRmiAgentBinding)
          Gets the resolved RMI Binding for unresolvedRmiAgentBinding by looking up the machine which is running the Agent implictly refered to in unresolvedRmiAgentBinding
static java.lang.String getWatcherObjectNameProperty(java.lang.String rmiAgentBinding)
          Gets the name of the property used to store the ObjectName of the Watchdog MBean watching the JMX Agent bound to rmiAgentBinding
static java.lang.String getWatcherRmiBindingProperty(java.lang.String rmiAgentBinding)
          Gets the name of the property used to store the RMI Binding of the Agent watching the JMX Agent bound to rmiAgentBinding
private static boolean isMachineProperty(java.lang.String key)
          Gets whether key is a valid property key for storing the machine on which a JMX Agent is running
private static void listFile(java.lang.String fileName)
          Lists the contents of a file
private static java.util.Properties loadProperties(java.lang.String fileName)
          Returns a Properties class loaded from a properties file
static java.lang.String removeBraces(java.lang.String input)
          Removes the leftmost and rightmost braces in input
private static boolean saveProperties(java.util.Properties properties, java.lang.String fileName)
          Saves a Properties object to a file
static boolean setAgentWatcherDetails(java.lang.String rmiAgentBinding, java.lang.String watcherAgentRmiBinding, java.lang.String watcherObjectName)
          Sets the Watcher details for rmiAgentBinding
static boolean setMachineName(java.lang.String rmiAgentBinding, java.lang.String machineName)
          Sets the machine that rmiAgentBinding is running on
static boolean setProperty(java.lang.String property, java.lang.String value)
          Sets the value of the propertyName property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static org.jboss.logging.Logger LOG
Constructor Detail

HermesMachineProperties

public HermesMachineProperties()
Method Detail

getMachineName

public static java.lang.String getMachineName(java.lang.String rmiAgentBinding)
Gets the machine that rmiAgentBinding is running on


setMachineName

public static boolean setMachineName(java.lang.String rmiAgentBinding,
                                     java.lang.String machineName)
Sets the machine that rmiAgentBinding is running on


getAgentWatcherDetails

public static java.lang.String[] getAgentWatcherDetails(java.lang.String rmiAgentBinding)
Gets the Watcher details for rmiAgentBinding


setAgentWatcherDetails

public static boolean setAgentWatcherDetails(java.lang.String rmiAgentBinding,
                                             java.lang.String watcherAgentRmiBinding,
                                             java.lang.String watcherObjectName)
Sets the Watcher details for rmiAgentBinding


getProperty

public static java.lang.String getProperty(java.lang.String propertyName)
Gets the value of the propertyName property


setProperty

public static boolean setProperty(java.lang.String property,
                                  java.lang.String value)
Sets the value of the propertyName property


getMachineProperty

public static java.lang.String getMachineProperty(java.lang.String rmiAgentBinding)
Gets the name of the property used to store the current machine running the JMX Agent bound to rmiAgentBinding


getWatcherRmiBindingProperty

public static java.lang.String getWatcherRmiBindingProperty(java.lang.String rmiAgentBinding)
Gets the name of the property used to store the RMI Binding of the Agent watching the JMX Agent bound to rmiAgentBinding


getWatcherObjectNameProperty

public static java.lang.String getWatcherObjectNameProperty(java.lang.String rmiAgentBinding)
Gets the name of the property used to store the ObjectName of the Watchdog MBean watching the JMX Agent bound to rmiAgentBinding


getAgentsRunningOnMachine

public static java.util.Set getAgentsRunningOnMachine(java.lang.String machineName)
Gets the RMI Bindings of all the JMX Agents running on machineName


isMachineProperty

private static boolean isMachineProperty(java.lang.String key)
Gets whether key is a valid property key for storing the machine on which a JMX Agent is running


getAgentName

private static java.lang.String getAgentName(java.lang.String key)
Gets the substring of key which refers to the Agents RMI Binding


getResolvedRmiAgentBinding

public static java.lang.String getResolvedRmiAgentBinding(java.lang.String unresolvedRmiAgentBinding)
Gets the resolved RMI Binding for unresolvedRmiAgentBinding by looking up the machine which is running the Agent implictly refered to in unresolvedRmiAgentBinding

Example: Unresolved 'RMI Binding': {/ActiveAgent}, resolved RMI Binding: rmi://hugin/ActiveAgent


removeBraces

public static java.lang.String removeBraces(java.lang.String input)
Removes the leftmost and rightmost braces in input


enumerateProperties

public static void enumerateProperties(java.util.Properties properties)
Prints out all the properties in properties


loadProperties

private static java.util.Properties loadProperties(java.lang.String fileName)
Returns a Properties class loaded from a properties file


saveProperties

private static boolean saveProperties(java.util.Properties properties,
                                      java.lang.String fileName)
Saves a Properties object to a file


listFile

private static void listFile(java.lang.String fileName)
Lists the contents of a file