public interface BehaviorProducerIF
This implements a listener pattern. Those interested in hearing from the BehaviorProducerIF register with the object. When the BehaviorProducerIF gets (or produces) a PDU, it notifies all listeners. Note that there is no attempt to limit which listeners/consumers receive the PDU.
Modifier and Type | Method and Description |
---|---|
void |
addListener(BehaviorConsumerIF consumer)
Add a listener that will be notified when a PDU is
ready.
|
void |
removeListener(BehaviorConsumerIF consumer)
Remove a listener/consumer of PDUs from the notification list.
|
void |
setUseCopies(boolean shouldCreateCopy)
This is a performance option.
|
void addListener(BehaviorConsumerIF consumer)
consumer
- the object that will be notified of the PDUvoid removeListener(BehaviorConsumerIF consumer)
consumer
- to be removed from the notification listvoid setUseCopies(boolean shouldCreateCopy)
The default behavior should be to distribute a new, unqiue copy to each listener. this allows the user to override this behavior for better performance.
shouldCreateCopy
- true to create a new copy for each listener, false for a shared copy for each listener