Package org.osgi.framework

Examples of org.osgi.framework.BundleContext.ungetService()


        try {
          getJobManager().join(signerJob, monitor);
        } catch (OperationCanceledException e) {
        } catch (InterruptedException e) {
        }
        bundleContext.ungetService(certRef);
        return Status.OK_STATUS;
      }
    };
    cleanup.setSystem(true);
    cleanup.schedule();
View Full Code Here


                    }
                    finally
                    {
                        try
                        {
                            bundleContext.ungetService( caRef );
                        }
                        catch ( IllegalStateException e )
                        {
                            // ignore, bundle context was shut down during the above.
                        }
View Full Code Here

        if(bc != null){
            trackedServiceCount--;
            if(trackedServiceCount == 0 && engineRegistration != null){
               engineRegistration.unregister();
            }
            bc.ungetService(reference);
        }
    }
}
View Full Code Here

        // keep the service for later ungetting
        if ( !refPair.setServiceObject( serviceObject ) )
        {
            //another thread got the service first
            bundleContext.ungetService( refPair.getRef() );
        }

        // return the acquired service (may be null of course)
        //even if we did not set the service object, all the getService are for the same bundle so will have the same object.
        return serviceObject;
View Full Code Here

            if ( service != null )
            {
                BundleContext bundleContext = m_componentManager.getBundleContext();
                if ( bundleContext != null )
                {
                    bundleContext.ungetService( ref.getRef() );
                }
            }
        }

        protected void tracked( int trackingCount )
View Full Code Here

        if(bc != null){
            trackedServiceCount--;
            if(trackedServiceCount == 0 && engineRegistration != null){
               engineRegistration.unregister();
            }
            bc.ungetService(reference);
        }
    }
}
View Full Code Here

        } catch (Exception e) {
            logger.warn("Unable to add temporary directory " + tempDirectory + "to the Tomcat deployment watcher, that folder will not be delete on the undeployment", e);
        } finally {
            if (tomcatDeploymentWatcherReference != null) {
                try {
                    bundleContext.ungetService(tomcatDeploymentWatcherReference);
                } catch (Exception e) {
                }
            }
        }
    }
View Full Code Here

            this.application = new GeronimoApplication(bundle, applicationFactory, deploymentFactory);
           
            install(deploymentFactory);
        } finally {
            if (deploymentFactory != null) {
                bundleContext.ungetService(deploymentFactoryReference);
            }
            if (applicationFactory != null) {
                bundleContext.ungetService(applicationFactoryReference);
            }
        }
View Full Code Here

        } finally {
            if (deploymentFactory != null) {
                bundleContext.ungetService(deploymentFactoryReference);
            }
            if (applicationFactory != null) {
                bundleContext.ungetService(applicationFactoryReference);
            }
        }
                       
        ServiceReference applicationManagerReference =
            bundleContext.getServiceReference(AriesApplicationContextManager.class.getName());
View Full Code Here

        GeronimoApplicationContextManager applicationManager =
            getService(applicationManagerReference, GeronimoApplicationContextManager.class);
        try {
            applicationManager.registerApplicationContext(new GeronimoApplicationContext(this));
        } finally {
            bundleContext.ungetService(applicationManagerReference);
        }
    }

    public long[] getApplicationContentBundleIds() {
        long[] ids = new long[applicationBundles.size()];
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.