Package org.nuxeo.runtime.capabilities
Class CapabilitiesServiceImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.runtime.capabilities.CapabilitiesServiceImpl
-
- All Implemented Interfaces:
CapabilitiesService
,Adaptable
,Component
,Extensible
,TimestampedService
public class CapabilitiesServiceImpl extends DefaultComponent implements CapabilitiesService
- Since:
- 11.5
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Supplier<Map<String,Object>>>
capabilitiesSuppliers
static String
CAPABILITY_SERVER
-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description CapabilitiesServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(ComponentContext context)
Activates the component.int
getApplicationStartedOrder()
The component notification order forComponent.applicationStarted(org.nuxeo.runtime.model.ComponentContext)
.Capabilities
getCapabilities()
Returns the capabilities.protected Map<String,Object>
getServerCapabilities()
void
registerCapabilities(String name, Supplier<Map<String,Object>> supplier)
Registers capabilities under the givenname
.void
registerCapabilities(String name, Map<String,Object> map)
Registers capabilities under the givenname
.void
start(ComponentContext context)
Start the component.-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, stop, unregister, unregisterContribution, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted
-
-
-
-
Method Detail
-
activate
public void activate(ComponentContext context)
Description copied from interface:Component
Activates the component.This method is called by the runtime when a component is activated.
- Specified by:
activate
in interfaceComponent
- Overrides:
activate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
getApplicationStartedOrder
public int getApplicationStartedOrder()
Description copied from interface:Component
The component notification order forComponent.applicationStarted(org.nuxeo.runtime.model.ComponentContext)
.Components are notified in increasing order. Order 1000 is the default order for components that don't care. Order 100 is the repository initialization.
- Specified by:
getApplicationStartedOrder
in interfaceComponent
- Returns:
- the order, 1000 by default
-
start
public void start(ComponentContext context)
Description copied from interface:Component
Start the component. This method is called after all the components were resolved and activated- Specified by:
start
in interfaceComponent
- Overrides:
start
in classDefaultComponent
-
registerCapabilities
public void registerCapabilities(String name, Map<String,Object> map)
Description copied from interface:CapabilitiesService
Registers capabilities under the givenname
.- Specified by:
registerCapabilities
in interfaceCapabilitiesService
- See Also:
CapabilitiesService.registerCapabilities(String, Supplier)
-
registerCapabilities
public void registerCapabilities(String name, Supplier<Map<String,Object>> supplier)
Description copied from interface:CapabilitiesService
Registers capabilities under the givenname
.The given
Supplier
is called each timeCapabilitiesService.getCapabilities()
is called.Capabilities might be registered during the Component start step.
- Specified by:
registerCapabilities
in interfaceCapabilitiesService
-
getCapabilities
public Capabilities getCapabilities()
Description copied from interface:CapabilitiesService
Returns the capabilities.- Specified by:
getCapabilities
in interfaceCapabilitiesService
-
-