Package org.osgi.framework

Examples of org.osgi.framework.ServiceFactory


      addSupportedConfigsAndIntents(remoteServiceDescriptions[i]);

    // Register Remote Service Admin factory, with rsaProps
    remoteServiceAdminRegistration = context.registerService(
        org.osgi.service.remoteserviceadmin.RemoteServiceAdmin.class
            .getName(), new ServiceFactory() {
          public Object getService(Bundle bundle,
              ServiceRegistration registration) {
            RemoteServiceAdmin result = null;
            synchronized (remoteServiceAdmins) {
              RemoteServiceAdmin rsa = remoteServiceAdmins
View Full Code Here


      // be removed. This can be implemented straightforwardly with a
      // Service
      // Factory
      endpointEventListenerReg = getContext().registerService(
          EndpointEventListener.class.getName(),
          new ServiceFactory() {
            public Object getService(Bundle bundle,
                ServiceRegistration registration) {
              return new ProxyEndpointEventListener(bundle);
            }
View Full Code Here

    final Properties props = new Properties();
    props.put(IDiscoveryLocator.CONTAINER_NAME, ZooDiscoveryContainerInstantiator.NAME);
    props.put(IDiscoveryAdvertiser.CONTAINER_NAME, ZooDiscoveryContainerInstantiator.NAME);
    // register ourselves using a service factory
    discoveryRegistration = ctxt.registerService(
        new String[] { IDiscoveryLocator.class.getName(), IDiscoveryAdvertiser.class.getName() }, new ServiceFactory() {
          private volatile ZooDiscoveryContainer zdc;

          public Object getService(Bundle bundle, ServiceRegistration registration) {
            if (zdc == null) {
              zdc = ZooDiscoveryContainer.getSingleton();
View Full Code Here

    // create the platform abstraction layer but do not initialize!!!
    SLPCore.platform = new OSGiPlatformAbstraction(context);

    // register the service factories so each consumer gets its own Locator/Activator instance
    context.registerService("ch.ethz.iks.slp.Advertiser", new ServiceFactory() {
      public Object getService(Bundle bundle, ServiceRegistration registration) {
        SLPCore.init();
        SLPCore.initMulticastSocket();
        return new AdvertiserImpl();
      }
      public void ungetService(Bundle bundle, ServiceRegistration registration, Object service) {
      }
    }, null);
    context.registerService("ch.ethz.iks.slp.Locator", new ServiceFactory() {
      public Object getService(Bundle bundle, ServiceRegistration registration) {
        SLPCore.init();
        return new LocatorImpl();
      }
      public void ungetService(Bundle bundle,  ServiceRegistration registration, Object service) {
View Full Code Here

TOP

Related Classes of org.osgi.framework.ServiceFactory

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.