EventReceivingStrategy

public interface EventReceivingStrategy extends EventHandler, Activatable

An interface for strategies that dispatch received events to Handler s. Implementations have the task of freeing the caller of handle(rsb.Event) to dispatch the event in its thread.

Author

jwienke

Methods

addFilter

void addFilter(Filter filter)

Adds a filter that is applied for all registered handlers some time after this method call.

Parameters

filter – filter to add, not null

addHandler

void addHandler(Handler handler, boolean wait)

Registers a handler that will be informed in case of received events.

Parameters
  • handler – the handler to add, not null

  • wait – if true, wait with returning from this method until the handler is fully functional and will receive the next issued event

Throws

InterruptedException – interrupted while waiting for the handler to be installed

removeFilter

void removeFilter(Filter filter)

Removes a filter that is remove for all registered handlers some time after this method call.

Parameters

filter – filter to remove, not null

removeHandler

void removeHandler(Handler handler, boolean wait)

Removes a handler from the event dispatching. In case the given handler was not registered the call is silently ignored.

Parameters
  • handler – the handler to remove

  • wait – if true, wait with returning from this method until the handler cannot receive any more events

Throws

InterruptedException – interrupted while waiting for the handler to be removed