SUB_T
- the interface implemented by the subscriberspublic class LocalDispatcher<SUB_T> extends Object implements Dispatcher<SUB_T>
SUB_T
. They will provide a method that
allow obtaining the interface as a Dispatcher
to prevent the private
interface from being obtained.Constructor and Description |
---|
LocalDispatcher()
Creates a new local dispatcher.
|
Modifier and Type | Method and Description |
---|---|
void |
add_async(SUB_T subscriber)
Adds a new subscriber to the dispatcher using a asynchronous
subscription.
|
void |
add_sync(SUB_T subscriber)
Adds a new subscriber to the dispatcher using a synchronous
subscription.
|
void |
dispatch(DispatcherOp<SUB_T> op)
Dispatchers an event to all subscribers.
|
void |
remove(SUB_T subscriber)
Removes a previously registered subscriber from the dispatcher.
|
public void add_sync(SUB_T subscriber)
Dispatcher
add_sync
in interface Dispatcher<SUB_T>
subscriber
- the subscriber, cannot be null
public void add_async(SUB_T subscriber)
Dispatcher
add_async
in interface Dispatcher<SUB_T>
subscriber
- the subscriber, cannot be null
public void remove(SUB_T subscriber)
Dispatcher
remove
in interface Dispatcher<SUB_T>
subscriber
- the subscriber to remove, cannot be null
public void dispatch(DispatcherOp<SUB_T> op)
op
- the event dispatching operation, cannot be null
Copyright © 2015. All rights reserved.