public interface EventBus
PushEndpoint.value()
using one of the method annotated with OnMessage
.
PushEndpoint
are registered against a path, defined using the PushEndpoint.value()
. There can be multiple PushEndpoint registered against each path,
and a particular PushEndpoint can be registered against multiple paths. The event bus will route a sent message to all PushEndpoint which are registered against that path.
When sending a message, a EventBus.Reply
can be provided. If so, it will be called when the reply from the receiver has been completed.
Instances of EventBus are thread-safe.Modifier and Type | Interface and Description |
---|---|
static interface |
EventBus.Reply |
Modifier and Type | Method and Description |
---|---|
EventBus |
publish(Object o)
Fire an object to all connected
RemoteEndpoint |
EventBus |
publish(String path,
Object o)
Fire an object to
RemoteEndpoint that connected using the path value. |
EventBus |
publish(String path,
Object o,
EventBus.Reply r)
Fire an object to
RemoteEndpoint that connected using the path value. |
<T> Future<T> |
schedule(String path,
T t,
int time,
TimeUnit unit)
Schedule a period push operation.
|
EventBus publish(Object o)
RemoteEndpoint
o
- an ObjectEventBus publish(String path, Object o)
RemoteEndpoint
that connected using the path value.path
- A String starting with '/'o
- an ObjectEventBus publish(String path, Object o, EventBus.Reply r)
RemoteEndpoint
that connected using the path value.path
- A String starting with '/'o
- an Objectr
- an EventBus.Reply
<T> Future<T> schedule(String path, T t, int time, TimeUnit unit)
T
- The type of the messagepath
- a channel of communication.t
- a messagetime
- the timeunit
- the @TimeUnit
Copyright © 2015. All rights reserved.