simple.http.load
Interface LoaderManager

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
LoaderEngine, MapperEngine

public interface LoaderManager
extends java.rmi.Remote

The LoaderManager is used to load Service implementation classes. This can be used from a remote network host using RMI as it extends the Remote interface. Each Service that is loaded can be purged from the system using the unload method.

Once an object has been loaded into the system it needs to be looked up in terms of a URI path. This enables links between the service name and a wildcard pattern to be made. When the pattern is matched by a URI the resource can be isolated. A service instance can be linked to several patterns. If the service is to be unlinked the unlink method can remove the pattern from the system.

Configuring the links made with the LoaderManager can be done using the Loader. This will ensure that the changes in the configuration of links with the manager will be transmitted to the Loader. This can thus be used as a means to provide graphical administration of the manager.

Author:
Niall Gallagher

Method Summary
 void link(java.lang.String pattern, java.lang.String name)
          This is used to link a Service to a wild card pattern.
 void link(java.lang.String pattern, java.lang.String name, int pos)
          This is used to link a Service to a wild card pattern.
 void load(java.lang.String name, java.lang.String className)
          This loads the class into the system.
 void load(java.lang.String name, java.lang.String className, java.lang.Object data)
          This loads the class into the system.
 void load(java.lang.String name, java.lang.String className, java.lang.Object[] data)
          This loads the class into the system.
 void remove(java.lang.String name)
          This is used to terminate updates on a Loader object which has previously registered for updates.
 void unlink(Match match)
          This is used to unlink a loaded Service that was linked to the specified match.
 void unlink(java.lang.String pattern)
          This is used to unlink a loaded Service that was linked to the specified pattern.
 void unload(java.lang.String name)
          When an instance has been loaded by the load method this can be used to purge it from the system and subsequently remove all links to it.
 void update(java.lang.String name, Loader loader)
          This is used to insert a Loader object which is used to recieve updates on the configuration.
 

Method Detail

update

void update(java.lang.String name,
            Loader loader)
            throws java.rmi.RemoteException
This is used to insert a Loader object which is used to recieve updates on the configuration. The loader can be a remote object which enables the local instance to to communicate its state to a remote administration utility. Once registered the Loader will recieve an immedidate update of the managers layout.

This throws a SecurityException if the caller does not have the LoaderPermission with the "update" token. This ensures that any Loader instances from an untrusted codebase cannot register.

Parameters:
loader - this is the Loader object that will recieve updates on state changes
Throws:
java.lang.SecurityException - if the caller does not have the permission to register the Loader
java.rmi.RemoteException - this is thrown by the RMI system

remove

void remove(java.lang.String name)
            throws java.rmi.RemoteException
This is used to terminate updates on a Loader object which has previously registered for updates. If the Loader wishes to resume updates it must register again using the update method.

This throws a SecurityException if the caller does not have the LoaderPermission with the "update" token. This ensures that any Loader instances from an untrusted codebase cannot remove objects that have registered.

Parameters:
name - this is the Loader object that is terminating updates
Throws:
java.lang.SecurityException - if the caller does not have the permission to register the Loader
java.rmi.RemoteException - this is thrown by the RMI system

load

void load(java.lang.String name,
          java.lang.String className)
          throws java.rmi.RemoteException,
                 LoadingException
This loads the class into the system. This will attempt to locate and load the byte codes for a Resource implementation identified by the class name. If the class can not be loaded ClassNotFoundException is thrown. The fully qualified package name must be given.

Once the Service class has been loaded it is used to create an instance. This instance can then have links established to it. The link is created using the unique name of the instance specified and a wild pattern.

This method requires LoaderPermission with the "load" action. If the client does not have permission to load the service instance this throws an exception.

Parameters:
name - this is the unique name given to the instance
className - this is the fully qualified class name
Throws:
LoadingException - is thrown if the class cannot be located or loaded
java.rmi.RemoteException - thrown by the RMI system
java.lang.SecurityException - if the caller does not have permission to load the service

load

void load(java.lang.String name,
          java.lang.String className,
          java.lang.Object data)
          throws java.rmi.RemoteException,
                 LoadingException
This loads the class into the system. This will attempt to locate and load the byte codes for a Resource implementation identified by the class name. If the class can not be loaded ClassNotFoundException is thrown. The fully qualified package name must be given.

Once the Service class has been loaded it is used to create an instance. This instance can then have links established to it. The link is created using the unique name of the instance specified and a wild pattern.

This method requires LoaderPermission with the "load" action. If the client does not have permission to load the service instance this throws an exception.

