Package org.nuxeo.ecm.webengine.session
Interface Component
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractComponent
A stateful session component.
A component is instantiate and activated the first time it is requested. It is destroyed when the user session ends.
Stateful components are not necessarily thread safe.
- Author:
- Bogdan Stefanescu
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy
(UserSession session) Destroy this component.getName()
Get the component name if any.void
initialize
(UserSession session, String name) The component was instantiated by the given session.boolean
isLive()
Checks whether this component was initialized and can be used.
-
Method Details
-
initialize
The component was instantiated by the given session.This method should initialize the component. After returning the component will become visible in the session.
- Parameters:
session
- the user session that created the componentname
- the name under this component is registered. Can be null for unnamed component.- Throws:
InvalidStateException
- if the component is not in an appropriate life cycle stateSessionException
- an internal error occurred
-
destroy
Destroy this component. This is called by the when the owning session is about to be destroyed. The component should release any allocated resources.- Parameters:
session
- the session owning this component- Throws:
InvalidStateException
- if the component is not in an appropriate life cycle stateSessionException
- an internal error occurred
-
getName
String getName()Get the component name if any. A component may be initialized under a name. For singleton components no name is needed so this method might return null.- Returns:
- the name if any otherwise null
-
isLive
boolean isLive()Checks whether this component was initialized and can be used.
-