if (theEndpoint == null) {
// lets use the resolver on the activation spec if
// applicable
ActivationSpec activationSpec = exchange.getActivationSpec();
if (activationSpec != null) {
EndpointResolver destinationResolver = activationSpec.getDestinationResolver();
if (destinationResolver != null) {
try {
EndpointFilter filter = createEndpointFilter(context, exchange);
theEndpoint = (InternalEndpoint) destinationResolver.resolveEndpoint(context, exchange, filter);
}
catch (JBIException e) {
throw new MessagingException("Failed to resolve endpoint: " + e, e);
}
}