Package jade.mtp

Examples of jade.mtp.MTPException


        throws MTPException {
        try {
            localSlice.routeOut(msg.getEnvelope(), msg.getPayload(), receiver,
                address);
        } catch (IMTPException imtpe) {
            throw new MTPException("Error during message routing", imtpe);
        }
    }
View Full Code Here


                    myHelper = (MessagingSlice) getSlice(myHelperName);
                }

                myHelper.routeOut(env, payload, receiverID, address);
            } catch (ServiceException se) {
                throw new MTPException("No suitable route found for address " +
                    address + ".");
            }
        }
View Full Code Here

                "Agent location lookup not supported by this slice");
        }

        public MTPDescriptor installMTP(String address, String className)
            throws IMTPException, ServiceException, MTPException {
            throw new MTPException(
                "Installing MTPs is not supported by this slice");
        }
View Full Code Here

        }

        public void uninstallMTP(String address)
            throws IMTPException, ServiceException, NotFoundException,
                MTPException {
            throw new MTPException(
                "Uninstalling MTPs is not supported by this slice");
        }
View Full Code Here

        msg.getEnvelope().addProperties(new Property(ACLMessage.TRACE, msg.getTraceID()));
      }
      localSlice.routeOut(msg.getEnvelope(),msg.getPayload(), receiver, address);
    }
    catch(IMTPException imtpe) {
      throw new MTPException("Error during message routing", imtpe);
    }
   
  }
View Full Code Here

       throw new MTPException("The class " + className + " raised InstantiationException (see nested exception)", ie);
       }
       #DOTNET_INCLUDE_END*/
      catch(ClassNotFoundException cnfe)
      {
        throw new MTPException("ERROR: The class " + className + " for the " + address  + " MTP was not found");
      }
      catch(InstantiationException ie) {
        throw new MTPException("The class " + className + " raised InstantiationException (see nested exception)", ie);
      }
      catch(IllegalAccessException iae) {
        throw new MTPException("The class " + className  + " raised IllegalAccessException (see nested exception)", iae);
      }
    }
View Full Code Here

        gCmd.addParam(desc);
        gCmd.addParam(myContainer.getID());
        submit(gCmd);       
      }
      else {
        throw new MTPException("No such address was found on this container: " + address);
      }
    }
View Full Code Here

        myLogger.log(Logger.FINE,"Routing message to "+receiverID.getName()+" towards port "+out);
     
      if(out != null)
        out.route(env, payload, receiverID, address);
      else
        throw new MTPException("No suitable route found for address " + address + ".");
    }
