Package jade.imtp.leap.JICP

Examples of jade.imtp.leap.JICP.Connection


          throw new ICPException("Upsetting dispatching order");
        }
        waitingForFlush = false;
 
        // Wait for the connection to deliver outgoing commands to be ready
        Connection c = getOutgoingCommandsConnection();
 
        // Send the command to the front-end
        JICPPacket cmd = new JICPPacket(JICPProtocol.COMMAND_TYPE, JICPProtocol.DEFAULT_INFO, payload);
        int sid = nextOutgoingCommandSid;
        nextOutgoingCommandSid = increment(nextOutgoingCommandSid);
        if (myLogger.isLoggable(Logger.FINE)) {
          myLogger.log(Logger.FINE, myID+" - Delivering outgoing command to front-end. SID = " + sid);
        }
        cmd.setSessionID((byte) sid);
        boolean deliverOK = false;
        try {
          c.writePacket(cmd);
          close(c);
          // Wait for the response
          JICPPacket response = getResponse(RESPONSE_TIMEOUT + RESPONSE_TIMEOUT_INCREMENT * (cmd.getLength() / 1024));
          deliverOK = true;
          if (myLogger.isLoggable(Logger.FINE)) {
View Full Code Here


  private synchronized void dispatchKeepAlive() {
    if (status == ACTIVE) {
      if (frontEndStatus == CONNECTED) {
        try {
          // Wait for the connection to deliver outgoing commands to be ready
          Connection c = getOutgoingCommandsConnection();
   
          // Send the command to the front-end
          if (myLogger.isLoggable(Logger.FINER)) {
            myLogger.log(Logger.FINER, myID+" - Delivering keep-alive to front-end");
          }
          JICPPacket cmd = new JICPPacket(JICPProtocol.KEEP_ALIVE_TYPE, JICPProtocol.DEFAULT_INFO, null);
          c.writePacket(cmd);
          close(c);
          // Wait for the response
          JICPPacket response = getResponse(RESPONSE_TIMEOUT + RESPONSE_TIMEOUT_INCREMENT * (cmd.getLength() / 1024));
          if (isKeepAliveResponse(response)) {
            if (myLogger.isLoggable(Logger.FINER)) {
View Full Code Here

              setFrontEndDisconnected();
              throw new ICPException("Response timeout");
            }
          }
        }
        Connection c = outgoingCommandsConnection;
        outgoingCommandsConnection = null;
        return c;
      }
    }
    catch (InterruptedException ie) {
View Full Code Here

TOP

Related Classes of jade.imtp.leap.JICP.Connection

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.