@Component @Named(value="component") @Singleton public class ComponentScriptService extends Object implements org.xwiki.script.service.ScriptService
Constructor and Description |
---|
ComponentScriptService() |
Modifier and Type | Method and Description |
---|---|
org.xwiki.component.manager.ComponentManager |
getComponentManager()
Deprecated.
since 6.4.1, 6.2.6, use
getContextComponentManager() or
getContextComponentManager() instead |
org.xwiki.component.manager.ComponentManager |
getComponentManager(String namespace)
Retrieves the component manager associated with a specific namespace.
|
org.xwiki.component.manager.ComponentManager |
getContextComponentManager() |
<T> T |
getInstance(Type roleType)
Find a component instance that implements that passed type.
|
<T> T |
getInstance(Type roleType,
String roleHint)
Find a component instance that implements that passed interface class.
|
Exception |
getLastError()
Get the error generated while performing the previously called action.
|
org.xwiki.component.manager.ComponentManager |
getRootComponentManager() |
@Deprecated public org.xwiki.component.manager.ComponentManager getComponentManager()
getContextComponentManager()
or
getContextComponentManager()
insteadpublic org.xwiki.component.manager.ComponentManager getContextComponentManager()
public org.xwiki.component.manager.ComponentManager getRootComponentManager()
public org.xwiki.component.manager.ComponentManager getComponentManager(String namespace)
prefix:subid
where prefix
is used to find the proper factory. :
can be
escaped using \
and \
need to be escaped as well. There is a namespace for each
document, space, wiki and user. E.g. 'wiki:drafts' is the namespace corresponding to the 'drafts' wiki.
Namespaces can be nested in which case they inherit from the parent namespace. E.g. the component manager for a
specific document has access to the components registered specifically for that document or for any of its
namespace ancestors (space, wiki, root). The root (top level) component manager is returned if you pass
null
.namespace
- a namespace or null
for the root ComponentManager
null otherwise
public <T> T getInstance(Type roleType)
T
- the component role typeroleType
- the class (aka role) that the component implementspublic <T> T getInstance(Type roleType, String roleHint)
T
- the component role typeroleType
- the class (aka role) that the component implementsroleHint
- the hint that differentiates a component implementation from another one (each component is
registered with a hint; the "default" hint being the default)public Exception getLastError()
null
if no exception was thrownCopyright © 2004–2018 XWiki. All rights reserved.