ozone core API

org.ozoneDB.core.storage.gammaStore
Class GammaContainer

java.lang.Object
  extended byorg.ozoneDB.core.AbstractObjectContainer
      extended byorg.ozoneDB.core.storage.gammaStore.GammaContainer
All Implemented Interfaces:
java.io.Externalizable, Lockable, ObjectContainer, java.io.Serializable

public final class GammaContainer
extends AbstractObjectContainer
implements java.io.Externalizable

Version:
$Id: GammaContainer.java,v 1.2 2004/03/21 21:05:51 leomekenkamp Exp $
Author:
Leo Mekenkamp (mind the anti sp@m)
See Also:
Serialized Form

Field Summary
private  GammaStore gammaStore
           
private  int garbageCollectionLevel
          The garbage collection level of this ObjectContainer.
private  Lock lock
           
private  java.lang.String name
           
private  ObjectID objectID
           
private  Permissions permissions
           
private static long serialVersionUID
           
private  org.ozoneDB.OzoneCompatible target
           
 
Fields inherited from class org.ozoneDB.core.AbstractObjectContainer
shouldCallOnActivate, shouldCallOnPassivate, state
 
Fields inherited from interface org.ozoneDB.core.ObjectContainer
IMPLNAME_POSTFIX, PROXYNAME_POSTFIX, STATE_CLEAN, STATE_CREATED, STATE_DELETED, STATE_MODIFIED, STATE_READ
 
Constructor Summary
GammaContainer(ObjectID objectID, GammaStore gammaStore)
           
 
Method Summary
 DxCollection allLockers()
          Returns a collection of Locker objects that currently lock this Lockable object.
 void deleteTarget()
           
 int ensureGarbageCollectionLevel(int newGarbageCollectionLevel)
          Ensures that the garbageCollectionLevel is at least the given currentGarbageCollectionLevel.
 boolean equals(java.lang.Object object)
           
private  GammaStore getGammaStore()
           
 int getGarbageCollectionLevel()
          Returns the garbageCollectionLevel this ObjectContainer has reached due to (not) calling ensureGarbageCollectionLevel(int).
 ObjectID getObjectId()
           
 org.ozoneDB.OzoneCompatible getTarget()
           
 ObjectID id()
           
protected  boolean isCreated()
           
protected  boolean isDeleted()
           
 boolean isInvoked()
           
 boolean isPinned()
          GammaStore does not not care about pin.
 Lock lock()
           
 int lockLevel(Transaction ta)
           
 long modTime()
          Returns the time when the container was last commited with lock level greater than Lock.LEVEL_READ.
 java.lang.String name()
           
 void nameTarget(java.lang.String name)
           
 void notifyAllTAs(Transaction ta)
           
 Permissions permissions()
           
 void pin()
          GammaStore does not not care about pin.
 void readExternal(java.io.ObjectInput in)
           
private  void setGammaStore(GammaStore gammaStore)
           
 void setName(java.lang.String name)
           
 void setTarget(org.ozoneDB.OzoneCompatible target)
           
 org.ozoneDB.OzoneCompatible target()
           
 java.lang.Class targetClass()
          Returns the Class for the target object.
 java.lang.String toString()
           
 void touch()
           
 void unpin()
          GammaStore does not not care about pin.
 void updateLockLevel(Transaction ta)
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class org.ozoneDB.core.AbstractObjectContainer
clearState, constructorFor, createTarget, database, flushMethodCache, getCurrentDatabase, getCurrrentTransaction, getEnv, invokeOnActivate, invokeOnPassivate, invokeTarget, invokeTarget, methodFor, ozoneProxy, raiseState, requireWriteLocking, setShouldCallOnActivate, setShouldCallOnPassivate, shouldOnActivateBeCalled, shouldOnPassivateBeCalled, state, targetClone
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

target

private org.ozoneDB.OzoneCompatible target

objectID

private ObjectID objectID

name

private java.lang.String name

lock

private Lock lock

gammaStore

private transient GammaStore gammaStore

permissions

private Permissions permissions

garbageCollectionLevel

private int garbageCollectionLevel
The garbage collection level of this ObjectContainer. This number is compared to the currentGarbageCollectionLevel of the database. Is this number smaller, then this object may be reachable. Is it equal, then this object is reachable, but it's descendants are not yet considered. Is it greater, then this object is reachable and this object is processed, it's descendants have been considered. At the end of the mark-process, every object which still is not reachable must be unreachable, so at this and, a smaller garbageCollectionLevel than currentGarbageCollectionLevel means that this object may be deleted.

Constructor Detail

GammaContainer

public GammaContainer(ObjectID objectID,
                      GammaStore gammaStore)
Method Detail

setGammaStore

private void setGammaStore(GammaStore gammaStore)

getGammaStore

private GammaStore getGammaStore()

modTime

public long modTime()
Description copied from interface: ObjectContainer
Returns the time when the container was last commited with lock level greater than Lock.LEVEL_READ. The value returned by this method should only be compared against return values of this method.

Specified by:
modTime in interface ObjectContainer

isDeleted

protected boolean isDeleted()

isCreated

protected boolean isCreated()

targetClass

public java.lang.Class targetClass()
Returns the Class for the target object. This method is used by AbstractObjectContainer.

Specified by:
targetClass in interface ObjectContainer

setTarget

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

target

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

getTarget

public org.ozoneDB.OzoneCompatible getTarget()

touch

public void touch()
Specified by:
touch in interface ObjectContainer

lock

public Lock lock()
Specified by:
lock in interface ObjectContainer

updateLockLevel

public void updateLockLevel(Transaction ta)
                     throws java.lang.Exception
Throws:
java.lang.Exception

notifyAllTAs

public void notifyAllTAs(Transaction ta)

permissions

public Permissions permissions()
Specified by:
permissions in interface ObjectContainer

lockLevel

public int lockLevel(Transaction ta)

isInvoked

public boolean isInvoked()

deleteTarget

public void deleteTarget()
Specified by:
deleteTarget in interface ObjectContainer

nameTarget

public void nameTarget(java.lang.String name)
Specified by:
nameTarget in interface ObjectContainer

allLockers

public DxCollection allLockers()
Description copied from interface: Lockable
Returns a collection of Locker objects that currently lock this Lockable object.

Specified by:
allLockers in interface Lockable

equals

public boolean equals(java.lang.Object object)
Specified by:
equals in interface ObjectContainer

id

public ObjectID id()
Specified by:
id in interface ObjectContainer

getObjectId

public ObjectID getObjectId()

name

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

setName

public void setName(java.lang.String name)
Specified by:
setName in interface ObjectContainer

writeExternal

public final void writeExternal(java.io.ObjectOutput out)
                         throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public final void readExternal(java.io.ObjectInput in)
                        throws java.io.IOException,
                               java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

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 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 ObjectContainer

pin

public void pin()
GammaStore does not not care about pin.

Specified by:
pin in interface ObjectContainer

unpin

public void unpin()
GammaStore does not not care about pin.

Specified by:
unpin in interface ObjectContainer

isPinned

public boolean isPinned()
GammaStore does not not care about pin.

Specified by:
isPinned in interface ObjectContainer

toString

public java.lang.String toString()

ozone core API

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