Package org.osgi.framework

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


            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

   
    try {
      if(!service.isInstance(svcObj))
        fail(message);
    } finally {
      context.ungetService(refs[0]);
    }
  }

  /**
   * <p>
 
View Full Code Here

        throw new IOException("Framework instance location is undefined"); //$NON-NLS-1$
      URL root = location.getDataArea(ServerConstants.PI_SERVER_CORE);
      // strip off file: prefix from URL
      return new Path(root.toExternalForm().substring(5)).append("tasks"); //$NON-NLS-1$
    } finally {
      context.ungetService(ref);
    }
  }

  private void initializeMetaStore() {
    try {
View Full Code Here

      if (root == null)
        return null;
      // strip off file: prefix from URL
      return new Path(root.toExternalForm().substring(5));
    } finally {
      context.ungetService(ref);
    }
  }

  /**
   * Initialize the admin user on the server.
View Full Code Here

              } catch (InterruptedException ie) {}
       
              ctx.removeFrameworkListener(listener);
            }
          } finally {
            ctx.ungetService(ref);
          }
        }
       
        framework.close();
       
View Full Code Here

        expect(ctx.registerService("org.fusesource.commons.management.ManagementStrategy",
                                   strategy, null)).andReturn(sr);
        ServiceReference ref = createMock(ServiceReference.class);
        MBeanServer mbs = createMock(MBeanServer.class);
        expect(ctx.getService(ref)).andReturn(mbs);
        expect(ctx.ungetService(ref)).andReturn(false);
        replay(ctx, sr, ref, mbs);

        strategy.setEnabled(true);
        assertTrue(strategy.isEnabled());
        strategy.setBundleContext(ctx);
View Full Code Here

                try {
                    if (target instanceof Function) {
                        function = (Function) target;
                    }
                } finally {
                    context.ungetService(reference);
                }
            }
        } catch (Throwable t) {
        }
        return function;
View Full Code Here

                try {
                    if (target instanceof Function) {
                        function = (Function) target;
                    }
                } finally {
                    context.ungetService(reference);
                }
            }
        } catch (Throwable t) {
        }
        return function;
View Full Code Here

        providersTracker = new ServiceTracker(ctx.getBundleContext(), NamespacePrefixProvider.class.getName(),
            new ServiceTrackerCustomizer() {
           
            @Override
            public void removedService(ServiceReference reference, Object service) {
                bc.ungetService(reference);
                __sortedProviderRef = null;
            }
           
            @Override
            public void modifiedService(ServiceReference reference, Object service) {
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.