Package org.osgi.framework

Examples of org.osgi.framework.ServiceRegistration


      return;
    }
    Hashtable registrationProperties = objName.getKeyPropertyList();
    registrationProperties.put("domain", objName.getDomain());
    if (registeredServices.containsKey(objName)) {
      ServiceRegistration registration = (ServiceRegistration) registeredServices.get(objName);
      registration.setProperties(registrationProperties);
      return;
    }
   
    Set serviceNames = new HashSet();
    computeOSGiServiceNames(obj.getClass(), obj, serviceNames);
    ServiceRegistration registration = Activator.context.registerService((String[]) serviceNames.toArray(new String[serviceNames.size()]), obj, registrationProperties);
    registeredServices.put(objName, registration);
  }
View Full Code Here


      return;
    ObjectName objName = ObjectName.getInstance(fullName);
    mxserver.unregisterMBean(objName);

    if (registerAsService) {
      ServiceRegistration registration = (ServiceRegistration) registeredServices.remove(objName);
      if (registration != null) {
        registration.unregister();
      }
    }
  }
View Full Code Here

  }

  public void start(BundleContext context)
    throws Exception
  {
    final ServiceRegistration registration
      = context.registerService(FooService.class.getName(), this, null);

    System.out.println("bar: Registered " + registration);
  }
View Full Code Here

  }

  public void start(BundleContext context)
    throws Exception
  {
    final ServiceRegistration registration
      = context.registerService(FooService.class.getName(), this, null);

    System.out.println("bundleSL4: Registered " + registration);
  }
View Full Code Here

        prop.put(JiniDriver.SERVICE_ID, item.serviceID.toString());
        Debug.printDebugInfo(10,
            "Registering Jini Service in OSGi Framework " +
            item.serviceID.toString());

        ServiceRegistration reg = Activator.bc.registerService(toStrings(),
                service, prop);
        services.put(service, reg);
        Debug.printDebugInfo(10,
            "Registering Jini Service in OSGi Framework Completed " +
            item.serviceID.toString());
View Full Code Here

        prop.put(JiniDriver.SERVICE_ID, item.serviceID.toString());
        Debug.printDebugInfo(10,
            "Changing Jini Service properties in OSGi Framework " +
            item.serviceID.toString());

        ServiceRegistration reg = (ServiceRegistration) services.get(service);

        if (reg != null) {
            reg.setProperties(prop);
        } else {
            Debug.printDebugInfo(10, "Service is no longer in OSGi Framework");
        }

        Debug.printDebugInfo(10,
View Full Code Here

        Object service = item.service;
        Debug.printDebugInfo(10,
            "Unregistering Jini Service in OSGi Framework " +
            item.serviceID.toString());

        ServiceRegistration reg = (ServiceRegistration) services.remove(service);

        if (reg != null) {
            reg.unregister();
        } else {
            Debug.printDebugInfo(10,
                "Service Already Unregistered out OSGi Framework");
        }
View Full Code Here

    System.out.println(bc.getBundle().getHeaders().get
                       (Constants.BUNDLE_NAME) + " starting...");
    Activator.bc = bc;

    DateService         service       = new DateServiceImpl();
    ServiceRegistration registration =
      bc.registerService(DateService.class.getName(),
                         service,
                         new Hashtable());
    System.out.println("Service registered: DateService");
  }
View Full Code Here

    desktop = new Desktop();
    desktop.start();

    DefaultSwingBundleDisplayer disp;

    ServiceRegistration reg;

    String[] dispClassNames = new String[] {
      LargeIconsDisplayer.class.getName(),
      GraphDisplayer.class.getName(),
      TableDisplayer.class.getName(),
View Full Code Here

      }

      for(Iterator it = displayers.keySet().iterator(); it.hasNext();) {
        DefaultSwingBundleDisplayer disp
          = (DefaultSwingBundleDisplayer)it.next();
        ServiceRegistration reg = (ServiceRegistration)displayers.get(disp);

        disp.unregister();
      }
      displayers.clear();
View Full Code Here

TOP

Related Classes of org.osgi.framework.ServiceRegistration

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.