Package org.osgi.util.tracker

Examples of org.osgi.util.tracker.ServiceTracker


     * Activate this component.
     * @throws InvalidSyntaxException
     */
    @Activate
    protected void activate(final BundleContext btx) throws InvalidSyntaxException {
        this.serviceTracker = new ServiceTracker(btx,
                btx.createFilter("(|(" + Constants.OBJECTCLASS + "=" + Runnable.class.getName() + ")" +
                 "(" + Constants.OBJECTCLASS + "=" + Job.class.getName() + "))"),
                new ServiceTrackerCustomizer() {

            public synchronized void  removedService(final ServiceReference reference, final Object service) {
View Full Code Here


            }
        }

        this.bundleContext.addBundleListener(this);
        final Filter filter = this.bundleContext.createFilter("(&(adaptables=*)(adapters=*)(" + Constants.OBJECTCLASS + "=" + AdapterFactory.SERVICE_NAME + "))");
        this.adapterTracker = new ServiceTracker(this.bundleContext, filter, this);
        this.adapterTracker.open();
    }
View Full Code Here

        authHandlerTracker = new AuthenticationHandlerTracker(bundleContext,
            authHandlerCache);
        engineAuthHandlerTracker = new EngineAuthenticationHandlerTracker(
            bundleContext, authHandlerCache);
        authInfoPostProcessorTracker = new ServiceTracker(bundleContext, AuthenticationInfoPostProcessor.SERVICE_NAME, null);
        authInfoPostProcessorTracker.open();
    }
View Full Code Here

    // Last-modified values for each provider
    private Map<String, Long> lastModified = new HashMap<String, Long>();
   
    protected void activate(ComponentContext ctx) {
        bundleContext = ctx.getBundleContext();
        tracker = new ServiceTracker(bundleContext, TestsProvider.class.getName(), null);
        tracker.open();
    }
View Full Code Here

        return null;
    }
   
    protected void activate(ComponentContext ctx) throws ServletException, NamespaceException {
        bundleContext = ctx.getBundleContext();
        renderersTracker = new ServiceTracker(ctx.getBundleContext(), Renderer.class.getName(), null);
        renderersTracker.open();
    }
View Full Code Here

        pw.println("</table>");

    }

    public void activate(BundleContext context) {
        providerTracker = new ServiceTracker(context,
            ResourceProvider.SERVICE_NAME, null) {
            @Override
            public Object addingService(ServiceReference reference) {
                Object service = super.addingService(reference);
                if (service instanceof BundleResourceProvider) {
View Full Code Here

     * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
     */
    public void start(BundleContext context) {
        this.bundleContext = context;

        this.packageAdminTracker = new ServiceTracker(this.bundleContext, PACKAGE_ADMIN_NAME, null);
        this.packageAdminTracker.open();

        // register service
        this.registerManagerFactory();
        this.bundleContext.addBundleListener(this);
View Full Code Here

     */
    public DynamicClassLoaderManagerImpl(final BundleContext ctx,
            final PackageAdmin pckAdmin,
            final ClassLoader parent,
            final DynamicClassLoaderManagerFactory factory) {
        this.deprecatedProviderTracker = new ServiceTracker(ctx, DynamicClassLoaderProvider.class.getName(),
                new ServiceTrackerCustomizer() {

                    public void removedService(final ServiceReference serviceRef,
                            final Object paramObject) {
                        ctx.ungetService(serviceRef);
View Full Code Here

            filter = bundleContext.createFilter("(jackrabbit.extension=true)");
        } catch (InvalidSyntaxException e) {
            //Should not happen
            throw new RuntimeException("Invalid filter", e);
        }
        this.tracker = new ServiceTracker(bundleContext, filter, this);
    }
View Full Code Here

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

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

        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

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.