use of org.xwiki.component.manager.ComponentLifecycleException 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.manager.ComponentLifecycleException 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