Kieker 1.3

kieker.tools.logReplayer
Class RealtimeReplayDistributor

java.lang.Object
  extended by kieker.tools.logReplayer.RealtimeReplayDistributor
All Implemented Interfaces:
IAnalysisPlugin, IMonitoringRecordConsumerPlugin, IMonitoringRecordReceiver

public class RealtimeReplayDistributor
extends Object
implements IMonitoringRecordConsumerPlugin

IMonitoringRecordConsumerPlugin that distributes the log records to the worker thread for "real time" replays.

Author:
Robert von Massow

Field Summary
 int numWorkers
           
 
Constructor Summary
RealtimeReplayDistributor(int numWorkers, IMonitoringRecordConsumerPlugin cons, CountDownLatch terminationLatch)
          Constructs a RealtimeReplayDistributor.
 
Method Summary
 void decreaseActive()
           
 boolean execute()
          Initiates the start of a component.
 long getOffset()
           
 Collection<Class<? extends IMonitoringRecord>> getRecordTypeSubscriptionList()
          Simply return null to get records of all types.
 long getStartTime()
           
 boolean newMonitoringRecord(IMonitoringRecord monitoringRecord)
          Called for each new record.
 void terminate(boolean error)
          Initiates a termination of the component.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numWorkers

public final int numWorkers
Constructor Detail

RealtimeReplayDistributor

public RealtimeReplayDistributor(int numWorkers,
                                 IMonitoringRecordConsumerPlugin cons,
                                 CountDownLatch terminationLatch)
Constructs a RealtimeReplayDistributor.

Parameters:
numWorkers - number of worker threads processing the internal record buffer
cons - the consumer
terminationLatch - will be decremented after the last record was replayed
Method Detail

newMonitoringRecord

public boolean newMonitoringRecord(IMonitoringRecord monitoringRecord)
Description copied from interface: IMonitoringRecordReceiver
Called for each new record. Notice, that this method should not throw an exception, but indicate an error by the return value false.

Specified by:
newMonitoringRecord in interface IMonitoringRecordReceiver
Parameters:
monitoringRecord - the record.
Returns:
true on success; false in case of an error.

execute

public boolean execute()
Description copied from interface: IAnalysisPlugin
Initiates the start of a component. This method is called once when a TpanInstance's run() method is called. This implementation must not be blocking! Asynchronous consumers would spawn (an) aynchronous thread(s) in this method.

Specified by:
execute in interface IAnalysisPlugin
Returns:
true on success; false otherwise.

getRecordTypeSubscriptionList

public Collection<Class<? extends IMonitoringRecord>> getRecordTypeSubscriptionList()
Description copied from interface: IMonitoringRecordConsumerPlugin
Simply return null to get records of all types.

Specified by:
getRecordTypeSubscriptionList in interface IMonitoringRecordConsumerPlugin
Returns:

getOffset

public final long getOffset()

getStartTime

public final long getStartTime()

terminate

public void terminate(boolean error)
Description copied from interface: IAnalysisPlugin
Initiates a termination of the component. The value of the parameter error indicates whether an error occured.

Specified by:
terminate in interface IAnalysisPlugin
Parameters:
error - true iff an error occured.

decreaseActive

public void decreaseActive()

Kieker 1.3

Copyright 2011 the Kieker Project, http://kieker.sourceforge.net