Package org.jsmpp.session

Examples of org.jsmpp.session.SessionStateListener


    private final ReentrantLock reconnectLock = new ReentrantLock();

    public SmppProducer(SmppEndpoint endpoint, SmppConfiguration config) {
        super(endpoint);
        this.configuration = config;
        this.sessionStateListener = new SessionStateListener() {
            public void onStateChange(SessionState newState, SessionState oldState, Object source) {
                if (newState.equals(SessionState.CLOSED)) {
                    LOG.warn("Lost connection to: " + getEndpoint().getConnectionString() + " - trying to reconnect...");
                    closeSession();
                    reconnect(configuration.getInitialReconnectDelay());
View Full Code Here


     */
    public SmppConsumer(SmppEndpoint endpoint, SmppConfiguration config, Processor processor) {
        super(endpoint, processor);

        this.configuration = config;
        this.sessionStateListener = new SessionStateListener() {
            public void onStateChange(SessionState newState, SessionState oldState, Object source) {
                if (newState.equals(SessionState.CLOSED)) {
                    LOG.warn("Lost connection to: " + getEndpoint().getConnectionString()
                            + " - trying to reconnect...");
                    closeSession();
View Full Code Here

     */
    public SmppConsumer(SmppEndpoint endpoint, SmppConfiguration config, Processor processor) {
        super(endpoint, processor);

        this.configuration = config;
        this.internalSessionStateListener = new SessionStateListener() {
            public void onStateChange(SessionState newState, SessionState oldState, Object source) {
                if (configuration.getSessionStateListener() != null) {
                    configuration.getSessionStateListener().onStateChange(newState, oldState, source);
                }
               
View Full Code Here

    /**
     * Register session state listener to reconnect when session is closed by server.
     */
    private void registerSessionCloseListener() {
      log.debug("Registering session close listener");
      session.addSessionStateListener(new SessionStateListener() {
        @Override
        public void onStateChange(SessionState newState, SessionState oldState, Object source) {
          // when session is closed but client session has not been destroyed can indicates client
          // lose connection to server
          if (newState.equals(SessionState.CLOSED)) {
View Full Code Here

    private SessionStateListener sessionStateListener;

    public SmppProducer(SmppEndpoint endpoint, SmppConfiguration config) {
        super(endpoint);
        this.configuration = config;
        this.sessionStateListener = new SessionStateListener() {
            public void onStateChange(SessionState newState, SessionState oldState, Object source) {
                if (newState.equals(SessionState.CLOSED)) {
                    LOG.warn("Loosing connection to: " + getEndpoint().getConnectionString() + " - trying to reconnect...");
                    closeSession(session);
                    reconnect(configuration.getInitialReconnectDelay());
View Full Code Here

     */
    public SmppConsumer(SmppEndpoint endpoint, SmppConfiguration config, Processor processor) {
        super(endpoint, processor);

        this.configuration = config;
        this.sessionStateListener = new SessionStateListener() {
            public void onStateChange(SessionState newState, SessionState oldState, Object source) {
                if (newState.equals(SessionState.CLOSED)) {
                    LOG.warn("Loost connection to: " + getEndpoint().getConnectionString()
                            + " - trying to reconnect...");
                    closeSession(session);
View Full Code Here

TOP

Related Classes of org.jsmpp.session.SessionStateListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.