use of org.xwiki.bridge.event.WikiDeletedEvent 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.bridge.event.WikiDeletedEvent in project xwiki-platform by xwiki.
the class AbstractDocumentTranslationBundle method onEvent.
// EventListener
@Override
public void onEvent(Event event, Object source, Object data) {
if (event instanceof WikiDeletedEvent) {
this.bundleCache.clear();
this.disposed = true;
} else {
XWikiDocument document = (XWikiDocument) source;
this.bundleCache.remove(document.getLocale());
if (document.getLocale().equals(Locale.ROOT)) {
this.bundleCache.remove(document.getDefaultLocale());
}
}
}
Aggregations