Parameters:
name - this is the unique name given to the instance
className - this is the fully qualified class name
data - this is the data used for service preparation
Throws:
LoadingException - is thrown if the class cannot be located or loaded
java.rmi.RemoteException - thrown by the RMI system
java.lang.SecurityException - if the caller does not have permission to load the service

load

void load(java.lang.String name,
          java.lang.String className,
          java.lang.Object[] data)
          throws java.rmi.RemoteException,
                 LoadingException
This loads the class into the system. This will attempt to locate and load the byte codes for a Resource implementation identified by the class name. If the class can not be loaded ClassNotFoundException is thrown. The fully qualified package name must be given.

Once the Service class has been loaded it is used to create an instance. This instance can then have links established to it. The link is created using the unique name of the instance specified and a wild pattern. This method also allows an object to be issued to the new service instance for configuration purposes.

This method requires LoaderPermission with the "load" action. If the client does not have permission to load the service instance this throws an exception.

Parameters:
name - this is the unique name given to the instance
className - this is the fully qualified class name
data - the configuration object used by the service
Throws:
LoadingException - is thrown if the class cannot be located or loaded
java.rmi.RemoteException - thrown by the RMI system
java.lang.SecurityException - if the caller does not have permission to load the service

unload

void unload(java.lang.String name)
            throws java.rmi.RemoteException
When an instance has been loaded by the load method this can be used to purge it from the system and subsequently remove all links to it. If the class name specified does not correspond to a Service that had be previously loaded this will return quietly. The fully qualified package name must be given.

This method like the load methods requires the LoaderPermission with the "load" action to unload a named service instance.

Parameters:
name - this is the name of the service object
Throws:
java.rmi.RemoteException - thrown by the RMI system
java.lang.SecurityException - if the caller does not have permission to unload the service

link

void link(java.lang.String pattern,
          java.lang.String name)
          throws java.rmi.RemoteException
This is used to link a Service to a wild card pattern. The Service can be linked using the patterns '*' and '?'. This will enable the resource to be isolated using a string that matches the suggested pattern.

Patterns can take the form of a string with wild characters embedded in it, for instance "*.html". Also if the class name does not belong to a previously loaded Service this should return quietly.

This throws a SecurityException if the caller does not have the LoaderPermission with the "link" action. This ensures that any Service instances loaded from an untrusted codebase cannot change the configuration settings.

Parameters:
pattern - this is a wild string used for matching
name - this is the Service that will be identified by the pattern
Throws:
java.lang.SecurityException - if the caller does not have the permission to link the pattern
java.rmi.RemoteException - this is thrown by the RMI system

link

void link(java.lang.String pattern,
          java.lang.String name,
          int pos)
          throws java.rmi.RemoteException
This is used to link a Service to a wild card pattern. The Service can be linked using the patterns '*' and '?'. This will enable the resource to be isolated using a string that matches the suggested pattern.

Patterns can take the form of a string with wild characters embedded in it, for instance "*.html". Also if the class name does not belong to a previously loaded Service this should return quietly.

This throws a SecurityException if the caller does not have the LoaderPermission with the "link" action. This ensures that any Service instances loaded from an untrusted codebase cannot change the configuration settings.

Parameters:
pattern - this is a wild string used for matching
name - this is the Service that will be identified by the pattern
pos - the position within the list of patterns to add the new match
Throws:
java.lang.SecurityException - if the caller does not have the permission to link the pattern
java.rmi.RemoteException - this is thrown by the RMI system

unlink

void unlink(java.lang.String pattern)
            throws java.rmi.RemoteException
This is used to unlink a loaded Service that was linked to the specified pattern. If that pattern was not used to match a Service then this returns quietly.

This throws a SecurityException if the caller does not have the LoaderPermission with the "link" action. This ensures that any Service instances loaded from an untrusted codebase cannot change the configuration settings.

Parameters:
pattern - this is a wild string used for matching
Throws:
java.lang.SecurityException - if the caller does not have the permission to unlink the pattern
java.rmi.RemoteException - this is thrown by the RMI system

unlink

void unlink(Match match)
            throws java.rmi.RemoteException
This is used to unlink a loaded Service that was linked to the specified match. If that pattern was not used to match a Service then this returns quietly.

This throws a SecurityException if the caller does not have the LoaderPermission with the "link" action. This ensures that any Service instances loaded from an untrusted codebase cannot change the configuration settings.

Parameters:
match - this is the pattern match to remove from this
Throws:
java.lang.SecurityException - if the caller does not have the permission to unlink the match
java.rmi.RemoteException - this is thrown by the RMI system