gov.sns.ca.correlator
Class ChannelAgent

java.lang.Object
  |
  +--gov.sns.tools.correlator.SourceAgent
        |
        +--gov.sns.ca.correlator.ChannelAgent
All Implemented Interfaces:
gov.sns.tools.correlator.StateNotice

public class ChannelAgent
extends SourceAgent

ChannelAgent manages a single channel. It performs any setup, monitors the channel and it manages a circular buffer of bin agents that gather correlated events.


Nested Class Summary
protected  class ChannelAgent.EventHandler
          Handle the monitor events
protected  class ChannelAgent.FilteredEventHandler
          Handle the Monitor events and filter the events according to the supplied ChannelRecordFilter.
 
Field Summary
 
Fields inherited from class gov.sns.tools.correlator.SourceAgent
_name, binUpdateProxy, localCenter
 
Constructor Summary
ChannelAgent(MessageCenter newLocalCenter, Channel newChannel, java.lang.String newName, RecordFilter recordFilter, CorrelationTester tester)
          Creates new ChannelAgent
 
Method Summary
 boolean isActive()
          Determine if the channel is actively being monitored.
 boolean isEnabled()
          Determine if the channel is enabled for correlations.
protected  void makeMonitor()
          Create a monitor to listen for new channel records.
protected  void setupEventHandler(RecordFilter recordFilter)
          Setup the event handler to use the specified record filter to filter monitor events for this channel.
 boolean startMonitor()
          Start monitoring the channel.
 void stopMonitor()
          Stop monitoring the channel
 
Methods inherited from class gov.sns.tools.correlator.SourceAgent
binTimespanChanged, correlationFilterChanged, name, postEvent, reset, setBinTimespan, shutdown, sourceAdded, sourceRemoved, willStartMonitoring, willStopMonitoring
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelAgent

public ChannelAgent(MessageCenter newLocalCenter,
                    Channel newChannel,
                    java.lang.String newName,
                    RecordFilter recordFilter,
                    CorrelationTester tester)
Creates new ChannelAgent

Method Detail

setupEventHandler

protected void setupEventHandler(RecordFilter recordFilter)
Setup the event handler to use the specified record filter to filter monitor events for this channel.

Specified by:
setupEventHandler in class SourceAgent
Parameters:
recordFilter - The filter to use for this channel.
See Also:
SourceAgent.postEvent(java.lang.Object, double)

isEnabled

public boolean isEnabled()
Determine if the channel is enabled for correlations.

Returns:
true if the channel is enabled for correlations.

isActive

public boolean isActive()
Determine if the channel is actively being monitored.

Returns:
true if the channel is being monitored and false otherwise.

startMonitor

public boolean startMonitor()
Start monitoring the channel.

Specified by:
startMonitor in class SourceAgent
Returns:
true if the channel is successfully being monitored and false otherwise.

stopMonitor

public void stopMonitor()
Stop monitoring the channel

Specified by:
stopMonitor in class SourceAgent

makeMonitor

protected void makeMonitor()
Create a monitor to listen for new channel records.