NetKernel APIs


org.ten60.netkernel.xml.xahelper
Class XAccessor

java.lang.Object
  extended byorg.ten60.netkernel.layer1.representation.SimpleRepresentationImpl
      extended byorg.ten60.netkernel.layer1.accessor.AccessorImpl
          extended byorg.ten60.netkernel.layer1.accessor.ActiveAccessorImpl
              extended byorg.ten60.netkernel.xml.xahelper.XAccessor
All Implemented Interfaces:
IURAccessor, IURAspect, IURComponent, IURRepresentation, IURRequestee, IURRequestor

public abstract class XAccessor
extends ActiveAccessorImpl

An Highlevel accessor base class written to support migration of an old codebase from NetKernel v1, tailored to XML accessors but supports non-XML datatypes just as well.


Field Summary
static String OPERAND
           
static String OPERATOR
           
static String PARAMETER
           
static int SUPPORTS_SOURCE_BY_DOM
           
static int SUPPORTS_SOURCE_BY_STREAM
           
 
Fields inherited from class org.ten60.netkernel.layer1.representation.SimpleRepresentationImpl
mMeta
 
Fields inherited from interface com.ten60.netkernel.urii.accessor.IURAccessor
MIME_TYPE
 
Constructor Summary
XAccessor()
           
XAccessor(int aCost)
           
 
Method Summary
protected  void declareArgument(String aArgument, boolean isRequired, boolean acceptsFragment)
          Subclass constructor should call this method to declare which arguments are valid on requests.
protected  void declareDisableArgumentChecking()
          Subclass constructor should call this method to declare that argument checking should be disabled so that anything can be passed in
protected  void declareForgetDependencies()
          Subclass constructor may call this method to declare the accessor not to keep dependencies
protected  void declareThreadSafe()
          Subclass constructor may call this method to declare the accessor as threadsafe
protected  IURRepresentation fragment(IURRepresentation aSourceProxy, String aFragment, Class aAspectClass, URRequest aOriginalRequest)
           
protected  Container getContainer()
          return the container we operating within
protected  ModuleDefinition getModule()
          return the module we reside in
protected  IURRepresentation getProxy(URIdentifier aURI, Class aAspectClass, URRequest aOriginalRequest)
           
protected  Scheduler getScheduler()
          return the scheduler we can send requests too
 void requestAsync(URRequest aRequest)
          Make an asynchronous request
protected abstract  IURRepresentation source(XAHelper aHelper)
          This method must be implemented in subclasses to provide the source functionality
protected  IURRepresentation transrepresent(URIdentifier aSourceURI, IURRepresentation aSourceProxy, Class aAspectClass, URRequest aOriginalRequest)
          Transrepresent an IURRepresentation to another aspect
 
Methods inherited from class org.ten60.netkernel.layer1.accessor.ActiveAccessorImpl
getAAMeta, setThreadSafe
 
Methods inherited from class org.ten60.netkernel.layer1.accessor.AccessorImpl
destroy, finalize, getAccessorMeta, getResource, initialise, receiveAsyncException, receiveAsyncResult, sinkResource
 
Methods inherited from class org.ten60.netkernel.layer1.representation.SimpleRepresentationImpl
getAspect, getAspects, getMeta, hasAspect
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ten60.netkernel.urii.IURRepresentation
getAspect, getAspects, getMeta, hasAspect
 

Field Detail

OPERAND

public static final String OPERAND
See Also:
Constant Field Values

OPERATOR

public static final String OPERATOR
See Also:
Constant Field Values

PARAMETER

public static final String PARAMETER
See Also:
Constant Field Values

SUPPORTS_SOURCE_BY_DOM

public static final int SUPPORTS_SOURCE_BY_DOM
See Also:
Constant Field Values

SUPPORTS_SOURCE_BY_STREAM

public static final int SUPPORTS_SOURCE_BY_STREAM
See Also:
Constant Field Values
Constructor Detail

XAccessor

public XAccessor()

XAccessor

public XAccessor(int aCost)
Method Detail

requestAsync

public void requestAsync(URRequest aRequest)
Description copied from interface: IURRequestee
Make an asynchronous request

Parameters:
aRequest - the request being made

getModule

protected ModuleDefinition getModule()
Description copied from class: AccessorImpl
return the module we reside in

Overrides:
getModule in class AccessorImpl

getContainer

protected Container getContainer()
Description copied from class: AccessorImpl
return the container we operating within

Overrides:
getContainer in class AccessorImpl

getScheduler

protected Scheduler getScheduler()
Description copied from class: AccessorImpl
return the scheduler we can send requests too

Overrides:
getScheduler in class AccessorImpl

getProxy

protected IURRepresentation getProxy(URIdentifier aURI,
                                     Class aAspectClass,
                                     URRequest aOriginalRequest)
                              throws NetKernelException
Throws:
NetKernelException

transrepresent

protected IURRepresentation transrepresent(URIdentifier aSourceURI,
                                           IURRepresentation aSourceProxy,
                                           Class aAspectClass,
                                           URRequest aOriginalRequest)
                                    throws NetKernelException
Description copied from class: AccessorImpl
Transrepresent an IURRepresentation to another aspect

Overrides:
transrepresent in class AccessorImpl
Parameters:
aSourceURI - the URI of aSourceRepresentation
aSourceProxy - the representation we want to change aspects on
aAspectClass - the class of aspect we desire
aOriginalRequest - the parent request that invoked this accessor
Returns:
an IURRepresentation with the desired aspect
Throws:
NetKernelException - thrown if the IURRepresentation cannot be transrepresent for any reason

fragment

protected IURRepresentation fragment(IURRepresentation aSourceProxy,
                                     String aFragment,
                                     Class aAspectClass,
                                     URRequest aOriginalRequest)
                              throws NetKernelException
Throws:
NetKernelException

declareArgument

protected void declareArgument(String aArgument,
                               boolean isRequired,
                               boolean acceptsFragment)
Subclass constructor should call this method to declare which arguments are valid on requests.

Parameters:
aArgument - the argument name
isRequired - true if an argument is required, false if optional
acceptsFragment - true if an argument can be passed as a URI with a fragment specifier

declareThreadSafe

protected void declareThreadSafe()
Subclass constructor may call this method to declare the accessor as threadsafe


declareDisableArgumentChecking

protected void declareDisableArgumentChecking()
Subclass constructor should call this method to declare that argument checking should be disabled so that anything can be passed in


declareForgetDependencies

protected void declareForgetDependencies()
Subclass constructor may call this method to declare the accessor not to keep dependencies


source

protected abstract IURRepresentation source(XAHelper aHelper)
                                     throws Exception
This method must be implemented in subclasses to provide the source functionality

Parameters:
aHelper - the XAHelper with all necessary state
Returns:
and IURRepresentation of the result
Throws:
Throwable - thrown if it fails for any reason
Exception

NetKernel APIs


Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.