Package org.frankframework.monitoring
Class Monitor
java.lang.Object
org.frankframework.monitoring.Monitor
- All Implemented Interfaces:
FrankElement,HasApplicationContext,HasName,IConfigurable,IScopeProvider,NameAware,ConfigurableLifecycle,org.springframework.beans.factory.Aware,org.springframework.beans.factory.DisposableBean,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
@FrankDocGroup(MONITORING)
public class Monitor
extends Object
implements ConfigurableLifecycle, NameAware, org.springframework.beans.factory.DisposableBean, FrankElement
Example configuration:
<Monitor name="Receiver Shutdown" destinations="MONITOR_LOG">
<AlarmTrigger severity="WARNING">
<Event>Receiver Shutdown</Event>
</AlarmTrigger>
<ClearingTrigger severity="WARNING">
<Event>Receiver Shutdown</Event>
</ClearingTrigger>
</Monitor>
- Since:
- 4.9
- Version:
- 2.0
- Author:
- Gerrit van Brakel, Niels Meijer
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTrigger(ITrigger trigger) voidchangeMonitorState(EventType eventType, Severity severity, String eventCode, MonitorEvent event) voidchangeState(ITrigger.TriggerType type, Severity severity, MonitorEvent event) protected voidclearEvents(ITrigger.TriggerType alarm) voidConfigure this component.voiddestroy()Destroy the monitor and all registered triggersintorg.springframework.context.ApplicationContextgetTrigger(int index) booleanisRaised()booleanvoidremoveTrigger(ITrigger trigger) voidsetAdditionalHitCount(int i) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetDestinations(String newDestinations) voidsetDestinationSet(Set<String> newDestinations) voidThe functional name of the object.voidsetRaised(boolean b) voidstart()voidstop()toXml()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.frankframework.lifecycle.ConfigurableLifecycle
getPhase, isAutoStartup, isConfiguredMethods inherited from interface org.frankframework.core.FrankElement
addConfigWarningMethods inherited from interface org.frankframework.core.HasApplicationContext
getConfigurationClassLoaderMethods inherited from interface org.springframework.context.SmartLifecycle
stop
-
Constructor Details
-
Monitor
public Monitor()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()- Specified by:
getApplicationContextin interfaceHasApplicationContext
-
configure
Description copied from interface:IConfigurableConfigure this component.configure()is called once at startup of the framework in the configure method of the owner of thisIConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure(), to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configurein interfaceIConfigurable- Throws:
ConfigurationException- in case it was not able to configure the component.
-
changeState
public void changeState(ITrigger.TriggerType type, Severity severity, MonitorEvent event) throws MonitorException - Throws:
MonitorException
-
changeMonitorState
public void changeMonitorState(EventType eventType, Severity severity, String eventCode, MonitorEvent event) throws MonitorException - Throws:
MonitorException
-
clearEvents
-
toXml
-
getDestinationsAsString
-
setDestinations
-
getDestinationSet
-
setDestinationSet
-
addTrigger
-
removeTrigger
-
getLogPrefix
-
getTriggers
-
getTrigger
-
setName
Description copied from interface:NameAwareThe functional name of the object. -
setRaised
public void setRaised(boolean b) -
isRaised
public boolean isRaised() -
setAdditionalHitCount
public void setAdditionalHitCount(int i) -
getAdditionalHitCount
public int getAdditionalHitCount() -
destroy
public void destroy()Destroy the monitor and all registered triggers- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-
start
public void start()- Specified by:
startin interfaceConfigurableLifecycle- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-