org.sapia.clazzy
Class ClazzyURLStreamHandlerFactory

java.lang.Object
  extended by org.sapia.clazzy.ClazzyURLStreamHandlerFactory
All Implemented Interfaces:
java.net.URLStreamHandlerFactory

public class ClazzyURLStreamHandlerFactory
extends java.lang.Object
implements java.net.URLStreamHandlerFactory

A URLStreamHandlerFactory implementation.

An instance of this class can be set on the URL class, by calling the setURLStreamHandlerFactory() static method:

 ClazzyURLStreamHandlerFactory fac = new ClazzyURLStreamHandlerFactory();
 URL.setURLStreamHandlerFactory(fac);
 

The above approach is not recommended: the URL class does not allow setting the factory more than once per VM. As a workaround, the JDK provides a mechanism based on package and class naming conventions for factory implementations (see this link).

Thus, using this framework following the above convention involves setting the following system property:

 -Djava.protocol.handler.pkgs=org.sapia
 

Author:
Yanick Duchesne
See Also:
ClazzyURLConnection, JarLoader,
Copyright:
Copyright © 2002-2004 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site

Field Summary
static java.lang.String PROTOCOL
           
 
Constructor Summary
ClazzyURLStreamHandlerFactory()
           
 
Method Summary
 java.net.URLStreamHandler createURLStreamHandler(java.lang.String protocol)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROTOCOL

public static final java.lang.String PROTOCOL
See Also:
Constant Field Values
Constructor Detail

ClazzyURLStreamHandlerFactory

public ClazzyURLStreamHandlerFactory()
Method Detail

createURLStreamHandler

public java.net.URLStreamHandler createURLStreamHandler(java.lang.String protocol)
Specified by:
createURLStreamHandler in interface java.net.URLStreamHandlerFactory
See Also:
URLStreamHandlerFactory.createURLStreamHandler(java.lang.String)


Copyright © 2011 Sapia OSS. All Rights Reserved.