|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.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.
| Nested Class Summary | |
private class |
LifecycleExtensionManager.CachedArrayListCachedArrayList class. |
private static class |
LifecycleExtensionManager.UnmodifiableIteratorRead only iterator. |
| Field Summary | |
protected static int |
ACCESS |
protected static int |
CREATE |
protected static int |
DESTROY |
private LifecycleExtensionManager.CachedArrayList |
m_accessorExtensions |
private LifecycleExtensionManager.CachedArrayList |
m_creatorExtensions |
private boolean |
m_readOnly |
protected static int |
RELEASE |
static java.lang.String |
ROLE |
| Fields inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
|
| 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
private final LifecycleExtensionManager.CachedArrayList m_accessorExtensions
private final LifecycleExtensionManager.CachedArrayList m_creatorExtensions
private boolean m_readOnly
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 instancejava.lang.Exception - if an error occurs
public 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 instancejava.lang.Exception - if an error occurs
public 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 instancejava.lang.Exception - if an error occurs
public 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 instancejava.lang.Exception - if an error occurspublic void addAccessorExtension(Accessor extension)
extension - a Accessor instancepublic void addCreatorExtension(Creator extension)
extension - a Creator instance
public void insertAccessorExtension(int position,
Accessor extension)
position - an int index valueextension - a Accessor instance
public void insertCreatorExtension(int position,
Creator extension)
position - an int index valueextension - a Creator instancepublic Accessor removeAccessorExtension(int position)
position - an int index valueAccessor instancepublic Creator removeCreatorExtension(int position)
position - an int index valueCreator 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 valueAccessor instancepublic Creator getCreatorExtension(int index)
index - an int index valueCreator 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 tojava.lang.Exception - if an error occurs
protected final void checkWriteable()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if context is read only
|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||