Class LifeCycleServiceImpl
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.core.lifecycle.impl.LifeCycleServiceImpl
- All Implemented Interfaces:
LifeCycleService,Adaptable,Component,Extensible,TimestampedService
Life cycle service implementation.
- Author:
- Julien Anguenot, Florent Guillaume
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ComponentNameprotected static final Stringprotected static final StringFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfollowTransition(Document doc, String transitionName) Follows a given transition.getLifeCycleByName(String name) Returns a life cycle given its name.getLifeCycleFor(Document doc) Returns the life cycle a given document follows.getLifeCycleNameFor(String typeName) Returns the lifecycle name that the given type follows.Returns all the registered life cycles.getNonRecursiveTransitionForDocType(String docTypeName) Returns a list of transition for which, when a it is followed, it should no recurse in its children.getTypesFor(String lifeCycleName) Returns the types which follow a given life cycle.Returns the mapping from types to life cycle names.voidinitialize(Document doc) Initializes the life cycle for the given document.voidinitialize(Document doc, String initialStateName) Initializes the life cycle for the given document.protected LifeCyclevoidreinitLifeCycle(Document doc) Sets the current state to the initial state as defined by the associated lifecycle.voidstart(ComponentContext context) Start the component.voidstop(ComponentContext context) Stop the component.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterContribution, unregisterExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
NAME
-
XP_LIFECYCLE
- See Also:
-
XP_TYPES
- See Also:
-
lifeCycles
-
-
Constructor Details
-
LifeCycleServiceImpl
public LifeCycleServiceImpl()
-
-
Method Details
-
start
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
Description copied from interface:ComponentStop the component.- Specified by:
stopin interfaceComponent- Overrides:
stopin classDefaultComponent- Throws:
InterruptedException
-
getLifeCycleByName
Description copied from interface:LifeCycleServiceReturns a life cycle given its name.- Specified by:
getLifeCycleByNamein interfaceLifeCycleService- Parameters:
name- the life cycle's name- Returns:
- a life cycle descriptor instance or null if not found.
-
getLifeCycleFor
Description copied from interface:LifeCycleServiceReturns the life cycle a given document follows.- Specified by:
getLifeCycleForin interfaceLifeCycleService- Parameters:
doc- the document instance- Returns:
- the life cycle instance
-
getLifeCycleNameFor
Description copied from interface:LifeCycleServiceReturns the lifecycle name that the given type follows.- Specified by:
getLifeCycleNameForin interfaceLifeCycleService- Parameters:
typeName- the type's name- Returns:
- the life cycle name
-
getLifeCycles
Description copied from interface:LifeCycleServiceReturns all the registered life cycles.- Specified by:
getLifeCyclesin interfaceLifeCycleService- Returns:
- a collection of lifecycle descriptors
-
getTypesFor
Description copied from interface:LifeCycleServiceReturns the types which follow a given life cycle.- Specified by:
getTypesForin interfaceLifeCycleService- Parameters:
lifeCycleName- a string holding the name of the life cycle- Returns:
- a collection of type names as strings
-
getTypesMapping
Description copied from interface:LifeCycleServiceReturns the mapping from types to life cycle names.- Specified by:
getTypesMappingin interfaceLifeCycleService- Returns:
- a mapping from types to life cycle names
-
initialize
Description copied from interface:LifeCycleServiceInitializes the life cycle for the given document.Document state will be set to the life cycle initial state.
- Specified by:
initializein interfaceLifeCycleService- Parameters:
doc- the document instance- Throws:
LifeCycleException
-
initialize
Description copied from interface:LifeCycleServiceInitializes the life cycle for the given document.Tries to set given state on document, if it's a valid initial state.
- Specified by:
initializein interfaceLifeCycleService- Parameters:
doc- the document instanceinitialStateName- the initial state name- Throws:
LifeCycleException
-
followTransition
Description copied from interface:LifeCycleServiceFollows a given transition.- Specified by:
followTransitionin interfaceLifeCycleService- Parameters:
doc- the Document instancetransitionName- the transition name- Throws:
LifeCycleException
-
reinitLifeCycle
Description copied from interface:LifeCycleServiceSets the current state to the initial state as defined by the associated lifecycle.- Specified by:
reinitLifeCyclein interfaceLifeCycleService- Throws:
LifeCycleException
-
getNonRecursiveTransitionForDocType
Description copied from interface:LifeCycleServiceReturns a list of transition for which, when a it is followed, it should no recurse in its children. TheBulkLifeCycleChangeListenerwill listen to the transition taken event and call a follow transition on the children of the document if the document is folderish. It check this list of transition to find out if it should recurse.- Specified by:
getNonRecursiveTransitionForDocTypein interfaceLifeCycleService- Parameters:
docTypeName- The doc type- Returns:
- a list of transition name
- See Also:
-
instantiateLifeCycle
-