Berkeley DB XML
version 2.5.16

com.sleepycat.dbxml
Class XmlExternalFunction

java.lang.Object
  extended by com.sleepycat.dbxml.XmlExternalFunction

public class XmlExternalFunction
extends Object

The XmlExternalFunction class is used to implement XQuery extension functions in Java. An implementor creates a subclass of XmlExternalFunction and returns an instance of the class from XmlResolver.resolveExternalFunction(com.sleepycat.dbxml.XmlTransaction, com.sleepycat.dbxml.XmlManager, java.lang.String, java.lang.String, int). Returned instances may be singleton objects which means the application must eventually free the memory, or new instances in which case the instance should delete itself in its close() method.


Constructor Summary
XmlExternalFunction()
           
 
Method Summary
 void close()
          This method is called when the query has finished using the object.
 XmlResults execute(XmlTransaction txn, XmlManager mgr, XmlArguments args)
          This method is called from within a query to execute the function for which the instance was implemented.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlExternalFunction

public XmlExternalFunction()
Method Detail

execute

public XmlResults execute(XmlTransaction txn,
                          XmlManager mgr,
                          XmlArguments args)
                   throws XmlException
This method is called from within a query to execute the function for which the instance was implemented. It returns an XmlResults object used by the query for further processing.

Parameters:
txn - The XmlTransaction in which the operation is running.
mgr - The XmlManager instance controlling the operation.
args - The XmlArguments object that can be used to retrieve the function arguments.
Returns:
An XmlResults object containing the results of executing the function on the given arguments.
Throws:
XmlException

close

public void close()
           throws XmlException
This method is called when the query has finished using the object. It allows the implementation to clean up if necessary. If a new instance of XmlExternalFunction is returned from XmlResolver.resolveExternalFunction(com.sleepycat.dbxml.XmlTransaction, com.sleepycat.dbxml.XmlManager, java.lang.String, java.lang.String, int) then this method will probably need to delete itself to avoid memory leaks.

Throws:
XmlException

Berkeley DB XML
version 2.5.16

Copyright (c) 1996,2009 Oracle. All rights reserved.