org.jboss.services.loggingmonitor
Class LoggingMonitor

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.services.loggingmonitor.LoggingMonitor
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, LoggingMonitorMBean, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class LoggingMonitor
extends org.jboss.system.ServiceMBeanSupport
implements LoggingMonitorMBean

This class implements the LoggingMonitor service which provides the ability to create monitoring logs for various MBeans and their attributes.

Version:
$Revision: 57210 $
Author:
James Wilson, Dimitris Andreadis

Field Summary
static String DEFAULT_PATTERN_LAYOUT
           
static String MBEAN_ATTRIBUTE_ELEMENT
           
static String MBEAN_LOGGER_ATTRIBUTE
           
static String MBEAN_NAME_ATTRIBUTE
           
static String MONITORED_MBEAN_ELEMENT
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
LoggingMonitor()
          Default constructor.
 
Method Summary
 boolean getAppendToFile()
           
 String getFilename()
           
 long getMonitorPeriod()
           
 String getPatternLayout()
           
 String getRolloverFormat()
          This monitor's log file rollover format as determined by the RolloverPeriod attribute.
 String getRolloverPeriod()
           
 void setAppendToFile(boolean appendToFile)
          Flag to indicate whether or not this monitor's log file should have information appended to it, if it already exists.
 void setFilename(String filename)
          The name of the file to which this monitor's information will be logged.
 void setMonitoredObjects(Element monitoredObjects)
          Sets the monitored objects configuration.
 void setMonitorPeriod(long monitorPeriod)
          The period to delay between monitoring snapshots.
 void setPatternLayout(String patternLayout)
          The PatternLayout for logging entries (default is "%d %-5p [%c] %m%n")
 void setRolloverPeriod(String rolloverPeriod)
          This monitor's log file rollover period.
protected  void startService()
           
protected  void stopService()
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getDeploymentInfo, 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
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Field Detail

MONITORED_MBEAN_ELEMENT

public static final String MONITORED_MBEAN_ELEMENT
See Also:
Constant Field Values

MBEAN_NAME_ATTRIBUTE

public static final String MBEAN_NAME_ATTRIBUTE
See Also:
Constant Field Values

MBEAN_LOGGER_ATTRIBUTE

public static final String MBEAN_LOGGER_ATTRIBUTE
See Also:
Constant Field Values

MBEAN_ATTRIBUTE_ELEMENT

public static final String MBEAN_ATTRIBUTE_ELEMENT
See Also:
Constant Field Values

DEFAULT_PATTERN_LAYOUT

public static final String DEFAULT_PATTERN_LAYOUT
See Also:
Constant Field Values
Constructor Detail

LoggingMonitor

public LoggingMonitor()
Default constructor.

Method Detail

setFilename

public void setFilename(String filename)
Description copied from interface: LoggingMonitorMBean
The name of the file to which this monitor's information will be logged.

Specified by:
setFilename in interface LoggingMonitorMBean

getFilename

public String getFilename()
Specified by:
getFilename in interface LoggingMonitorMBean

setAppendToFile

public void setAppendToFile(boolean appendToFile)
Description copied from interface: LoggingMonitorMBean
Flag to indicate whether or not this monitor's log file should have information appended to it, if it already exists. (default is true)

Specified by:
setAppendToFile in interface LoggingMonitorMBean

getAppendToFile

public boolean getAppendToFile()
Specified by:
getAppendToFile in interface LoggingMonitorMBean

setRolloverPeriod

public void setRolloverPeriod(String rolloverPeriod)
Description copied from interface: LoggingMonitorMBean
This monitor's log file rollover period. Valid values are MONTH, WEEK, DAY, HALFDAY, HOUR, and MINUTE (case insensitive). (default is DAY)

Specified by:
setRolloverPeriod in interface LoggingMonitorMBean

getRolloverPeriod

public String getRolloverPeriod()
Specified by:
getRolloverPeriod in interface LoggingMonitorMBean

setMonitorPeriod

public void setMonitorPeriod(long monitorPeriod)
Description copied from interface: LoggingMonitorMBean
The period to delay between monitoring snapshots. (non-zero positive value)

Specified by:
setMonitorPeriod in interface LoggingMonitorMBean

getMonitorPeriod

public long getMonitorPeriod()
Specified by:
getMonitorPeriod in interface LoggingMonitorMBean

setPatternLayout

public void setPatternLayout(String patternLayout)
Description copied from interface: LoggingMonitorMBean
The PatternLayout for logging entries (default is "%d %-5p [%c] %m%n")

Specified by:
setPatternLayout in interface LoggingMonitorMBean

getPatternLayout

public String getPatternLayout()
Specified by:
getPatternLayout in interface LoggingMonitorMBean

getRolloverFormat

public String getRolloverFormat()
Description copied from interface: LoggingMonitorMBean
This monitor's log file rollover format as determined by the RolloverPeriod attribute.

Specified by:
getRolloverFormat in interface LoggingMonitorMBean

setMonitoredObjects

public void setMonitoredObjects(Element monitoredObjects)
                         throws javax.management.MalformedObjectNameException
Description copied from interface: LoggingMonitorMBean
Sets the monitored objects configuration.

Specified by:
setMonitoredObjects in interface LoggingMonitorMBean
Parameters:
monitoredObjects - the objects to be monitored specified in the following format:
 <attribute name="MonitoredObjects">
   <configuration>
      <monitoredmbean name="[object name]" logger="[logger name]">
         <attribute>[attribute name]</attribute>
         <attribute>[attribute name]</attribute>
         ...
      </monitoredmbean>
   </configuration>
 </attribute>
 
Throws:
javax.management.MalformedObjectNameException - if the monitored objects configuration contains an invalid object name.

startService

protected void startService()
Overrides:
startService in class org.jboss.system.ServiceMBeanSupport

stopService

protected void stopService()
Overrides:
stopService in class org.jboss.system.ServiceMBeanSupport


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.