if (configuration.getEndpoint() != null) {
endpoint = configuration.getEndpoint();
return new ProtocolChannelClient<T>(false, endpoint, null, configuration.getUri(), configuration.getChannelFactory());
} else {
endpoint = Remoting.createEndpoint(configuration.getEndpointName(), configuration.getOptionMap());
Registration providerRegistration = endpoint.addConnectionProvider(configuration.getUri().getScheme(), new RemoteConnectionProviderFactory(), OptionMap.create(Options.SSL_ENABLED, Boolean.FALSE));
return new ProtocolChannelClient<T>(true, endpoint, providerRegistration, configuration.getUri(), configuration.getChannelFactory());
}
}