1 17 18 package tutorial; 19 20 import org.apache.avalon.composition.model.LifecycleCreateExtension; 21 import org.apache.avalon.composition.model.ComponentModel; 22 23 import org.apache.avalon.framework.activity.Disposable; 24 import org.apache.avalon.framework.activity.Initializable; 25 import org.apache.avalon.framework.context.Context; 26 import org.apache.avalon.framework.logger.AbstractLogEnabled; 27 28 import org.apache.avalon.meta.info.StageDescriptor; 29 30 38 public class DemonstratableProvider extends AbstractLogEnabled 39 implements LifecycleCreateExtension 40 { 41 42 46 53 public void create( ComponentModel model, StageDescriptor stage, Object object ) 54 throws Exception 55 { 56 getLogger().info( "invoking create on target: " + model ); 57 if( object instanceof Demonstratable ) 58 { 59 ((Demonstratable)object).demo( "creator id: " + System.identityHashCode( this ) ); 60 } 61 } 62 } 63 | Popular Tags |