Package ch.ethz.iks.r_osgi

Examples of ch.ethz.iks.r_osgi.RemoteServiceReference


          LOGGER.error("failed to establish connection (Service-Descriptor: "
              + desc + ")");
        }
        LOGGER.debug("getting remote service ({})", desc);
        URI suri = this.getAddress(desc, true);
        RemoteServiceReference rref = null;
        int retries = 5;
        while (rref == null) {
          rref = remoteOSGiSvc.getRemoteServiceReference(suri);
          if (rref == null) {
            LOGGER.debug(
                "remote service unavailable ({}, #retries: {})",
                desc, retries--);
            try {
              Thread.sleep(1000);
            } catch (InterruptedException ie) {
              // Ignore
            }
            continue;
          }
        }
        active.add(desc);
        Object obj = remoteOSGiSvc.getRemoteService(rref);
        obj.hashCode();
        refByDesc.put(desc, rref);
      } else {
        stale.remove(desc);
      }
    }
    for (ServiceDescriptor desc : stale) {
      LOGGER.debug("ungetting remote service ({})", desc);
      active.remove(desc);
      RemoteServiceReference rref = refByDesc.remove(desc);
      try {
        remoteOSGiSvc.ungetRemoteService(rref);
      } catch (Exception e) {
        /* Ignore */
      }
 
View Full Code Here


      }
      case LeaseUpdateMessage.SERVICE_REMOVED: {
        if (networkChannel == null) {
          return null;
        }
        final RemoteServiceReference ref = (RemoteServiceReference) remoteServices
            .remove(serviceURI);
        if (ref != null) {
          RemoteOSGiServiceImpl
              .notifyRemoteServiceListeners(new RemoteServiceEvent(
                  RemoteServiceEvent.UNREGISTERING, ref));
View Full Code Here

TOP

Related Classes of ch.ethz.iks.r_osgi.RemoteServiceReference

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.