1 package org.apache.fulcrum.yaafi; 2 3 56 57 import java.io.File ; 58 59 import org.apache.avalon.framework.logger.AbstractLogEnabled; 60 import org.apache.avalon.framework.parameters.ParameterException; 61 import org.apache.avalon.framework.parameters.Parameterizable; 62 import org.apache.avalon.framework.parameters.Parameters; 63 import org.apache.avalon.framework.activity.Initializable; 64 import org.apache.avalon.framework.activity.Disposable; 65 import org.apache.avalon.framework.configuration.Configurable; 66 import org.apache.avalon.framework.configuration.Configuration; 67 import org.apache.avalon.framework.configuration.ConfigurationException; 68 import org.apache.avalon.framework.context.Contextualizable; 69 import org.apache.avalon.framework.context.Context; 70 import org.apache.avalon.framework.context.ContextException; 71 72 78 public class TestComponentImpl 79 extends AbstractLogEnabled 80 implements Initializable, Configurable, Parameterizable, Disposable, TestComponent, Contextualizable 81 { 82 public File appRoot; 83 public String foo; 84 public String bar; 85 86 public void initialize() throws Exception 87 { 88 getLogger().debug("initialize() was called"); 89 } 90 91 public void contextualize(Context context) throws ContextException 92 { 93 appRoot = (File ) context.get( "urn:avalon:home" ); 94 } 95 96 public void configure(Configuration configuration) throws ConfigurationException 97 { 98 this.foo = configuration.getChild("FOO").getValue("FOO Not Found?!"); 99 } 100 101 public void parameterize(Parameters parameters) throws ParameterException 102 { 103 this.bar = parameters.getParameter("BAR", "BAR Not Found?!"); 104 } 105 106 public void dispose() 107 { 108 getLogger().debug("dispose() was called"); 109 } 110 111 public void test() 112 { 113 setupLogger(this, "TestComponent"); 114 getLogger().debug("TestComponent.test() was called"); 115 getLogger().debug("componentAppRoot = " + appRoot.getAbsolutePath()); 116 getLogger().debug("foo = " + this.foo ); 117 getLogger().debug("bar = " + this.bar ); 118 } 119 } 120 | Popular Tags |