Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.webengine.session
Class AbstractComponent

java.lang.Object
  extended by org.nuxeo.ecm.webengine.session.AbstractComponent
All Implemented Interfaces:
Serializable, Component

public abstract class AbstractComponent
extends Object
implements Component

Author:
Bogdan Stefanescu
See Also:
Serialized Form

Constructor Summary
AbstractComponent()
           
 
Method Summary
 void destroy(UserSession session)
          Destroy this component.
 void doDestroy(UserSession session)
           
 void doInitialize(UserSession session, String name)
           
 String 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractComponent

public AbstractComponent()
Method Detail

getName

public String getName()
Description copied from interface: Component
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.

Specified by:
getName in interface Component
Returns:
the name if any otherwise null

isLive

public boolean isLive()
Description copied from interface: Component
Checks whether this component was initialized and can be used.

Specified by:
isLive in interface Component

initialize

public void initialize(UserSession session,
                       String name)
                throws SessionException
Description copied from interface: Component
The component was instantiated by the given session.

This method should initialize the component. After returning the component will become visible in the session.

Specified by:
initialize in interface Component
Parameters:
session - the user session that created the component
name - 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 state
SessionException - an internal error occurred

destroy

public void destroy(UserSession session)
             throws SessionException
Description copied from interface: Component
Destroy this component. This is called by the when the owning session is about to be destroyed. The component should release any allocated resources.

Specified by:
destroy in interface Component
Parameters:
session - the session owning this component
Throws:
InvalidStateException - if the component is not in an appropriate life cycle state
SessionException - an internal error occurred

doInitialize

public void doInitialize(UserSession session,
                         String name)
                  throws SessionException
Throws:
SessionException

doDestroy

public void doDestroy(UserSession session)
               throws SessionException
Throws:
SessionException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.