Package xal.tools.correlator
Class PatientBroadcaster<T>
java.lang.Object
xal.tools.correlator.PatientBroadcaster<T>
- All Implemented Interfaces:
BinListener<T>
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 Summary
FieldsModifier and TypeFieldDescriptionprotected double
protected CorrelationFilter<T>
protected CorrelationNotice<T>
protected int
protected double
protected Correlation<T>
-
Constructor Summary
ConstructorsConstructorDescriptionPatientBroadcaster
(MessageCenter aLocalCenter) Creates a new instance of PatientBroadcaster -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCorrelationNoticeListener
(CorrelationNotice<T> listener) Register the listener as a receiver of Correlation notices from this correlator.void
binTimespanChanged
(Correlator<?, T, ?> sender, double newTimespan) Handle the bin timespan changed event.void
correlationFilterChanged
(Correlator<?, T, ?> sender, CorrelationFilter<T> newFilter) Handle the correlation filter changed event.void
newCorrelation
(BinAgent<T> sender, Correlation<T> correlation) Handle the BinListener event and determine if we should cache it or post it.protected void
postCorrelation
(Correlation<T> correlation) Post the correlation.void
removeCorrelationNoticeListener
(CorrelationNotice<T> listener) Unregister the listener as a receiver of Correlation notices from this correlator.void
sourceAdded
(Correlator<?, T, ?> sender, String name, int newCount) Handle the source added event.void
sourceRemoved
(Correlator<?, T, ?> sender, String name, int newCount) Handle the source removed event.void
Implement BinListener interface.void
willStartMonitoring
(Correlator<?, T, ?> sender) Handle the advance notice of the correlator starting.void
willStopMonitoring
(Correlator<?, T, ?> sender) Handle the advance notice of the correlator stopping.
-
Field Details
-
binTimespan
protected double binTimespan -
lastTime
protected double lastTime -
pendingCorrelation
-
fullCount
protected transient int fullCount -
correlationProxy
-
correlationFilter
-
-
Constructor Details
-
PatientBroadcaster
Creates a new instance of PatientBroadcaster
-
-
Method Details
-
newCorrelation
Handle the BinListener event and determine if we should cache it or post it.- Specified by:
newCorrelation
in interfaceBinListener<T>
- Parameters:
sender
- The bin agent that published the new correlation.correlation
- The new correlation.
-
binTimespanChanged
Handle the bin timespan changed event.- Parameters:
sender
- The correlator whose timespan bin has changed.newTimespan
- The new timespan used by the correlator.
-
addCorrelationNoticeListener
Register the listener as a receiver of Correlation notices from this correlator. -
removeCorrelationNoticeListener
Unregister the listener as a receiver of Correlation notices from this correlator. -
postCorrelation
Post the correlation.- Parameters:
correlation
- The correlation to post.
-
willReset
Implement BinListener interface. This method does nothing.- Specified by:
willReset
in interfaceBinListener<T>
- Parameters:
sender
- The bin agent who sent this message.
-
sourceAdded
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
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
Handle the advance notice of the correlator stopping.- Parameters:
sender
- The correlator that will stop.
-
willStartMonitoring
Handle the advance notice of the correlator starting.- Parameters:
sender
- The correlator that will start.
-
correlationFilterChanged
Handle the correlation filter changed event.- Parameters:
sender
- The correlator whose correlation filter has changed.newFilter
- The new correlation filter to use.
-