Package org.osgi.util.tracker

Examples of org.osgi.util.tracker.ServiceTrackerCustomizer


        } catch (InvalidSyntaxException e) {
            e.printStackTrace();
            LOG.warning("Service tracker could not be started. The service will not be automatically unexported.");
            return;
        }
        serviceTracker = new ServiceTracker(bctx, f, new ServiceTrackerCustomizer() {
           
            public void removedService(ServiceReference sr, Object s) {
                LOG.info("Service ["+sid+"] has ben unregistered: Removing service export");
                close();
            }
View Full Code Here


                for (ServiceReference sRef : sRefs) {
                    IDiagramStencilSetFactory service = (IDiagramStencilSetFactory) bundleContext.getService(sRef);
                    _factories.add(service);
                }
            }
            ServiceTrackerCustomizer cust = new ServiceTrackerCustomizer() {

                public void removedService(ServiceReference reference, Object service) {
                }

                public void modifiedService(ServiceReference reference, Object service) {
View Full Code Here

        Dictionary dict = new Hashtable();
        dict.put(EventConstants.EVENT_TOPIC, topics);
        context.registerService(EventHandler.class.getName(), m_listener, dict);

        // keep track of when the real log is available
        ServiceTrackerCustomizer logTrackerCust = new LogTracker(context, logProxy);
        m_logTracker = new ServiceTracker(context, context.createFilter("(&(" + Constants.OBJECTCLASS + "=" + Log.class.getName() + ")(name=" + LOG_NAME + "))"), logTrackerCust);
        m_logTracker.open();
    }
View Full Code Here

            // this will track the availability of the EventAdmin service when we need to dispatch
            tracker = new ServiceTracker(bundleContext, EventAdmin.class.getName(), null);
            tracker.open();
        }
       
        listenerTracker = new ServiceTracker(bundleContext, WebApplicationListener.class.getName(), new ServiceTrackerCustomizer() {
            public Object addingService(ServiceReference reference) {
                WebApplicationListener listener = (WebApplicationListener) bundleContext.getService(reference);
                listeners.add(listener);
                return listener;
            }
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

            // 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

        if (context == null) throw new IllegalArgumentException("Bundle context is null");
        if (executor == null) throw new IllegalArgumentException("Executor service is null");
        if (scheduledExecutor == null) throw new IllegalArgumentException("Scheduled executor service is null");

        this.context = context;
        this.tracker = new ServiceTracker(context, EventHandler.class.getName(), new ServiceTrackerCustomizer()
        {
            public Object addingService(ServiceReference reference)
            {
                return EventAdminImpl.this.addingService(reference);
            }
View Full Code Here

  private volatile Binding m_binding;
  private volatile ServiceTracker tracker;

  public void start(final BundleContext context) throws Exception {
    tracker = new ServiceTracker(context, Command.class.getName(), new ServiceTrackerCustomizer() {
     
      public Object addingService(ServiceReference ref) {
        Command command = (Command) context.getService(ref);
        startTty(context, command);
        return command;
View Full Code Here

  private volatile Binding m_binding;
  private volatile ServiceTracker tracker;

  public void start(final BundleContext context) throws Exception {
    tracker = new ServiceTracker(context, Command.class.getName(), new ServiceTrackerCustomizer() {
     
      public Object addingService(ServiceReference ref) {
        Command command = (Command) context.getService(ref);
        startTelnet(context, command);
        return command;
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

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.