|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ClientMessageBus
An extended client-specific/in-browser interface of MessageBus
, which defines client-specific functionality.
Method Summary | |
---|---|
void |
addLifecycleListener(BusLifecycleListener l)
Adds the given listener instance to this bus. |
void |
addTransportErrorHandler(TransportErrorHandler errorHandler)
Adds a global transport error handler to deal with any errors which arise from communication between the bus and the server. |
void |
clearProperties()
|
Set<String> |
getAllRegisteredSubjects()
Returns a set of all reject subjects in the bus. |
void |
init()
Takes this bus out of the "local only" state, causing it to try and connect with the server (unless remote communication is globally disabled). |
void |
removeLifecycleListener(BusLifecycleListener l)
Removes the given listener from this bus. |
void |
removeTransportErrorHandler(TransportErrorHandler errorHandler)
Removes the given global transport error handler from this bus. |
void |
sendLocal(Message message)
Delivers the given message to all local callbacks that subscribe to its subject. |
void |
setProperty(String name,
String value)
Sets a property on the bus. |
void |
stop(boolean sendDisconnectToServer)
Takes this bus into the "local only" state. |
Subscription |
subscribeShadow(String subject,
MessageCallback callback)
Declares a new shadow subscription. |
Methods inherited from interface org.jboss.errai.bus.client.api.messaging.MessageBus |
---|
addSubscribeListener, addUnsubscribeListener, attachMonitor, isSubscribed, send, send, sendGlobal, subscribe, subscribeLocal, unsubscribeAll |
Method Detail |
---|
Subscription subscribeShadow(String subject, MessageCallback callback)
When a message is sent by an application component to a remote service while the bus is physically disconnected from the server, the bus will consider shadow subscriptions with a matching subject name to deliver the message to.
Shadow subscriptions are considered routable in all bus states except CONNECTING.
subject
- the subject name.callback
-
void addLifecycleListener(BusLifecycleListener l)
l
- The listener that wants to receive lifecycle notifications. Must
not be null. If the same listener is added more than once, it will
receive the corresponding number of callbacks upon each lifecycle
event.void removeLifecycleListener(BusLifecycleListener l)
l
- The listener to remove. If the listener was added more than one
time, removing it will decrease by one the number of notifications
that listener receices for each event. If the listener was not
already registered to receive events, this method has no effect.void init()
BusToolsCli.isRemoteCommunicationEnabled()
void stop(boolean sendDisconnectToServer)
sendDisconnectToServer
- if true, the server will be notified that we are breaking the
connection. Else, no attempt will be made to notify the server.Set<String> getAllRegisteredSubjects()
void addTransportErrorHandler(TransportErrorHandler errorHandler)
errorHandler
- the error handler to add.void removeTransportErrorHandler(TransportErrorHandler errorHandler)
errorHandler
- the error handler to remove. This method has no effect if the
given handler is null
or it was not already registered.void setProperty(String name, String value)
name
- the property namevalue
- the property valuevoid clearProperties()
void sendLocal(Message message)
message
- The message to deliver to local subscribers.
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |