Package org.osgi.framework

Examples of org.osgi.framework.ServiceRegistration.unregister()


        } catch (ConnectionNotFoundException e)
        {
            // "expected"
        }

        registration.unregister();
    }

}
View Full Code Here


        Felix4350Component.check(1, 0, true);

        disableAndCheck(main)//does not need to be asyncv??
        dep1Reg.unregister();
        dep2Reg.unregister();

        Felix4350Component.check(1, 1, false);
        dep1Reg = register(new SimpleComponent(), 0);
        dep2Reg = register(new SimpleComponent2(), 1000);
        Felix4350Component.check(1, 1, false);
View Full Code Here

        // the field is not null but the service already unregistered
        final ServiceRegistration caReg = configurationAdminRegistration;
        configurationAdminRegistration = null;
        if ( caReg != null )
        {
            caReg.unregister();
        }

        // consider inactive after unregistering such that during
        // unregistration the manager is still alive and can react
        isActive = false;
View Full Code Here

        // shutdown the file persistence manager
        final ServiceRegistration filePmReg = filepmRegistration;
        filepmRegistration = null;
        if ( filePmReg != null )
        {
            filePmReg.unregister();
        }

        // stop listening for events
        bundleContext.removeBundleListener( this );
View Full Code Here

    assertEquals("Check the number of unregistration", 1, all.unregistration);
   
    reg2.setProperties(props);
    assertEquals("Check the number of modification", 2, all.modification);
   
    reg2.unregister();
    assertEquals("Check the number of unregistration", 2, all.unregistration);
   
    registry.removeServiceListener(all);
  }
 
View Full Code Here

    reg2.setProperties(props);
    assertEquals("Check the number of modification", 1, filtered.modification);
    // Follow the OSGi semantics of filters
   
    reg1.unregister();
    reg2.unregister();
    assertEquals("Check the number of unregistration", 2, filtered.unregistration);
    registry.removeServiceListener(filtered);
  }
 
  public void testGetService() {
View Full Code Here

    assertNotNull("Check ref not null", ref);
    assertEquals("Test property", ref.getProperty("foo"), "bar");
    BarService bar = (BarService) registry.getService(im2, ref);
    assertTrue("Test invocation", bar.bar());
   
    reg1.unregister();
    ref = registry.getServiceReference(BarService.class.getName());
    assertNull("Check ref null", ref);
  }
 
  public void testGetFilteredService() {
View Full Code Here

    try {
      ref = registry.getServiceReferences(BarService.class.getName(), "(bar=foo)");
    } catch (InvalidSyntaxException e) { fail("Registry query fail : " + e.getMessage()); }
    assertNull("Check ref null", ref);
   
    reg2.unregister();
  }
 
 

}
View Full Code Here

    assertEquals("Check the number of available factories - 1.1", parentsFactoryReferences.length, Level1FactoryReferences.length);
    assertEquals("Check the number of available factories - 1.2", parentsFactoryReferences.length, Level2FactoryReferences.length);
    assertEquals("Check the number of available factories - 1.3", Level1FactoryReferences.length, Level2FactoryReferences.length);

    reg2.unregister();

    parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
    sc1 = Utils.getServiceContext(empty);
    Level1FactoryReferences = Utils.getServiceReferences(sc1, Factory.class.getName(), null);
    sc2 = Utils.getServiceContext(empty2);
View Full Code Here

            assertNotNull("No completion event received?!", event);
            assertTrue("Completion property set to true?!", Boolean.FALSE.equals(event.getProperty(Constants.EVENTPROPERTY_SUCCESSFUL)));
        }
        finally
        {
            sreg.unregister();
        }
    }

    /**
     * FELIX-4466 - test that an event is fired when an installation of a DP succeeds.
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.