1 17 18 package org.apache.geronimo.spring; 19 20 import org.apache.commons.logging.Log; 21 import org.apache.commons.logging.LogFactory; 22 import org.apache.geronimo.gbean.GBeanInfo; 23 import org.apache.geronimo.gbean.GBeanInfoBuilder; 24 import org.apache.geronimo.gbean.GBeanLifecycle; 25 import org.apache.geronimo.kernel.Kernel; 26 27 32 public class POJOGBean 33 implements GBeanLifecycle 34 { 35 protected static final Log _log = LogFactory.getLog(POJOGBean.class); 36 37 protected final Kernel _kernel; 39 protected final String _objectName; 40 protected final Object _peer; 41 42 public static final GBeanInfo GBEAN_INFO; 44 45 static 46 { 47 GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder("Spring Managed POJO", POJOGBean.class); 48 49 infoBuilder.addAttribute("kernel" , Kernel.class , false); 50 infoBuilder.addAttribute("objectName" , String .class , false); 51 infoBuilder.addAttribute("peer" , Object .class , true); 52 53 infoBuilder.setConstructor(new String []{ 54 "kernel", 55 "objectName", 56 "peer" 57 }); 58 59 GBEAN_INFO = infoBuilder.getBeanInfo(); 60 } 61 62 public static GBeanInfo getGBeanInfo() {return GBEAN_INFO;} 63 64 66 public 67 POJOGBean(Kernel kernel, String objectName, Object peer) 68 { 69 _kernel =kernel; 70 _objectName=objectName; 71 _peer =peer; 72 } 73 74 78 public void doStart() throws Exception {} 79 public void doStop() throws Exception {} 80 public void doFail() {} 81 } 82 | Popular Tags |