Package org.osgi.util.tracker

Examples of org.osgi.util.tracker.ServiceTrackerCustomizer


            Filter filter = Activator.bc.createFilter("(&(" +
                    org.osgi.service.device.Constants.DEVICE_CATEGORY + "=" +
                    JiniDriver.DEVICE_CATEGORY + ")(" + JiniDriver.EXPORT +
                    "=*))");
            ServiceTrackerCustomizer serviceTrackerCustomizer = new JiniExporter();
            serviceTracker = new ServiceTracker(Activator.bc, filter,
                    serviceTrackerCustomizer);
        } catch (Exception ex) {
            serviceTracker = null;
            Debug.printDebugInfo(10,
View Full Code Here


    @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) {
                btx.ungetService(reference);
                unregister(reference, service);
            }
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

        // 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 {
                        HttpService service = (HttpService)_context.getService(serviceReference);
                        Dictionary<String, String> initParams = new Hashtable<String, String>();
                        initParams.put("javax.ws.rs.Application", SampleApplication.class.getName());
View Full Code Here

        trackers.clear();
    }

    private ServiceTracker createBindTracker(final Class<?> c)
    {
        return new ServiceTracker(ctx, c.getName(), new ServiceTrackerCustomizer()
        {
            public Object addingService(ServiceReference reference)
            {
                Object o = ctx.getService(reference);
                Method m = getBindMethod(c);
View Full Code Here

        this.bundleContext = context;
        this.startupMode = manager.getMode();
        this.targetStartLevel = manager.getTargetStartLevel();

        this.listenerTracker = new ServiceTracker(context, StartupListener.class.getName(),
                new ServiceTrackerCustomizer() {

                    public void removedService(final ServiceReference reference, final Object service) {
                        context.ungetService(reference);
                    }
View Full Code Here

        // Init the bundle context
        this.ctx = context;

        // Set up a tracker to add providers as they register themselves
        ServiceTrackerCustomizer customizer = new ProviderTrackerCustomizer(this);
        serviceTracker = new ServiceTracker(ctx, PERSISTENCE_PROVIDER, customizer);
        serviceTracker.open();

        // Set the persistence provider resolver to use OSGi services
        PersistenceProviderResolverHolder.setPersistenceProviderResolver(this);
View Full Code Here

            // Ignore, if the EventAdmin package is not available, just don't use it
            LOGGER.debug("EventAdmin package is not available, just don't use it");
        }
        this.eventAdminListener = listener;

        this.containerListenerTracker = new ServiceTracker(bundleContext, BlueprintListener.class.getName(), new ServiceTrackerCustomizer() {
            public Object addingService(ServiceReference reference) {
                BlueprintListener listener = (BlueprintListener) bundleContext.getService(reference);

                synchronized (listeners) {
                    sendInitialEvents(listener);
View Full Code Here

        this.bundleContext = bundleContext;
        this.classLoader = classLoader;

        serviceManager = ServiceManager.getManager();

        tracker = new ServiceTracker(bundleContext, ServerService.class.getName(), new ServiceTrackerCustomizer() {

            public Object addingService(ServiceReference reference) {
                ServerService service = (ServerService) bundleContext.getService(reference);
                return addServerService(service);
            }
View Full Code Here

            // Ignore, if the EventAdmin package is not available, just don't use it
            LOGGER.debug("EventAdmin package is not available, just don't use it");
        }
        this.eventAdminListener = listener;

        this.containerListenerTracker = new ServiceTracker(bundleContext, BlueprintListener.class.getName(), new ServiceTrackerCustomizer() {
            public Object addingService(ServiceReference reference) {
                BlueprintListener listener = (BlueprintListener) bundleContext.getService(reference);

                synchronized (listeners) {
                    sendInitialEvents(listener);
View Full Code Here

TOP

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

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.