Package jade.mtp

Examples of jade.mtp.TransportAddress


      throw new MTPException("No server on address "+ta);
  }
 
  public void deactivate() throws MTPException {
    for(Enumeration it=addr2srv.keys(); it.hasMoreElements() ; ) {
      TransportAddress ta=(TransportAddress)it.nextElement();
      deactivate(ta);
    }
   
  }
View Full Code Here


 
  private void adjustMainURL() {
    //#MIDP_EXCLUDE_BEGIN
    try {
      String mainURL = theProfile.getParameter(MAIN_URL, null);
      TransportAddress ta = theDispatcher.stringToAddr(mainURL);
      java.net.InetAddress ad = java.net.InetAddress.getByName(ta.getHost());
      TransportProtocol tp = theDispatcher.getProtocol(ta.getProto());
      String hostAddr = ad.getHostAddress();
      if (hostAddr.equals("127.0.0.1")) {
        hostAddr = ad.getHostName();
      }
      ta = tp.buildAddress(hostAddr, ta.getPort(), ta.getFile(), ta.getAnchor());
      // DEBUG
      //System.out.println("MAIN URL set to "+tp.addrToString(ta));
      theProfile.setParameter(MAIN_URL, tp.addrToString(ta));
    }
    catch (Exception e) {
View Full Code Here

 
  synchronized PlatformManager getPlatformManagerProxy(Profile p) throws IMTPException {
    if(thePlatformManager == null) {
     
      PlatformManagerStub stub = new PlatformManagerStub(platformName);
      TransportAddress mainTA = initMainTA(p);
      stub.bind(this);
      stub.addTA(mainTA);
      setPlatformManager(stub);
    }
   
View Full Code Here

   
    // Try to translate the address into a TransportAddress
    // using a protocol supported by this CommandDispatcher
    try {
      PlatformManagerStub stub = new PlatformManagerStub(platformName);
      TransportAddress ta = stringToAddr(addr);
      stub.bind(this);
      stub.addTA(ta);
      return stub;
    }
    catch (DispatcherException de) {
View Full Code Here

   
  }
 
  public void addAddressToStub(Stub target, String toAdd) {
    try {
      TransportAddress ta = stringToAddr(toAdd);
      target.addTA(ta);
    }
    catch(DispatcherException de) {
      de.printStackTrace();
    }
View Full Code Here

    }
  }
 
  public void removeAddressFromStub(Stub target, String toRemove) {
    try {
      TransportAddress ta = stringToAddr(toRemove);
      target.removeTA(ta);
    }
    catch(DispatcherException de) {
      de.printStackTrace();
    }
View Full Code Here

    if (url != null) {
      // The default router must be directly reachable -->
      // Its URL can be converted into a TransportAddress by
      // the ICP registered to this CommandDispatcher
      try {
        TransportAddress ta = stringToAddr(url);
        if (routerTA != null && !routerTA.equals(ta)) {
          if(myLogger.isLoggable(Logger.WARNING))
            myLogger.log(Logger.WARNING,"Transport address of current router has been changed");
        }
        routerTA = ta;
View Full Code Here

    return response;
  }
 
  private boolean isLocal(List destTAs) {
    try {
      TransportAddress ta1 = (TransportAddress) addresses.get(0);
      TransportAddress ta2 = (TransportAddress) destTAs.get(0);
      return (ta1.getHost().equals(ta2.getHost()) && ta1.getPort().equals(ta2.getPort()) && ta2.getFile() == null);
    }
    catch (Exception e) {
      return false;
    }
  }
View Full Code Here

    return response;
  }
 
  private TransportAddress initMainTA(Profile p) throws IMTPException {
   
    TransportAddress mainTA = null;
   
    try {
      String mainURL = p.getParameter(LEAPIMTPManager.MAIN_URL, null);
      // DEBUG
      //System.out.println("Main URL is "+mainURL);
View Full Code Here

   */
  public void addICP(ICP peer, String peerID, Profile p) {
    try {
     
      // Activate the peer.
      TransportAddress  ta = peer.activate(this, peerID, p);
     
      // Add the listening address to the list of local addresses.
      TransportProtocol tp = peer.getProtocol();
      String            url = tp.addrToString(ta);
      if (myLogger.isLoggable(Logger.FINE)) {
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.