Package org.osgi.framework

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


            this.eventAdmin.sendEvent(getJobEvent(null));
            assertTrue("No event received in the given time.", cb.block(5));
            cb.reset();
            assertFalse("Unexpected event received in the given time.", cb.block(5));
        } finally {
            reg.unregister();
        }
    }

    /**
     * Test simple job execution with job id.
View Full Code Here


            jobManager.addJob(TOPIC, "myid1", null);
            assertTrue("No event received in the given time.", cb.block(5));
            cb.reset();
            assertFalse("Unexpected event received in the given time.", cb.block(5));
        } finally {
            jcReg.unregister();
        }
    }

    /**
     * Test force canceling a job
View Full Code Here

                for(final Job j : col) {
                    jobManager.removeJobById(j.getId());
                }
            }
        } finally {
            jcReg.unregister();
        }
    }
}
View Full Code Here

            for(int i=0; i < n; i++) {
                executor.execute(id);
            }
            assertTrue("Expecting counter to increment asynchronously", counter.get() < previous + n);
        } finally {
            reg.unregister();
        }
       
    }

}
View Full Code Here

     * can react accordingly
     */
    protected void dependenciesUnSatisfied() {
        ServiceRegistration reg = beanFactoryReg;
        if (reg != null) {
            reg.unregister();
            beanFactoryReg = null;
            log.info("Dependencies unsatisfied. Deregistering the BeanFactory instance");
        }
    }

View Full Code Here

        if (repository instanceof RepositoryImpl) {
            String mbeanName = StatisticsMBeanImpl.getMBeanName((RepositoryImpl) repository);
            try {
                ServiceRegistration serviceRegistration = statisticsServices.get(mbeanName);
                if (serviceRegistration != null) {
                    serviceRegistration.unregister();
                }
            } catch (Exception e) {
                log.warn("Failed to unregister statistics JMX bean {} ", e.getMessage());
            }
            statisticsServices.remove(mbeanName);
View Full Code Here

                fail("OSGi add resource events are missing for "
                        + missing.size() + "/" + nPaths + " paths after "
                        + timeoutMsec + " msec: " + missingStr);
            }
        } finally {
            reg.unregister();
            s.logout();
        }
       
        log.info("Successfuly detected OSGi observation events for " + nPaths + " paths");
    }
View Full Code Here

        final ServiceRegistration reg;
        synchronized ( this.registrations ) {
            reg = this.registrations.remove(key);
        }
        if ( reg != null ) {
            reg.unregister();
        }
    }

    /**
     * Data class for a pending service.
View Full Code Here

        //No events should be logged as filter would have rejected that
        bar.debug("Test");
        assertTrue(ta.events.isEmpty());

        //Now unregister and earlier asserts should work
        sr.unregister();

        delay();
        ta.events.clear();

        assertTrue(bar.isDebugEnabled());
View Full Code Here

        //No events should be logged as filter would have rejected that
        bar.debug("Test");
        assertTrue(ta.events.isEmpty());

        //Now unregister and earlier asserts should work
        sr.unregister();

        delay();
        ta.events.clear();

        assertTrue(bar.isDebugEnabled());
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.