Class PatientBroadcaster<T>

java.lang.Object
xal.tools.correlator.PatientBroadcaster<T>
All Implemented Interfaces:
BinListener<T>

public class PatientBroadcaster<T> extends Object
PatientBroadcaster posts only the best correlation (most records) for a given correlation time period. Smaller correlations for a given correlation time period are dropped. The effect is to post only mutually exclusive correlations.
Author:
tap
  • Field Details

    • binTimespan

      protected double binTimespan
    • lastTime

      protected double lastTime
    • pendingCorrelation

      protected Correlation<T> pendingCorrelation
    • fullCount

      protected transient int fullCount
    • correlationProxy

      protected CorrelationNotice<T> correlationProxy
    • correlationFilter

      protected CorrelationFilter<T> correlationFilter
  • Constructor Details

    • PatientBroadcaster

      public PatientBroadcaster(MessageCenter aLocalCenter)
      Creates a new instance of PatientBroadcaster
  • Method Details

    • newCorrelation

      public void newCorrelation(BinAgent<T> sender, Correlation<T> correlation)
      Handle the BinListener event and determine if we should cache it or post it.
      Specified by:
      newCorrelation in interface BinListener<T>
      Parameters:
      sender - The bin agent that published the new correlation.
      correlation - The new correlation.
    • binTimespanChanged

      public void binTimespanChanged(Correlator<?,T,?> sender, double newTimespan)
      Handle the bin timespan changed event.
      Parameters:
      sender - The correlator whose timespan bin has changed.
      newTimespan - The new timespan used by the correlator.
    • addCorrelationNoticeListener

      public void addCorrelationNoticeListener(CorrelationNotice<T> listener)
      Register the listener as a receiver of Correlation notices from this correlator.
    • removeCorrelationNoticeListener

      public void removeCorrelationNoticeListener(CorrelationNotice<T> listener)
      Unregister the listener as a receiver of Correlation notices from this correlator.
    • postCorrelation

      protected void postCorrelation(Correlation<T> correlation)
      Post the correlation.
      Parameters:
      correlation - The correlation to post.
    • willReset

      public void willReset(BinAgent<T> sender)
      Implement BinListener interface. This method does nothing.
      Specified by:
      willReset in interface BinListener<T>
      Parameters:
      sender - The bin agent who sent this message.
    • sourceAdded

      public void sourceAdded(Correlator<?,T,?> sender, String name, int newCount)
      Handle the source added event.
      Parameters:
      sender - The correlator to which the source has been added.
      name - The name identifying the new source.
      newCount - The new number of sources correlated.
    • sourceRemoved

      public void sourceRemoved(Correlator<?,T,?> sender, String name, int newCount)
      Handle the source removed event.
      Parameters:
      sender - The correlator from which the source has been removed.
      name - The name identifying the new source.
      newCount - The new number of sources correlated.
    • willStopMonitoring

      public void willStopMonitoring(Correlator<?,T,?> sender)
      Handle the advance notice of the correlator stopping.
      Parameters:
      sender - The correlator that will stop.
    • willStartMonitoring

      public void willStartMonitoring(Correlator<?,T,?> sender)
      Handle the advance notice of the correlator starting.
      Parameters:
      sender - The correlator that will start.
    • correlationFilterChanged

      public void correlationFilterChanged(Correlator<?,T,?> sender, CorrelationFilter<T> newFilter)
      Handle the correlation filter changed event.
      Parameters:
      sender - The correlator whose correlation filter has changed.
      newFilter - The new correlation filter to use.