|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.avalon.fortress.util.LifecycleExtensionManager
LifecycleExtensionManager
class. This class manages a list
of extensions objects that are executed on components during the various
stages of their lifecycles.
It provides methods for adding extension objects to the system, and a method for executing them on a particular component object. The current context is also passed in to the extension objects to facilitate the communication of any global values.
Extensions are stored internally in a list. This guarentees that the order in which they are executed matches the order in which they are inserted.
Field Summary | |
protected static int |
ACCESS
|
protected static int |
CREATE
|
protected static int |
DESTROY
|
protected static int |
RELEASE
|
static java.lang.String |
ROLE
|
Constructor Summary | |
LifecycleExtensionManager()
|
Method Summary | |
int |
accessorExtensionsCount()
Find out the total number of accessor extensions registered with this manager |
java.util.Iterator |
accessorExtensionsIterator()
Obtain an iterator. |
void |
addAccessorExtension(Accessor extension)
Adds an accessor extension to the manager |
void |
addCreatorExtension(Creator extension)
Adds a creator extension to the manager |
protected void |
checkWriteable()
Utility method to check if LifecycleExtensionsManager is writeable and if not throw exception. |
void |
clearAccessorExtensions()
Clears all accessor extensions registered with this manager |
void |
clearCreatorExtensions()
Clears all creator extensions registered with this manager |
int |
creatorExtensionsCount()
Find out the total number of creator extensions registered with this manager |
java.util.Iterator |
creatorExtensionsIterator()
Obtain an iterator. |
void |
executeAccessExtensions(java.lang.Object component,
Context context)
executeAccessExtensions method, executes all access
level extensions on the given component. |
void |
executeCreationExtensions(java.lang.Object component,
Context context)
executeCreationExtensions method, executes all creation
level extensions on the given component. |
void |
executeDestructionExtensions(java.lang.Object component,
Context context)
executeDestructionExtensions method, executes all
destruction level extensions on the given component. |
protected void |
executeExtensions(java.lang.Object[] extensions,
java.lang.Object component,
Context context,
int type)
executeExtensions method, executes a given array of
lifecycle interfaces on a given component. |
void |
executeReleaseExtensions(java.lang.Object component,
Context context)
executeReleaseExtensions method, executes all release
level extensions on the given component. |
Accessor |
getAccessorExtension(int index)
Obtain the particular accessor extension at the given index |
Creator |
getCreatorExtension(int index)
Obtain the particular creator extension at the given index |
void |
insertAccessorExtension(int position,
Accessor extension)
Inserts an accessor extension at a given index in the manager |
void |
insertCreatorExtension(int position,
Creator extension)
Inserts a creator extension at a given index in the manager |
void |
makeReadOnly()
Make the extension manager read only (immutable). |
Accessor |
removeAccessorExtension(int position)
Removes a particular accessor extension from the manager |
Creator |
removeCreatorExtension(int position)
Removes a particular creator extension from the manager |
LifecycleExtensionManager |
writeableCopy()
Create a copy; it will be writeable even if the original was not. |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String ROLE
protected static final int ACCESS
protected static final int RELEASE
protected static final int CREATE
protected static final int DESTROY
Constructor Detail |
public LifecycleExtensionManager()
Method Detail |
public void makeReadOnly()
public LifecycleExtensionManager writeableCopy()
public void executeAccessExtensions(java.lang.Object component, Context context) throws java.lang.Exception
executeAccessExtensions
method, executes all access
level extensions on the given component.
component
- a Component
instancecontext
- a Context
instance
java.lang.Exception
- if an error occurspublic void executeReleaseExtensions(java.lang.Object component, Context context) throws java.lang.Exception
executeReleaseExtensions
method, executes all release
level extensions on the given component.
component
- a Component
instancecontext
- a Context
instance
java.lang.Exception
- if an error occurspublic void executeCreationExtensions(java.lang.Object component, Context context) throws java.lang.Exception
executeCreationExtensions
method, executes all creation
level extensions on the given component.
component
- a Component
instancecontext
- a Context
instance
java.lang.Exception
- if an error occurspublic void executeDestructionExtensions(java.lang.Object component, Context context) throws java.lang.Exception
executeDestructionExtensions
method, executes all
destruction level extensions on the given component.
component
- a Component
instancecontext
- a Context
instance
java.lang.Exception
- if an error occurspublic void addAccessorExtension(Accessor extension)
extension
- a Accessor
instancepublic void addCreatorExtension(Creator extension)
extension
- a Creator
instancepublic void insertAccessorExtension(int position, Accessor extension)
position
- an int
index valueextension
- a Accessor
instancepublic void insertCreatorExtension(int position, Creator extension)
position
- an int
index valueextension
- a Creator
instancepublic Accessor removeAccessorExtension(int position)
position
- an int
index value
Accessor
instancepublic Creator removeCreatorExtension(int position)
position
- an int
index value
Creator
instancepublic java.util.Iterator accessorExtensionsIterator()
Iterator
instancepublic java.util.Iterator creatorExtensionsIterator()
Iterator
instancepublic int accessorExtensionsCount()
int
valuepublic int creatorExtensionsCount()
int
valuepublic Accessor getAccessorExtension(int index)
index
- an int
index value
Accessor
instancepublic Creator getCreatorExtension(int index)
index
- an int
index value
Creator
instancepublic void clearAccessorExtensions()
public void clearCreatorExtensions()
protected void executeExtensions(java.lang.Object[] extensions, java.lang.Object component, Context context, int type) throws java.lang.Exception
executeExtensions
method, executes a given array of
lifecycle interfaces on a given component.
component
- a Component
instancecontext
- a Context
instancetype
- a constant, referencing which phase the
extensions array adheres to
java.lang.Exception
- if an error occursprotected final void checkWriteable() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if context is read only
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |