Package org.osgi.framework

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


        if (serviceReference != null) {
            DependencyManager dependencyManager = (DependencyManager) bundleContext.getService(serviceReference);
            try {
                dependentBundles.addAll(dependencyManager.getFullDependentBundles(bundleId));
            } finally {
                bundleContext.ungetService(serviceReference);
            }
        }
       
        // add in wired bundles if WAB       
        Bundle bundle = bundleContext.getBundle(bundleId);
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

        } finally {
            if (refreshListener != null) {
                context.removeFrameworkListener(refreshListener);
            }
            if (reference != null) {
                context.ungetService(reference);
            }
        }
    }
   
    private class RefreshListener implements FrameworkListener {
View Full Code Here

            applicationBundles.clear();

            throw be;
        } finally {
            if (resolver != null) {
                bundleContext.ungetService(resolverRef);
            }
            if (packageAdmin != null) {
                bundleContext.ungetService(packageAdminRef);
            }
        }
View Full Code Here

        } finally {
            if (resolver != null) {
                bundleContext.ungetService(resolverRef);
            }
            if (packageAdmin != null) {
                bundleContext.ungetService(packageAdminRef);
            }
        }

        applicationState = ApplicationState.INSTALLED;
    }
View Full Code Here

            TldRegistry tldRegistry = (TldRegistry) bundleContext.getService(reference);
            for (TldProvider.TldEntry entry : tldRegistry.getDependentTlds(bundle)) {
                URL url = entry.getURL();
                tldLocationBundleMap.put(url.toString(), entry.getBundle());
            }
            bundleContext.ungetService(reference);
        }
        return tldLocationBundleMap;
    }

    private LinkedHashSet<Class<?>> getListenerClasses(WebApp webApp, WebModule webModule, Map<String, Bundle> tldLocationBundleMap, Set<String> listenerNames) throws DeploymentException {
View Full Code Here

            }
            return Collections.<Class<?>>emptyList();
        } finally {
            if (serviceReference != null) {
                try {
                    bundleContext.ungetService(serviceReference);
                } catch (Exception e) {
                }
            }
        }
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

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.