public interface ClientMessageBus extends MessageBus
MessageBus
, which defines client-specific functionality.Modifier and Type | Method and Description |
---|---|
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.
|
addSubscribeListener, addUnsubscribeListener, attachMonitor, isSubscribed, send, send, sendGlobal, subscribe, subscribeLocal, unsubscribeAll
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()
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.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.