Rio Project 4.2 API Documentation



org.rioproject.watch
Class WatchDescriptor

java.lang.Object
  extended by org.rioproject.watch.WatchDescriptor
All Implemented Interfaces:
Serializable

public class WatchDescriptor
extends Object
implements Serializable

The WatchDescriptor defines attributes of a declarable Watch, allowing a Watch to be declared as part of an OperationalString.

Author:
Dennis Reedy
See Also:
Serialized Form

Nested Class Summary
static class WatchDescriptor.Type
           
 
Field Summary
static long DEFAULT_PERIOD
           
 
Constructor Summary
WatchDescriptor()
          Create a WatchDescriptor
WatchDescriptor(String name, String property, long period)
          Create a WatchDescriptor
WatchDescriptor(String name, WatchDescriptor.Type type, String property, long period)
          Create a WatchDescriptor
 
Method Summary
 boolean equals(Object o)
           
 String getAttribute()
          Get the MBean attribute to access
 MBeanServerConnection getMBeanServerConnection()
           
 String getName()
          Get the name of the watch
 String getObjectName()
          Get the JMX ObjectName to access
 long getPeriod()
          Get the periodicity to collect data from the property
 String getProperty()
          Get the property name to invoke on the bean
 WatchDescriptor.Type getType()
          Get the Watch type
 int hashCode()
           
 void setAttribute(String attribute)
          Set the MBean attribute to access
 void setMBeanServerConnection(MBeanServerConnection mbsc)
           
 void setName(String name)
          Set the name of the watch
 void setObjectName(String objectName)
          Set the JMX ObjectName to access
 void setPeriod(long period)
          Set the periodicity to collect data from the property
 void setProperty(String property)
          Set the property name to invoke on the bean
 void setType(WatchDescriptor.Type type)
          Set the Watch type
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PERIOD

public static final long DEFAULT_PERIOD
See Also:
Constant Field Values
Constructor Detail

WatchDescriptor

public WatchDescriptor()
Create a WatchDescriptor


WatchDescriptor

public WatchDescriptor(String name,
                       String property,
                       long period)
Create a WatchDescriptor

Parameters:
name - The name of the Watch
property - The bean property to invoke to obtain a value to record in the Watch.
period - The period the Watch should use to collect data (in milliseconds). If the period is 0, the default period of 10 seconds will be used
Throws:
IllegalArgumentException - if the name or property arguments are null

WatchDescriptor

public WatchDescriptor(String name,
                       WatchDescriptor.Type type,
                       String property,
                       long period)
Create a WatchDescriptor

Parameters:
name - The name of the Watch
type - An enum Type.
property - The bean property to invoke to obtain a value to record in the Watch.
period - The period the Watch should use to collect data (in milliseconds). If the period is 0, the default period of 10 seconds will be used
Throws:
IllegalArgumentException - if the name, type, or property arguments are null
Method Detail

getName

public String getName()
Get the name of the watch

Returns:
The name of the Watch

setName

public void setName(String name)
Set the name of the watch

Parameters:
name - The name of the watch

setObjectName

public void setObjectName(String objectName)
Set the JMX ObjectName to access

Parameters:
objectName - The JMX ObjectName

getObjectName

public String getObjectName()
Get the JMX ObjectName to access

Returns:
The JMX ObjectName

getType

public WatchDescriptor.Type getType()
Get the Watch type

Returns:
The type of Watch to create

setType

public void setType(WatchDescriptor.Type type)
Set the Watch type

Parameters:
type - The watch type
Throws:
IllegalArgumentException - if the type is null

getProperty

public String getProperty()
Get the property name to invoke on the bean

Returns:
The bean property name to invoke. may be null

setProperty

public void setProperty(String property)
Set the property name to invoke on the bean

Parameters:
property - The property name to invoke on the bean

getPeriod

public long getPeriod()
Get the periodicity to collect data from the property

Returns:
The periodicity to collect data from the property, default is 10 seconds

setPeriod

public void setPeriod(long period)
Set the periodicity to collect data from the property

Parameters:
period - The periodicity to collect data from the property

getAttribute

public String getAttribute()
Get the MBean attribute to access

Returns:
The MBean attribute to access. This property is used in conjunction with the objectName property to create a Watch that uses the value obtained by the attribute as input for the Watch.

setAttribute

public void setAttribute(String attribute)
Set the MBean attribute to access

Parameters:
attribute - The MBean attribute to access. This property is used in conjunction with the objectName property to create a Watch that uses the value obtained by the attribute as input for the Watch.

setMBeanServerConnection

public void setMBeanServerConnection(MBeanServerConnection mbsc)

getMBeanServerConnection

public MBeanServerConnection getMBeanServerConnection()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.