nl.uva.vlet.vrs
Class Registry

java.lang.Object
  extended by nl.uva.vlet.vrs.Registry

public class Registry
extends java.lang.Object

Registry to query 'Resources' and/or services.

Uses the java Class Loader to load an implementation of a (VRS) Service. It tries to load the class and calls the initService method, which must return an instance of that class that implements that service. That object acts as Service Handler which can provide/produce Resource objects of the type VNode.

See Also:
VFS

Method Summary
static void addResourceEventListener(ResourceEventListener listener)
           
 void clear()
          The clear is similar to 'dispose' except that after the 'cleanup' execution might continue.
static void clearClass()
           
 void dispose()
          Clean up resource.
static void fireEvent(ResourceEvent event)
           
 java.lang.String getDefaultScheme(java.lang.String scheme)
          When more then one scheme names are allowed (for example: gftp/gsiftp) this method returns the default scheme for the gvien name.
 java.lang.String[] getDefaultSchemeNames()
          Returns array of default scheme names for the registered protocols.
 VAttribute[] getDefaultServerAttributesFor(VRL loc)
           
 VAttributeGroup getServiceAttributeGroups()
           
 VRS getServiceForScheme(java.lang.String typestr)
          Searches the type registry.
 VRS getServiceForScheme(java.lang.String typestr, java.lang.String hostname)
           
 VRS[] getServices()
          Returns array of registered services
 VFS getVFSFor(VRL loc)
           
 VRS getVRSFor(VRL loc)
           
static void init()
          In the case auto class initialisation does not work, call this init method to initialize the class
static boolean isLocalLocation(VRL location)
           
 VNode openLocation(VRSContext context, java.lang.String location)
          Open location specified by the location string.
 VNode openLocation(VRSContext context, java.net.URL url)
           
 VNode openLocation(VRSContext context, VRL location)
          Registry openLocation, this is the master openLocation
static void removeResourceEventListener(ResourceEventListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getVFSFor

public VFS getVFSFor(VRL loc)
              throws VlException
Throws:
VlException

getVRSFor

public VRS getVRSFor(VRL loc)
              throws VlException
Throws:
VlException

getServiceForScheme

public VRS getServiceForScheme(java.lang.String typestr)
Searches the type registry. Note: searches the type registry from last to first, making it possible to overide default types.

Parameters:
typestr -
Returns:

getServiceForScheme

public VRS getServiceForScheme(java.lang.String typestr,
                               java.lang.String hostname)

openLocation

public VNode openLocation(VRSContext context,
                          java.lang.String location)
                   throws VlException
Open location specified by the location string.

Throws:
VlException
See Also:
#openLocation(VRL)

openLocation

public VNode openLocation(VRSContext context,
                          java.net.URL url)
                   throws VlException
Throws:
VlException

openLocation

public VNode openLocation(VRSContext context,
                          VRL location)
                   throws VlException
Registry openLocation, this is the master openLocation

Throws:
VlException

getDefaultScheme

public java.lang.String getDefaultScheme(java.lang.String scheme)
When more then one scheme names are allowed (for example: gftp/gsiftp) this method returns the default scheme for the gvien name. The default scheme is the first one which is return from VRS.getServiceTypes();

Parameters:
scheme -
Returns:

getServiceAttributeGroups

public VAttributeGroup getServiceAttributeGroups()

getDefaultSchemeNames

public java.lang.String[] getDefaultSchemeNames()
Returns array of default scheme names for the registered protocols. One scheme name per protocol.

Returns:

getDefaultServerAttributesFor

public VAttribute[] getDefaultServerAttributesFor(VRL loc)
                                           throws VlException
Throws:
VlException

dispose

public void dispose()
Clean up resource. Calls clear() method


clear

public void clear()
The clear is similar to 'dispose' except that after the 'cleanup' execution might continue.


getServices

public VRS[] getServices()
Returns array of registered services


fireEvent

public static void fireEvent(ResourceEvent event)

addResourceEventListener

public static void addResourceEventListener(ResourceEventListener listener)

removeResourceEventListener

public static void removeResourceEventListener(ResourceEventListener listener)

isLocalLocation

public static boolean isLocalLocation(VRL location)

clearClass

public static void clearClass()

init

public static void init()
In the case auto class initialisation does not work, call this init method to initialize the class