Package org.nuxeo.runtime.model.impl
Class RegistrationInfoImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.impl.RegistrationInfoImpl
-
- All Implemented Interfaces:
RegistrationInfo
public class RegistrationInfoImpl extends Object implements RegistrationInfo
- Author:
- Bogdan Stefanescu
-
-
Field Summary
-
Fields inherited from interface org.nuxeo.runtime.model.RegistrationInfo
ACTIVATED, ACTIVATING, DEACTIVATING, REGISTERED, RESOLVED, START_FAILURE, STARTED, STARTING, STOPPING, UNREGISTERED
-
-
Constructor Summary
Constructors Constructor Description RegistrationInfoImpl()
RegistrationInfoImpl(ComponentName name)
Useful when dynamically registering components
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
activate()
void
attach(ComponentManagerImpl manager)
Attach to a manager - this method must be called after all registration fields are initialized.protected Extension[]
checkExtensions()
Checks extensions and returns only valid ones.void
deactivate()
void
deactivate(boolean mustUnregisterExtensions)
Deactivate the component.void
destroy()
boolean
equals(Object obj)
Set<ComponentName>
getAliases()
Gets the list of aliases.int
getApplicationStartedOrder()
The component notification order forComponentManager.start()
.String
getBundle()
Get the owner bundle symbolic name of that component.ComponentInstance
getComponent()
Gets the component instance or null if the component was not yet activated.RuntimeContext
getContext()
Gets the runtime context that created this registration info.String
getDocumentation()
Gets any comments on this component.ExtensionPoint[]
getExtensionPoints()
Gets the defined extension points.Extension[]
getExtensions()
Gets the extensions contributed by this component.String
getImplementation()
Give the class name for the component implementation if this is a java componentComponentManager
getManager()
Gets the component manager.ComponentName
getName()
Gets the name of the component.Map<String,Property>
getProperties()
Gets the component properties.String[]
getProvidedServiceNames()
Gets the list of provided services or null if no service is provided.Set<ComponentName>
getRequiredComponents()
Gets the list of the required components.ServiceDescriptor
getServiceDescriptor()
String
getSourceId()
The id of the content source used to create the registration (usually a StreamRef id)int
getState()
Gets the component state.Version
getVersion()
Gets the component version.URL
getXmlFileUrl()
Retrieve the URL of the XML file used to declare the componentint
hashCode()
boolean
instantiate()
Instantiates corresponding component.boolean
isActivated()
Checks whether this component is activated.boolean
isDisabled()
Whether this component is disabled.boolean
isDisposed()
boolean
isPersistent()
Whether or not this registration is persisted by the user (not part of a real bundle).boolean
isResolved()
Checks whether this component is resolved (i.e.boolean
isStarted()
Checks whether this component is startedvoid
reload()
Deprecated.since 9.3, but in fact since 5.6, see only usage in LiveInstallTask#reloadComponentvoid
resolve()
void
restart()
Deprecated.since 9.2 seems unusedvoid
setContext(RuntimeContext context)
void
setPersistent(boolean isPersistent)
Set the persistent flag on this registrationvoid
setState(int state)
DON'T USE THIS METHOD - INTERNAL API.void
start()
void
stop()
String
toString()
void
unresolve()
boolean
useFormerLifecycleManagement()
Use former way forRegistrationInfoImpl
.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.RegistrationInfo
getExtensionPoint
-
-
-
-
Constructor Detail
-
RegistrationInfoImpl
public RegistrationInfoImpl()
-
RegistrationInfoImpl
public RegistrationInfoImpl(ComponentName name)
Useful when dynamically registering components- Parameters:
name
- the component name
-
-
Method Detail
-
attach
public void attach(ComponentManagerImpl manager)
Attach to a manager - this method must be called after all registration fields are initialized.
-
setContext
public void setContext(RuntimeContext context)
-
isDisabled
public boolean isDisabled()
Description copied from interface:RegistrationInfo
Whether this component is disabled. For now this is used only for persistent components.- Specified by:
isDisabled
in interfaceRegistrationInfo
-
isPersistent
public final boolean isPersistent()
Description copied from interface:RegistrationInfo
Whether or not this registration is persisted by the user (not part of a real bundle).- Specified by:
isPersistent
in interfaceRegistrationInfo
- Returns:
- true if persisted, false otherwise
-
setPersistent
public void setPersistent(boolean isPersistent)
Description copied from interface:RegistrationInfo
Set the persistent flag on this registration- Specified by:
setPersistent
in interfaceRegistrationInfo
-
destroy
public void destroy()
-
isDisposed
public final boolean isDisposed()
-
getExtensionPoints
public ExtensionPoint[] getExtensionPoints()
Description copied from interface:RegistrationInfo
Gets the defined extension points.- Specified by:
getExtensionPoints
in interfaceRegistrationInfo
- Returns:
- the defined extension points
-
getComponent
public ComponentInstance getComponent()
Description copied from interface:RegistrationInfo
Gets the component instance or null if the component was not yet activated.- Specified by:
getComponent
in interfaceRegistrationInfo
- Returns:
- the component instance
-
reload
@Deprecated public void reload()
Deprecated.since 9.3, but in fact since 5.6, see only usage in LiveInstallTask#reloadComponentReload the underlying component if reload is supported
-
getName
public ComponentName getName()
Description copied from interface:RegistrationInfo
Gets the name of the component.- Specified by:
getName
in interfaceRegistrationInfo
- Returns:
- the component name
-
getProperties
public Map<String,Property> getProperties()
Description copied from interface:RegistrationInfo
Gets the component properties.- Specified by:
getProperties
in interfaceRegistrationInfo
- Returns:
- the component properties
-
getState
public int getState()
Description copied from interface:RegistrationInfo
Gets the component state.- Specified by:
getState
in interfaceRegistrationInfo
- Returns:
- the component state
-
getExtensions
public Extension[] getExtensions()
Description copied from interface:RegistrationInfo
Gets the extensions contributed by this component.- Specified by:
getExtensions
in interfaceRegistrationInfo
- Returns:
- the contributed extensions
-
getAliases
public Set<ComponentName> getAliases()
Description copied from interface:RegistrationInfo
Gets the list of aliases.- Specified by:
getAliases
in interfaceRegistrationInfo
- Returns:
- the aliases
-
getRequiredComponents
public Set<ComponentName> getRequiredComponents()
Description copied from interface:RegistrationInfo
Gets the list of the required components.- Specified by:
getRequiredComponents
in interfaceRegistrationInfo
- Returns:
- the required components
-
getContext
public RuntimeContext getContext()
Description copied from interface:RegistrationInfo
Gets the runtime context that created this registration info.- Specified by:
getContext
in interfaceRegistrationInfo
- Returns:
- the runtime context
-
getBundle
public String getBundle()
Description copied from interface:RegistrationInfo
Get the owner bundle symbolic name of that component. If null the default owner is used.- Specified by:
getBundle
in interfaceRegistrationInfo
-
getVersion
public Version getVersion()
Description copied from interface:RegistrationInfo
Gets the component version.- Specified by:
getVersion
in interfaceRegistrationInfo
-
getDocumentation
public String getDocumentation()
Description copied from interface:RegistrationInfo
Gets any comments on this component.- Specified by:
getDocumentation
in interfaceRegistrationInfo
-
getManager
public ComponentManager getManager()
Description copied from interface:RegistrationInfo
Gets the component manager.- Specified by:
getManager
in interfaceRegistrationInfo
- Returns:
- the component manager
-
setState
public void setState(int state)
Description copied from interface:RegistrationInfo
DON'T USE THIS METHOD - INTERNAL API.- Specified by:
setState
in interfaceRegistrationInfo
- Parameters:
state
- the state to set in this registration info
-
restart
@Deprecated public void restart()
Deprecated.since 9.2 seems unused
-
getApplicationStartedOrder
public int getApplicationStartedOrder()
Description copied from interface:RegistrationInfo
The component notification order forComponentManager.start()
.- Specified by:
getApplicationStartedOrder
in interfaceRegistrationInfo
- Returns:
- the order, 1000 by default
-
start
public void start()
-
isStarted
public boolean isStarted()
Description copied from interface:RegistrationInfo
Checks whether this component is started- Specified by:
isStarted
in interfaceRegistrationInfo
-
stop
public void stop() throws InterruptedException
- Throws:
InterruptedException
-
instantiate
public boolean instantiate()
Instantiates corresponding component.Allows registering listeners on ComponentManager at component instantiation, before all components activation.
Should be called before
activate()
.- Returns:
- false in case of error during instantiation, true otherwise.
- Since:
- 11.3
-
activate
public void activate()
-
deactivate
public void deactivate()
-
deactivate
public void deactivate(boolean mustUnregisterExtensions)
Deactivate the component. If mustUnregisterExtensions is false then the call was made by the manager because all components are stopped (and deactivated) so the extension unregister should not be done (this will speedup the stop and also fix broken component which are not correctly defining dependencies.)- Since:
- 9.2
-
resolve
public void resolve()
-
unresolve
public void unresolve()
-
isActivated
public boolean isActivated()
Description copied from interface:RegistrationInfo
Checks whether this component is activated.- Specified by:
isActivated
in interfaceRegistrationInfo
- Returns:
- true if the component is activated, false otherwise
-
isResolved
public boolean isResolved()
Description copied from interface:RegistrationInfo
Checks whether this component is resolved (i.e. all its dependencies are satisfied).- Specified by:
isResolved
in interfaceRegistrationInfo
- Returns:
- true if the component is resolved, false otherwise
-
getProvidedServiceNames
public String[] getProvidedServiceNames()
Description copied from interface:RegistrationInfo
Gets the list of provided services or null if no service is provided.- Specified by:
getProvidedServiceNames
in interfaceRegistrationInfo
- Returns:
- an array containing the service class names or null if no service are provided
-
getServiceDescriptor
public ServiceDescriptor getServiceDescriptor()
-
getImplementation
public String getImplementation()
Description copied from interface:RegistrationInfo
Give the class name for the component implementation if this is a java component- Specified by:
getImplementation
in interfaceRegistrationInfo
- Returns:
- class name
-
checkExtensions
protected Extension[] checkExtensions()
Checks extensions and returns only valid ones.- Since:
- 11.3
-
getXmlFileUrl
public URL getXmlFileUrl()
Description copied from interface:RegistrationInfo
Retrieve the URL of the XML file used to declare the component- Specified by:
getXmlFileUrl
in interfaceRegistrationInfo
- Returns:
- the XML file URL
-
getSourceId
public String getSourceId()
Description copied from interface:RegistrationInfo
The id of the content source used to create the registration (usually a StreamRef id)- Specified by:
getSourceId
in interfaceRegistrationInfo
-
useFormerLifecycleManagement
public boolean useFormerLifecycleManagement()
Use former way forRegistrationInfoImpl
.- Specified by:
useFormerLifecycleManagement
in interfaceRegistrationInfo
- Returns:
- whether or not
ComponentManager
orComponentRegistry
should use the former way to manage component lifecycle. - Since:
- 9.3
-
-