public <T> T getConnectionProviderInterface(final String uriScheme, final Class<T> expectedType) throws UnknownURISchemeException, ClassCastException { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(RemotingPermission.GET_CONNECTION_PROVIDER_INTERFACE); } if (! expectedType.isInterface()) { throw new IllegalArgumentException("Interface expected"); } final ProtocolRegistration protocolRegistration = connectionProviders.get(uriScheme); if (protocolRegistration == null) { throw new UnknownURISchemeException("No connection provider for URI scheme \"" + uriScheme + "\" is installed"); } return expectedType.cast(protocolRegistration.getProvider().getProviderInterface()); }
final ProtocolRegistration protocolRegistration = connectionProviders.get(scheme); if (protocolRegistration == null) { return new FailedIoFuture<>(new UnknownURISchemeException("No connection provider for URI scheme \"" + scheme + "\" is installed"));
public <T> T getConnectionProviderInterface(final String uriScheme, final Class<T> expectedType) throws UnknownURISchemeException, ClassCastException { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(GET_CONNECTION_PROVIDER_INTERFACE_PERM); } if (! expectedType.isInterface()) { throw new IllegalArgumentException("Interface expected"); } final ConnectionProvider provider = connectionProviders.get(uriScheme); if (provider == null) { throw new UnknownURISchemeException("No connection provider for URI scheme \"" + uriScheme + "\" is installed"); } return expectedType.cast(provider.getProviderInterface()); }
public <T> T getConnectionProviderInterface(final String uriScheme, final Class<T> expectedType) throws UnknownURISchemeException, ClassCastException { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(RemotingPermission.GET_CONNECTION_PROVIDER_INTERFACE); } if (! expectedType.isInterface()) { throw new IllegalArgumentException("Interface expected"); } final ProtocolRegistration protocolRegistration = connectionProviders.get(uriScheme); if (protocolRegistration == null) { throw new UnknownURISchemeException("No connection provider for URI scheme \"" + uriScheme + "\" is installed"); } return expectedType.cast(protocolRegistration.getProvider().getProviderInterface()); }
final ConnectionProvider connectionProvider = connectionProviders.get(scheme); if (connectionProvider == null) { throw new UnknownURISchemeException("No connection provider for URI scheme \"" + scheme + "\" is installed");
final ProtocolRegistration protocolRegistration = connectionProviders.get(scheme); if (protocolRegistration == null) { return new FailedIoFuture<>(new UnknownURISchemeException("No connection provider for URI scheme \"" + scheme + "\" is installed"));