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 classResourcePublisherService.FactoriesRegistryprotected classResourcePublisherService.ResourcesRegistryprotected classResourcePublisherService.ShortcutsRegistry
-
Field Summary
Fields Modifier and Type Field Description static StringFACTORIES_EXT_KEYprotected ResourcePublisherService.FactoriesRegistryfactoriesRegistrystatic ComponentNameNAMEprotected ResourcePublisherService.ResourcesRegistryresourcesRegistryprotected ServerLocatorServiceserverLocatorServicestatic StringSERVICES_EXT_KEYstatic StringSHORTCUTS_EXT_KEYprotected ResourcePublisherService.ShortcutsRegistryshortcutsRegistryprotected booleanstarted-
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 voidactivate(ComponentContext context)Activates the component.protected voidbindForTest(MBeanServer server, ObjectName name, Object instance, Class<?> clazz)voidbindResource(ObjectName name)voidbindResources()voiddeactivate(ComponentContext context)Deactivates the component.protected voiddoBindResources()protected voiddoUnbindResources()Set<ObjectName>getResourcesName()Set<String>getShortcutsName()ObjectNamelookupName(String name)voidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)voidregisterResource(String shortName, String qualifiedName, Class<?> managementClass, Object instance)voidregisterShortcut(String shortName, String qualifiedName)voidstart(ComponentContext context)Start the component.voidstop(ComponentContext context)Stop the component.voidunbindResource(ObjectName name)voidunbindResources()voidunregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)voidunregisterResource(String shortName, String qualifiedName)voidunregisterShortcut(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:
registerContributionin classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContributionin classDefaultComponent
-
registerResource
public void registerResource(String shortName, String qualifiedName, Class<?> managementClass, Object instance)
- Specified by:
registerResourcein interfaceResourcePublisher
-
unregisterResource
public void unregisterResource(String shortName, String qualifiedName)
- Specified by:
unregisterResourcein interfaceResourcePublisher
-
registerShortcut
public void registerShortcut(String shortName, String qualifiedName)
-
unregisterShortcut
public void unregisterShortcut(String shortName)
-
getShortcutsName
public Set<String> getShortcutsName()
- Specified by:
getShortcutsNamein interfaceResourcePublisher
-
getResourcesName
public Set<ObjectName> getResourcesName()
- Specified by:
getResourcesNamein interfaceResourcePublisher- Specified by:
getResourcesNamein interfaceResourcePublisherMBean
-
lookupName
public ObjectName lookupName(String name)
- Specified by:
lookupNamein interfaceResourcePublisher
-
doBindResources
protected void doBindResources()
-
bindResources
public void bindResources()
- Specified by:
bindResourcesin interfaceResourcePublisherMBean
-
doUnbindResources
protected void doUnbindResources()
-
unbindResources
public void unbindResources()
- Specified by:
unbindResourcesin interfaceResourcePublisherMBean
-
start
public void start(ComponentContext context)
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
stop
public void stop(ComponentContext context)
Description copied from interface:ComponentStop the component.- Specified by:
stopin interfaceComponent- Overrides:
stopin classDefaultComponent
-
activate
public void activate(ComponentContext context)
Description copied from interface:ComponentActivates the component.This method is called by the runtime when a component is activated.
- Specified by:
activatein interfaceComponent- Overrides:
activatein classDefaultComponent- Parameters:
context- the runtime context
-
deactivate
public void deactivate(ComponentContext context)
Description copied from interface:ComponentDeactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivatein interfaceComponent- Overrides:
deactivatein 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
-
-