NetKernel APIs


com.ten60.netkernel.cache
Class Cache

java.lang.Object
  extended bycom.ten60.netkernel.urii.representation.SimpleRepresentationImpl
      extended bycom.ten60.netkernel.container.ComponentImpl
          extended bycom.ten60.netkernel.cache.Cache
All Implemented Interfaces:
IAspectBinaryStream, IComponent, IURAspect, IURRepresentation

public class Cache
extends ComponentImpl

NetKernel Cache Component- responsible for locating a cachelet for getting or putting an IURRepresentation from an URRequest.


Field Summary
static IURRepresentation EXPIRED_RESOURCE
          expired resource in cache
static URIdentifier URI
          our static URI
 
Fields inherited from class com.ten60.netkernel.urii.representation.SimpleRepresentationImpl
mMeta
 
Constructor Summary
Cache()
          Creates a new instance of Cache
 
Method Summary
 IURRepresentation get(URRequest aRequest)
          public interface for getting a IURRepresentation that will satisfy the given request
 void put(URResult aResult)
          public interface for putting informing the cache of a result- it is its choice whether to use it or not
 void registerCacheletModule(ModuleDefinition aModule)
           
 void registerDefaultCacheletModule(ModuleDefinition aModule)
           
 void start(Container aContainer)
          Initialise the cache, finding the default cachelet
 void stop()
          stop method implemented with null body
 void write(OutputStream aStream)
          outputs the state of the cache with each if its cachelets in XML
 
Methods inherited from class com.ten60.netkernel.container.ComponentImpl
doPeriodicHouseKeeping, getEncoding, getURI
 
Methods inherited from class com.ten60.netkernel.urii.representation.SimpleRepresentationImpl
getAspect, getAspects, getMeta, hasAspect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ten60.netkernel.urii.IURRepresentation
getAspect, getAspects, getMeta, hasAspect
 

Field Detail

URI

public static final URIdentifier URI
our static URI


EXPIRED_RESOURCE

public static final IURRepresentation EXPIRED_RESOURCE
expired resource in cache

Constructor Detail

Cache

public Cache()
Creates a new instance of Cache

Method Detail

registerCacheletModule

public void registerCacheletModule(ModuleDefinition aModule)

registerDefaultCacheletModule

public void registerDefaultCacheletModule(ModuleDefinition aModule)

start

public void start(Container aContainer)
           throws NetKernelException
Initialise the cache, finding the default cachelet

Specified by:
start in interface IComponent
Overrides:
start in class ComponentImpl
Throws:
NetKernelException

stop

public void stop()
          throws NetKernelException
Description copied from class: ComponentImpl
stop method implemented with null body

Specified by:
stop in interface IComponent
Overrides:
stop in class ComponentImpl
Throws:
NetKernelException

get

public IURRepresentation get(URRequest aRequest)
                      throws NetKernelException
public interface for getting a IURRepresentation that will satisfy the given request

Parameters:
aRequest - the request
Returns:
a representation that will satisfy the request
Throws:
NetKernelException - thrown if the cachelet fails in anyway

put

public void put(URResult aResult)
         throws NetKernelException
public interface for putting informing the cache of a result- it is its choice whether to use it or not

Parameters:
aResult - a URResult that has been issued
Throws:
NetKernelException - thrown if the cachelet fails in any way

write

public void write(OutputStream aStream)
           throws IOException
outputs the state of the cache with each if its cachelets in XML

Specified by:
write in interface IAspectBinaryStream
Overrides:
write in class ComponentImpl
Parameters:
aStream - an output stream to write the XML to
Throws:
IOException - thrown if we fail to write to the stream

NetKernel APIs


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