View Full Code Here

      // verifies if the server object really exists (useful if the IOR is
      // valid, i.e corresponds to a good object) (e.g. old IOR)
      // FIXME. To check if this call slows down performance
      if (objRef._non_existent())
        throw new MTPException("Bad IIOP server object reference:" + objRef.toString());

      // Fill in the 'to' field of the IDL envelope
      Iterator itTo = env.getAllTo();
      List to = new ArrayList();
      while(itTo.hasNext()) {
  AID id = (AID)itTo.next();
  to.add(marshalAID(id));
      }

      FIPA.AgentID[] IDLto = new FIPA.AgentID[to.size()];
      for(int i = 0; i < to.size(); i++)
  IDLto[i] = (FIPA.AgentID)to.get(i);


      // Fill in the 'from' field of the IDL envelope
      AID from = env.getFrom();
      FIPA.AgentID[] IDLfrom = new FIPA.AgentID[] { marshalAID(from) };


      // Fill in the 'intended-receiver' field of the IDL envelope
      Iterator itIntendedReceiver = env.getAllIntendedReceiver();
      List intendedReceiver = new ArrayList();
      while(itIntendedReceiver.hasNext()) {
  AID id = (AID)itIntendedReceiver.next();
  intendedReceiver.add(marshalAID(id));
      }

      FIPA.AgentID[] IDLintendedReceiver = new FIPA.AgentID[intendedReceiver.size()];
      for(int i = 0; i < intendedReceiver.size(); i++)
  IDLintendedReceiver[i] = (FIPA.AgentID)intendedReceiver.get(i);


      // Fill in the 'encrypted' field of the IDL envelope
      //Iterator itEncrypted = env.getAllEncrypted();
      //List encrypted = new ArrayList();
      //while(itEncrypted.hasNext()) {
  //String word = (String)itEncrypted.next();
  //encrypted.add(word);
      //}

      String[] IDLencrypted = new String[0];
      //String[] IDLencrypted = new String[encrypted.size()];
      //for(int i = 0; i < encrypted.size(); i++)
  //IDLencrypted[i] = (String)encrypted.get(i);


      // Fill in the other fields of the IDL envelope ...
     
      String IDLcomments = (env.getComments() != null)?env.getComments():"";
      String IDLaclRepresentation = env.getAclRepresentation();
      Long payloadLength = env.getPayloadLength();
      int IDLpayloadLength = payloadLength.intValue();
      String IDLpayloadEncoding = (env.getPayloadEncoding() != null)?env.getPayloadEncoding():"";
      FIPA.DateTime[] IDLdate = new FIPA.DateTime[] { marshalDateTime(env.getDate()) };
      FIPA.Property[][] IDLtransportBehaviour = new FIPA.Property[][] { };

      // Fill in the 'userdefined-properties' field of the IDL envelope
      Iterator itUserDefProps = env.getAllProperties();
      List userDefProps = new ArrayList();
      while(itUserDefProps.hasNext()) {
  Property p = (Property)itUserDefProps.next();
  userDefProps.add(marshalProperty(p));
      }
      FIPA.Property[] IDLuserDefinedProperties = new FIPA.Property[userDefProps.size()];
      for(int i = 0; i < userDefProps.size(); i++)
  IDLuserDefinedProperties[i] = (FIPA.Property)userDefProps.get(i);

      // Fill in the list of 'received' stamps
      /* FIXME: Maybe several IDL Envelopes should be generated, one for every 'received' stamp...
      ReceivedObject[] received = env.getStamps();
      FIPA.ReceivedObject[] IDLreceived = new FIPA.ReceivedObject[received.length];
      for(int i = 0; i < received.length; i++)
  IDLreceived[i] = marshalReceivedObj(received[i]);
      */

      // FIXME: For now, only the current 'received' object is considered...
      ReceivedObject received = env.getReceived();
      FIPA.ReceivedObject[] IDLreceived;
      if(received != null)
  IDLreceived = new FIPA.ReceivedObject[] { marshalReceivedObj(received) };
      else
  IDLreceived = new FIPA.ReceivedObject[] { };

      FIPA.Envelope IDLenv = new FIPA.Envelope(IDLto,
                 IDLfrom,
                 IDLcomments,
                 IDLaclRepresentation,
                 IDLpayloadLength,
                 IDLpayloadEncoding,
                 IDLdate,
                 IDLencrypted,
                 IDLintendedReceiver,
                 IDLreceived,
                 IDLtransportBehaviour,
                 IDLuserDefinedProperties);

      FipaMessage msg = new FipaMessage(new FIPA.Envelope[] { IDLenv }, payload);

      //String tmp = "\n\n"+(new  java.util.Date()).toString()+"   SENT IIOP MESSAGE"+ "\n" + env.toString() + "\n" + new String(payload);
      //System.out.println(tmp);
 
  //MessageTransportProtocol.log(tmp); // write in a log file for sent iiop message
   
  objRef.message(msg);
    }
    catch(ClassCastException cce) {
      cce.printStackTrace();
      throw new MTPException("Address mismatch: this is not a valid IIOP address.");
    }
catch(Exception cce2) {
      cce2.printStackTrace();
      throw new MTPException("Address mismatch: this is not a valid IIOP address.");
    }

  }
View Full Code Here

    try {
      IIOPAddress addr = (IIOPAddress)ta;
      return addr.getIOR();
    }
    catch(ClassCastException cce) {
      throw new MTPException("Address mismatch: this is not a valid IIOP address.");
    }
  }
View Full Code Here

TOP

Related Classes of jade.mtp.MTPException

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.