org.ow2.jonas.web.tomcat6.handler
Class DirContextURLStreamHandlerService

java.lang.Object
  extended by java.net.URLStreamHandler
      extended by org.apache.naming.resources.DirContextURLStreamHandler
          extended by org.ow2.jonas.web.tomcat6.handler.DirContextURLStreamHandlerService
All Implemented Interfaces:
org.osgi.service.url.URLStreamHandlerService

public class DirContextURLStreamHandlerService
extends org.apache.naming.resources.DirContextURLStreamHandler
implements org.osgi.service.url.URLStreamHandlerService

The DirContextURLStreamHandlerService is a wrapper around the Tomcat's DirContextURLStreamHandler that is responsible of loading URL of the scheme 'jndi' (jndi://...). This class is exposed as a URLStreamHandlerService (OSGi URL service interface).

Author:
Guillaume Sauthier

Field Summary
protected  org.osgi.service.url.URLStreamHandlerSetter realHandler
          The URLStreamHandlerSetter object passed to the parseURL method.
 
Fields inherited from class org.apache.naming.resources.DirContextURLStreamHandler
context
 
Constructor Summary
DirContextURLStreamHandlerService()
           
 
Method Summary
 boolean equals(URL url, URL url1)
           
 int getDefaultPort()
           
 InetAddress getHostAddress(URL url)
           
 int hashCode(URL url)
           
 boolean hostsEqual(URL url, URL url1)
           
 URLConnection openConnection(URL url)
           
 void parseURL(org.osgi.service.url.URLStreamHandlerSetter realHandler, URL url, String spec, int start, int limit)
           
 boolean sameFile(URL url, URL url1)
           
protected  void setURL(URL u, String proto, String host, int port, String file, String ref)
          Deprecated. This method is only for compatibility with handlers written for JDK 1.1.
protected  void setURL(URL u, String proto, String host, int port, String auth, String user, String path, String query, String ref)
          This method calls realHandler.setURL(URL,String,String,int,String,String,String,String).
 String toExternalForm(URL url)
           
 
Methods inherited from class org.apache.naming.resources.DirContextURLStreamHandler
bind, bind, bindThread, get, get, get, isBound, setProtocolHandler, unbind, unbind, unbindThread
 
Methods inherited from class java.net.URLStreamHandler
openConnection, parseURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

realHandler

protected volatile org.osgi.service.url.URLStreamHandlerSetter realHandler
The URLStreamHandlerSetter object passed to the parseURL method.

Constructor Detail

DirContextURLStreamHandlerService

public DirContextURLStreamHandlerService()
Method Detail

openConnection

public URLConnection openConnection(URL url)
                             throws IOException
Specified by:
openConnection in interface org.osgi.service.url.URLStreamHandlerService
Overrides:
openConnection in class org.apache.naming.resources.DirContextURLStreamHandler
Throws:
IOException

parseURL

public void parseURL(org.osgi.service.url.URLStreamHandlerSetter realHandler,
                     URL url,
                     String spec,
                     int start,
                     int limit)
Specified by:
parseURL in interface org.osgi.service.url.URLStreamHandlerService

toExternalForm

public String toExternalForm(URL url)
Specified by:
toExternalForm in interface org.osgi.service.url.URLStreamHandlerService
Overrides:
toExternalForm in class org.apache.naming.resources.DirContextURLStreamHandler

equals

public boolean equals(URL url,
                      URL url1)
Specified by:
equals in interface org.osgi.service.url.URLStreamHandlerService
Overrides:
equals in class URLStreamHandler

getDefaultPort

public int getDefaultPort()
Specified by:
getDefaultPort in interface org.osgi.service.url.URLStreamHandlerService
Overrides:
getDefaultPort in class URLStreamHandler

getHostAddress

public InetAddress getHostAddress(URL url)
Specified by:
getHostAddress in interface org.osgi.service.url.URLStreamHandlerService
Overrides:
getHostAddress in class URLStreamHandler

hashCode

public int hashCode(URL url)
Specified by:
hashCode in interface org.osgi.service.url.URLStreamHandlerService
Overrides:
hashCode in class URLStreamHandler

hostsEqual

public boolean hostsEqual(URL url,
                          URL url1)
Specified by:
hostsEqual in interface org.osgi.service.url.URLStreamHandlerService
Overrides:
hostsEqual in class URLStreamHandler

sameFile

public boolean sameFile(URL url,
                        URL url1)
Specified by:
sameFile in interface org.osgi.service.url.URLStreamHandlerService
Overrides:
sameFile in class URLStreamHandler

setURL

protected void setURL(URL u,
                      String proto,
                      String host,
                      int port,
                      String file,
                      String ref)
Deprecated. This method is only for compatibility with handlers written for JDK 1.1.

This method calls realHandler.setURL(URL,String,String,int,String,String).

Overrides:
setURL in class URLStreamHandler
See Also:
"java.net.URLStreamHandler.setURL(URL,String,String,int,String,String)"

setURL

protected void setURL(URL u,
                      String proto,
                      String host,
                      int port,
                      String auth,
                      String user,
                      String path,
                      String query,
                      String ref)
This method calls realHandler.setURL(URL,String,String,int,String,String,String,String).

Overrides:
setURL in class URLStreamHandler
See Also:
"java.net.URLStreamHandler.setURL(URL,String,String,int,String,String,String,String)"


Copyright © 2010 OW2 Consortium. All Rights Reserved.