private void destroySession() { if (smppSession != null) { LOGGER.info("Cleaning up SMPP session... "); smppSession.destroy(); smppSession = null; } }
public void bind() { if ( this.state == ClientState.BOUND || this.state == ClientState.IDLE ) { log.debug("Binding state"); if ( this.session != null && this.session.isBound() ) { this.session.close(); this.session.destroy(); } this.state = ClientState.BINDING; if (elinkTask != null) { this.elinkTask.cancel(true); } runRebindTask(); } }
@Override protected void _stop() throws Exception { if (this.smppSession != null) { if (this.smppSession.isBinding() || this.smppSession.isBound()) this.smppSession.unbind(this.timeout); this.smppSession.destroy(); } if (this.clientBootstrap != null) this.clientBootstrap.destroy(); if (this.monitorExecutor != null) this.monitorExecutor.shutdownNow(); }
public void doStop() { if (this.session0 != null) { this.session0.unbind(5000); this.session0.destroy(); this.session0 = null; } if (this.defaultSmppServer != null) { this.defaultSmppServer.stop(); this.defaultSmppServer.destroy(); this.defaultSmppServer = null; } if (clientBootstrap != null) { try { clientBootstrap.destroy(); executor.shutdownNow(); monitorExecutor.shutdownNow(); } catch (Exception e) { } clientBootstrap = null; executor = null; monitorExecutor = null; } enableStart(true); setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); this.addMessage("Session has been stopped", ""); }
public void sessionDestroyed(SmppSession session) { synchronized (this) { if (logger.isInfoEnabled()) { logger.info(String.format("Session destroyed: %s", session.getConfiguration().getSystemId())); } // print out final stats if (session.hasCounters()) { logger.info(String.format("final session rx-submitSM: %s", session.getCounters().getRxSubmitSM())); } // remove esmeServer out of enquire list String esmeName = session.getConfiguration().getName(); Esme esmeServer = this.esmeManagement.getEsmeByName(esmeName); esmeServer.setServerBound(false); esmeServer.resetEnquireLinkFail(); this.smppServerOpsThread.removeEnquireList(esmeName); DefaultSmppSession defaultSession = (DefaultSmppSession) session; // firing of onPduRequestTimeout() for sent messages for which we do not have responses Window<Integer, PduRequest, PduResponse> wind = defaultSession.getSendWindow(); Map<Integer, WindowFuture<Integer, PduRequest, PduResponse>> futures = wind.createSortedSnapshot(); for (WindowFuture<Integer, PduRequest, PduResponse> future : futures.values()) { this.logger.warn("Firing of onPduRequestTimeout from DefaultSmppServerHandler.sessionDestroyed(): " + future.getRequest().toString()); defaultSession.expired(future); } // make sure it's really shutdown session.destroy(); } }