Package jade.core

Examples of jade.core.NotFoundException


   
    private byte[] getResourceFromClasspath(String name) throws IOException, NotFoundException {
      // Get resource URL
      URL resourceUrl = getClass().getClassLoader().getResource(name);
      if (resourceUrl == null) {
        throw new NotFoundException("Resource " + name + " not found in class-path");
      }

      // Get input stream and read the bytes
      URLConnection uc = (URLConnection)resourceUrl.openConnection();
      InputStream is = uc.getInputStream();
View Full Code Here


      return resource;
    }

    private byte[] getResourceFromFile(File file) throws IOException, NotFoundException {
      if (!file.exists()) {
        throw new NotFoundException("Resource " + file.getName() + " not found");
      }
     
      return getResourceFromStream(new FileInputStream(file));
    }
View Full Code Here

            AID receiverID) throws IMTPException, NotFoundException {
            boolean found = myContainer.postMessageToLocalAgent(msg.getACLMessage(),
                    receiverID);

            if (!found) {
                throw new NotFoundException(
                    "Messaging service slice failed to find " + receiverID);
            }
        }
View Full Code Here

            }
        }

        public ContainerID getAgentLocation(AID agentID)
            throws IMTPException, NotFoundException {
            throw new NotFoundException(
                "Agent location lookup not supported by this slice");
        }
View Full Code Here

   
    private void moveAgent(AID agentID, Location where) throws IMTPException, NotFoundException {
      Agent a = myContainer.acquireLocalAgent(agentID);
     
      if(a == null) {
        throw new NotFoundException("Move-Agent failed to find " + agentID);
      }
      a.doMove(where);
     
      myContainer.releaseLocalAgent(agentID);
    }
View Full Code Here

   
    private void copyAgent(AID agentID, Location where, String newName) throws IMTPException, NotFoundException {
      Agent a = myContainer.acquireLocalAgent(agentID);
     
      if(a == null)
        throw new NotFoundException("Clone-Agent failed to find " + agentID);
      a.doClone(where, newName);
     
      myContainer.releaseLocalAgent(agentID);
    }
View Full Code Here

     
      try {
        Agent agent = myContainer.acquireLocalAgent(agentID);
       
        if ((agent == null) || (agent.getState() != AP_TRANSIT)) {
          throw new NotFoundException("handleTransferResult() unable to find a suitable agent.");
        }
       
        if (result == TRANSFER_ABORT) {
          myContainer.removeLocalAgent(agentID);
        }
View Full Code Here

          finally {
            impl.releaseAgentDescriptor(agentID);
          }
        }
        else {
          throw new NotFoundException("Agent agentID not found");
        }
      }
      else {
        // Do nothing for now, but could also use another slice as transaction coordinator...
        //log("Not a main!", 2);
View Full Code Here

        // Sender indicated in the message different than the real sender --> store the latter in the REAL_SENDER user defined param
        msg.addUserDefinedParameter(ACLMessage.REAL_SENDER, senderID.getName());
      }
      boolean found = myContainer.postMessageToLocalAgent(msg, receiverID);
      if(!found) {
        throw new NotFoundException("Messaging service slice failed to find " + receiverID);
      }
    }
View Full Code Here

      agentID = resolveGlobalAlias(agentID);
      return impl.getContainerID(agentID);
    }
    else {
      // Should never happen
      throw new NotFoundException("getAgentLocation() invoked on a non-main container");
    }
  }
View Full Code Here

TOP

Related Classes of jade.core.NotFoundException

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.