Package ch.ethz.iks.r_osgi

Examples of ch.ethz.iks.r_osgi.RemoteServiceEvent


      final RemoteServiceReference[] refs = (RemoteServiceReference[]) remoteServices
          .values().toArray(
              new RemoteServiceReference[remoteServices.size()]);
      for (int i = 0; i < refs.length; i++) {
        RemoteOSGiServiceImpl
            .notifyRemoteServiceListeners(new RemoteServiceEvent(
                RemoteServiceEvent.UNREGISTERING, refs[i]));
      }

      // uninstall the proxy bundle
      final Bundle[] proxies = (Bundle[]) proxyBundles.values().toArray(
View Full Code Here


            properties, this);

        remoteServices.put(serviceURI, ref);

        RemoteOSGiServiceImpl
            .notifyRemoteServiceListeners(new RemoteServiceEvent(
                RemoteServiceEvent.REGISTERED, ref));

        return null;
      }
      case LeaseUpdateMessage.SERVICE_MODIFIED: {
        final Dictionary properties = (Dictionary) suMsg.getPayload()[1];
        sanitizeServiceProperties(properties, serviceURI);
        final ServiceRegistration reg = (ServiceRegistration) proxiedServices
            .get(serviceID);
        if (reg != null) {
          reg.setProperties(properties);
        }

        final RemoteServiceReferenceImpl ref = getRemoteReference(serviceURI); //$NON-NLS-1$
        // If r-OSGi receives a SERVICE_MODIFIED for service X before it
        // knows about X (SERVICE_ADDED), there is no point in updating
        // the local service instance. It will fail with an NPE anyway.
        // (see https://bugs.eclipse.org/420433)
        if (ref == null && reg == null) {
          return null;
        }
        ref.setProperties(properties);
        RemoteOSGiServiceImpl
            .notifyRemoteServiceListeners(new RemoteServiceEvent(
                RemoteServiceEvent.MODIFIED, ref));
        return null;
      }
      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));
        }

        final Bundle bundle = (Bundle) proxyBundles.remove(serviceID);
        if (bundle != null) {
View Full Code Here

      refs[i] = new RemoteServiceReferenceImpl(serviceInterfaces[i],
          serviceID, properties, this);

      remoteServices.put(refs[i].getURI().toString(), refs[i]);
      RemoteOSGiServiceImpl
          .notifyRemoteServiceListeners(new RemoteServiceEvent(
              RemoteServiceEvent.REGISTERED, refs[i]));
    }
    updateTopics(lease.getTopics(), new String[0]);
    return refs;
  }
View Full Code Here

TOP

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

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.