use of org.jboss.msc.service.StopContext in project wildfly by wildfly.
the class ServiceBasedNamingStoreTestCase method bindObject.
private void bindObject(final ServiceName serviceName, final Object value) throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
container.addService(serviceName, new Service<ManagedReferenceFactory>() {
public void start(StartContext context) throws StartException {
store.add(serviceName);
latch.countDown();
}
public void stop(StopContext context) {
}
public ManagedReferenceFactory getValue() throws IllegalStateException, IllegalArgumentException {
return new ValueManagedReferenceFactory(Values.immediateValue(value));
}
}).install();
latch.await();
}
Aggregations