1 22 package org.objectweb.petals.jbi.routing.mock; 23 24 import javax.jbi.JBIException; 25 import javax.jbi.messaging.MessageExchange; 26 import javax.jbi.servicedesc.ServiceEndpoint; 27 import javax.xml.namespace.QName ; 28 29 import org.objectweb.fractal.api.NoSuchInterfaceException; 30 import org.objectweb.fractal.api.control.IllegalBindingException; 31 import org.objectweb.fractal.api.control.IllegalLifeCycleException; 32 import org.objectweb.petals.jbi.management.service.EndpointService; 33 import org.objectweb.petals.jbi.registry.AbstractEndpoint; 34 import org.objectweb.petals.jbi.registry.ConsumerEndpoint; 35 import org.objectweb.petals.jbi.registry.InternalEndpoint; 36 import org.w3c.dom.Document ; 37 38 43 public class MockEndpointService implements EndpointService { 44 45 public QName [] getInterfacesForEndpoint(AbstractEndpoint endpoint) { 46 return null; 47 } 48 49 public InternalEndpoint activateEndpoint(QName serviceName, 50 String endpointName, ConsumerEndpoint address) throws JBIException { 51 return null; 52 } 53 54 public void deactivateEndpoint(ServiceEndpoint endpoint) 55 throws JBIException { 56 } 57 58 public void deregisterInternalEndpoint(ServiceEndpoint endpoint) 59 throws JBIException { 60 } 61 62 public void deregisterExternalEndpoint(ServiceEndpoint endpoint) 63 throws JBIException { 64 } 65 66 public ServiceEndpoint getEndpoint(QName service, String name) { 67 return new InternalEndpoint(service, name, "compo", "0", this); 68 } 69 70 public Document getEndpointDescriptorForEndpoint(ServiceEndpoint endpoint) { 71 return null; 72 } 73 74 public ServiceEndpoint[] getInternalEndpointsForInterface( 75 QName interfaceName) { 76 ServiceEndpoint[] endpoints = new ServiceEndpoint[] {new InternalEndpoint( 77 new QName ("service"), "endpoint", "compo", "0", this)}; 78 return endpoints; 79 } 80 81 public ServiceEndpoint[] getInternalEndpointsForService(QName serviceName) { 82 if (serviceName.equals(new QName ("foo"))) { 83 return new ServiceEndpoint[0]; 84 } 85 return new InternalEndpoint[] { 86 new InternalEndpoint(new QName ("service"), "endpoint", "compo", 87 "0", this), 88 new InternalEndpoint(new QName ("servicename"), "endpoint1", 89 "compo", "0", this)}; 90 } 91 92 public ServiceEndpoint[] getExternalEndpointsForInterface( 93 QName interfaceName) { 94 return null; 95 } 96 97 public ServiceEndpoint[] getExternalEndpointsForService(QName serviceName) { 98 return null; 99 } 100 101 public void registerExternalEndpoint(ServiceEndpoint externalEndpoint) 102 throws JBIException { 103 } 104 105 public AbstractEndpoint getInternalEndpoint(QName service, String name) { 106 return new InternalEndpoint(service, name, "compo", "0", this); 107 } 108 109 public String getFcState() { 110 return null; 111 } 112 113 public void startFc() throws IllegalLifeCycleException { 114 } 115 116 public void stopFc() throws IllegalLifeCycleException { 117 } 118 119 public String [] listFc() { 120 return null; 121 } 122 123 public Object lookupFc(String arg0) throws NoSuchInterfaceException { 124 return null; 125 } 126 127 public void bindFc(String arg0, Object arg1) 128 throws NoSuchInterfaceException, IllegalBindingException, 129 IllegalLifeCycleException { 130 } 131 132 public void unbindFc(String arg0) throws NoSuchInterfaceException, 133 IllegalBindingException, IllegalLifeCycleException { 134 } 135 136 public void createConnection(QName consInterface, QName provService, 137 String provEndpoint) throws JBIException { 138 } 139 140 public void createConnection(QName consService, String consEndpoint, 141 QName provService, String provEndpoint) throws JBIException { 142 } 143 144 public void deleteConnection(QName consInterface, QName provService, 145 String provEndpoint) throws JBIException { 146 } 147 148 public void deleteConnection(QName consService, String consEndpoint, 149 QName provService, String provEndpoint) throws JBIException { 150 } 151 152 public boolean isExchangeWithConsumerOkayForComponent( 153 InternalEndpoint internalEndpoint, MessageExchange exchange) { 154 return true; 155 } 156 157 public boolean isExchangeWithProviderOkayForComponent( 158 InternalEndpoint internalEndpoint, MessageExchange exchange) { 159 return true; 160 } 161 162 public boolean isContainerStarted(AbstractEndpoint endpoint) { 163 return true; 164 } 165 166 public ServiceEndpoint getEndpoint(QName service, String name, boolean resolveLink) { 167 return new InternalEndpoint(service, name, "compo", "0", this); 168 } 169 170 } 171 | Popular Tags |