@Override public void onClose(final CloseEvent<Window> event) { if (state != BusState.LOCAL_ONLY) { stop(true); } } });
@Override public void stop(final boolean sendDisconnect) { stop(sendDisconnect, null); }
private void stopBus() { clientMessageBus.stop(false); }
@Override public void onClick(final ClickEvent event) { if (Window .confirm("Are you sure you want to disconnect and de-federate the local bus from the server bus? " + "This will permanently kill your session. You will need to refresh to reconnect. OK will proceed. Click " + "Cancel to abort this operation")) { clientMessageBus.stop(true); } } });
/** * When called, the MessageBus assumes that the currently active transport is no longer capable of operating. The * MessageBus then find the best remaining handler and activates it. */ public void reconsiderTransport() { TransportHandler newHandler = null; for (final TransportHandler handler : availableHandlers.values()) { if (handler.isUsable()) { newHandler = handler; break; } } if (newHandler == null) { logger.error("no available transports! stopping bus!"); stop(false); } else if (newHandler != transportHandler) { logger.info("transitioning to new handler: " + newHandler); transportHandler.stop(false); transportHandler = newHandler; transportHandler.start(); } // 3rd case: we're already using the best available handler. Do nothing. }
@Override public void onClose(final CloseEvent<Window> event) { if (state != BusState.LOCAL_ONLY) { stop(true); } } });
private void stopBus() { clientMessageBus.stop(false); }
@Override public void stop(final boolean sendDisconnect) { stop(sendDisconnect, null); }
@Override public void onClick(final ClickEvent event) { if (Window .confirm("Are you sure you want to disconnect and de-federate the local bus from the server bus? " + "This will permanently kill your session. You will need to refresh to reconnect. OK will proceed. Click " + "Cancel to abort this operation")) { clientMessageBus.stop(true); } } });
/** * When called, the MessageBus assumes that the currently active transport is no longer capable of operating. The * MessageBus then find the best remaining handler and activates it. */ public void reconsiderTransport() { TransportHandler newHandler = null; for (final TransportHandler handler : availableHandlers.values()) { if (handler.isUsable()) { newHandler = handler; break; } } if (newHandler == null) { logger.error("no available transports! stopping bus!"); stop(false); } else if (newHandler != transportHandler) { logger.info("transitioning to new handler: " + newHandler); transportHandler.stop(false); transportHandler = newHandler; transportHandler.start(); } // 3rd case: we're already using the best available handler. Do nothing. }