public class BusLifecycleAdapter extends Object implements BusLifecycleListener
BusLifecycleListener
. Convenient for
subclassing (instead of implementing BusLifecycleListener directly) when you
are only interested in one or two of the event types.
For example:
bus.addLifecycleListener(new BusLifecycleAdapter() {
@Override
public void busOnline(BusLifecycleEvent e) {
// do stuff
}
});
Constructor and Description |
---|
BusLifecycleAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
busAssociating(BusLifecycleEvent e)
Indicates that the bus is about to transition from the local only to
the connecting state.
|
void |
busDisassociating(BusLifecycleEvent e)
Indicates that the bus is about to transition from the connecting to
the local only state.
|
void |
busOffline(BusLifecycleEvent e)
Indicates that the bus has just transitioned from the connected to
the connecting state.
|
void |
busOnline(BusLifecycleEvent e)
Indicates that the bus has just transitioned from the connecting to
the connected state.
|
public void busAssociating(BusLifecycleEvent e)
BusLifecycleListener
busAssociating
in interface BusLifecycleListener
e
- the object describing the event (includes a reference to the bus
that fired the event).public void busDisassociating(BusLifecycleEvent e)
BusLifecycleListener
When you want to try to connect to the server again (for example, to fail
over to another server, after a set timeout has elapsed, or in response to
the user clicking a "Reconnect" button in the user interface), call
ClientMessageBusImpl.init()
. This will transition the bus back to
the connecting state.
busDisassociating
in interface BusLifecycleListener
e
- the object describing the event (includes a reference to the bus
that fired the event).public void busOnline(BusLifecycleEvent e)
BusLifecycleListener
busOnline
in interface BusLifecycleListener
e
- the object describing the event (includes a reference to the bus
that fired the event).public void busOffline(BusLifecycleEvent e)
BusLifecycleListener
BusLifecycleListener.busOnline(BusLifecycleEvent)
event.
If the bus gives up trying to reconnect, you will receive a
BusLifecycleListener.busDisassociating(BusLifecycleEvent)
event.
At the time when this event is delivered, messages intended for the remote bus will be enqueued for delivery when (and if) the bus goes back online.
busOffline
in interface BusLifecycleListener
e
- the object describing the event (includes a reference to the bus
that fired the event).Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.