|
||||
XAccessorThe
XAccessor is a helper class that takes care of the low-level interactions with the NetKernel. This
includes thread interlocks and synchronous and asynchronous request management.
URAs can be quickly developed by subclassing
/** This method must be implemented in subclasses to provide the source functionality
* @param aHelper the XAHelper with all necessary state
* @return and IURRepresentation of the result
* @exception Throwable thrown if it fails for any reason
*/
protected IURRepresentation source(XAHelper aHelper) throws Throwable;
A step-by-step guide to developing an XAccessor based URA is available here. XAHelperXAccessor based URAs receive managed requests via an XAHelper object XAHelper is a wrapper around a low-level NetKernel request. It allows the CompoundURI of the request to be interrogated and its arguments to be retrieved. Typically the convenience methods getOperator, getOperand, getParameter are used though other named arguments can be retrieved using a combination of getURI and getXResource. XAHelper also provides get and set interfaces to issue requests to source or sink other URI referenced resources. As with all general NetKernel requests the request is qualified by the class of the Aspect that should be returned. These methods issue low-level synchronous requests to the NetKernel and are blocking. To make asynchronous non-blocking requests a developer must implement a low-level Data Accessor. The XAHelper can provide standard SAX and JAXP entity resolvers. XML APIs that require resource resolution can use the NetKernel as a resolver via the XAHelper. XAHelperExtra
For advanced use. The
/** return an IXAspect of the operand
* @exception NetKernelException thrown if we fail to obtain aspect for any reason
*/
IXAspect getOperand() throws NetKernelException;
/** return an IURRepresentation of the operand that has a particular aspect
* @param aClass the class of the aspect that must be available
* @exception NetKernelException thrown if we fail to obtain aspect for any reason
*/
IURRepresentation getOperand(Class aClass) throws NetKernelException;
/** return an IXAspect of the operator
* @exception NetKernelException thrown if we fail to obtain aspect for any reason
*/
IXAspect getOperator() throws NetKernelException;
/** return an IURRepresentation of the operator that has a particular aspect
* @param aClass the class of the aspect that must be available
* @exception NetKernelException thrown if we fail to obtain aspect for any reason
*/
IURRepresentation getOperator(Class aClass) throws NetKernelException;
/** return an IXAspect of the parameter
* @exception NetKernelException thrown if we fail to obtain aspect for any reason
*/
IXAspect getParameter() throws NetKernelException;
/** return an IURRepresentation of the parameter that has a particular aspect
* @param aClass the class of the aspect that must be available
* @exception NetKernelException thrown if we fail to obtain aspect for any reason
*/
IURRepresentation getParameter(Class aClass) throws NetKernelException;
/** Return an IXAspect of an abitrary URI
* @exception NetKernelException thrown if we fail to obtain aspect for any reason
*/
IXAspect getXResource(URI aURI) throws NetKernelException;
/** return an IURRepresentation of an abitrary URI
* @param aClass the class of the aspect that must be available
* @exception NetKernelException thrown if we fail to obtain aspect for any reason
*/
IURRepresentation getResource(URI aURI, Class aClass) throws NetKernelException;
/** Return true if the operand available
*/
boolean hasOperand();
/** Return true if the operator available
*/
boolean hasOperator();
/** Return true if the parameter available
*/
boolean hasParameter();
/** Return the URI of a particular argument- null if it doesn't exist
*/
URI getURI(String aArgument);
/** Return the type value of the compound URI that initiated this accessor request
*/
String getType();
/** Return the current working URI of this request- may be null if none defined
*/
URI getCurrentWorkingURI();
/** Return a dependency meta that has as dependents all requested arguments
* @param aMimeType the mimetype of the meta
* @param aCost the creation cost for the meta
*/
IURMeta getDependencyMeta(String aMimeType, int aCost);
/** Sink an abitrary resource
* @param aURI the URI of the resource to sink to
* @param aRepresentation the IURRepresentation containing the state to sink
* @exception NetKernelException thrown if we fail to obtain aspect for any reason
*/
void setResource(URI aURI, IURRepresentation aRepresentation) throws NetKernelException;
/** the EntityResolver interface for SAX */
InputSource resolveEntity(String aPublicId, String aSystemId) throws SAXException, IOException;
/** the URIResolver interface for JAXP */
Source resolve(String href, String base) throws TransformerException;
|
||||
|
© 2003,2004, 1060® Research Limited
1060 registered trademark, NetKernel trademark of 1060 Research Limited
|
||||