org.fjank.jcache
Class StreamCacheObject

java.lang.Object
  extended by java.lang.ref.Reference<T>
      extended by java.lang.ref.WeakReference
          extended by org.fjank.jcache.CacheObject
              extended by org.fjank.jcache.StreamCacheObject

public class StreamCacheObject
extends CacheObject

A cacheobject which reads/writes the content with the aid of Input/Outputstreams Contains an internal reference to the wrapped object, so the override of SoftReference is probably broken on this object...

Author:
Frank Karlstrøm

Constructor Summary
StreamCacheObject(Object key, Object referent, CacheGroup group, CacheRegion region, ReferenceQueue q)
          Creates a new StreamCacheObject object.
 
Method Summary
 InputStream getInputStream()
          Overrides the normal get method by getting the Object, then creating an InputStream to this object.
 OutputStream getOutputStream()
          gets an OutputStream to write to this object.
 
Methods inherited from class org.fjank.jcache.CacheObject
clear, destroy, equals, get, getAccesses, getAttributes, getGroup, getKey, getRefCount, getRegion, invalidate, needsLoading, resetRefCount, setAttributes, setAttributes, toString
 
Methods inherited from class java.lang.ref.Reference
enqueue, isEnqueued
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StreamCacheObject

public StreamCacheObject(Object key,
                         Object referent,
                         CacheGroup group,
                         CacheRegion region,
                         ReferenceQueue q)
                  throws CacheException
Creates a new StreamCacheObject object.

Parameters:
key - the name of this object
referent - the actuall object
group - the group this object belongs to
q - the ReferenceQueue this object goes to wneh the GC determines that this object is garbage.
Throws:
CacheException
Method Detail

getInputStream

public InputStream getInputStream()
                           throws ObjectNotFoundException
Overrides the normal get method by getting the Object, then creating an InputStream to this object.

Throws:
ObjectNotFoundException

getOutputStream

public OutputStream getOutputStream()
                             throws InvalidArgumentException
gets an OutputStream to write to this object.

Returns:
Throws:
InvalidArgumentException


Copyright © 2002-2009 Hosted by SourceForge. All Rights Reserved.