站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

URLStreamHandlerFactory (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


org.jboss.net.protocol
Class URLStreamHandlerFactory

java.lang.Object
  extended byorg.jboss.net.protocol.URLStreamHandlerFactory
All Implemented Interfaces:
URLStreamHandlerFactory

public class URLStreamHandlerFactory
extends Object
implements URLStreamHandlerFactory

A factory for loading URL protocol handlers. This is based on Sun's URL mechanism, in that Handler classes will be searched for in the packages specified by the java.protocol.handler.pkgs property are searched for classes matching the protocol + ".Handler" classname. The default JBoss package "org.jboss.net.protocol" is searched even if not specified in the java.protocol.handler.pkgs property.

This factory is installed by the default server implementaion to ensure that protocol handlers not in the system classpath are located. The thread context class is used first followed by the Class.forName method.

Use preload to force the URL handler map to load the handlers for each protocol listed in PROTOCOLS.

Version:
$Revision: 1.8 $
Author:
Jason Dillon, Scott.Stark@jboss.org

Field Summary
static String PACKAGE_PREFIX
          The package prefix where JBoss protocol handlers live.
static String[] PROTOCOLS
          A list of JBoss specific protocols for preloading.
 
Constructor Summary
URLStreamHandlerFactory()
           
 
Method Summary
static void clear()
          Clear the current protocol to handler map.
 URLStreamHandler createURLStreamHandler(String protocol)
          Search the handlerPkgs for URLStreamHandler classes matching the pkg + protocol + ".Handler" naming convention.
static void preload()
          Preload the JBoss specific protocol handlers, so that URL knows about them even if the handler factory is changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PACKAGE_PREFIX

public static final String PACKAGE_PREFIX
The package prefix where JBoss protocol handlers live.

See Also:
Constant Field Values

PROTOCOLS

public static final String[] PROTOCOLS
A list of JBoss specific protocols for preloading.

Constructor Detail

URLStreamHandlerFactory

public URLStreamHandlerFactory()
Method Detail

preload

public static void preload()
Preload the JBoss specific protocol handlers, so that URL knows about them even if the handler factory is changed.


clear

public static void clear()
Clear the current protocol to handler map. The map will be rebuilt as protocol handlers are requested.


createURLStreamHandler

public URLStreamHandler createURLStreamHandler(String protocol)
Search the handlerPkgs for URLStreamHandler classes matching the pkg + protocol + ".Handler" naming convention.

Specified by:
createURLStreamHandler in interface URLStreamHandlerFactory
Parameters:
protocol - The protocol to create a stream handler for
Returns:
The protocol handler or null if not found
See Also:
#checkHandlerPkgs()


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.