Overview | Package | Class | Tree | Deprecated | Index | Help
| Qizx/Open v0.3
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.xfra.qizxopen.xquery
Class ModuleManager

    java.lang.Object
      |
      +--net.xfra.qizxopen.xquery.ModuleManager

public class ModuleManager
extends java.lang.Object

Compiles and caches XQuery modules on behalf of a XQueryProcessor.

This is a simple implementation that assumes that all modules URIs can be resolved using the same base location (any URL supported by Java). If the physical location ("at") is not specified in the "import module" declaration, then the module URI is used as follows: periods are replaced by '/' and the extension '.xqm' is appended. For example if the base URL is `http://myserver.net/xqmodules`, the declaration `import module mod1 = "myapp.module1"` will resolve the module location as `http://myserver.net/xqmodules/myapp/module1.xqm`

Ensures that a module is loaded only once for the same query (i.e. two indirect references to a module from the same query must yield the same object).

Can be shared by several XQueryProcessors in a multithreaded context.

Constructor Summary
`ModuleManager(java.lang.String baseURI)` Builds a Module Manager with a base location for resolution of module URIs.
`ModuleManager(java.net.URL baseURL)` Builds a Module Manager with a base location for resolution of module URIs.

Method Summary
`net.xfra.qizxopen.xquery.impl.Module` | `loadModule(net.xfra.qizxopen.xquery.impl.Module predefinedModule, java.lang.String uri, java.lang.String location, Log log)` [Undocumented: used internally by the parser.]
`java.net.URL` | `resolveModuleLocation(java.lang.String uri, java.lang.String location)` Overridable method for resolving a module name and location to an actual URL.
`void` | `unloadAllModules()` Unloads all modules.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ModuleManager

    public ModuleManager(java.net.URL baseURL)
                  throws java.io.IOException

  Builds a Module Manager with a base location for resolution of module URIs.

### ModuleManager

    public ModuleManager(java.lang.String baseURI)
                  throws java.io.IOException

  Builds a Module Manager with a base location for resolution of module URIs.

Method Detail

### resolveModuleLocation

    public java.net.URL resolveModuleLocation(java.lang.String uri,
                                              java.lang.String location)
                                       throws java.io.IOException

  Overridable method for resolving a module name and location to an actual URL.

    `java.io.IOException`

### unloadAllModules

    public void unloadAllModules()

  Unloads all modules. Main Queries can still refer safely to the modules.

  Note: Due to possible dependencies between modules, it would be very difficult to unload a module selectively.

### loadModule

    public net.xfra.qizxopen.xquery.impl.Module loadModule(net.xfra.qizxopen.xquery.impl.Module predefinedModule,
                                                           java.lang.String uri,
                                                           java.lang.String location,
                                                           Log log)
                                                    throws java.io.IOException,
                                                           XQueryException

  [Undocumented: used internally by the parser.]

    `java.io.IOException`
    `XQueryException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright Xavier FRANC 2003-2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD