Package psiprobe.beans.stats.listeners
Class MemoryPoolMailingListener
- java.lang.Object
-
- psiprobe.beans.stats.listeners.AbstractStatsCollectionListener
-
- psiprobe.beans.stats.listeners.AbstractThresholdListener
-
- psiprobe.beans.stats.listeners.AbstractFlapListener
-
- psiprobe.beans.stats.listeners.MemoryPoolMailingListener
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.MessageSourceAware
,StatsCollectionListener
public class MemoryPoolMailingListener extends AbstractFlapListener implements org.springframework.context.MessageSourceAware, org.springframework.beans.factory.InitializingBean
The listener interface for receiving memoryPoolMailing events. The class that is interested in processing a memoryPoolMailing event implements this interface, and the object created with that class is registered with a component using the component'saddMemoryPoolMailingListener
method. When the memoryPoolMailing event occurs, that object's appropriate method is invoked.
-
-
Field Summary
Fields Modifier and Type Field Description private static String
BASE_PROPERTY
The Constant BASE_PROPERTY.private Mailer
mailer
The mailer.private org.springframework.context.support.MessageSourceAccessor
messageSourceAccessor
The message source accessor.-
Fields inherited from class psiprobe.beans.stats.listeners.AbstractThresholdListener
DEFAULT_THRESHOLD, DEFAULT_VALUE
-
Fields inherited from class psiprobe.beans.stats.listeners.AbstractStatsCollectionListener
logger
-
-
Constructor Summary
Constructors Constructor Description MemoryPoolMailingListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
aboveThresholdFlappingStopped(StatsCollectionEvent sce)
Above threshold flapping stopped.protected void
aboveThresholdNotFlapping(StatsCollectionEvent sce)
Above threshold not flapping.void
afterPropertiesSet()
protected void
belowThresholdFlappingStopped(StatsCollectionEvent sce)
Below threshold flapping stopped.protected void
belowThresholdNotFlapping(StatsCollectionEvent sce)
Below threshold not flapping.protected void
flappingStarted(StatsCollectionEvent sce)
Flapping started.Mailer
getMailer()
Gets the mailer.org.springframework.context.support.MessageSourceAccessor
getMessageSourceAccessor()
Gets the message source accessor.protected void
sendMail(StatsCollectionEvent sce, String message, boolean flappingStop)
Send mail.void
setDefaultFlapHighWeight(float defaultFlapHighWeight)
Sets the default flap high weight.void
setDefaultFlapInterval(int defaultFlapInterval)
Sets the default flap interval.void
setDefaultFlapLowWeight(float defaultFlapLowWeight)
Sets the default flap low weight.void
setDefaultFlapStartThreshold(float defaultFlapStartThreshold)
Sets the default flap start threshold.void
setDefaultFlapStopThreshold(float defaultFlapStopThreshold)
Sets the default flap stop threshold.void
setMailer(Mailer mailer)
Sets the mailer.void
setMessageSource(org.springframework.context.MessageSource messageSource)
-
Methods inherited from class psiprobe.beans.stats.listeners.AbstractFlapListener
addFlap, calculateStateTransitionPercentage, checkFlappingStateChanged, crossedAboveThreshold, crossedBelowThreshold, getDefaultFlapHighWeight, getDefaultFlapInterval, getDefaultFlapLowWeight, getDefaultFlapStartThreshold, getDefaultFlapStopThreshold, getFlapHighWeight, getFlapInterval, getFlapLowWeight, getFlappingState, getFlaps, getFlapStartThreshold, getFlapStopThreshold, remainedAboveThreshold, remainedBelowThreshold, reset, setFlappingState, statsCollected
-
Methods inherited from class psiprobe.beans.stats.listeners.AbstractThresholdListener
getPreviousValue, getThreshold, isPreviousValueAboveThreshold, isSeriesDisabled, isValueAboveThreshold, setPreviousValue, setSeriesDisabled, statsCollected
-
Methods inherited from class psiprobe.beans.stats.listeners.AbstractStatsCollectionListener
getPropertyCategory, getPropertyKey, getPropertyValue, getPropertyValue, isEnabled, setEnabled, setPropertyCategory
-
-
-
-
Field Detail
-
BASE_PROPERTY
private static final String BASE_PROPERTY
The Constant BASE_PROPERTY.- See Also:
- Constant Field Values
-
messageSourceAccessor
private org.springframework.context.support.MessageSourceAccessor messageSourceAccessor
The message source accessor.
-
mailer
@Inject private Mailer mailer
The mailer.
-
-
Method Detail
-
getMessageSourceAccessor
public org.springframework.context.support.MessageSourceAccessor getMessageSourceAccessor()
Gets the message source accessor.- Returns:
- the message source accessor
-
setMessageSource
public void setMessageSource(org.springframework.context.MessageSource messageSource)
- Specified by:
setMessageSource
in interfaceorg.springframework.context.MessageSourceAware
-
getMailer
public Mailer getMailer()
Gets the mailer.- Returns:
- the mailer
-
setMailer
public void setMailer(Mailer mailer)
Sets the mailer.- Parameters:
mailer
- the new mailer
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
flappingStarted
protected void flappingStarted(StatsCollectionEvent sce)
Description copied from class:AbstractFlapListener
Flapping started.- Specified by:
flappingStarted
in classAbstractFlapListener
- Parameters:
sce
- the sce
-
aboveThresholdFlappingStopped
protected void aboveThresholdFlappingStopped(StatsCollectionEvent sce)
Description copied from class:AbstractFlapListener
Above threshold flapping stopped.- Specified by:
aboveThresholdFlappingStopped
in classAbstractFlapListener
- Parameters:
sce
- the sce
-
belowThresholdFlappingStopped
protected void belowThresholdFlappingStopped(StatsCollectionEvent sce)
Description copied from class:AbstractFlapListener
Below threshold flapping stopped.- Specified by:
belowThresholdFlappingStopped
in classAbstractFlapListener
- Parameters:
sce
- the sce
-
aboveThresholdNotFlapping
protected void aboveThresholdNotFlapping(StatsCollectionEvent sce)
Description copied from class:AbstractFlapListener
Above threshold not flapping.- Specified by:
aboveThresholdNotFlapping
in classAbstractFlapListener
- Parameters:
sce
- the sce
-
belowThresholdNotFlapping
protected void belowThresholdNotFlapping(StatsCollectionEvent sce)
Description copied from class:AbstractFlapListener
Below threshold not flapping.- Specified by:
belowThresholdNotFlapping
in classAbstractFlapListener
- Parameters:
sce
- the sce
-
sendMail
protected void sendMail(StatsCollectionEvent sce, String message, boolean flappingStop)
Send mail.- Parameters:
sce
- the scemessage
- the messageflappingStop
- the flapping stop
-
setDefaultFlapInterval
@Value("${psiprobe.beans.stats.listeners.flapInterval}") public void setDefaultFlapInterval(int defaultFlapInterval)
Description copied from class:AbstractFlapListener
Sets the default flap interval.- Overrides:
setDefaultFlapInterval
in classAbstractFlapListener
- Parameters:
defaultFlapInterval
- the new default flap interval
-
setDefaultFlapStartThreshold
@Value("${psiprobe.beans.stats.listeners.flapStartThreshold}") public void setDefaultFlapStartThreshold(float defaultFlapStartThreshold)
Description copied from class:AbstractFlapListener
Sets the default flap start threshold.- Overrides:
setDefaultFlapStartThreshold
in classAbstractFlapListener
- Parameters:
defaultFlapStartThreshold
- the new default flap start threshold
-
setDefaultFlapStopThreshold
@Value("${psiprobe.beans.stats.listeners.flapStopThreshold}") public void setDefaultFlapStopThreshold(float defaultFlapStopThreshold)
Description copied from class:AbstractFlapListener
Sets the default flap stop threshold.- Overrides:
setDefaultFlapStopThreshold
in classAbstractFlapListener
- Parameters:
defaultFlapStopThreshold
- the new default flap stop threshold
-
setDefaultFlapLowWeight
@Value("${psiprobe.beans.stats.listeners.flapLowWeight}") public void setDefaultFlapLowWeight(float defaultFlapLowWeight)
Description copied from class:AbstractFlapListener
Sets the default flap low weight.- Overrides:
setDefaultFlapLowWeight
in classAbstractFlapListener
- Parameters:
defaultFlapLowWeight
- the new default flap low weight
-
setDefaultFlapHighWeight
@Value("${psiprobe.beans.stats.listeners.flapHighWeight}") public void setDefaultFlapHighWeight(float defaultFlapHighWeight)
Description copied from class:AbstractFlapListener
Sets the default flap high weight.- Overrides:
setDefaultFlapHighWeight
in classAbstractFlapListener
- Parameters:
defaultFlapHighWeight
- the new default flap high weight
-
-