Package org.osgi.util.tracker

Examples of org.osgi.util.tracker.ServiceTracker


                public void sendEvent(Event event) {
                    // nothing to do
                }
            };
            final ServiceTracker voidTracker = mock(ServiceTracker.class);
            when(voidTracker.getService()).thenReturn(mockVoidEA);

            mapEntries = new MapEntries(resFac, mock(BundleContext.class), voidTracker);
            PrivateAccessor.setField(resFac, "mapEntries", mapEntries);

            try {
View Full Code Here


    @Activate
    protected void activate(ComponentContext ctx) throws InterruptedException {
        bundleContext = ctx.getBundleContext();
       
        providersTracker = new ServiceTracker(bundleContext, StartupInfoProvider.class.getName(), null);
        providersTracker.open();
       
        Object prop = ctx.getProperties().get(DEFAULT_MESSAGE_PROP);
        defaultMessage = prop == null ? DEFAULT_MESSAGE : prop.toString();
               
View Full Code Here

                    type,
                    friendlyNameProperty,
                    resourceRoot,
                    additionalResourceProperties);

            serviceTracker = new ServiceTracker(context, type, servicePropertiesResourceProvider);
            serviceTracker.open();
        }
        log.debug("created resource provider {}", resourceProvider);
    }
View Full Code Here

    private final Map<Long, ServiceRegistration> serviceRegistrations = new ConcurrentHashMap<Long, ServiceRegistration>();

    @Activate
    protected void activate(final BundleContext bundleContext) {
        this.bundleContext = bundleContext;
        tracker = new ServiceTracker(bundleContext, MergedResourcePicker.class.getName(), this);
        tracker.open();
    }
View Full Code Here

    public void start(BundleContext context) throws Exception {
        Properties p  = new Properties();
        p.setProperty("alias","/mdc");
        context.registerService(Servlet.class.getName(),this,p);
        configAdminTracker = new ServiceTracker(context, ConfigurationAdmin.class.getName(),null);
        configAdminTracker.open();
    }
View Full Code Here

        }
       
        public void activate(BundleContext ctx) {
            super.activate(ctx);

            repositoryTracker = new ServiceTracker(ctx, SlingRepository.class.getName(), null);
            repositoryTracker.open();

            Dictionary<String, Object> props = new Hashtable<String, Object>();
            props.put(Constants.SERVICE_DESCRIPTION,
                    "Web Console Plugin to display Background servlets and ExecutionEngine status");
View Full Code Here

        //
        // When this bundle is started, a HttpService may not be alive. Thus, we use
        // ServiceTracker to automatically monitor when a HttpService comes alive and
        // then register this our CXF-based JAX-RS service with it.
        //
        _tracker = new ServiceTracker(
            _context,
            HttpService.class.getName(),
            new ServiceTrackerCustomizer() {
                public Object addingService(ServiceReference serviceReference) {
                    try {
View Full Code Here

  public void start(BundleContext context) throws Exception {
    bundle = context.getBundle();
    singleton = this;
    bundleContext = context;

    packageAdminTracker = new ServiceTracker(context,
        PackageAdmin.class.getName(), this);
    packageAdminTracker.open();

    registryTracker = new ServiceTracker(context,
        IExtensionRegistry.class.getName(), this);
    registryTracker.open();
    initializeFileSystem();
    registerDecorators();
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public synchronized IProxyService getProxyService() {
    if (proxyService == null) {
      if (tracker == null) {
        tracker = new ServiceTracker(getBundle().getBundleContext(), IProxyService.class.getName(), null);
        tracker.open();
      }

      proxyService = (IProxyService) tracker.getService();
    }
View Full Code Here

     * @param context The <code>BundleContext</code> of this activator's bundle
     */
    public void start( BundleContext context )
    {
        // register for log service events
        logService = new ServiceTracker( context, NAME_LOG_SERVICE, null );
        logService.open();

        // register the MetaTypeService now, that we are ready
        Dictionary props = new Hashtable();
        props.put( Constants.SERVICE_PID, "org.apache.felix.metatype.MetaTypeService" );
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.