} else {
principal = src.getOriginalRequest().getUserPrincipal();
}
final InstanceHandle<Endpoint> endpointInstance;
if(config.getAnnotatedEndpointFactory() != null) {
final AnnotatedEndpoint annotated = config.getAnnotatedEndpointFactory().createInstance(instance);
endpointInstance = new InstanceHandle<Endpoint>() {
@Override
public Endpoint getInstance() {
return annotated;
}