org.jboss.monitor.services
Class MemoryMonitor

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.monitor.services.MemoryMonitor
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)

public class MemoryMonitor
extends ServiceMBeanSupport (src)

MemoryMonitor class.


Field Summary
static java.lang.String DEFAULT_CRITICAL_THRESHOLD
          default critical threshold
static java.lang.String DEFAULT_SAMPLING_PERIOD
          default sampling period
static int DEFAULT_WARNING_MEASUREMENTS
          default number of measurements to trigger warning
static java.lang.String DEFAULT_WARNING_THRESHOLD
          default warning threshold
static java.lang.String FREE_MEMORY_KEY
          Free memory key to use in AlarmNotification/userData map
static long GIGA
           
static long HOUR
           
static long KILO
          conversion constants
static long MEGA
           
static java.lang.String MEMORY_LOW
          Notification type which indicates a memory low alarm
static long MINS
           
static long SECS
           
 
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
MemoryMonitor()
          CTOR
 
Method Summary
 java.lang.String getFreeMemoryCriticalThreshold()
           
 long getFreeMemorySample()
           
 java.lang.String getFreeMemoryWarningThreshold()
           
 java.lang.String getSamplingPeriod()
           
 java.lang.String getSeverity()
           
 int getTriggeringWarningMeasurements()
           
 void setFreeMemoryCriticalThreshold(java.lang.String s)
           
 void setFreeMemoryWarningThreshold(java.lang.String s)
           
 void setSamplingPeriod(java.lang.String s)
           
 void setTriggeringWarningMeasurements(int measurements)
           
 void startService()
          Sub-classes should override this method to provide custum 'start' logic.
 void stopService()
          Sub-classes should override this method to provide custum 'stop' logic.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, 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
 

Field Detail

MEMORY_LOW

public static final java.lang.String MEMORY_LOW
Notification type which indicates a memory low alarm

See Also:
Constant Field Values (src)

FREE_MEMORY_KEY

public static final java.lang.String FREE_MEMORY_KEY
Free memory key to use in AlarmNotification/userData map

See Also:
Constant Field Values (src)

DEFAULT_WARNING_THRESHOLD

public static final java.lang.String DEFAULT_WARNING_THRESHOLD
default warning threshold

See Also:
Constant Field Values (src)

DEFAULT_WARNING_MEASUREMENTS

public static final int DEFAULT_WARNING_MEASUREMENTS
default number of measurements to trigger warning

See Also:
Constant Field Values (src)

DEFAULT_CRITICAL_THRESHOLD

public static final java.lang.String DEFAULT_CRITICAL_THRESHOLD
default critical threshold

See Also:
Constant Field Values (src)

DEFAULT_SAMPLING_PERIOD

public static final java.lang.String DEFAULT_SAMPLING_PERIOD
default sampling period

See Also:
Constant Field Values (src)

KILO

public static final long KILO
conversion constants

See Also:
Constant Field Values (src)

MEGA

public static final long MEGA
See Also:
Constant Field Values (src)

GIGA

public static final long GIGA
See Also:
Constant Field Values (src)

SECS

public static final long SECS
See Also:
Constant Field Values (src)

MINS

public static final long MINS
See Also:
Constant Field Values (src)

HOUR

public static final long HOUR
See Also:
Constant Field Values (src)
Constructor Detail

MemoryMonitor

public MemoryMonitor()
CTOR

Method Detail

setTriggeringWarningMeasurements

public void setTriggeringWarningMeasurements(int measurements)

getTriggeringWarningMeasurements

public int getTriggeringWarningMeasurements()

setFreeMemoryWarningThreshold

public void setFreeMemoryWarningThreshold(java.lang.String s)

getFreeMemoryWarningThreshold

public java.lang.String getFreeMemoryWarningThreshold()

setFreeMemoryCriticalThreshold

public void setFreeMemoryCriticalThreshold(java.lang.String s)

getFreeMemoryCriticalThreshold

public java.lang.String getFreeMemoryCriticalThreshold()

setSamplingPeriod

public void setSamplingPeriod(java.lang.String s)

getSamplingPeriod

public java.lang.String getSamplingPeriod()

getFreeMemorySample

public long getFreeMemorySample()

getSeverity

public java.lang.String getSeverity()

startService

public void startService()
                  throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'start' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

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

stopService

public void stopService()
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'stop' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
stopService in class ServiceMBeanSupport (src)