Package org.osgi.framework

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


    public void disableQueueProcessing(@Nonnull String agentName) {
        synchronized (jobConsumers) {
            log.info("unregistering job consumer for agent {}", agentName);
            ServiceRegistration jobReg = jobConsumers.remove(agentName);
            if (jobReg != null) {
                jobReg.unregister();
                log.info("job consumer for agent {} unregistered", agentName);
            }
        }
    }
View Full Code Here


    }

    public void unregister(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException {
        ServiceRegistration serviceRegistration = registrations.get(requestHandler.toString());
        if (serviceRegistration != null) {
            serviceRegistration.unregister();
        }
    }

    private class TriggerAgentEventListener implements EventHandler {
View Full Code Here

    }

    public void unregister(@Nonnull ReplicationRequestHandler requestHandler) throws ReplicationTriggerException {
        ServiceRegistration serviceRegistration = registrations.get(requestHandler.toString());
        if (serviceRegistration != null) {
            serviceRegistration.unregister();
        }
    }

    public void enable() {
    }
View Full Code Here

    public void removedService(final ServiceReference reference, final Object service) {
        final Long key = (Long) reference.getProperty(Constants.SERVICE_ID);
        final ServiceRegistration reg = serviceRegistrations.get(key);
        if ( reg != null ) {
            reg.unregister();
            this.bundleContext.ungetService(reference);
        }
    }

}
View Full Code Here

        // Should be opened automatically when picked up by the Jetty implementation...
        assertTrue("Felix HTTP Jetty did not open the Connection or pick up the registered ConnectionFactory", openLatch.await(5, TimeUnit.SECONDS));

        // Should close our connection...
        reg.unregister();

        assertTrue("Felix HTTP Jetty did not close the Connection", closeLatch.await(5, TimeUnit.SECONDS));
    }
}
View Full Code Here

        // factoryPids must be empty
        assertTrue( mti.getFactoryPids() == null || mti.getFactoryPids().length == 0 );

        // unregister the service
        sr.unregister();

        // ensure everything is clear now again
        checkEmpty( mti );
    }
View Full Code Here

        assertNotNull( mti.getFactoryPids() );
        assertTrue( mti.getFactoryPids().length == 1 );
        assertEquals( factoryPid2, mti.getFactoryPids()[0] );

        // unregister the service
        sr.unregister();

        // ensure everything is clear now again
        checkEmpty( mti );
    }
View Full Code Here

            this.plugin = null;
            // unregister configuration printer too
            ServiceRegistration reg = printerRegistration;
            if (reg != null)
            {
                reg.unregister();
                printerRegistration = null;
            }
            // unregister info provider too
            reg = infoRegistration;
            if (reg != null)
View Full Code Here

            }
            // unregister info provider too
            reg = infoRegistration;
            if (reg != null)
            {
                reg.unregister();
                infoRegistration = null;
            }
        }

    }
View Full Code Here

                    context.getServletContext().removeAttribute(OSGI_BUNDLE_CONTEXT);

                    ServiceRegistration registration = deployment.getRegistration();
                    if (registration != null)
                    {
                        registration.unregister();
                    }
                    deployment.setRegistration(null);
                    deployment.setContext(null);
                    context.stop();
                }
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.