Package org.osgi.util.tracker

Examples of org.osgi.util.tracker.ServiceTracker


    private final Set<SessionTerminal> sessions = new HashSet<SessionTerminal>();

    @SuppressWarnings("serial")
    public SessionTerminalManager(final BundleContext context) {
        this.commandProcessor = new ServiceTracker(context, CommandProcessor.class.getName(), null) {
            @Override
            public void removedService(ServiceReference reference, Object service) {
                cleanupSessions();
                super.removedService(reference, service);
            }
View Full Code Here


     */
    public void start(final BundleContext context) throws Exception {
        this.context = context;

        // track the log service using a ServiceTracker
        this.logTracker = new ServiceTracker(context, LogService.class.getName(), null);
        this.logTracker.open();

        // create the tracker for our backing store
        this.storeTracker = new ServiceTracker(context, BackingStore.class.getName(), null);
        this.storeTracker.open();

        // register this activator as a bundle lister
        context.addBundleListener(this);

View Full Code Here

    /**
     * @see org.apache.felix.prefs.BackingStoreManager#getStore()
     */
    public BackingStore getStore() throws BackingStoreException {
        BackingStore service = null;
        ServiceTracker storeTracker = this.storeTracker;

        // Only possible if we're not stopped already...
        if (storeTracker != null) {
          // has the service changed?
          int currentCount = storeTracker.getTrackingCount();
          service = (BackingStore) storeTracker.getService();
          if (service != null && this.storeTrackingCount < currentCount) {
              this.storeTrackingCount = currentCount;
              this.cleanupStore(service);
          }
          if (service == null) {
View Full Code Here

        thread.start();
    }

    private ServiceTracker processorTracker()
    {
        ServiceTracker t = new ServiceTracker(context, CommandProcessor.class.getName(),
            null)
        {
            @Override
            public Object addingService(ServiceReference reference)
            {
                CommandProcessor processor = (CommandProcessor) super.addingService(reference);
                startShell(context, processor);
                return processor;
            }

            @Override
            public void removedService(ServiceReference reference, Object service)
            {
                if (thread != null)
                {
                    thread.interrupt();
                }
                super.removedService(reference, service);
            }
        };

        t.open();
        return t;
    }
View Full Code Here

    @Before
    public void startup()
    {
        bundleContext.registerService( LogService.class.getName(), this, null );
        _tracker = new ServiceTracker( bundleContext, ConfigurationAdmin.class.getName(), null );
        _tracker.open();
    }
View Full Code Here

    ApamManagers.addDynamicManager(this);
   
      Filter filter;
    try {
      filter = context.createFilter("(" + Constants.OBJECTCLASS + "=*)");
          instancesServiceTracker = new ServiceTracker(context,filter, this);
          instancesServiceTracker.open(true);
    } catch (InvalidSyntaxException ignored) {
    }
   
  }
View Full Code Here

    public void start() {
    ApamManagers.addDynamicManager(this);

        try {
            Filter filter = context.createFilter("(instance.name=*)");
            instancesServiceTracker = new ServiceTracker(context, filter, this);
            instancesServiceTracker.open();


        } catch (InvalidSyntaxException e) {
            e.printStackTrace(System.err);
View Full Code Here

     */
    public void activate( BundleContext bundleContext )
    {
        super.activate( bundleContext );

        bundleInfoTracker = new ServiceTracker( bundleContext, BundleInfoProvider.class.getName(), null);
        bundleInfoTracker.open();

        // bootdelegation property parsing from Apache Felix R4SearchPolicyCore
        String bootDelegation = bundleContext.getProperty( Constants.FRAMEWORK_BOOTDELEGATION );
        bootDelegation = ( bootDelegation == null ) ? "java.*" : bootDelegation + ",java.*";
 
View Full Code Here

    private TestFilter filter2 = new TestFilter("filter2");

    public void start(BundleContext context)
        throws Exception
    {
        this.tracker = new ServiceTracker(context, ExtHttpService.class.getName(), null)
        {
            @Override
            public Object addingService(ServiceReference ref)
            {
                Object service =  super.addingService(ref);
View Full Code Here

            try
            {
                BundleContext bundleContext = (BundleContext) bundleContextAttr;
                Filter filter = createFilter(bundleContext, null);
                this.eventDispatcherTracker = new ServiceTracker(bundleContext, filter, null)
                {
                    public void removedService(ServiceReference reference, Object service)
                    {
                        ProxyListener.this.sessionDispatcher = null;
                        ProxyListener.this.attributeDispatcher = null;
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.