1 64 package com.jcorporate.expresso.kernel.test; 65 66 import com.jcorporate.expresso.kernel.ComponentBase; 67 import com.jcorporate.expresso.kernel.ComponentLifecycle; 68 import com.jcorporate.expresso.kernel.Configuration; 69 import com.jcorporate.expresso.kernel.exception.ConfigurationException; 70 import org.apache.log4j.Logger; 71 72 import java.net.URL ; 73 74 80 81 public class TestComponent extends ComponentBase implements ComponentLifecycle { 82 Logger log = Logger.getLogger(TestComponent.class); 83 84 String property1 = null; 85 Boolean property2 = null; 86 87 public TestComponent() { 88 } 89 90 public URL getMetadataLocation() { 91 return this.getClass().getResource("TestComponentMetadata.xml"); 92 } 93 94 public void initialize() { 95 log.info("Received Initialize Event"); 96 } 97 98 public void configure(Configuration newConfig) throws ConfigurationException { 99 log.info("Received Configure Event"); 100 } 101 102 public void reconfigure(Configuration newConfig) throws ConfigurationException { 103 log.info("Received Reconfigure Event"); 104 property1 = (String ) newConfig.get("property1"); 105 property2 = (Boolean ) newConfig.get("property2"); 106 } 107 108 public void destroy() { 109 log.info("Received Destroy Event"); 110 } 111 112 public void doSomething(String param1, Class param2) { 113 log.info("doSomething command invoked."); 114 } 115 116 public String getProperty1() { 117 return property1; 118 } 119 120 public Boolean getProperty2() { 121 return property2; 122 } 123 124 public void setProperty1(String property1) { 125 this.property1 = property1; 126 } 127 128 public void setProperty2(Boolean property2) { 129 this.property2 = property2; 130 } 131 } | Popular Tags |