Package org.osgi.util.tracker

Examples of org.osgi.util.tracker.ServiceTracker


          zap(); // Create "empty" roles table
        }
        listeners = new Vector();

        eventAdminTracker
          = new ServiceTracker(Activator.bc, EventAdmin.class.getName(), null );
        eventQueue = new EventQueue(Activator.bc);
    }
View Full Code Here


  CommandProvidersService commandProviders;
  Bundle b;

  CommandProcessorImpl(Bundle b) {
    this.b = b;
    tioTracker = new ServiceTracker(Activator.bc,
                                    ThreadIO.class.getName(),
                                    null);
    tioTracker.open();

    commandProviders = new CommandProvidersService();     
View Full Code Here

        }

        reader = new InputStreamReader(new SystemIn(bc));
        writer = new PrintWriter(out);

        consoleTracker = new ServiceTracker(bc, consoleServiceName, this);
        consoleTracker.open();
    }
View Full Code Here

  public void start(BundleContext bc) {
    Activator.bc = bc;

    Activator.startLevelTracker
      = new ServiceTracker(bc, StartLevel.class.getName(), null);
    Activator.startLevelTracker.open();

    Activator.packageAdminTracker
      = new ServiceTracker(bc, PackageAdmin.class.getName(), null);
    Activator.packageAdminTracker.open();

    bc.addFrameworkListener(this);

    deployer = new DirDeployerImpl();
View Full Code Here

  public DirDeployerImpl() {

    // create and register the configuration class
    config = new Config();

    logTracker = new ServiceTracker(Activator.bc,
                                    LogService.class.getName(),
                                    null);
    logTracker.open();
  }
View Full Code Here

    String docurl = getBeanString(suite, "getDocURL", "");
    out.print("  <docurl>");
    out.print("<![CDATA[" + docurl + "]]>");
    out.println("</docurl>");

    ServiceTracker testListenerTracker = null;

    try {
      System.out.println("run test on " + suite);

      final TestResult tr = new TestResult();
      testListenerTracker = new ServiceTracker(Activator.bc,
                                               TestListener.class.getName(),
                                               null) {
          public Object addingService(ServiceReference reference)
          {
            TestListener tl = (TestListener) Activator.bc.getService(reference);
            tr.addListener(tl);
            return tl;
          }
          public void removedService(ServiceReference reference, Object service)
          {
            TestListener tl = (TestListener) service;
            tr.removeListener(tl);
          }
        };
      testListenerTracker.open();

      long start = System.currentTimeMillis();
      suite.run(tr);
      long stop  = System.currentTimeMillis();

      toXMLSuite(suite, tr, stop - start, out, 2);
      toXMLResult(tr, out);
      testListenerTracker.close();
    } finally {
      out.println(" </testcase>");
      if (null!=testListenerTracker){
        testListenerTracker.close();
      }
    }
  }
View Full Code Here

  }

  static StartLevel getStartLevelService()
  {
    if (null!=desktop) {
      final ServiceTracker slTracker = (ServiceTracker) desktop.slTracker;
      if (null!=slTracker) {
        return (StartLevel) slTracker.getService();
      }
    }
    return null;
  }
View Full Code Here

    Activator.bc        = _bc;
    Activator.log       = new LogRef(bc);
    Activator.myself    = this;

    remoteTracker = new ServiceTracker(bc, RemoteFramework.class.getName(), null) {
        public Object addingService(ServiceReference sr) {
          Object obj = super.addingService(sr);
          try desktop.setRemote(true); } catch (Exception e) { }
          return obj;
        }
View Full Code Here

        .createFilter("(&" +
                      "(" + CommandProcessor.COMMAND_SCOPE + "=*)" +
                      "(" + CommandProcessor.COMMAND_FUNCTION + "=*)" +
                      ")");
     
      cpTracker = new ServiceTracker(Activator.bc,
                                     filter,
                                     null);
      cpTracker.open();
    } catch (Exception e) {
      throw new RuntimeException("Failed to init command provider tracker " + e);
    }
    convTracker = new ServiceTracker(Activator.bc,
                                     Converter.class.getName(),
                                     null);
    convTracker.open();
  }
View Full Code Here

  Test6(BundleContext bc) {
    this.bc = bc;
  }
 
  public void prepare() {
    tracker = new ServiceTracker(bc, Control.class.getName(), null);
    tracker.open();
  }
View Full Code Here

TOP

Related Classes of org.osgi.util.tracker.ServiceTracker

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.