You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by do...@apache.org on 2002/05/19 04:09:05 UTC
cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/lifecycle LifecycleHelper.java
donaldp 02/05/18 19:09:05
Modified: src/java/org/apache/avalon/phoenix/components/lifecycle
LifecycleHelper.java
Log:
Support shutdown phase in helper.
Revision Changes Path
1.2 +27 -0 jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/lifecycle/LifecycleHelper.java
Index: LifecycleHelper.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/lifecycle/LifecycleHelper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LifecycleHelper.java 19 May 2002 02:06:21 -0000 1.1
+++ LifecycleHelper.java 19 May 2002 02:09:05 -0000 1.2
@@ -220,6 +220,33 @@
}
/**
+ * Method to run a <code>Block</code> through it's shutdown phase.
+ * Errors that occur during shutdown will be logged appropraitely.
+ *
+ * @param entry the entry containing Block
+ */
+ public void shutdown( final ComponentEntry entry )
+ {
+ final Object block = entry.getObject();
+
+ //Invalidate entry. This will invalidate
+ //and null out Proxy object aswell as nulling out
+ //block property
+ entry.invalidate();
+
+ //Stoppable stage
+ try
+ {
+ ContainerUtil.shutdown( block );
+ }
+ finally
+ {
+ entry.setObject( null );
+ entry.setState( State.DESTROYED );
+ }
+ }
+
+ /**
* Utility method to report that a lifecycle stage is about to be processed.
*
* @param name the name of block that caused failure
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>