to.etc.webapp.query
Interface IQContextManager

All Known Implementing Classes:
QDefaultContextManager

public interface IQContextManager

Interface for a QContextManager handler.

Author:
Frits Jalvingh Created on Jul 17, 2009

Method Summary
 void closeSharedContext(IQContextContainer cc)
          If the specified container contains a shared context close it.
 QDataContext createUnmanagedContext()
          Create an unmanaged (manually closed) context factory.
 QDataContextFactory getDataContextFactory()
          Return the default QDataContextFactory.
 QDataContext getSharedContext(IQContextContainer cc)
          Gets a shared QDataContext from the container.
 QDataContextFactory getSharedContextFactory(IQContextContainer cc)
          Get/create a shared context factory.
 void setContextFactory(QDataContextFactory f)
          Initialize the data context factory that is to be used by default to allocate QDataContexts.
 

Method Detail

setContextFactory

void setContextFactory(QDataContextFactory f)
Initialize the data context factory that is to be used by default to allocate QDataContexts. Can be called only once.

Parameters:
f -

getDataContextFactory

QDataContextFactory getDataContextFactory()
Return the default QDataContextFactory. This is the root of *all* default connections allocated through DomUI.

Returns:

createUnmanagedContext

QDataContext createUnmanagedContext()
                                    throws java.lang.Exception
Create an unmanaged (manually closed) context factory.

Returns:
Throws:
java.lang.Exception

getSharedContextFactory

QDataContextFactory getSharedContextFactory(IQContextContainer cc)
Get/create a shared context factory. The context factory gets attached to the container it is shared in, and will always try to re-use any QDataContext already present in the container. In addition, all data contexts allocated thru this mechanism have a disabled close() method, preventing them from closing the shared connection.

Parameters:
cc -
Returns:

getSharedContext

QDataContext getSharedContext(IQContextContainer cc)
                              throws java.lang.Exception
Gets a shared QDataContext from the container. If it is not already present it will be allocated, stored in the container for later reuse and returned. The context is special in that it cannot be closed() using it's close() call - it is silently ignored.

Throws:
java.lang.Exception

closeSharedContext

void closeSharedContext(IQContextContainer cc)
If the specified container contains a shared context close it.

Parameters:
cc -