* @throws JBIException if the service cannot be resolved
*/
protected ServiceEndpoint chooseEndpoint(QName serviceName) throws JBIException {
ServiceEndpoint[] endpoints = getContext().getEndpointsForService(serviceName);
if (endpoints == null || endpoints.length == 0) {
throw new NoServiceAvailableException(serviceName);
}
// TODO how should we choose?
return endpoints[0];
}