com.jalios.jcms.monitoring
Class MonitoringManager

java.lang.Object
  extended by com.jalios.jcms.db.TransactionalAlarmListener
      extended by com.jalios.jcms.monitoring.MonitoringManager
All Implemented Interfaces:
AlarmListener

public class MonitoringManager
extends TransactionalAlarmListener

Monitoring class which saves site monitoring measures and events.

Since:
jcms-5.7
Version:
$Revision: 22248 $
Author:
Olivier Jaquemet

Field Summary
static String REVISION
           
 
Method Summary
 void generateAndSaveRandomEvent(Date startDate, Date endDate)
          Method to be use for testing only, rename the existing monitoring file and generate fake events with random data.
 Date getLatestEventDate()
          Retrieve the latest (most recent) event Date.
static MonitoringManager getMonitoringManager()
          Retrieve the MonitoringManager singleton (create it if it does not exists)
 Date getOldestEventDate()
          Retrieve the oldest event Date.
 long getRequestNbr()
          Retrieve the number of request counted in the measure interval
 void handleTransactionalAlarm(AlarmEntry entry)
          TransactionalAlarmListener implementation.
 void monitorRequest(javax.servlet.http.HttpServletRequest request)
          Methods to allow the Monitoring Manager to keep track of information about request (number of request).
 List<com.jalios.jcms.monitoring.Event> readEvents(Date startDate, Date endDate)
          Read monitoring events previously saved.
 
Methods inherited from class com.jalios.jcms.db.TransactionalAlarmListener
handleAlarm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Method Detail

getMonitoringManager

public static MonitoringManager getMonitoringManager()
Retrieve the MonitoringManager singleton (create it if it does not exists)

Returns:
the MonitoringManager singleton

handleTransactionalAlarm

public void handleTransactionalAlarm(AlarmEntry entry)
TransactionalAlarmListener implementation.

Specified by:
handleTransactionalAlarm in class TransactionalAlarmListener
Parameters:
entry - the AlarmEntry which has been triggered.
Since:
jcms-6.0

monitorRequest

public void monitorRequest(javax.servlet.http.HttpServletRequest request)
Methods to allow the Monitoring Manager to keep track of information about request (number of request). This method is called by the InitFilter each time a request is processed.

Parameters:
request - the request to count

getRequestNbr

public long getRequestNbr()
Retrieve the number of request counted in the measure interval

Returns:
the current request number

getOldestEventDate

public Date getOldestEventDate()
Retrieve the oldest event Date.

Returns:
the oldest event Date

getLatestEventDate

public Date getLatestEventDate()
Retrieve the latest (most recent) event Date.

Returns:
the latest (most revent) event Date

readEvents

public List<com.jalios.jcms.monitoring.Event> readEvents(Date startDate,
                                                         Date endDate)
Read monitoring events previously saved.

Parameters:
startDate - the starting Date below which events are not read, if null, it is not used.
endDate - the ending Date above which events are not read, if null, it is not used.
Returns:
a List of Measure, in the order they were read
Since:
jcms-5.7

generateAndSaveRandomEvent

public void generateAndSaveRandomEvent(Date startDate,
                                       Date endDate)
Method to be use for testing only, rename the existing monitoring file and generate fake events with random data.

Parameters:
startDate - the starting date to use for Event generation
endDate - the ending date to use for Event generation
Since:
jcms-5.7


Copyright © 2001-2010 Jalios SA. All Rights Reserved.