Package org.nuxeo.runtime.model.impl
Class RegistrationInfoImpl
java.lang.Object
org.nuxeo.runtime.model.impl.RegistrationInfoImpl
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionUseful when dynamically registering components -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()voidattach(ComponentManagerImpl manager) Attach to a manager - this method must be called after all registration fields are initialized.protected Extension[]Checks extensions and returns only valid ones.voidvoiddeactivate(boolean mustUnregisterExtensions) Deactivate the component.voiddestroy()booleanGets the list of aliases.intThe component notification order forComponentManager.start().Get the owner bundle symbolic name of that component.Gets the component instance or null if the component was not yet activated.Gets the runtime context that created this registration info.Gets any comments on this component.Gets the defined extension points.Gets the extensions contributed by this component.Give the class name for the component implementation if this is a java componentGets the component manager.getName()Gets the name of the component.Gets the component properties.String[]Gets the list of provided services or null if no service is provided.Gets the list of the required components.The id of the content source used to create the registration (usually a StreamRef id)intgetState()Gets the component state.Gets the component version.Retrieve the URL of the XML file used to declare the componentinthashCode()booleanInstantiates corresponding component.booleanChecks whether this component is activated.booleanWhether this component is disabled.final booleanfinal booleanWhether or not this registration is persisted by the user (not part of a real bundle).booleanChecks whether this component is resolved (i.e. all its dependencies are satisfied).booleanChecks whether this component is startedvoidresolve()voidsetContext(RuntimeContext context) voidsetPersistent(boolean isPersistent) Set the persistent flag on this registrationvoidsetState(int state) DON'T USE THIS METHOD - INTERNAL API.voidstart()voidstop()toString()voidbooleanUse former way forRegistrationInfoImpl.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.model.RegistrationInfo
getExtensionPoint
-
Constructor Details
-
RegistrationInfoImpl
public RegistrationInfoImpl() -
RegistrationInfoImpl
Useful when dynamically registering components- Parameters:
name- the component name
-
-
Method Details
-
attach
Attach to a manager - this method must be called after all registration fields are initialized. -
setContext
-
isDisabled
public boolean isDisabled()Description copied from interface:RegistrationInfoWhether this component is disabled. For now this is used only for persistent components.- Specified by:
isDisabledin interfaceRegistrationInfo
-
isPersistent
public final boolean isPersistent()Description copied from interface:RegistrationInfoWhether or not this registration is persisted by the user (not part of a real bundle).- Specified by:
isPersistentin interfaceRegistrationInfo- Returns:
- true if persisted, false otherwise
-
setPersistent
public void setPersistent(boolean isPersistent) Description copied from interface:RegistrationInfoSet the persistent flag on this registration- Specified by:
setPersistentin interfaceRegistrationInfo
-
destroy
public void destroy() -
isDisposed
public final boolean isDisposed() -
getExtensionPoints
Description copied from interface:RegistrationInfoGets the defined extension points.- Specified by:
getExtensionPointsin interfaceRegistrationInfo- Returns:
- the defined extension points
-
getComponent
Description copied from interface:RegistrationInfoGets the component instance or null if the component was not yet activated.- Specified by:
getComponentin interfaceRegistrationInfo- Returns:
- the component instance
-
getName
Description copied from interface:RegistrationInfoGets the name of the component.- Specified by:
getNamein interfaceRegistrationInfo- Returns:
- the component name
-
getProperties
Description copied from interface:RegistrationInfoGets the component properties.- Specified by:
getPropertiesin interfaceRegistrationInfo- Returns:
- the component properties
-
getState
public int getState()Description copied from interface:RegistrationInfoGets the component state.- Specified by:
getStatein interfaceRegistrationInfo- Returns:
- the component state
-
getExtensions
Description copied from interface:RegistrationInfoGets the extensions contributed by this component.- Specified by:
getExtensionsin interfaceRegistrationInfo- Returns:
- the contributed extensions
-
getAliases
Description copied from interface:RegistrationInfoGets the list of aliases.- Specified by:
getAliasesin interfaceRegistrationInfo- Returns:
- the aliases
-
getRequiredComponents
Description copied from interface:RegistrationInfoGets the list of the required components.- Specified by:
getRequiredComponentsin interfaceRegistrationInfo- Returns:
- the required components
-
getContext
Description copied from interface:RegistrationInfoGets the runtime context that created this registration info.- Specified by:
getContextin interfaceRegistrationInfo- Returns:
- the runtime context
-
getBundle
Description copied from interface:RegistrationInfoGet the owner bundle symbolic name of that component. If null the default owner is used.- Specified by:
getBundlein interfaceRegistrationInfo
-
getVersion
Description copied from interface:RegistrationInfoGets the component version.- Specified by:
getVersionin interfaceRegistrationInfo
-
getDocumentation
Description copied from interface:RegistrationInfoGets any comments on this component.- Specified by:
getDocumentationin interfaceRegistrationInfo
-
toString
-
getManager
Description copied from interface:RegistrationInfoGets the component manager.- Specified by:
getManagerin interfaceRegistrationInfo- Returns:
- the component manager
-
setState
public void setState(int state) Description copied from interface:RegistrationInfoDON'T USE THIS METHOD - INTERNAL API.- Specified by:
setStatein interfaceRegistrationInfo- Parameters:
state- the state to set in this registration info
-
getApplicationStartedOrder
public int getApplicationStartedOrder()Description copied from interface:RegistrationInfoThe component notification order forComponentManager.start().- Specified by:
getApplicationStartedOrderin interfaceRegistrationInfo- Returns:
- the order, 1000 by default
-
start
public void start() -
isStarted
public boolean isStarted()Description copied from interface:RegistrationInfoChecks whether this component is started- Specified by:
isStartedin interfaceRegistrationInfo
-
stop
- 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:RegistrationInfoChecks whether this component is activated.- Specified by:
isActivatedin interfaceRegistrationInfo- Returns:
- true if the component is activated, false otherwise
-
isResolved
public boolean isResolved()Description copied from interface:RegistrationInfoChecks whether this component is resolved (i.e. all its dependencies are satisfied).- Specified by:
isResolvedin interfaceRegistrationInfo- Returns:
- true if the component is resolved, false otherwise
-
getProvidedServiceNames
Description copied from interface:RegistrationInfoGets the list of provided services or null if no service is provided.- Specified by:
getProvidedServiceNamesin interfaceRegistrationInfo- Returns:
- an array containing the service class names or null if no service are provided
-
getServiceDescriptor
-
getImplementation
Description copied from interface:RegistrationInfoGive the class name for the component implementation if this is a java component- Specified by:
getImplementationin interfaceRegistrationInfo- Returns:
- class name
-
checkExtensions
Checks extensions and returns only valid ones.- Since:
- 11.3
-
getXmlFileUrl
Description copied from interface:RegistrationInfoRetrieve the URL of the XML file used to declare the component- Specified by:
getXmlFileUrlin interfaceRegistrationInfo- Returns:
- the XML file URL
-
getSourceId
Description copied from interface:RegistrationInfoThe id of the content source used to create the registration (usually a StreamRef id)- Specified by:
getSourceIdin interfaceRegistrationInfo
-
equals
-
hashCode
public int hashCode() -
useFormerLifecycleManagement
public boolean useFormerLifecycleManagement()Use former way forRegistrationInfoImpl.- Specified by:
useFormerLifecycleManagementin interfaceRegistrationInfo- Returns:
- whether or not
ComponentManagerorComponentRegistryshould use the former way to manage component lifecycle. - Since:
- 9.3
-