use of org.xwiki.model.namespace.WikiNamespace in project xwiki-platform by xwiki.
the class DefaultRecordableEventDescriptorManager method getDescriptorsFromWiki.
private List<RecordableEventDescriptor> getDescriptorsFromWiki(String wikiId) throws ComponentLookupException {
Namespace namespace = new WikiNamespace(wikiId);
ComponentManager wikiComponentManager = componentManagerManager.getComponentManager(namespace.serialize(), false);
if (wikiComponentManager == null) {
return Collections.emptyList();
}
List<RecordableEventDescriptor> descriptors = new ArrayList<>();
descriptors.addAll(wikiComponentManager.getInstanceList(RecordableEventDescriptor.class));
descriptors.addAll(wikiComponentManager.getInstanceList(UntypedRecordableEventDescriptor.class));
return descriptors;
}
use of org.xwiki.model.namespace.WikiNamespace 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);
}
}
}
Aggregations