Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.events.server.session
Class AlertConditionEvaluatorRepositoryImpl

java.lang.Object
  extended by org.hyperic.hq.events.server.session.AlertConditionEvaluatorRepositoryImpl
All Implemented Interfaces:
ShutdownCallback, AlertConditionEvaluatorRepository

public class AlertConditionEvaluatorRepositoryImpl
extends java.lang.Object
implements AlertConditionEvaluatorRepository, ShutdownCallback

Default implementation ofAlertConditionEvaluatorRepository This implementation is NOT thread-safe. Access to add, remove, and get should be synchronized by external callers if concurrent access is expected (current impl of add/get is single-threaded through RegisteredTriggerManager. remove is very unlikely to occur concurrently). This implementation persists the state of AlertConditionEvaluators and their ExecutionStrategy s on server shutdown.


Constructor Summary
protected AlertConditionEvaluatorRepositoryImpl(AlertConditionEvaluatorStateRepository alertConditionEvaluatorStateRepository)
           
 
Method Summary
 void addAlertConditionEvaluator(AlertConditionEvaluator alertConditionEvaluator)
          Add to the repository
 AlertConditionEvaluator getAlertConditionEvaluatorById(java.lang.Integer alertDefinitionId)
           
 java.util.Map getAlertConditionEvaluators()
          ConcurrentModificationException may occur to callers of this method when iterating through the map.
static AlertConditionEvaluatorRepository getInstance()
           
 AlertConditionEvaluatorStateRepository getStateRepository()
          Get the AlertConditionEvaluatorStateRepository
 void removeAlertConditionEvaluator(java.lang.Integer alertDefinitionId)
          Remove from the repository
 void shutdown()
          Called by the HQ Application when it has been requested to shutdown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlertConditionEvaluatorRepositoryImpl

protected AlertConditionEvaluatorRepositoryImpl(AlertConditionEvaluatorStateRepository alertConditionEvaluatorStateRepository)
Parameters:
alertConditionEvaluatorStateRepository - The AlertConditionEvaluatorStateRepository to use for persisting state on server shutdown
Method Detail

addAlertConditionEvaluator

public void addAlertConditionEvaluator(AlertConditionEvaluator alertConditionEvaluator)
Description copied from interface: AlertConditionEvaluatorRepository
Add to the repository

Specified by:
addAlertConditionEvaluator in interface AlertConditionEvaluatorRepository
Parameters:
alertConditionEvaluator - The AlertConditionEvaluator to add the repository

getAlertConditionEvaluatorById

public AlertConditionEvaluator getAlertConditionEvaluatorById(java.lang.Integer alertDefinitionId)
Specified by:
getAlertConditionEvaluatorById in interface AlertConditionEvaluatorRepository
Parameters:
alertDefinitionId - The ID of the alert definition
Returns:
The corresponding AlertConditionEvaluator or null if none exists

getAlertConditionEvaluators

public java.util.Map getAlertConditionEvaluators()
ConcurrentModificationException may occur to callers of this method when iterating through the map. However, since the AlertConditionEvaluatorDiagnosticService MBean is the only client, it is not a big issue for now.

Specified by:
getAlertConditionEvaluators in interface AlertConditionEvaluatorRepository

removeAlertConditionEvaluator

public void removeAlertConditionEvaluator(java.lang.Integer alertDefinitionId)
Description copied from interface: AlertConditionEvaluatorRepository
Remove from the repository

Specified by:
removeAlertConditionEvaluator in interface AlertConditionEvaluatorRepository
Parameters:
alertDefinitionId - The ID of the alert definition whose AlertConditionEvaluator should be removed from the repository

getStateRepository

public AlertConditionEvaluatorStateRepository getStateRepository()
Description copied from interface: AlertConditionEvaluatorRepository
Get the AlertConditionEvaluatorStateRepository

Specified by:
getStateRepository in interface AlertConditionEvaluatorRepository

shutdown

public void shutdown()
Description copied from interface: ShutdownCallback
Called by the HQ Application when it has been requested to shutdown. Recipients of this message should only perform trivial operations, as session beans, etc. are not guaranteed to be functional.

Specified by:
shutdown in interface ShutdownCallback

getInstance

public static AlertConditionEvaluatorRepository getInstance()

Hyperic HQ Plugin API v. 4.4.0.2

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.