use of org.eclipse.scout.rt.platform.IBeanManager in project scout.rt by eclipse.
the class SoapServiceTunnelContentHandlerTest method after.
@After
public void after() {
TestingUtility.unregisterBean(m_serviceReg);
IBeanManager beanManager = BEANS.getBeanManager();
// restore
for (IBean<?> bean : m_oldBeans) {
beanManager.registerBean(new BeanMetaData(bean));
}
}
use of org.eclipse.scout.rt.platform.IBeanManager in project scout.rt by eclipse.
the class NotificationHandlerRegistryTest method ensureHandlerRegistryRefreshed.
private void ensureHandlerRegistryRefreshed() {
IBeanManager beanManager = BEANS.getBeanManager();
IBean<NotificationHandlerRegistry> bean = beanManager.getBean(NotificationHandlerRegistry.class);
beanManager.unregisterBean(bean);
beanManager.registerBean(new BeanMetaData(bean));
}
use of org.eclipse.scout.rt.platform.IBeanManager in project scout.rt by eclipse.
the class CodeTypeRegistrator method stateChanged.
@Override
public void stateChanged(PlatformEvent e) {
if (e.getState() == IPlatform.State.BeanManagerPrepared) {
IBeanManager beanManager = e.getSource().getBeanManager();
Set<Class<? extends ICodeType<?, ?>>> classes = BEANS.get(CodeTypeClassInventory.class).getClasses();
for (Class<? extends ICodeType<?, ?>> c : classes) {
LOG.debug("Register {}", c.getName());
beanManager.registerBean(new BeanMetaData(c).withProducer(new CodeTypeProducer()));
}
LOG.info("{} code type classes registered.", classes.size());
}
}
use of org.eclipse.scout.rt.platform.IBeanManager in project scout.rt by eclipse.
the class NotificationDispatcherTest method before.
@Before
public void before() throws Exception {
m_globalNotificationHanlder = mock(GlobalNotificationHandler.class);
m_groupNotificationHanlder = mock(GroupNotificationHandler.class);
m_serviceReg = TestingUtility.registerBeans(new BeanMetaData(GlobalNotificationHandler.class).withInitialInstance(m_globalNotificationHanlder).withApplicationScoped(true), new BeanMetaData(GroupNotificationHandler.class).withInitialInstance(m_groupNotificationHanlder).withApplicationScoped(true));
// ensure bean hander cache of notification dispatcher gets refreshed
IBeanManager beanManager = BEANS.getBeanManager();
IBean<NotificationHandlerRegistry> bean = beanManager.getBean(NotificationHandlerRegistry.class);
beanManager.unregisterBean(bean);
beanManager.registerBean(new BeanMetaData(bean));
}
use of org.eclipse.scout.rt.platform.IBeanManager in project scout.rt by eclipse.
the class RunContextChainInterceptorTest method unregisterInterceptor.
@After
public void unregisterInterceptor() {
IBeanManager manager = BEANS.getBeanManager();
for (IBean<?> bean : m_registeredBeans) {
manager.unregisterBean(bean);
}
BEANS.get(RunContextChainIntercepterRegistry.class).reindex();
}
Aggregations