1 22 package org.objectweb.petals.jbi.component.lifecycle.mock; 23 24 import javax.jbi.JBIException; 25 import javax.jbi.component.ComponentContext; 26 import javax.jbi.component.ComponentLifeCycle; 27 import javax.management.ObjectName ; 28 29 import org.objectweb.petals.tools.jbicommon.descriptor.Identification; 30 import org.objectweb.petals.tools.jbicommon.descriptor.ServiceUnit; 31 32 37 public class ServiceUnitMock extends ServiceUnit implements ComponentLifeCycle { 38 39 private String state = "Shutdown"; 40 41 private String targetArtifactsZip; 42 43 public String getTargetArtifactsZip() { 44 return targetArtifactsZip; 45 } 46 47 public void setTargetArtifactsZip(String targetArtifactsZip) { 48 this.targetArtifactsZip = targetArtifactsZip; 49 } 50 51 public ServiceUnitMock() { 52 super(); 53 } 54 55 private Identification identification; 56 57 private String targetComponentName; 58 59 public void setIdentification(Identification identification) { 60 this.identification = identification; 61 } 62 63 public void setTargetComponentName(String targetComponentName) { 64 this.targetComponentName = targetComponentName; 65 } 66 67 public ObjectName getExtensionMBeanName() { 68 return null; 69 } 70 71 public void init(ComponentContext context) throws JBIException { 72 } 73 74 public void shutDown() throws JBIException { 75 state = "Shutdown"; 76 } 77 78 public void start() throws JBIException { 79 state = "Started"; 80 } 81 82 public void stop() throws JBIException { 83 state = "Stopped"; 84 } 85 86 public String getState() { 87 return state; 88 } 89 90 public Identification getIdentification() { 91 return identification; 92 } 93 94 public String getTargetComponentName() { 95 return targetComponentName; 96 } 97 98 public void setState(String state) { 99 this.state = state; 100 } 101 102 } 103 | Popular Tags |