1 17 18 package tutorial.location; 19 20 import java.io.File ; 21 22 import org.apache.avalon.framework.logger.AbstractLogEnabled; 23 import org.apache.avalon.framework.configuration.Configurable; 24 import org.apache.avalon.framework.configuration.Configuration; 25 import org.apache.avalon.framework.configuration.ConfigurationException; 26 import org.apache.avalon.framework.activity.Disposable; 27 28 35 public class LocationComponent extends AbstractLogEnabled implements 36 Configurable, Disposable, LocationService 37 { 38 private String m_location = "unknown"; 39 40 48 public void configure( Configuration config ) throws 49 ConfigurationException 50 { 51 m_location = config.getChild( "source" ).getValue( "unknown" ); 52 getLogger().info( "location: " + m_location ); 53 } 54 55 59 public String getLocation() 60 { 61 return m_location; 62 } 63 64 public void dispose() 65 { 66 getLogger().info( "disposal" ); 67 } 68 } 69 70 | Popular Tags |