コード例 #1
0
ファイル: LocatorInfo.java プロジェクト: oceanwavechina/ice
 private void getEndpointsTrace(Reference ref, EndpointI[] endpoints, boolean cached) {
   if (endpoints != null && endpoints.length > 0) {
     if (cached) {
       trace("found endpoints in locator table", ref, endpoints);
     } else {
       trace("retrieved endpoints from locator, adding to locator table", ref, endpoints);
     }
   } else {
     final Instance instance = ref.getInstance();
     StringBuilder s = new StringBuilder(128);
     s.append("no endpoints configured for ");
     if (ref.getAdapterId().length() > 0) {
       s.append("adapter\n");
       s.append("adapter = ");
       s.append(ref.getAdapterId());
       s.append("\n");
     } else {
       s.append("object\n");
       s.append("object = ");
       s.append(instance.identityToString(ref.getIdentity()));
       s.append("\n");
     }
     instance.initializationData().logger.trace(instance.traceLevels().locationCat, s.toString());
   }
 }
コード例 #2
0
ファイル: LocatorInfo.java プロジェクト: oceanwavechina/ice
  private synchronized Request getObjectRequest(Reference ref) {
    if (ref.getInstance().traceLevels().location >= 1) {
      Instance instance = ref.getInstance();
      StringBuilder s = new StringBuilder(128);
      s.append("searching for object by id\n");
      s.append("object = ");
      s.append(instance.identityToString(ref.getIdentity()));
      instance.initializationData().logger.trace(instance.traceLevels().locationCat, s.toString());
    }

    Request request = _objectRequests.get(ref.getIdentity());
    if (request != null) {
      return request;
    }
    request = new ObjectRequest(this, ref);
    _objectRequests.put(ref.getIdentity(), request);
    return request;
  }
コード例 #3
0
ファイル: LocatorInfo.java プロジェクト: oceanwavechina/ice
  private synchronized Request getAdapterRequest(Reference ref) {
    if (ref.getInstance().traceLevels().location >= 1) {
      Instance instance = ref.getInstance();
      StringBuilder s = new StringBuilder(128);
      s.append("searching for adapter by id\n");
      s.append("adapter = ");
      s.append(ref.getAdapterId());
      instance.initializationData().logger.trace(instance.traceLevels().locationCat, s.toString());
    }

    Request request = _adapterRequests.get(ref.getAdapterId());
    if (request != null) {
      return request;
    }
    request = new AdapterRequest(this, ref);
    _adapterRequests.put(ref.getAdapterId(), request);
    return request;
  }
コード例 #4
0
ファイル: LocatorInfo.java プロジェクト: oceanwavechina/ice
  private void getEndpointsException(Reference ref, Exception exc) {
    assert (ref.isIndirect());

    try {
      throw exc;
    } catch (Ice.AdapterNotFoundException ex) {
      final Instance instance = ref.getInstance();
      if (instance.traceLevels().location >= 1) {
        StringBuilder s = new StringBuilder(128);
        s.append("adapter not found\n");
        s.append("adapter = ");
        s.append(ref.getAdapterId());
        instance
            .initializationData()
            .logger
            .trace(instance.traceLevels().locationCat, s.toString());
      }

      Ice.NotRegisteredException e = new Ice.NotRegisteredException();
      e.kindOfObject = "object adapter";
      e.id = ref.getAdapterId();
      throw e;
    } catch (Ice.ObjectNotFoundException ex) {
      final Instance instance = ref.getInstance();
      if (instance.traceLevels().location >= 1) {
        StringBuilder s = new StringBuilder(128);
        s.append("object not found\n");
        s.append("object = ");
        s.append(instance.identityToString(ref.getIdentity()));
        instance
            .initializationData()
            .logger
            .trace(instance.traceLevels().locationCat, s.toString());
      }

      Ice.NotRegisteredException e = new Ice.NotRegisteredException();
      e.kindOfObject = "object";
      e.id = instance.identityToString(ref.getIdentity());
      throw e;
    } catch (Ice.NotRegisteredException ex) {
      throw ex;
    } catch (Ice.LocalException ex) {
      final Instance instance = ref.getInstance();
      if (instance.traceLevels().location >= 1) {
        StringBuilder s = new StringBuilder(128);
        s.append("couldn't contact the locator to retrieve adapter endpoints\n");
        if (ref.getAdapterId().length() > 0) {
          s.append("adapter = ");
          s.append(ref.getAdapterId());
          s.append("\n");
        } else {
          s.append("object = ");
          s.append(instance.identityToString(ref.getIdentity()));
          s.append("\n");
        }
        s.append("reason = " + ex);
        instance
            .initializationData()
            .logger
            .trace(instance.traceLevels().locationCat, s.toString());
      }
      throw ex;
    } catch (Exception ex) {
      assert (false);
    }
  }