org.gloin.resource.protocol.jrap
Class Handler

java.lang.Object
  |
  +--java.net.URLStreamHandler
        |
        +--org.gloin.resource.protocol.jrap.Handler

public class Handler
extends java.net.URLStreamHandler

URL stream handler specialized to handle the JRAP url protocol. Creates and caches references to JrapURLConnections. openConnection returns references to JrapURLConnections. Provides a utility method, install, to programmatically install the jrap protocol handler into VMs which need to use JRAP urls.


Constructor Summary
Handler()
           
 
Method Summary
protected  int getDefaultPort()
           
static void install()
          Simple utility method to install this protocol handler so that a given VM can make use of JRAP urls.
protected  java.net.URLConnection openConnection(java.net.URL u)
           
protected  void parseURL(java.net.URL url, java.lang.String spec, int start, int limit)
           
protected  boolean sameFile(java.net.URL u1, java.net.URL u2)
           
protected  java.lang.String toExternalForm(java.net.URL url)
          String form of supplied URL.
 
Methods inherited from class java.net.URLStreamHandler
equals, getHostAddress, hashCode, hostsEqual, setURL, setURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Handler

public Handler()
Method Detail

toExternalForm

protected java.lang.String toExternalForm(java.net.URL url)
String form of supplied URL. Simply creates a JrapURLParser and delegates to the toString() method of that object.
Overrides:
toExternalForm in class java.net.URLStreamHandler
Parameters:
url - the url for which an external form should be returned
Returns:
the string form of the given url.

openConnection

protected java.net.URLConnection openConnection(java.net.URL u)
                                         throws java.io.IOException
Overrides:
openConnection in class java.net.URLStreamHandler

parseURL

protected void parseURL(java.net.URL url,
                        java.lang.String spec,
                        int start,
                        int limit)
Overrides:
parseURL in class java.net.URLStreamHandler

sameFile

protected boolean sameFile(java.net.URL u1,
                           java.net.URL u2)
Overrides:
sameFile in class java.net.URLStreamHandler

getDefaultPort

protected int getDefaultPort()
Overrides:
getDefaultPort in class java.net.URLStreamHandler

install

public static void install()
Simple utility method to install this protocol handler so that a given VM can make use of JRAP urls. The protocol handler must be installed before any JRAP urls can be accessed.