ozone API

org.ozoneDB
Class CacheObjectContainer

java.lang.Object
  |
  +--org.ozoneDB.CacheObjectContainer
All Implemented Interfaces:
org.ozoneDB.core.dr.Lockable, org.ozoneDB.core.ObjectContainer, java.io.Serializable

public final class CacheObjectContainer
extends java.lang.Object
implements org.ozoneDB.core.ObjectContainer, java.io.Serializable

An implementation of ObjectContainer that works together with ClientCacheDatabase to provide an client site cache. A client program never needs to directly deal with it.

Version:
$Revision: 1.2 $Date: 2002/06/08 00:49:38 $
Author:
SMB
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.ozoneDB.core.ObjectContainer
IMPLNAME_POSTFIX, PROXYNAME_POSTFIX, STATE_CLEAN, STATE_CREATED, STATE_DELETED, STATE_MODIFIED, STATE_READ
 
Constructor Summary
CacheObjectContainer(org.ozoneDB.core.ObjectContainer rhs)
           
CacheObjectContainer(OzoneCompatible _target, org.ozoneDB.core.ObjectID _id, java.lang.String _name, int _access)
           
 
Method Summary
 int access()
           
 DxCollection allLockers()
           
 void clearState()
           
 void createTarget(org.ozoneDB.core.Env env, java.lang.Class cl, java.lang.String sig, java.lang.Object[] args)
           
 OzoneInterface database()
           
 void deleteTarget()
           
 boolean dirty()
           
 int ensureGarbageCollectionLevel(int newGarbageCollectionLevel)
          Ensures that the garbageCollectionLevel is at least the given currentGarbageCollectionLevel.
 void finalizeTarget()
           
 int getGarbageCollectionLevel()
          Returns the garbageCollectionLevel this ObjectContainer has reached due to (not) calling ensureGarbageCollectionLevel(int).
 org.ozoneDB.core.ObjectID id()
           
 java.lang.Object invokeTarget(org.ozoneDB.core.Env env, int methodIndex, java.lang.Object[] args)
           
 java.lang.Object invokeTarget(org.ozoneDB.core.Env env, java.lang.String methodName, java.lang.String sig, java.lang.Object[] args)
           
 boolean isPinned()
          Returns wether this ObjectContainer is pinned.
 long lastTouched()
           
 org.ozoneDB.core.Lock lock()
           
 long modTime()
           
 java.lang.String name()
           
 void nameTarget(java.lang.String _name)
           
 OzoneProxy ozoneProxy()
           
 org.ozoneDB.core.Permissions permissions()
           
 void pin()
          Pins this ObjectContainer.
 void raiseState(int newState)
           
 void setDatabase(ClientCacheDatabase _db)
           
 void setDirty(boolean _dirty)
           
 void setName(java.lang.String _name)
           
 void setTarget(OzoneCompatible _target)
           
 int state()
           
 OzoneCompatible target()
           
 java.lang.Class targetClass()
           
 OzoneCompatible targetClone()
           
 void touch()
           
 void unpin()
          Unpins this ObjectContainer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ozoneDB.core.ObjectContainer
equals
 

Constructor Detail

CacheObjectContainer

public CacheObjectContainer(org.ozoneDB.core.ObjectContainer rhs)

CacheObjectContainer

public CacheObjectContainer(OzoneCompatible _target,
                            org.ozoneDB.core.ObjectID _id,
                            java.lang.String _name,
                            int _access)
Method Detail

access

public int access()

state

public int state()
Specified by:
state in interface org.ozoneDB.core.ObjectContainer

dirty

public boolean dirty()

setDirty

public void setDirty(boolean _dirty)

raiseState

public void raiseState(int newState)

clearState

public void clearState()

touch

public void touch()
Specified by:
touch in interface org.ozoneDB.core.ObjectContainer

lastTouched

public long lastTouched()

modTime

public long modTime()
Specified by:
modTime in interface org.ozoneDB.core.ObjectContainer

lock

public org.ozoneDB.core.Lock lock()
Specified by:
lock in interface org.ozoneDB.core.ObjectContainer

allLockers

public DxCollection allLockers()
Specified by:
allLockers in interface org.ozoneDB.core.dr.Lockable

setTarget

