Package org.osgi.framework

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


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

    /**
     * FELIX-4466 - test that an event is fired when a DP is uninstalled.
View Full Code Here


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

    /**
     * FELIX-4466 - test that an event is fired when a DP is uninstalled, but fails.
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();
        }
    }
}
View Full Code Here

    AriesApplication app = appContext.getApplication();
    if (app != null) {
      ServiceRegistration reg = serviceRegistrations.remove(app);
      if (reg != null)
        try {
          reg.unregister();
        } catch (IllegalStateException e) {
          // Must be already unregistered - ignore
        }
    }
  }
View Full Code Here

        Iterator iterator = refs.iterator();
        while (iterator.hasNext()) {
            ServiceReference ref = (ServiceReference) iterator.next();
            ServiceRegistration reg = (ServiceRegistration) m_registrations.get(ref);
            try {
                reg.unregister();
            } catch (IllegalStateException e) {
                // The service is already unregistered
                // Do nothing silently
            }
        }
View Full Code Here

     * @see org.apache.felix.ipojo.util.TrackerCustomizer#removedService(org.osgi.framework.ServiceReference, java.lang.Object)
     */
    public void onServiceDeparture(ServiceReference reference) {
        ServiceRegistration reg = (ServiceRegistration) m_registrations.get(reference);
        if (reg != null) {
            reg.unregister();
        }
        m_registrations.remove(reference);
    }

    /**
 
View Full Code Here

            }
        }
        if (proxyRegistration != null) {
            LOG.info("unregistering proxy service for endpoint ID: "
                     + endpointId);
            proxyRegistration.unregister();
        }
    }

    private class DiscoveryCallback implements DiscoveredServiceTracker {
        public void serviceChanged(DiscoveredServiceNotification notification) {
View Full Code Here

        Server server = control.createMock(Server.class);

        String publicationClass = ServicePublication.class.getName();
        ServiceRegistration publicationRegistration =
            control.createMock(ServiceRegistration.class);
        publicationRegistration.unregister();
        EasyMock.expectLastCall().times(serviceNames.length);
        dswContext.addServiceRegistration(publicationClass, publicationRegistration);
        ServiceReference publicationReference =
            control.createMock(ServiceReference.class);
        dswContext.addServiceReference(publicationClass, publicationReference);
View Full Code Here

       
        BundleTestContext dswContext = new BundleTestContext(bundle);
        ServiceRegistration serviceRegistration =
            control.createMock(ServiceRegistration.class);
        dswContext.addServiceRegistration(serviceClass, serviceRegistration);
        serviceRegistration.unregister();
        EasyMock.expectLastCall().times(1);
        ServiceReference serviceReference =
            control.createMock(ServiceReference.class);
        dswContext.addServiceReference(serviceClass, serviceReference);
View Full Code Here

        ServiceRegistration sr = c.createMock(ServiceRegistration.class);

        EasyMock.expect(
                        bc.registerService(EasyMock.eq(ManagedService.class.getName()), EasyMock.eq(a),
                                           (Dictionary)EasyMock.anyObject())).andReturn(sr).once();
        sr.unregister();
        EasyMock.expectLastCall().once();

        c.replay();

        a.start(bc);
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.