Package org.nuxeo.runtime.management
Class ResourcePublisherService
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.runtime.management.ResourcePublisherService
-
- All Implemented Interfaces:
ResourcePublisher
,ResourcePublisherMBean
,Adaptable
,Component
,Extensible
,TimestampedService
public class ResourcePublisherService extends DefaultComponent implements ResourcePublisher, ResourcePublisherMBean
- Author:
- Stephane Lacoin (Nuxeo EP Software Engineer)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
ResourcePublisherService.FactoriesRegistry
protected class
ResourcePublisherService.ResourcesRegistry
protected class
ResourcePublisherService.ShortcutsRegistry
-
Field Summary
Fields Modifier and Type Field Description static String
FACTORIES_EXT_KEY
protected ResourcePublisherService.FactoriesRegistry
factoriesRegistry
static ComponentName
NAME
protected ResourcePublisherService.ResourcesRegistry
resourcesRegistry
protected ServerLocatorService
serverLocatorService
static String
SERVICES_EXT_KEY
static String
SHORTCUTS_EXT_KEY
protected ResourcePublisherService.ShortcutsRegistry
shortcutsRegistry
protected boolean
started
-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description ResourcePublisherService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(ComponentContext context)
Activates the component.protected void
bindForTest(MBeanServer server, ObjectName name, Object instance, Class<?> clazz)
void
bindResource(ObjectName name)
void
bindResources()
void
deactivate(ComponentContext context)
Deactivates the component.protected void
doBindResources()
protected void
doUnbindResources()
Set<ObjectName>
getResourcesName()
Set<String>
getShortcutsName()
ObjectName
lookupName(String name)
void
registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
void
registerResource(String shortName, String qualifiedName, Class<?> managementClass, Object instance)
void
registerShortcut(String shortName, String qualifiedName)
void
start(ComponentContext context)
Start the component.void
stop(ComponentContext context)
Stop the component.void
unbindResource(ObjectName name)
void
unbindResources()
void
unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
void
unregisterResource(String shortName, String qualifiedName)
void
unregisterShortcut(String shortName)
-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, unregister, 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, getApplicationStartedOrder
-
-
-
-
Field Detail
-
SERVICES_EXT_KEY
public static final String SERVICES_EXT_KEY
- See Also:
- Constant Field Values
-
FACTORIES_EXT_KEY
public static final String FACTORIES_EXT_KEY
- See Also:
- Constant Field Values
-
SHORTCUTS_EXT_KEY
public static final String SHORTCUTS_EXT_KEY
- See Also:
- Constant Field Values
-
NAME
public static final ComponentName NAME
-
shortcutsRegistry
protected final ResourcePublisherService.ShortcutsRegistry shortcutsRegistry
-
factoriesRegistry
protected final ResourcePublisherService.FactoriesRegistry factoriesRegistry
-
resourcesRegistry
protected final ResourcePublisherService.ResourcesRegistry resourcesRegistry
-
serverLocatorService
protected ServerLocatorService serverLocatorService
-
started
protected boolean started
-
-
Constructor Detail
-
ResourcePublisherService
public ResourcePublisherService()
-
-
Method Detail
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
registerContribution
in classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContribution
in classDefaultComponent
-
registerResource
public void registerResource(String shortName, String qualifiedName, Class<?> managementClass, Object instance)
- Specified by:
registerResource
in interfaceResourcePublisher
-
unregisterResource
public void unregisterResource(String shortName, String qualifiedName)
- Specified by:
unregisterResource
in interfaceResourcePublisher
-
registerShortcut
public void registerShortcut(String shortName, String qualifiedName)
-
unregisterShortcut
public void unregisterShortcut(String shortName)
-
getShortcutsName
public Set<String> getShortcutsName()
- Specified by:
getShortcutsName
in interfaceResourcePublisher
-
getResourcesName
public Set<ObjectName> getResourcesName()
- Specified by:
getResourcesName
in interfaceResourcePublisher
- Specified by:
getResourcesName
in interfaceResourcePublisherMBean
-
lookupName
public ObjectName lookupName(String name)
- Specified by:
lookupName
in interfaceResourcePublisher
-
doBindResources
protected void doBindResources()
-
bindResources
public void bindResources()
- Specified by:
bindResources
in interfaceResourcePublisherMBean
-
doUnbindResources
protected void doUnbindResources()
-
unbindResources
public void unbindResources()
- Specified by:
unbindResources
in interfaceResourcePublisherMBean
-
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
-
stop
public void stop(ComponentContext context)
Description copied from interface:Component
Stop the component.- Specified by:
stop
in interfaceComponent
- Overrides:
stop
in classDefaultComponent
-
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
-
deactivate
public void deactivate(ComponentContext context)
Description copied from interface:Component
Deactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivate
in interfaceComponent
- Overrides:
deactivate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
bindResource
public void bindResource(ObjectName name)
-
unbindResource
public void unbindResource(ObjectName name)
-
bindForTest
protected void bindForTest(MBeanServer server, ObjectName name, Object instance, Class<?> clazz) throws JMException, InvalidTargetObjectTypeException
-
-