org.apache.jackrabbit.core.value
Class RefCountingBLOBFileValue

java.lang.Object
  extended by org.apache.jackrabbit.core.value.RefCountingBLOBFileValue
All Implemented Interfaces:
Binary

public class RefCountingBLOBFileValue
extends Object

RefCountingBLOBFileValue implements a reference counting BLOB file value on top of an existing BLOBFileValue. Whenever a copy() is created from this BLOB file value, a new light weight RefCountBinary is created and the reference count refCount is incremented. The underlying value is discarded once this RefCountingBLOBFileValue and all its light weight RefCountBinary intances have been discarded.


Constructor Summary
RefCountingBLOBFileValue(org.apache.jackrabbit.core.value.BLOBFileValue value)
          Creates a new reference counting blob file value based on the given value.
 
Method Summary
 void dispose()
          Discards the underyling value if the reference count drops to zero.
 boolean equals(Object obj)
           
protected  void finalize()
           
 long getSize()
           
 InputStream getStream()
           
 int hashCode()
           
 int read(byte[] b, long position)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RefCountingBLOBFileValue

public RefCountingBLOBFileValue(org.apache.jackrabbit.core.value.BLOBFileValue value)
Creates a new reference counting blob file value based on the given value.

Parameters:
value - the underlying value.
Method Detail

dispose

public void dispose()
Discards the underyling value if the reference count drops to zero.


equals

public boolean equals(Object obj)

toString

public String toString()

hashCode

public int hashCode()

getSize

public long getSize()
             throws RepositoryException
Throws:
RepositoryException

getStream

public InputStream getStream()
                      throws RepositoryException
Throws:
RepositoryException

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

read

public int read(byte[] b,
                long position)
         throws IOException,
                RepositoryException
Specified by:
read in interface Binary
Throws:
IOException
RepositoryException


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.