1 17 package org.apache.servicemix.jbi.installation; 18 19 import javax.jbi.JBIException; 20 import javax.jbi.component.Component; 21 import javax.jbi.component.ComponentContext; 22 import javax.jbi.component.ComponentLifeCycle; 23 import javax.jbi.component.ServiceUnitManager; 24 import javax.jbi.management.DeploymentException; 25 import javax.jbi.messaging.MessageExchange; 26 import javax.jbi.servicedesc.ServiceEndpoint; 27 import javax.management.ObjectName ; 28 29 import org.w3c.dom.Document ; 30 import org.w3c.dom.DocumentFragment ; 31 32 public class DummyComponent implements Component, ComponentLifeCycle, ServiceUnitManager { 33 34 private String result; 35 private boolean exception; 36 37 public DummyComponent() { 38 } 39 40 public ComponentLifeCycle getLifeCycle() { 41 return this; 42 } 43 44 public ServiceUnitManager getServiceUnitManager() { 45 return this; 46 } 47 48 public Document getServiceDescription(ServiceEndpoint endpoint) { 49 return null; 50 } 51 52 public boolean isExchangeWithConsumerOkay(ServiceEndpoint endpoint, MessageExchange exchange) { 53 return false; 54 } 55 56 public boolean isExchangeWithProviderOkay(ServiceEndpoint endpoint, MessageExchange exchange) { 57 return false; 58 } 59 60 public ServiceEndpoint resolveEndpointReference(DocumentFragment epr) { 61 return null; 62 } 63 64 public ObjectName getExtensionMBeanName() { 65 return null; 66 } 67 68 public void init(ComponentContext context) throws JBIException { 69 } 70 71 public void shutDown() throws JBIException { 72 } 73 74 public void start() throws JBIException { 75 } 76 77 public void stop() throws JBIException { 78 } 79 80 public String deploy(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException { 81 if (exception) { 82 throw new DeploymentException(result); 83 } 84 return result; 85 } 86 87 public void init(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException { 88 } 89 90 public void start(String serviceUnitName) throws DeploymentException { 91 } 92 93 public void stop(String serviceUnitName) throws DeploymentException { 94 } 95 96 public void shutDown(String serviceUnitName) throws DeploymentException { 97 } 98 99 public String undeploy(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException { 100 if (exception) { 101 throw new DeploymentException(result); 102 } 103 return result; 104 } 105 106 public String getResult() { 107 return result; 108 } 109 110 public void setResult(String result) { 111 this.result = result; 112 } 113 114 public boolean isException() { 115 return exception; 116 } 117 118 public void setException(boolean exception) { 119 this.exception = exception; 120 } 121 122 } 123 | Popular Tags |