Package org.osgi.framework

Examples of org.osgi.framework.ServiceReference


        }
    }

    private void removePluginReference(Object serviceId, Vector pluginsVector) {
        for (int i = 0; i < pluginsVector.size(); ++i) {
            ServiceReference serviceReference = (ServiceReference) pluginsVector
                    .elementAt(i);
            Long currentId = (Long) serviceReference.getProperty(SERVICE_ID);
            if (currentId.equals(serviceId)) {
                pluginsVector.removeElementAt(i);
                return;
            }
        }
View Full Code Here


            boolean allowModification) {
        String pid = (String)dictionary.get(SERVICE_PID);
        ConfigurationDictionary currentDictionary = dictionary;
        Enumeration e = plugins.elements();
        while (e.hasMoreElements()) {
            ServiceReference pluginReference = (ServiceReference) e
                    .nextElement();

            // Only call the plugin if no cm.target is specified or if it
            // matches the pid of the target service
            String cmTarget = (String) pluginReference.getProperty(CM_TARGET);
            if (cmTarget == null || cmTarget.equals(pid)) {
                ConfigurationPlugin plugin = (ConfigurationPlugin) Activator.bc
                        .getService(pluginReference);
                if (plugin == null) {
                    continue;
View Full Code Here

    this.bc = bc;
  }

  public void prepare() {
    try {
      ServiceReference ref = bc.getServiceReference(Control.class.getName());
      bundle = ref.getBundle();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

  Test7(BundleContext bc) {
    this.bc = bc;
  }
 
  public void prepare() {
    ServiceReference ref = bc.getServiceReference(Control.class.getName());
    bundle = ref.getBundle();
  }
View Full Code Here

    this.bc = bc;

    // all of these services are framework singleton internal services
    // thus, we take a shortcut and skip the service tracking

    ServiceReference sr = bc.getServiceReference(PackageAdmin.class
                                                 .getName());
    packageAdmin = null==sr ? null : (PackageAdmin) bc.getService(sr);

    sr = bc.getServiceReference(PermissionAdmin.class.getName());
    permissionAdmin = null==sr ? null : (PermissionAdmin) bc.getService(sr);
View Full Code Here

    final String si = (String) opts.get("interface");
    final String filterArg = (String) opts.get("-f");
    final String filter = null==filterArg
      ? null
      : "(&(objectClass=" +si +")" +filterArg +")";
    final ServiceReference sr = (ServiceReference) AccessController
      .doPrivileged(new PrivilegedAction() {
          public Object run() {
            ServiceReference res = null;
            if (null==filter) {
              res = bc.getServiceReference(si);
              if (null==res) {
                out.println("No service with interface '" + si +"'.");
              }
View Full Code Here

    });
  }

  private void log(int level, String message)
  {
    ServiceReference sRef =
      bc.getServiceReference(LogService.class.getName());
    if (sRef != null) {
      LogService log = (LogService) bc.getService(sRef);
      if (log != null) {
        log.log(level, message);
View Full Code Here

            boolean requireUM = telnetConfig.umRequired();
            String requiredGroup = telnetConfig.getRequiredGroup();
            String forbiddenGroup = telnetConfig.getForbiddenGroup();

            ServiceReference sr = bc
                    .getServiceReference(PasswdAuthenticator.class.getName());
            TelnetLogin telnetLogin = new TelnetLogin(false, null, userName);

            // Only one of the following if cases (1,2 or 3) is executed
View Full Code Here

     *
     * @param se
     *            the service event that has occured.
     */
    public void serviceChanged(ServiceEvent se) {
        ServiceReference sr = se.getServiceReference();
        Bundle bundle = sr.getBundle();
        String msg = null;
        int level = LogService.LOG_INFO;
        switch (se.getType()) {
        case ServiceEvent.REGISTERED:
            msg = "ServiceEvent REGISTERED";
View Full Code Here

    // --
    public void setIPAMContext(String inputPath, String authMethod) {
        int authLevel = Levels.LOWEST;
        int confLevel = Levels.LOWEST;
        int integrLevel = Levels.LOWEST;
        ServiceReference ipamsr = Activator.bc
                .getServiceReference(IPAMValuationService.class.getName());
        if (ipamsr != null) {
            IPAMValuationService ipam = (IPAMValuationService) Activator.bc
                    .getService(ipamsr);
            if (ipam != null) {
View Full Code Here

TOP

Related Classes of org.osgi.framework.ServiceReference

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.