Qizx/open 4.1 API

com.qizx.api
Class XQuerySessionManager

java.lang.Object
  extended by com.qizx.api.XQuerySessionManager

public class XQuerySessionManager
extends Object

Manager of simple XQuery sessions without access to a XML Library.

Provides a cache of Modules and a cache of transient documents, shared among the sessions created on this manager. This cache avoids reparsing XML documents if different sessions access it. It can detect a change on documents stored in the file-system and reload the document.


Constructor Summary
XQuerySessionManager(ModuleResolver moduleResolver, int transientDocumentCacheSize)
          Creates a session manager.
XQuerySessionManager(URL moduleBaseURI)
          Creates a session manager with a default Module Resolver and a default cache for parsed documents.
 
Method Summary
 XQuerySession createSession()
          Creates a new XQuery session.
 com.qizx.xdm.DocumentPool getDocumentCache()
          For internal use.
 com.qizx.xquery.ModuleManager getModuleManager()
          For internal use.
 ModuleResolver getModuleResolver()
          Returns the current Resolver of XQuery modules.
 long getTransientDocumentCacheSize()
          Gets the current maximum memory size for the document cache.
 void setDocumentCache(com.qizx.xdm.DocumentPool documentCache)
          For internal use.
 void setModuleResolver(ModuleResolver resolver)
          Defines a resolver of XQuery modules.
 long setTransientDocumentCacheSize(long size)
          Sets the maximum memory size for the document cache.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XQuerySessionManager

public XQuerySessionManager(URL moduleBaseURI)
Creates a session manager with a default Module Resolver and a default cache for parsed documents.

Parameters:
moduleBaseURI - base URI for the default Module Resolver

XQuerySessionManager

public XQuerySessionManager(ModuleResolver moduleResolver,
                            int transientDocumentCacheSize)
Creates a session manager.

Parameters:
moduleResolver - resolver used for modules
transientDocumentCacheSize - size in bytes of the document cache
Method Detail

createSession

public XQuerySession createSession()
Creates a new XQuery session.

Returns:
a new XQuery session using the resources of this session manager

getModuleManager

public com.qizx.xquery.ModuleManager getModuleManager()
For internal use.


setTransientDocumentCacheSize

public long setTransientDocumentCacheSize(long size)
Sets the maximum memory size for the document cache. The document cache stores transient documents which are parsed in memory.

Parameters:
size - maximum memory size in bytes. Decreasing this size will flush the cache accordingly.
Returns:
the former maximum memory size in bytes

getTransientDocumentCacheSize

public long getTransientDocumentCacheSize()
Gets the current maximum memory size for the document cache.

Returns:
a size in bytes

getDocumentCache

public com.qizx.xdm.DocumentPool getDocumentCache()
For internal use.


setDocumentCache

public void setDocumentCache(com.qizx.xdm.DocumentPool documentCache)
For internal use.


setModuleResolver

public void setModuleResolver(ModuleResolver resolver)
Defines a resolver of XQuery modules.

Parameters:
resolver - a module resolver

getModuleResolver

public ModuleResolver getModuleResolver()
Returns the current Resolver of XQuery modules.

Returns:
the current module resolver

© 2010 Axyana Software