1 16 17 package tutorial; 18 19 import java.io.File ; 20 21 import org.apache.avalon.framework.logger.Logger; 22 import org.apache.avalon.framework.context.Contextualizable; 23 import org.apache.avalon.framework.context.Context; 24 import org.apache.avalon.framework.context.ContextException; 25 26 32 public class DefaultGizmo implements Gizmo, Contextualizable 33 { 34 38 41 private final Logger m_logger; 42 43 47 51 public DefaultGizmo( Logger logger ) 52 { 53 m_logger = logger; 54 m_logger.info( "I've been created" ); 55 } 56 57 61 66 public void contextualize( Context context ) throws ContextException 67 { 68 File home = (File ) context.get( "urn:avalon:home" ); 69 m_logger.info( "home: " + home ); 70 } 71 72 76 public String toString() 77 { 78 return "[gizmo:" + System.identityHashCode( this ) + "]"; 79 } 80 } 81 | Popular Tags |