1 16 17 package tutorial; 18 19 import org.apache.avalon.framework.logger.Logger; 20 import org.apache.avalon.framework.configuration.Configurable; 21 import org.apache.avalon.framework.configuration.Configuration; 22 import org.apache.avalon.framework.configuration.ConfigurationException; 23 import org.apache.avalon.framework.activity.Disposable; 24 25 31 public class DefaultWidget implements Widget, Configurable, Disposable 32 { 33 37 40 private final Logger m_logger; 41 42 46 50 public DefaultWidget( Logger logger ) 51 { 52 m_logger = logger; 53 m_logger.info( "hello" ); 54 } 55 56 60 64 public void configure( Configuration config ) throws ConfigurationException 65 { 66 final String message = config.getChild( "message" ).getValue( null ); 67 if( null != message ) 68 { 69 m_logger.info( message ); 70 } 71 } 72 73 77 80 public void dispose() 81 { 82 m_logger.info( "time to die" ); 83 } 84 85 89 public String toString() 90 { 91 return "[widget:" + System.identityHashCode( this ) + "]"; 92 } 93 } 94 95 | Popular Tags |