1 22 package org.jboss.kernel.plugins.dependency; 23 24 import java.util.List ; 25 26 import org.jboss.beans.metadata.spi.BeanMetaData; 27 import org.jboss.beans.metadata.spi.LifecycleMetaData; 28 import org.jboss.beans.metadata.spi.ParameterMetaData; 29 import org.jboss.beans.metadata.spi.annotations.StartLifecycle; 30 import org.jboss.beans.metadata.spi.annotations.StopLifecycle; 31 32 38 public class StartStopLifecycleAction extends LifecycleAction 39 { 40 public String getInstallMethod(BeanMetaData beanMetaData) 41 { 42 LifecycleMetaData lifecycle = beanMetaData.getStart(); 43 if (lifecycle != null) 44 return lifecycle.getMethodName(); 45 return null; 46 } 47 48 public String getDefaultInstallMethod() 49 { 50 return "start"; 51 } 52 53 public String getInstallAnnotation() 54 { 55 return StartLifecycle.class.getName(); 56 } 57 58 public List <ParameterMetaData> getInstallParameters(BeanMetaData beanMetaData) 59 { 60 LifecycleMetaData lifecycle = beanMetaData.getStart(); 61 if (lifecycle != null) 62 return lifecycle.getParameters(); 63 return null; 64 } 65 66 public String getUninstallMethod(BeanMetaData beanMetaData) 67 { 68 LifecycleMetaData lifecycle = beanMetaData.getStop(); 69 if (lifecycle != null) 70 return lifecycle.getMethodName(); 71 return null; 72 } 73 74 public String getDefaultUninstallMethod() 75 { 76 return "stop"; 77 } 78 79 public String getUninstallAnnotation() 80 { 81 return StopLifecycle.class.getName(); 82 } 83 84 public List <ParameterMetaData> getUninstallParameters(BeanMetaData beanMetaData) 85 { 86 LifecycleMetaData lifecycle = beanMetaData.getStop(); 87 if (lifecycle != null) 88 return lifecycle.getParameters(); 89 return null; 90 } 91 } | Popular Tags |