Package com.adaptris.core.interceptor
Class MetricsInterceptorImpl<T>
- java.lang.Object
-
- com.adaptris.core.interceptor.WorkflowInterceptorImpl
-
- com.adaptris.core.interceptor.MetricsInterceptorImpl<T>
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,StateManagedComponent
,WorkflowInterceptor
- Direct Known Subclasses:
MessageMetricsInterceptorImpl
,MetadataMetricsInterceptorImpl
public abstract class MetricsInterceptorImpl<T> extends WorkflowInterceptorImpl
Abstract WorkflowInterceptor implementation that captures historical data.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MetricsInterceptorImpl.StatisticsDelta<E extends InterceptorStatistic>
-
Nested classes/interfaces inherited from class com.adaptris.core.interceptor.WorkflowInterceptorImpl
WorkflowInterceptorImpl.WorkflowInterceptorException
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
DEFAULT_TIMESLICE_HISTORY_COUNT
-
Fields inherited from class com.adaptris.core.interceptor.WorkflowInterceptorImpl
log
-
-
Constructor Summary
Constructors Constructor Description MetricsInterceptorImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the component.TimeInterval
getTimesliceDuration()
java.lang.Integer
getTimesliceHistoryCount()
void
init()
Initialises the component.void
setTimesliceDuration(TimeInterval timesliceDuration)
Set the duration of each timeslice for metrics gathering.void
setTimesliceHistoryCount(java.lang.Integer s)
Set the number of timeslices to keep.void
start()
Starts the component.void
stop()
Stop the componentprotected int
timesliceHistoryCount()
-
Methods inherited from class com.adaptris.core.interceptor.WorkflowInterceptorImpl
changeState, getUniqueId, parentChannel, parentWorkflow, prepare, registerParentChannel, registerParentWorkflow, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setUniqueId, wasSuccessful
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.WorkflowInterceptor
processingStart, workflowEnd, workflowStart
-
-
-
-
Field Detail
-
DEFAULT_TIMESLICE_HISTORY_COUNT
protected static final int DEFAULT_TIMESLICE_HISTORY_COUNT
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init() throws CoreException
Description copied from interface:ComponentLifecycle
Initialises the component.Component initialisation includes config verification, creation of connections etc.
- Throws:
CoreException
- wrapping any underlyingException
s
-
start
public void start() throws CoreException
Description copied from interface:ComponentLifecycle
Starts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.- Throws:
CoreException
- wrapping any underlyingException
s
-
stop
public void stop()
Description copied from interface:ComponentLifecycle
Stop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing aRuntimeException
may cause unintended consequences
-
close
public void close()
Description copied from interface:ComponentLifecycle
Closes the component.A closed component should release any connections it uses, etc. and clean up completely. Throwing a
RuntimeException
may cause unintended consequences
-
timesliceHistoryCount
protected int timesliceHistoryCount()
-
getTimesliceHistoryCount
public java.lang.Integer getTimesliceHistoryCount()
-
setTimesliceHistoryCount
public void setTimesliceHistoryCount(java.lang.Integer s)
Set the number of timeslices to keep.- Parameters:
s
- the number of timeslices to keep (default 100)
-
getTimesliceDuration
public TimeInterval getTimesliceDuration()
-
setTimesliceDuration
public void setTimesliceDuration(TimeInterval timesliceDuration)
Set the duration of each timeslice for metrics gathering.- Parameters:
timesliceDuration
- the timeslice duration, default is 10 seconds if not explicitly specified.
-
-