Package org.osgi.util.tracker

Examples of org.osgi.util.tracker.ServiceTracker


        }
        // invariant: moduleCache is null or modules have changed

        // tracker may be null if moduleCache is null
        if (loginModuleTracker == null) {
            loginModuleTracker = new ServiceTracker(getBundleContext(),
                LoginModulePlugin.class.getName(), null);
            loginModuleTracker.open();
        }

        if (moduleCache == null || lastTrackingCount < loginModuleTracker.getTrackingCount()) {
View Full Code Here


    private final BundleContext context;
    private final ServiceRegistration reg;

    public MultiplexingAuthorizableAction(BundleContext context){
        this.context = context;
        this.tracker = new ServiceTracker(context, createFilter(context),this);
        this.tracker.open();

        Properties p = new Properties();
        p.setProperty("jackrabbit.extension","true");
        reg = context.registerService(AuthorizableAction.class.getName(),this,p);
View Full Code Here

        return null;
    }

    protected void setup(final BundleContext bundleContext) {
        super.setup(bundleContext, this);
        this.namespaceMapperTracker = new ServiceTracker(bundleContext, NamespaceMapper.class.getName(), null);
        this.namespaceMapperTracker.open();
    }
View Full Code Here

        }

    }

    public void setup() throws Exception {
        final ServiceTracker st = new ServiceTracker(bundleContext, SlingRepository.class.getName(), null);
        st.open(true);
        try {
            this.repository = (SlingRepository) st.waitForService(10000);
        } catch (InterruptedException e) {
        }
       
        // Make sure the JcrResourceProvider is initialized, as it
        // setups conversion of JCR to OSGi events, and some tests use this
View Full Code Here

            public void sendEvent(final Event event) {
                addEvent(event);
            }
        };

        final ServiceTracker tracker = mock(ServiceTracker.class);
        when(tracker.getService()).thenReturn(mockEA);

        final BundleContext bundleContext = mock(BundleContext.class);
        when(bundleContext.createFilter(any(String.class))).thenReturn(null);
        when(bundleContext.getServiceReference(any(String.class))).thenReturn(null);
        when(bundleContext.getService(null)).thenReturn(mockEA);
View Full Code Here

                addingService(ref);
            }
            pendingRefs.clear();
        }

        bvpTracker = new ServiceTracker(bundleContext, BindingsValuesProvider.class.getName(), this);
        bvpTracker.open();

        // Map services can also be registered to provide bindings
        mapsTracker = new ServiceTracker(bundleContext, Map.class.getName(), this);
        mapsTracker.open();
    }
View Full Code Here

     *            service property for service selection.
     */
    public RequestLogServiceFacade(BundleContext context, String serviceName) {
        String filter = "(&(" + Constants.OBJECTCLASS + "=" + RequestLog.class.getName() + ")("
            + RequestLog.REQUEST_LOG_NAME + "=" + serviceName + "))";
        this.requestLogTracker = new ServiceTracker(context, filter, null);
        this.requestLogTracker.open();

        // use negative initial tracking count to force acquiry of services
        this.trackingCount = -1;
    }
View Full Code Here

    private final ServiceTracker serviceTracker;

    private final ServletContext servletContext;

  public RequestListenerManager( final BundleContext context, final ServletContext servletContext ) {
    serviceTracker = new ServiceTracker( context, SlingRequestListener.SERVICE_NAME, null );
    serviceTracker.open();
    this.servletContext = servletContext;
  }
View Full Code Here

    public ObservationListenerSupport(final BundleContext bundleContext, final SlingRepository repository)
    throws RepositoryException {
        this.bundleContext = bundleContext;

        this.eventAdminTracker = new ServiceTracker(bundleContext, EventAdmin.class.getName(), null);
        this.eventAdminTracker.open();

        this.session = repository.loginAdministrative(null);
    }
View Full Code Here

    protected void activate(ComponentContext context) {
        this.bundleContext = context.getBundleContext();

        // setup tracker first as this is used in the bind/unbind methods
        this.eventAdminTracker = new ServiceTracker(this.bundleContext, EventAdmin.class.getName(), null);
        this.eventAdminTracker.open();

        this.bundleContext.addBundleListener(this);

        Bundle[] bundles = this.bundleContext.getBundles();
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.