Package org.osgi.framework

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


            }
        }
        finally
        {
            if (paRef != null)
                bc.ungetService(paRef);
            if (cpaRef != null)
                bc.ungetService(cpaRef);
        }
    }
View Full Code Here


        finally
        {
            if (paRef != null)
                bc.ungetService(paRef);
            if (cpaRef != null)
                bc.ungetService(cpaRef);
        }
    }

    private static final void print(PermissionInfo[] infos, PrintWriter pw)
    {
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

            // thrown by wireAdmin.getWires(null) - will not happen, we are not setting filter.
        }
        finally
        {
            if (ref != null)
                bc.ungetService(ref);
        }
    }

    private static final void print(Wire wire, PrintWriter pw)
    {
View Full Code Here

        bundleContext2.getService( reference2 );
        findComponentConfigurationByName(pid, ComponentConfigurationDTO.ACTIVE);
        TestCase.assertNotNull( SimpleComponent.INSTANCE );

        // unget the service once -- must still be active !
        bundleContext2.ungetService( reference2 );
        findComponentConfigurationByName(pid, ComponentConfigurationDTO.ACTIVE);
        TestCase.assertNotNull( SimpleComponent.INSTANCE );

        // unget the service second time -- must be registered and null now
        bundleContext.ungetService( reference1 );
View Full Code Here

                Bundle bundle = ref.getBundle();
                if (bundle != null) {
                    BundleContext ctx = getBundleContextForServiceLookup();
                    if (ctx != null) {
                      try {
                          ctx.ungetService(ref);
                      } catch (IllegalStateException ise) {
                        // we don't care it doesn't exist so, shrug.
                      }
                    }
                }
View Full Code Here

        bundleContext2.getService( reference2 );
        TestCase.assertEquals( Component.STATE_ACTIVE, component.getState() );
        TestCase.assertNotNull( SimpleComponent.INSTANCE );

        // unget the service once -- must still be active !
        bundleContext2.ungetService( reference2 );
        TestCase.assertEquals( Component.STATE_ACTIVE, component.getState() );
        TestCase.assertNotNull( SimpleComponent.INSTANCE );

        // unget the service second time -- must be registered and null now
        bundleContext.ungetService( reference1 );
View Full Code Here

      return isSigned;
    } catch (IOException e) {
      throw (IllegalStateException) new IllegalStateException()
          .initCause(e);
    } finally {
      bundleContext.ungetService(certRef);
    }
  }

  /**
   * @return
 
View Full Code Here

        } catch (InvalidSyntaxException e) {
            LOGGER.error("Syntax error looking up service {} using filter {}", EventHandler.class.getName(), EventHandler.MANAGED_FILTER);
        } finally {
            if (references != null) {
                for (ServiceReference ref : references) {
                    bundleContext.ungetService(ref);
                }
            }
        }
        return result;
    }
View Full Code Here

                    tldScanStream(url, new TldLocation(entry.getName(), entry.getJarUrl().toExternalForm()));
                } else {
                    tldScanStream(url, new TldLocation(entry.getName(), new BundleJarResource(entry.getBundle())));
                }
            }
            bundleContext.ungetService(reference);           
        }
    }
   
    private void tldScanStream(URL url, TldLocation location) throws IOException {
        InputStream in = url.openStream();
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.