protected void parse(String address) throws ProviderException { if (address == null) { throw new ProviderException("Null address."); } if (!address.startsWith("ncacn_ip_tcp:")) { throw new ProviderException("Not an ncacn_ip_tcp address."); } address = address.substring(13); int index = address.indexOf('['); if (index == -1) { throw new ProviderException("No port specifier present."); } String server = address.substring(0, index); address = address.substring(index + 1); index = address.indexOf(']'); if (index == -1) { throw new ProviderException("Port specifier not terminated."); } address = address.substring(0, index); if ("".equals(server)) server = LOCALHOST; try { port = Integer.parseInt(address); } catch (Exception ex) { throw new ProviderException("Invalid port specifier."); } host = server; }
protected void parse(String address) throws ProviderException { if (address == null) { throw new ProviderException("Null address."); } if (!address.startsWith("ncacn_ip_tcp:")) { throw new ProviderException("Not an ncacn_ip_tcp address."); } address = address.substring(13); int index = address.indexOf('['); if (index == -1) { throw new ProviderException("No port specifier present."); } String server = address.substring(0, index); address = address.substring(index + 1); index = address.indexOf(']'); if (index == -1) { throw new ProviderException("Port specifier not terminated."); } address = address.substring(0, index); if ("".equals(server)) server = LOCALHOST; try { port = Integer.parseInt(address); } catch (Exception ex) { throw new ProviderException("Invalid port specifier."); } host = server; }
throw new ProviderException ( "Null address." ); throw new ProviderException ( "Not an ncacn_ip_tcp address." ); if ( index == -1 ) throw new ProviderException ( "No port specifier present." ); if ( index == -1 ) throw new ProviderException ( "Port specifier not terminated." ); throw new ProviderException ( "Invalid port specifier." );
protected ConnectionContext createContext() throws ProviderException { Properties properties = getTransport().getProperties(); if (properties == null) return new BasicConnectionContext(); String context = properties.getProperty(CONNECTION_CONTEXT); if (context == null) return new BasicConnectionContext(); try { return (ConnectionContext) Class.forName(context).newInstance(); } catch (Exception ex) { throw new ProviderException(ex.getMessage()); } }
protected ConnectionContext createContext() throws ProviderException { Properties properties = getTransport().getProperties(); if (properties == null) return new BasicConnectionContext(); String context = properties.getProperty(CONNECTION_CONTEXT); if (context == null) return new BasicConnectionContext(); try { return (ConnectionContext) Class.forName(context).newInstance(); } catch (Exception ex) { throw new ProviderException(ex.getMessage()); } }
protected void parse(String address) throws ProviderException { if (address == null) { throw new ProviderException("Null address."); throw new ProviderException("Not an ncacn_np address."); throw new ProviderException("No port specifier present."); index = address.indexOf(']'); if (index == -1) { throw new ProviderException("Port specifier not terminated."); throw new ProviderException("Not a named pipe address."); if ("".equals(address)) throw new ProviderException("Empty port."); while (server.startsWith("\\")) server = server.substring(1); if ("".equals(server)) server = LOCALHOST;
protected void parse(String address) throws ProviderException { if (address == null) { throw new ProviderException("Null address."); throw new ProviderException("Not an ncacn_np address."); throw new ProviderException("No port specifier present."); index = address.indexOf(']'); if (index == -1) { throw new ProviderException("Port specifier not terminated."); throw new ProviderException("Not a named pipe address."); if ("".equals(address)) throw new ProviderException("Empty port."); while (server.startsWith("\\")) server = server.substring(1); if ("".equals(server)) server = LOCALHOST;
throw new ProviderException ( "Null address." ); throw new ProviderException ( "Not an ncacn_np address." ); if ( index == -1 ) throw new ProviderException ( "No port specifier present." ); if ( index == -1 ) throw new ProviderException ( "Port specifier not terminated." ); if ( !address.regionMatches ( true, 0, "PIPE", 0, 4 ) ) throw new ProviderException ( "Not a named pipe address." ); address = address.substring ( 1 ); if ( "".equals ( address ) ) throw new ProviderException ( "Empty port." ); while ( server.startsWith ( "\\" ) ) server = server.substring ( 1 );
protected ConnectionContext createContext () throws ProviderException { Properties properties = getTransport ().getProperties (); if ( properties == null ) return new BasicConnectionContext (); String context = properties.getProperty ( CONNECTION_CONTEXT ); if ( context == null ) return new BasicConnectionContext (); try { return (ConnectionContext)Class.forName ( context ).newInstance (); } catch ( Exception ex ) { throw new ProviderException ( ex.getMessage () ); } }