void clearSessionData() { clearPendingRequests(new ApplicationError(ApplicationError.TRANSPORT_CLOSED)); clearAllSubscriptions(null); clearAllRegisteredProcedures(null); }
@Override public void initClose() { closeSession(null, ApplicationError.SYSTEM_SHUTDOWN, false); }
/** * Is called if the underlying connection was closed from the remote side. * Won't be called if the user issues the close, since the client will then move * to the {@link WaitingForDisconnectState} directly. * @param closeReason An optional reason why the connection closed. */ void onConnectionClosed(Throwable closeReason) { if (currentState instanceof SessionEstablishedState) ((SessionEstablishedState)currentState).onConnectionClosed(closeReason); else if (currentState instanceof HandshakingState) ((HandshakingState)currentState).onConnectionClosed(closeReason); }
@Override public void run() { if (stateController.currentState() != session) return; session.connectionController().sendMessage(msg, IWampConnectionPromise.Empty); } });
/** * Is called when the underlying connection received a message from the remote side. * @param message The received message */ void onMessage(WampMessage message) { if (currentState instanceof SessionEstablishedState) ((SessionEstablishedState)currentState).onMessage(message); else if (currentState instanceof HandshakingState) ((HandshakingState)currentState).onMessage(message); }
void closeSession(Throwable disconnectReason, String optCloseMessageReason, boolean reconnectAllowed) { // Send goodbye message with close reason to the remote if (optCloseMessageReason != null) { GoodbyeMessage msg = new GoodbyeMessage(null, optCloseMessageReason); connectionController.sendMessage(msg, IWampConnectionPromise.Empty); } stateController.setExternalState(new WampClient.DisconnectedState(disconnectReason)); int nrReconnectAttempts = reconnectAllowed ? stateController.clientConfig().totalNrReconnects : 0; if (nrReconnectAttempts != 0) { stateController.setExternalState(new WampClient.ConnectingState()); } clearSessionData(); WaitingForDisconnectState newState = new WaitingForDisconnectState(stateController, nrReconnectAttempts); connectionController.close(true, newState.closePromise()); stateController.setState(newState); }
SessionEstablishedState newState = new SessionEstablishedState( stateController, connectionController, sessionId, welcomeDetails, routerRoles); stateController.setState(newState);
attachPubSubCancellationAction(subscriber, entry, topic);
@Override public void run() { if (stateController.currentState() != session) return; session.connectionController().sendMessage(msg, IWampConnectionPromise.Empty); } });
/** * Is called when the underlying connection received a message from the remote side. * @param message The received message */ void onMessage(WampMessage message) { if (currentState instanceof SessionEstablishedState) ((SessionEstablishedState)currentState).onMessage(message); else if (currentState instanceof HandshakingState) ((HandshakingState)currentState).onMessage(message); }
void closeSession(Throwable disconnectReason, String optCloseMessageReason, boolean reconnectAllowed) { // Send goodbye message with close reason to the remote if (optCloseMessageReason != null) { GoodbyeMessage msg = new GoodbyeMessage(null, optCloseMessageReason); connectionController.sendMessage(msg, IWampConnectionPromise.Empty); } stateController.setExternalState(new WampClient.DisconnectedState(disconnectReason)); int nrReconnectAttempts = reconnectAllowed ? stateController.clientConfig().totalNrReconnects : 0; if (nrReconnectAttempts != 0) { stateController.setExternalState(new WampClient.ConnectingState()); } clearSessionData(); WaitingForDisconnectState newState = new WaitingForDisconnectState(stateController, nrReconnectAttempts); connectionController.close(true, newState.closePromise()); stateController.setState(newState); }
SessionEstablishedState newState = new SessionEstablishedState( stateController, connectionController, sessionId, welcomeDetails, routerRoles); stateController.setState(newState);
attachPubSubCancellationAction(subscriber, entry, topic);
void clearSessionData() { clearPendingRequests(new ApplicationError(ApplicationError.TRANSPORT_CLOSED)); clearAllSubscriptions(null); clearAllRegisteredProcedures(null); }
@Override public void initClose() { closeSession(null, ApplicationError.SYSTEM_SHUTDOWN, false); }
@Override public void run() { if (stateController.currentState() != session) return; session.connectionController().sendMessage(msg, IWampConnectionPromise.Empty); } });
/** * Is called if the underlying connection was closed from the remote side. * Won't be called if the user issues the close, since the client will then move * to the {@link WaitingForDisconnectState} directly. * @param closeReason An optional reason why the connection closed. */ void onConnectionClosed(Throwable closeReason) { if (currentState instanceof SessionEstablishedState) ((SessionEstablishedState)currentState).onConnectionClosed(closeReason); else if (currentState instanceof HandshakingState) ((HandshakingState)currentState).onConnectionClosed(closeReason); }
/** * Is called when the underlying connection received a message from the remote side. * @param message The received message */ void onMessage(WampMessage message) { if (currentState instanceof SessionEstablishedState) ((SessionEstablishedState)currentState).onMessage(message); else if (currentState instanceof HandshakingState) ((HandshakingState)currentState).onMessage(message); }
void closeSession(Throwable disconnectReason, String optCloseMessageReason, boolean reconnectAllowed) { // Send goodbye message with close reason to the remote if (optCloseMessageReason != null) { GoodbyeMessage msg = new GoodbyeMessage(null, optCloseMessageReason); connectionController.sendMessage(msg, IWampConnectionPromise.Empty); } stateController.setExternalState(new WampClient.DisconnectedState(disconnectReason)); int nrReconnectAttempts = reconnectAllowed ? stateController.clientConfig().totalNrReconnects() : 0; if (nrReconnectAttempts != 0) { stateController.setExternalState(new WampClient.ConnectingState()); } clearSessionData(); WaitingForDisconnectState newState = new WaitingForDisconnectState(stateController, nrReconnectAttempts); connectionController.close(true, newState.closePromise()); stateController.setState(newState); }
SessionEstablishedState newState = new SessionEstablishedState( stateController, connectionController, sessionId, welcomeDetails, routerRoles); stateController.setState(newState);