@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.
BaseStatisticManager.MaxCapacityList<E>
log
Constructor and Description |
---|
ProducingStatisticManager() |
ProducingStatisticManager(int maxHistoryCount) |
Modifier and Type | Method and 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
|
clear, getLatestStat, getMaxHistoryCount, getStats, setMaxHistoryCount, setStats, stats, updateCurrent
public ProducingStatisticManager()
public ProducingStatisticManager(int maxHistoryCount)
public void produce(InterceptorStatistic interceptorStatistic) throws ProduceException
ProduceException
public void init() throws CoreException
ComponentLifecycle
Component initialisation includes config verification, creation of connections etc.
init
in interface ComponentLifecycle
init
in class BaseStatisticManager
CoreException
- wrapping any underlying Exception
spublic void start() throws CoreException
ComponentLifecycle
Once a component is started it should be ready to process messages. In the case of AdaptrisMessageConsumer
, calling start
will begin message delivery.
start
in interface ComponentLifecycle
start
in class BaseStatisticManager
CoreException
- wrapping any underlying Exception
spublic void stop()
ComponentLifecycle
A stopped component is not expected to be ready to process messages. In the case of AdaptrisMessageConsumer
, calling stop
will pause message delivery. Throwing a RuntimeException
may cause unintended consequences
stop
in interface ComponentLifecycle
stop
in class BaseStatisticManager
public void close()
ComponentLifecycle
A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException
may
cause unintended consequences
close
in interface ComponentLifecycle
close
in class BaseStatisticManager
public StandaloneProducer getProducer()
public void setProducer(StandaloneProducer producer)
public AdaptrisMarshaller getMarshaller()
public void setMarshaller(AdaptrisMarshaller marshaller)