After playing around with the Phoenix BlockListener I decided to transfer our human interface centric block implementation to a block listener instance. The resulting code is much cleaner - however - I found some limitations with the way LifecycleHelper handles listener instances. Under the CVS LifecycleHelper implementation the only component phase handled by the helper is to configure the listener. I want my listener to be log enabled, contextualized, configured, and initalized. So, I have updated LifecycleHelper to do exactly that by changing the startupListener method. I though it would be worthwhile adding the updated version to the CVS (source attached).
The diff for the source is included below. Cheers, Steve. ------------------------------------------------------------------------- RCS file: /home/cvspublic/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/co mponents/application/LifecycleHelper.java,v retrieving revision 1.18 diff -r1.18 LifecycleHelper.java 116c116,161 < if( listener instanceof Configurable ) --- > int stage = 0; > > try > { > stage = STAGE_LOGGER; > if( listener instanceof Loggable ) > { > notice( name, stage ); > ((Loggable)listener).setLogger( m_context.getLogger( name ) ); > } > else if( listener instanceof LogEnabled ) > { > notice( name, stage ); > final Logger logger = new LogKitLogger( m_context.getLogger( name ) ); > ((LogEnabled)listener).enableLogging( logger ); > } > > //Contextualize stage > stage = STAGE_CONTEXT; > if( listener instanceof Contextualizable ) > { > notice( name, stage ); > final BlockContext context = createBlockContext( name ); > ((Contextualizable)listener).contextualize( context ); > } > > stage = STAGE_CONFIG; > if( listener instanceof Configurable ) > { > notice( name, stage ); > final Configuration configuration = getConfiguration( name, TYPE_LISTENER ); > ((Configurable)listener).configure( configuration ); > } > > //Initialize stage > stage = STAGE_INIT; > if( listener instanceof Initializable ) > { > notice( name, stage ); > ((Initializable)listener).initialize(); > } > > m_listenerSupport.addBlockListener( listener ); > > } > catch( final Throwable t ) 118,119c163 < final Configuration configuration = getConfiguration( name, TYPE_LISTENER ); < ((Configurable)listener).configure( configuration ); --- > fail( name, stage, t ); 122d165 < m_listenerSupport.addBlockListener( listener );
LifecycleHelper.java
Description: Binary data
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>