1 17 package org.apache.servicemix.jbi.resolver; 18 19 import org.apache.servicemix.jbi.NoInterfaceAvailableException; 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 InterfaceNameEndpointResolver extends EndpointResolverSupport { 34 35 private QName interfaceName; 36 37 public InterfaceNameEndpointResolver() { 38 } 39 40 public InterfaceNameEndpointResolver(QName interfaceName) { 41 this.interfaceName = interfaceName; 42 } 43 44 public ServiceEndpoint[] resolveAvailableEndpoints(ComponentContext context, MessageExchange exchange) { 45 return context.getEndpoints(interfaceName); 46 } 47 48 49 public QName getInterfaceName() { 52 return interfaceName; 53 } 54 55 public void setInterfaceName(QName interfaceName) { 56 this.interfaceName = interfaceName; 57 } 58 protected JBIException createServiceUnavailableException() { 59 return new NoInterfaceAvailableException(interfaceName); 60 } 61 } 62 | Popular Tags |