1 17 package org.apache.servicemix.geronimo; 18 19 import org.apache.commons.logging.Log; 20 import org.apache.commons.logging.LogFactory; 21 import org.apache.geronimo.gbean.GBeanInfo; 22 import org.apache.geronimo.gbean.GBeanInfoBuilder; 23 import org.apache.geronimo.gbean.GBeanLifecycle; 24 25 public class SharedLibrary implements GBeanLifecycle { 26 27 private static final Log log = LogFactory.getLog(SharedLibrary.class); 28 29 private String name; 30 private String description; 31 private Container container; 32 33 public SharedLibrary(String name, String description, Container container) { 34 this.name = name; 35 this.description = description; 36 this.container = container; 37 } 38 39 public String getName() { 40 return this.name; 41 } 42 43 public void doStart() throws Exception { 44 log.info("doStart called for JBI service assembly: " + name); 45 } 46 47 public void doStop() throws Exception { 48 log.info("doStop called for JBI service assembly: " + name); 49 } 50 51 public void doFail() { 52 log.info("doFail called for JBI service assembly: " + name); 53 } 54 55 public static final GBeanInfo GBEAN_INFO; 56 57 static { 58 GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("JBISharedLibrary", SharedLibrary.class, "JBISharedLibrary"); 59 infoFactory.addAttribute("name", String .class, true); 60 infoFactory.addAttribute("description", String .class, true); 61 infoFactory.addReference("container", Container.class); 62 infoFactory.setConstructor(new String [] {"name", "description", "container"}); 63 GBEAN_INFO = infoFactory.getBeanInfo(); 64 } 65 66 public static GBeanInfo getGBeanInfo() { 67 return GBEAN_INFO; 68 } 69 70 } 71 | Popular Tags |