public void setTarget(OzoneCompatible _target)
Specified by:
setTarget in interface org.ozoneDB.core.ObjectContainer

target

public OzoneCompatible target()
Specified by:
target in interface org.ozoneDB.core.ObjectContainer

targetClass

public java.lang.Class targetClass()
Specified by:
targetClass in interface org.ozoneDB.core.ObjectContainer

setDatabase

public void setDatabase(ClientCacheDatabase _db)

database

public OzoneInterface database()
Specified by:
database in interface org.ozoneDB.core.ObjectContainer

id

public org.ozoneDB.core.ObjectID id()
Specified by:
id in interface org.ozoneDB.core.ObjectContainer

permissions

public org.ozoneDB.core.Permissions permissions()
Specified by:
permissions in interface org.ozoneDB.core.ObjectContainer

name

public java.lang.String name()
Specified by:
name in interface org.ozoneDB.core.ObjectContainer

setName

public void setName(java.lang.String _name)
Specified by:
setName in interface org.ozoneDB.core.ObjectContainer

ozoneProxy

public OzoneProxy ozoneProxy()
Specified by:
ozoneProxy in interface org.ozoneDB.core.ObjectContainer

targetClone

public OzoneCompatible targetClone()
                            throws java.lang.Exception
Specified by:
targetClone in interface org.ozoneDB.core.ObjectContainer
java.lang.Exception

invokeTarget

public java.lang.Object invokeTarget(org.ozoneDB.core.Env env,
                                     java.lang.String methodName,
                                     java.lang.String sig,
                                     java.lang.Object[] args)
                              throws java.lang.Exception
Specified by:
invokeTarget in interface org.ozoneDB.core.ObjectContainer
java.lang.Exception

invokeTarget

public java.lang.Object invokeTarget(org.ozoneDB.core.Env env,
                                     int methodIndex,
                                     java.lang.Object[] args)
                              throws java.lang.Exception
Specified by:
invokeTarget in interface org.ozoneDB.core.ObjectContainer
java.lang.Exception

createTarget

public void createTarget(org.ozoneDB.core.Env env,
                         java.lang.Class cl,
                         java.lang.String sig,
                         java.lang.Object[] args)
                  throws java.lang.Exception
Specified by:
createTarget in interface org.ozoneDB.core.ObjectContainer
java.lang.Exception

deleteTarget

public void deleteTarget()
Specified by:
deleteTarget in interface org.ozoneDB.core.ObjectContainer

nameTarget

public void nameTarget(java.lang.String _name)
Specified by:
nameTarget in interface org.ozoneDB.core.ObjectContainer

finalizeTarget

public void finalizeTarget()
                    throws java.lang.Exception
java.lang.Exception

pin

public void pin()
Pins this ObjectContainer. Every caller of this method must pair this call with a call to unpin(). An ObjectContainer remains in main memory at least as long as it is pinned.

Specified by:
pin in interface org.ozoneDB.core.ObjectContainer

unpin

public void unpin()
Unpins this ObjectContainer. This method must be called exactly once for every call to pin().

Specified by:
unpin in interface org.ozoneDB.core.ObjectContainer

isPinned

public boolean isPinned()
Returns wether this ObjectContainer is pinned.

Specified by:
isPinned in interface org.ozoneDB.core.ObjectContainer

ensureGarbageCollectionLevel

public int ensureGarbageCollectionLevel(int newGarbageCollectionLevel)
Ensures that the garbageCollectionLevel is at least the given currentGarbageCollectionLevel. The return value is meaningful if the supplied newGarbageCollectionLevel is the currentGarbageCollectionLevel

Specified by:
ensureGarbageCollectionLevel in interface org.ozoneDB.core.ObjectContainer
Returns:
<=0 if this object still has to be processed. This is the case if it belongs to the surelyReachable set but not to the processedReachable set > otherwise <0 if this object has been updated =0 if this object has not been updated, it is surelyReachable >0 if this object has not been updated, it is processedReachable

getGarbageCollectionLevel

public int getGarbageCollectionLevel()
Returns the garbageCollectionLevel this ObjectContainer has reached due to (not) calling ensureGarbageCollectionLevel(int).

Specified by:
getGarbageCollectionLevel in interface org.ozoneDB.core.ObjectContainer

ozone API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.