Package jade.mtp

Examples of jade.mtp.TransportAddress


    // Start the Ticker
    ticker = new Ticker(60000);
    ticker.start();

    // Creates the local transport address
    TransportAddress localTA = getProtocol().buildAddress(server.getLocalHost(), String.valueOf(server.getLocalPort()), null, null);

    return localTA;
  }
View Full Code Here


   */
  String getAddress(String pingURL) throws ICPException {
    byte[] respPayload = null;

    try {
      TransportAddress pingAddr = getProtocol().stringToAddr(pingURL);

      respPayload = client.send(pingAddr, JICPProtocol.GET_ADDRESS_TYPE, new byte[0], false);
    }
    catch (ICPException icpe) {
      throw new ICPException("JICP GET_ADDRESS error. Cannot retrieve local hostname: "
View Full Code Here

                setUseSSLAuth(SSLHelper.needAuth());
    if (myLogger.isLoggable(Logger.FINE)) {
      myLogger.log(Logger.FINE,
          "activate() context created ctx="+ctx );
    }
    TransportAddress ta = super.activate(l, peerID, p);
    if (myLogger.isLoggable(Logger.INFO)) {
      myLogger.log(Logger.INFO,
          "JICP Secure Peer activated. (auth="+getUseSSLAuth()+", ta="+ta+")");
    }
    return ta;
View Full Code Here

   * The provided IMTPManager must be able to deal with the protocols (e.g. http) the two transport address
   * refer to.
   */
  public static boolean compareTransportAddresses(String addr1, String addr2, IMTPManager imtpManager) {
    try {
      TransportAddress ta1 = imtpManager.stringToAddr(addr1);
      TransportAddress ta2 = imtpManager.stringToAddr(addr2);
      return compareTransportAddresses(ta1, ta2);
    }
    catch (Exception e) {
      // If we can't parse the addresses, just compare them as strings
      return CaseInsensitiveString.equalsIgnoreCase(addr1, addr2);
View Full Code Here

    platformID = p.getParameter(Profile.PLATFORM_ID, null);
    if (platformID == null || platformID.equals("")) {
      try {
        // Build the PlatformID using the local host and port
        List l = myIMTPManager.getLocalAddresses();
        TransportAddress localAddr = (TransportAddress) l.get(0);
        platformID = localAddr.getHost() + ":" + localAddr.getPort() + "/JADE";
      } catch (Exception e) {
        throw new ProfileException("Can't set PlatformID", e);
      }
    }
  }
View Full Code Here

          }
        };
       
        if(address == null) {
          // Let the MTP choose the address
          TransportAddress ta = proto.activate(dispatcher, myProfile);
          address = proto.addrToStr(ta);
        }
        else {
          // Convert the given string into a TransportAddress object and use it
          TransportAddress ta = proto.strToAddr(address);
          proto.activate(dispatcher, ta, myProfile);
        }
        MTPDescriptor result = new MTPDescriptor(proto.getName(), className, new String[] {address}, proto.getSupportedProtocols());
        routes.addLocalMTP(address, proto, result);
       
View Full Code Here

    private void uninstallMTP(String address) throws IMTPException, ServiceException, NotFoundException, MTPException {
     
      RoutingTable.MTPInfo info = routes.removeLocalMTP(address);
      if(info != null) {
        MTP proto = info.getMTP();
        TransportAddress ta = proto.strToAddr(address);
        proto.deactivate(ta);
        MTPDescriptor desc = info.getDescriptor();
        //MTPDescriptor desc = new MTPDescriptor(proto.getName(), proto.getClass().getName(), new String[] {address}, proto.getSupportedProtocols());
       
        String[] addresses = desc.getAddresses();
View Full Code Here

    // Create the ResourceManager
    myResourceManager = myProfile.getResourceManager();
    myResourceManager.initialize(myProfile);

    // Initialize the Container ID
    TransportAddress addr = (TransportAddress) myIMTPManager.getLocalAddresses().get(0);
    myID = new ContainerID(myProfile.getParameter(Profile.CONTAINER_NAME, PlatformManager.NO_NAME), addr);
    myNodeDescriptor = new NodeDescriptor(myID, myIMTPManager.getLocalNode());
  }
View Full Code Here

  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    }
   
    TransportAddress otherTA = null;
    if (obj instanceof TransportAddressWrapper) {
      TransportAddressWrapper taw = (TransportAddressWrapper) obj;
      otherTA = taw.getAddress();
    }
    else if (obj instanceof TransportAddress) {
View Full Code Here

    myORB.disconnect(server);
  }

  public void deliver(String addr, Envelope env, byte[] payload) throws MTPException {
    try {
      TransportAddress ta = strToAddr(addr);
      IIOPAddress iiopAddr = (IIOPAddress)ta;
      FIPA.MTS objRef = iiopAddr.getObject();

      // verifies if the server object really exists (useful if the IOR is
      // valid, i.e corresponds to a good object) (e.g. old IOR)
View Full Code Here

TOP

Related Classes of jade.mtp.TransportAddress

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.