Class ProducingStatisticManager
- java.lang.Object
-
- com.adaptris.core.interceptor.BaseStatisticManager
-
- com.adaptris.core.interceptor.ProducingStatisticManager
-
- All Implemented Interfaces:
ComponentLifecycle
,StatisticManager
@ComponentProfile(summary="Statistic manager that allows configuration of a standalone producer for each timeslice when they expire.", tag="interceptor") public class ProducingStatisticManager extends BaseStatisticManager
This statistic manager allows you to configure a marshaller and a stand alone producer.
When the produce() method is triggered we will serialize the
InterceptorStatistic
with the configured marshaller and then execute the producer with the resulting string payload.If the producer should fail, we simply attempt to restart the stand alone producer and continue.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.adaptris.core.interceptor.BaseStatisticManager
BaseStatisticManager.MaxCapacityList<E>
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.interceptor.BaseStatisticManager
log
-
-
Constructor Summary
Constructors Constructor Description ProducingStatisticManager()
ProducingStatisticManager(int maxHistoryCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the component.AdaptrisMarshaller
getMarshaller()
StandaloneProducer
getProducer()
void
init()
Initialises the component.void
produce(InterceptorStatistic interceptorStatistic)
void
setMarshaller(AdaptrisMarshaller marshaller)
void
setProducer(StandaloneProducer producer)
void
start()
Starts the component.void
stop()
Stop the component-
Methods inherited from class com.adaptris.core.interceptor.BaseStatisticManager
clear, getLatestStat, getMaxHistoryCount, getStats, setMaxHistoryCount, setStats, stats, updateCurrent
-
-
-
-
Method Detail
-
produce
public void produce(InterceptorStatistic interceptorStatistic) throws ProduceException
- Throws:
ProduceException
-
init
public void init() throws CoreException
Description copied from interface:ComponentLifecycle
Initialises the component.Component initialisation includes config verification, creation of connections etc.
- Specified by:
init
in interfaceComponentLifecycle
- Overrides:
init
in classBaseStatisticManager
- 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.- Specified by:
start
in interfaceComponentLifecycle
- Overrides:
start
in classBaseStatisticManager
- 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- Specified by:
stop
in interfaceComponentLifecycle
- Overrides:
stop
in classBaseStatisticManager
-
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- Specified by:
close
in interfaceComponentLifecycle
- Overrides:
close
in classBaseStatisticManager
-
getProducer
public StandaloneProducer getProducer()
-
setProducer
public void setProducer(StandaloneProducer producer)
-
getMarshaller
public AdaptrisMarshaller getMarshaller()
-
setMarshaller
public void setMarshaller(AdaptrisMarshaller marshaller)
-
-