@Override
public void start(StartContext context) throws StartException {
super.start(context);
// setup the connection provider factory for remote:// scheme, for the endpoint
final Endpoint endpoint = this.endpointInjectedValue.getValue();
// first check if the URI scheme is already registered. If it is, then *don't* re-register
// Note: The isValidUriScheme method name is a bit misleading. All it does is a check for already
// registered connection providers for that URI scheme
if (!endpoint.isValidUriScheme(REMOTE_URI_SCHEME)) {
try {
// TODO: Allow a way to pass the options
endpoint.addConnectionProvider(REMOTE_URI_SCHEME, new RemoteConnectionProviderFactory(), OptionMap.EMPTY);
} catch (IOException ioe) {
throw new StartException("Could not register a connection provider factory for " + REMOTE_URI_SCHEME + " uri scheme", ioe);
}
}
}