Package jade.core

Examples of jade.core.UnreachableException


                    myHelper = (MessagingSlice) getSlice(myHelperName);
                }

                deliverUntilOK(msg, receiverID);
            } catch (IMTPException imtpe) {
                throw new UnreachableException("Unreachable network node", imtpe);
            } catch (ServiceException se) {
                throw new UnreachableException("Unreachable service slice:", se);
            }
        }
View Full Code Here


   */
  private byte[] dispatchDirectly(List destTAs, byte[] commandPayload, boolean requireFreshConnection) throws UnreachableException {
   
    // Loop on destinaltion addresses (No need to check again
    // that the list of addresses is not-null and not-empty)
    UnreachableException lastException = null;
    for (int i = 0; i < destTAs.size(); i++) {
      try {
        return send((TransportAddress) destTAs.get(i), commandPayload, requireFreshConnection);
      }
      catch (UnreachableException ue) {
View Full Code Here

      }
      else    // UnreachableException (the Command was sent to the router,
        // but the final destination was unreachable from there)
        // --> throw an UnreachableException
        if (exception.equals("jade.core.UnreachableException")) {
          throw new UnreachableException((String) response.getParamAt(1));
        }
    }
  }
View Full Code Here

   
    // Get the ICPs suitable for the given TransportAddress.
    List list = (List) icps.get(ta.getProto().toLowerCase());
   
    if (list == null) {
      throw new UnreachableException("no ICP suitable for protocol "+ta.getProto()+".");
     
    }
   
    ICPException lastException = null;
    for (int i = 0; i < list.size(); i++) {
      try {
        return ((ICP) list.get(i)).deliverCommand(ta, commandPayload, requireFreshConnection);
      }
      catch (ICPException icpe) {
        lastException = icpe;
        // DEBUG
        // Print a warning and try next address
        //System.out.println("Warning: can't deliver command to "+ta+". "+icpe.getMessage());
      }
    }
   
    throw new UnreachableException("ICPException delivering command to address "+ta+".", lastException);
  }
View Full Code Here

        List   destTAs = (List) command.getParamAt(1);
        String origin = (String) command.getParamAt(2);
       
        if (origin.equals(name)) {
          // The forwarding mechanism is looping.
          response = buildExceptionResponse(new UnreachableException("destination unreachable (and forward loop)."));
        }
        else {
          try {
            response = dispatchSerializedCommand(destTAs, originalPayload, false, origin);
          }
View Full Code Here

        else if(name.equals(AgentManagementSlice.KILL_CONTAINER)) {
          handleKillContainer(cmd);
        }
      }
      catch(IMTPException imtpe) {
        cmd.setReturnValue(new UnreachableException("Remote container is unreachable", imtpe));
      }
      catch(NotFoundException nfe) {
        cmd.setReturnValue(nfe);
      }
      catch(NameClashException nce) {
        cmd.setReturnValue(nce);
      }
      catch(JADESecurityException ae) {
        cmd.setReturnValue(ae);
      }
      catch(ServiceException se) {
        cmd.setReturnValue(new UnreachableException("A Service Exception occurred", se));
      }

    }
View Full Code Here

TOP

Related Classes of jade.core.UnreachableException

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.