use of org.xwiki.component.phase.Disposable in project xwiki-platform by xwiki.
the class ScriptingIntegrationTest method cleanUp.
@After
public void cleanUp() throws Exception {
// Make sure we stop the Mail Sender thread after each test (since it's started automatically when looking
// up the MailSender component.
Disposable listener = this.componentManager.getInstance(EventListener.class, MailSenderInitializerListener.LISTENER_NAME);
listener.dispose();
}
use of org.xwiki.component.phase.Disposable in project xwiki-platform by xwiki.
the class AuthenticatingIntegrationTest method cleanUp.
@After
public void cleanUp() throws Exception {
// Make sure we stop the Mail Sender thread after each test (since it's started automatically when looking
// up the MailSender component.
Disposable listener = this.componentManager.getInstance(EventListener.class, MailSenderInitializerListener.LISTENER_NAME);
listener.dispose();
}
use of org.xwiki.component.phase.Disposable in project xwiki-platform by xwiki.
the class JavaIntegrationTest method cleanUp.
@After
public void cleanUp() throws Exception {
// Make sure we stop the Mail Sender thread after each test (since it's started automatically when looking
// up the MailSender component.
Disposable listener = this.componentManager.getInstance(EventListener.class, MailSenderInitializerListener.LISTENER_NAME);
listener.dispose();
}
use of org.xwiki.component.phase.Disposable in project xwiki-platform by xwiki.
the class WikiDeletedListener method onEvent.
@Override
public void onEvent(Event event, Object o, Object context) {
String wiki = ((WikiDeletedEvent) event).getWikiId();
ComponentManager componentManager = this.componentManagerManager.getComponentManager(new WikiNamespace(wiki).serialize(), false);
if (componentManager instanceof Disposable) {
try {
((Disposable) componentManager).dispose();
} catch (ComponentLifecycleException e) {
this.logger.error(String.format("Failed to dispose component manager for wiki [%s]", wiki), e);
}
}
}
use of org.xwiki.component.phase.Disposable in project xwiki-platform by xwiki.
the class DocumentDeletedListener method onEvent.
@Override
public void onEvent(Event event, Object o, Object context) {
String document = ((DocumentDeletedEvent) event).getEventFilter().getFilter();
ComponentManager componentManager = this.componentManagerManager.getComponentManager(new DocumentNamespace(document).serialize(), false);
if (componentManager instanceof Disposable) {
try {
((Disposable) componentManager).dispose();
} catch (ComponentLifecycleException e) {
this.logger.error(String.format("Failed to dispose component manager for document [%s]", document), e);
}
}
}
Aggregations