|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XQConnection2
Extended interface which implements functionality that is missing from
XQConnection
, based on findings whilst trying to implement
XQJ API v1.0.
Method Summary | ||
---|---|---|
|
createModuleProxy(String namespaceUri,
String moduleUri,
Class<T> clazz)
Creates a Module Proxy, a Java Facade of an XQuery Library Module. |
|
|
createModuleProxy(String namespaceUri,
String moduleUri,
Class<T> clazz,
XQStaticContext properties)
Creates a Module Proxy, a Java Facade of an XQuery Library Module. |
|
int |
getTransactionTimeout()
Gets the transaction timeout of the connection, in seconds. |
|
XAResource |
getXAResource()
Gets the XAResource |
|
void |
insertItem(String uri,
XQItem item,
XQInsertOptions options)
Inserts an item into the XML DataSource with a given URI. |
|
boolean |
isReadOnly()
Retrieves whether the connection object is in read-only mode. |
|
void |
setReadOnly(boolean readOnly)
Puts this connection in read-only mode as a hint to the driver to enable database optimizations. |
|
void |
setTransactionTimeout(int seconds)
Sets the transaction timeout of the connection, in seconds. |
Methods inherited from interface javax.xml.xquery.XQConnection |
---|
close, commit, createExpression, createExpression, getAutoCommit, getMetaData, getStaticContext, isClosed, prepareExpression, prepareExpression, prepareExpression, prepareExpression, prepareExpression, prepareExpression, rollback, setAutoCommit, setStaticContext |
Method Detail |
---|
<T> T createModuleProxy(String namespaceUri, String moduleUri, Class<T> clazz) throws XQException
Invoking methods on the returned instance will manifest in the implementation calling XQuery functions contained within the specified XQuery Library Module.
Java method parameters are mapped to XQuery function parameters according to the mapping rules outlined in the XQJ2 specification.
The XDM result of calling the XQuery function will be mapped into the Java interface's expected return type for that method, if possible.
Invoking Module Proxy methods will implicitly close any previous result sequences obtained from the connection.
Invoking XQuery Functions from Java in this manner was described in the presentation Building Bridges from Java to XQuery at XML Prague 2012.
namespaceUri
- The Namespace URI of the XQuery Library Module,
required parameter.moduleUri
- The URI of the XQuery Library Module,
null
is permitted.clazz
- A regular Java interface class, acting as the
Facade for the XQuery Library Module.
clazz
parameter.
XQException
<T> T createModuleProxy(String namespaceUri, String moduleUri, Class<T> clazz, XQStaticContext properties) throws XQException
Invoking methods on the returned instance will manifest in the implementation calling XQuery functions contained within the specified XQuery Library Module.
Java method parameters are mapped to XQuery function parameters according to the mapping rules outlined in the XQJ2 specification.
The XDM result of calling the XQuery function will be mapped into the Java interface's expected return type for that method, if possible.
Invoking Module Proxy methods will implicitly close any previous result sequences obtained from the connection.
Invoking XQuery Functions from Java in this manner was described in the presentation Building Bridges from Java to XQuery at XML Prague 2012.
namespaceUri
- The Namespace URI of the XQuery Library Module,
required parameter.moduleUri
- The URI of the XQuery Library Module,
null
is permitted.clazz
- A regular Java interface class, acting as the Facade
for the XQuery Library Module.properties
- The static context properties, which the
XQuery Module Proxy should run against.
clazz
parameter.
XQException
void insertItem(String uri, XQItem item, XQInsertOptions options) throws XQException
The item must be a document node.
This method pays respect to the state of the auto-commit attribute.
If auto-commit is set to false
, an item or items will only
be committed once the commit method has been invoked.
uri
- The absolute URI of the item. Can not be null
.item
- The item to insert. Must be a document node.
Can not be null
.options
- Gives hints to the implementation regarding how to ingest
the item. Can be null.
XQException
- if any of the following is true
null
void setReadOnly(boolean readOnly) throws XQException
Note: This method cannot be called during a transaction.
readOnly
- true enables read-only mode; false disables it
XQException
- if any of the following is true
boolean isReadOnly() throws XQException
true
if the connection object is read-only;
false
otherwise
XQException
- if this connection object is closedvoid setTransactionTimeout(int seconds) throws XQException
When the auto-commit mode is set to false
and a
transaction is manually started by the user, the transaction will remain
alive up to the number of seconds specified by the parameter
seconds
before timing out and being rolled back.
seconds
- The number of seconds to wait before a manual
transaction times out. 0
to wait
indefinitely.
XQException
- if any of the following is true
seconds
parameter is a negative
valueint getTransactionTimeout() throws XQException
If the value returned is 0
, then manual transactions
will wait indefinitely.
XQException
- if any of the following is true
XAResource getXAResource() throws XQException
XAResource associated with the connection.
- Returns:
- a
XAResource
object, associated with this connection.
- Throws:
XQException
- if any of the following is true
- the connection object is closed
- the implementation does not support XA transactions
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |