1 17 package org.apache.servicemix.jbi.resolver; 18 19 import org.apache.servicemix.jbi.NoServiceAvailableException; 20 21 import javax.jbi.JBIException; 22 import javax.jbi.component.ComponentContext; 23 import javax.jbi.messaging.MessageExchange; 24 import javax.jbi.servicedesc.ServiceEndpoint; 25 import javax.xml.namespace.QName ; 26 27 33 public class ExternalServiceNameEndpointResolver extends EndpointResolverSupport { 34 35 private QName serviceName; 36 37 public ExternalServiceNameEndpointResolver() { 38 } 39 40 public ExternalServiceNameEndpointResolver(QName serviceName) { 41 this.serviceName = serviceName; 42 } 43 44 public ServiceEndpoint[] resolveAvailableEndpoints(ComponentContext context, MessageExchange exchange) { 45 return context.getExternalEndpointsForService(serviceName); 46 } 47 48 public QName getServiceName() { 51 return serviceName; 52 } 53 54 public void setServiceName(QName serviceName) { 55 this.serviceName = serviceName; 56 } 57 58 protected JBIException createServiceUnavailableException() { 61 return new NoServiceAvailableException(serviceName); 62 } 63 } 64 | Popular Tags |