Package org.xmlBlaster.client

Examples of org.xmlBlaster.client.I_ConnectionStateListener


    queueProps.setMaxBytes(200000L);
    this.updateQueue.initialize(storageId, queueProps);
    this.blockingQueueWrapper = new BlockingQueueWrapper(500L);
    this.blockingQueueWrapper.init(this.updateQueue);
    log.info(id + " Created new sessionId=" + this.sessionId);
    this.xmlBlasterAccess.registerConnectionListener(new I_ConnectionStateListener() {
      public void reachedAlive(ConnectionStateEnum oldState, I_XmlBlasterAccess connection) {
        org.xmlBlaster.client.qos.ConnectReturnQos qos = connection.getConnectReturnQos();
        if (qos != null) {
          log
              .info("I_ConnectionStateListener.reachedAlive(): We were lucky, connected to "
View Full Code Here


         //cbAddress.setType("SOCKET");    // force SOCKET protocol for callback

         connectQos.addCallbackAddress(cbAddress);

         // We want to be notified about connection states:
         con.registerConnectionListener(new I_ConnectionStateListener() {

               public void reachedAlive(ConnectionStateEnum oldState, I_XmlBlasterAccess connection) {
                  conRetQos = connection.getConnectReturnQos();
                  log.info("I_ConnectionStateListener: We were lucky, connected to " + glob.getId() + " as " + conRetQos.getSessionName());
                  // we can access the queue via connectionHandler and for example erase the entries ...
View Full Code Here

            }
         });


         // Listen on status changes of our connection to xmlBlaster
         con.registerConnectionListener(new I_ConnectionStateListener() {
              
               public void reachedAlive(ConnectionStateEnum oldState, I_XmlBlasterAccess connection) {
                  log.info("I_ConnectionStateListener.reachedAlive(): We were lucky, connected to " +
                           connection.getConnectReturnQos().getSessionName());
                  if (connection.getQueue().getNumOfEntries() > 0) {
View Full Code Here

         log.info("   http://www.xmlBlaster.org/xmlBlaster/doc/requirements/interface.publish.html");

         I_XmlBlasterAccess con = glob.getXmlBlasterAccess();

         // Handle lost server explicitly
         con.registerConnectionListener(new I_ConnectionStateListener() {

               public void reachedAlive(ConnectionStateEnum oldState,
                                        I_XmlBlasterAccess connection) {
                  /*
                  ConnectReturnQos conRetQos = connection.getConnectReturnQos();
View Full Code Here

         log.info("Connected to xmlBlaster node '" + getId() + "', sending " + connection.getQueue().getNumOfEntries() + " tailback messages ...");
      }
      else {
         log.info("Connected to " + getId() + ", no backup messages to flush");
      }
      I_ConnectionStateListener connectionListener = this.connectionStateListener;
      if (connectionListener != null)
         connectionListener.reachedAlive(oldState, connection);
   }
View Full Code Here

    * This method is enforced through interface I_ConnectionStateListener
    */
   public void reachedPolling(ConnectionStateEnum oldState, I_XmlBlasterAccess connection) {
      this.available = false;
      log.warning("I_ConnectionStateListener: No connection to xmlBlaster node '" + getId() + "', we are polling ...");
      I_ConnectionStateListener connectionListener = this.connectionStateListener;
      if (connectionListener != null)
         connectionListener.reachedPolling(oldState, connection);
   }
View Full Code Here

    * This method is enforced through interface I_ConnectionStateListener
    */
   public void reachedDead(ConnectionStateEnum oldState, I_XmlBlasterAccess connection) {
      this.available = false;
      log.severe("I_ConnectionStateListener: No connection to xmlBlaster node '" + getId() + "', state=DEAD, giving up.");
      I_ConnectionStateListener connectionListener = this.connectionStateListener;
      if (connectionListener != null)
         connectionListener.reachedDead(oldState, connection);
   }
View Full Code Here

      CallbackAddress cbAddress = new CallbackAddress(this.glob);
      cbAddress.setDispatchPlugin("undef")// To avoid recursive loading of this PRIO plugin
      cbAddress.setSecretSessionId(this.cbSessionId); // to protect our callback server - see method update()
      this.connectQos.addCallbackAddress(cbAddress);

      this.xmlBlasterCon.registerConnectionListener(new I_ConnectionStateListener() {
           
            public void reachedAlive(ConnectionStateEnum oldState, I_XmlBlasterAccess connection) {
               connected = true;
               conRetQos = connection.getConnectReturnQos();
               log.info("I_ConnectionStateListener: We were lucky, connected to " +
View Full Code Here

            if (ret == 'q')
               break;

            I_XmlBlasterAccess con = new XmlBlasterAccess(glob.getClone(null));

            con.registerConnectionListener(new I_ConnectionStateListener() {

               public void reachedAlive(ConnectionStateEnum oldState,
                     I_XmlBlasterAccess connection) {
                  log.info("I_ConnectionStateListener: Connected");
               }
View Full Code Here

         log.info("   http://www.xmlBlaster.org/xmlBlaster/doc/requirements/interface.subscribe.html");

         con = glob.getXmlBlasterAccess();

         // Do fail safe handling:
         con.registerConnectionListener(new I_ConnectionStateListener() {
            public void reachedAlive(ConnectionStateEnum oldState, I_XmlBlasterAccess connection) {
               if (connection.getConnectReturnQos().isReconnected())
                  log.info("I_ConnectionStateListener.reachedAlive(): Same server instance found");
               else
                  log.info("I_ConnectionStateListener.reachedAlive(): New server instance found, connected to " +
View Full Code Here

TOP

Related Classes of org.xmlBlaster.client.I_ConnectionStateListener

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.