org.jboss.virtual.spi
Class VFSContextFactoryLocator

java.lang.Object
  extended by org.jboss.virtual.spi.VFSContextFactoryLocator

public class VFSContextFactoryLocator
extends Object

A singleton factory for locating VFSContextFactory instances given VFS root URIs.

Version:
$Revision: 45764 $
Author:
Scott.Stark@jboss.org, adrian@jboss.org

Field Summary
static String DEFAULT_FACTORY_PROPERTY
          The system property that defines the default file factory
static String SERVICES_PATH
          The path used to load services from the classpath
 
Constructor Summary
VFSContextFactoryLocator()
           
 
Method Summary
static VFSContextFactory getFactory(URI rootURI)
          Return the VFSContextFactory for the VFS mount point specified by the rootURI.
static VFSContextFactory getFactory(URL rootURL)
          Return the VFSContextFactory for the VFS mount point specified by the rootURL.
static void registerFactory(VFSContextFactory factory)
          Register a new VFSContextFactory
static boolean unregisterFactory(VFSContextFactory factory)
          Unregister a VFSContextFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FACTORY_PROPERTY

public static final String DEFAULT_FACTORY_PROPERTY
The system property that defines the default file factory


SERVICES_PATH

public static final String SERVICES_PATH
The path used to load services from the classpath

Constructor Detail

VFSContextFactoryLocator

public VFSContextFactoryLocator()
Method Detail

registerFactory

public static void registerFactory(VFSContextFactory factory)
Register a new VFSContextFactory

Parameters:
factory - the factory
Throws:
IllegalArgumentException - if the factory is null or the factory returns a null or no protocols
IllegalStateException - if one of the protocols is already registered

unregisterFactory

public static boolean unregisterFactory(VFSContextFactory factory)
Unregister a VFSContextFactory

Parameters:
factory - the factory
Returns:
false when not registered
Throws:
IllegalArgumentException - if the factory is null

getFactory

public static VFSContextFactory getFactory(URL rootURL)
Return the VFSContextFactory for the VFS mount point specified by the rootURL.

Parameters:
rootURL - - the URL to a VFS root
Returns:
the VFSContextFactory capable of handling the rootURL. This will be null if there is no factory registered for the rootURL protocol.
Throws:
IllegalArgumentException - if the rootURL is null

getFactory

public static VFSContextFactory getFactory(URI rootURI)
Return the VFSContextFactory for the VFS mount point specified by the rootURI.

Parameters:
rootURI - - the URI to a VFS root
Returns:
the VFSContextFactory capable of handling the rootURI. This will be null if there is no factory registered for the rootURI scheme.
Throws:
IllegalArgumentException - if the rootURI is null


Copyright © 2009 JBoss, A division of Red Hat, Inc. All Rights Reserved.