|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.netflix.stats.distribution.DataPublisher
public class DataPublisher
An object that periodically updates a DataAccumulator,
swapping between the buffers.
| Constructor Summary | |
|---|---|
DataPublisher(DataAccumulator accumulator,
long delayMillis)
Creates a new DataPublisher. |
|
| Method Summary | |
|---|---|
DataAccumulator |
getDataAccumulator()
Gets the DataAccumulator that is managed by this publisher. |
protected java.util.concurrent.ScheduledExecutorService |
getExecutor()
Gets the ScheduledExecutorService to use to run the task to periodically
update the DataAccumulator. |
protected void |
handleException(java.lang.Exception e)
Called if an attempt to publish data throws an exception. |
boolean |
isRunning()
Is the DataPublisher scheduled to run? |
void |
start()
Starts the DataPublisher. |
void |
stop()
Stops publishing new data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataPublisher(DataAccumulator accumulator,
long delayMillis)
DataPublisher.
When created it is not running; it is up to the caller to call start().
accumulator - the DataAccumulator to periodically publishdelayMillis - the number of milliseconds between publish events| Method Detail |
|---|
public DataAccumulator getDataAccumulator()
DataAccumulator that is managed by this publisher.
public boolean isRunning()
DataPublisher scheduled to run?
public void start()
DataPublisher.
The method DataAccumulator.publish() will be called approximately
every delayMillis milliseconds.
If the publisher has already been started, does nothing.
stop()protected java.util.concurrent.ScheduledExecutorService getExecutor()
ScheduledExecutorService to use to run the task to periodically
update the DataAccumulator.
The default uses a global executor pool for all DataPublishers.
Subclasses are free to override this if desired, for example to use
a per-publisher executor pool.
public void stop()
start()protected void handleException(java.lang.Exception e)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||