A container manages extensions using an extension handler. Handlers
may implement the
Creator
and/or
Accessor
interfaces. A creator extension will be activated during the create and
destroy stages of a component lifecycle. A accessor extension will be
activated during the access and release stages.
The
Creator
interface describes the create and destroy
stages that occur between a component and a container
during service management. Lifecycle extensions supporting create
and destroy stages must implement this interface.
package org.apache.avalon.lifecycle; import org.apache.avalon.framework.context.Context; public interface Creator { /** * Create stage handler. * * @param object the object that is being created * @param context the context instance required by the create handler * implementation * @exception Exception if an error occurs */ void create( Object object, Context context ) throws Exception; /** * Destroy stage handler. * * @param object the object that is being destroyed * @param context the context instance required by the handler * implementation */ void destroy( Object object, Context context ); }
The
Accessor
interface describes the access and release
stages that occur between a service or component manager and a
container during service deployment. Lifecycle extensions supporting
access and release stages must implement this interface.
package org.apache.avalon.lifecycle; import org.apache.avalon.framework.context.Context; public interface Accessor { /** * Access stage handler. * * @param object the object that is being accessed * @param context the context instance required by the access handler * implementation * @exception Exception if an error occurs */ void access( Object object, Context context ) throws Exception; /** * Release stage handler. * * @param object the object that is being released * @param context the context instance required by the release handler * implementation */ void release( Object object, Context context ); }