src/main/java/uk/bl/wa/whois/JRubyWhois.java
public WhoisResult lookup(String domain, int timeout) {
        container.put("domain", domain);
        container.put("timeout_param", timeout);
        try {
            return (WhoisResult) container.runScriptlet(
                    JRubyWhois.class.getResourceAsStream("jruby-whois.rb"),
                    "jruby-whois.rb");
        } catch (EvalFailedException e) {
            if (e.getMessage().startsWith("(ServerNotFound)")) {
                throw new ServerNotFoundException(e);
            }
            if (e.getMessage().startsWith("(WebInterfaceError")) {
                throw new WebInterfaceErrorException(e);
            }
            throw e;
        }
    }
public WhoisResult lookup(String domain, int timeout) {
        container.put("domain", domain);
        container.put("timeout_param", timeout);
        try {
            return (WhoisResult) container.runScriptlet(
                    JRubyWhois.class.getResourceAsStream("jruby-whois.rb"),
                    "jruby-whois.rb");
        } catch (EvalFailedException e) {
            if (e.getMessage().startsWith("(ServerNotFound)")) {
                throw new ServerNotFoundException(e);
            }
            if (e.getMessage().startsWith("(WebInterfaceError")) {
                throw new WebInterfaceErrorException(e);
            }
            throw e;
        }
    }
public WhoisResult lookup ( String domain , int timeout ) { container . put ( "domain" , domain ) ; container . put ( "timeout_param" , timeout ) ; try { return ( WhoisResult ) container . runScriptlet ( JRubyWhois . class . getResourceAsStream ( "jruby-whois.rb" ) , "jruby-whois.rb" ) ; } catch ( EvalFailedException e ) { if ( e . getMessage ( ) . startsWith ( "(ServerNotFound)" ) ) { throw new ServerNotFoundException ( e ) ; } if ( e . getMessage ( ) . startsWith ( "(WebInterfaceError" ) ) { throw new WebInterfaceErrorException ( e ) ; } throw e ; } }
Uses the Ruby Whois gem to perform a whois lookup

@param domain
domain name to lookup
@param timeout
timeout in seconds
@return
Uses the Ruby Whois gem to perform a whois lookup