ozone core API

org.ozoneDB.core.classicStore
Class ClassicObjectContainer

java.lang.Object
  |
  +--org.ozoneDB.DxLib.DxObject
        |
        +--org.ozoneDB.core.classicStore.ClassicObjectContainer
All Implemented Interfaces:
java.lang.Cloneable, DxCompatible, java.io.Externalizable, Lockable, ObjectContainer, java.io.Serializable

public final class ClassicObjectContainer
extends DxObject
implements ObjectContainer, java.io.Externalizable

See Also:
Serialized Form

Field Summary
protected  ClusterID clusterID
          the cluster id where the object is stored
protected  ClusterSpace clusterSpace
           
protected  boolean created
           
protected  boolean deleted
           
protected  Env env
          The environment of this object.
protected static boolean keepObjectsAlive
          objekte werden nach transaktion nicht geloescht
protected  Lock lock
          the lock of the object
private static DxHashMap methodTable
          global method cache
protected  java.lang.String name
          a possible name for the object
protected  ObjectID objID
          the id of the object
protected  Permissions permissions
          permissions
protected static long serialVersionUID
          magic number for streaming
protected static byte subSerialVersionUID
           
protected  org.ozoneDB.OzoneCompatible target
          null, if not activted
protected  byte[] targetBackup
           
protected  org.ozoneDB.OzoneCompatible targetShadow
           
protected  short touchCount
           
protected  boolean touched
           
protected  long touchTime
          time of last invoke
 
Fields inherited from interface org.ozoneDB.core.ObjectContainer
IMPLNAME_POSTFIX, PROXYNAME_POSTFIX, STATE_CLEAN, STATE_CREATED, STATE_DELETED, STATE_MODIFIED, STATE_READ
 
Constructor Summary
ClassicObjectContainer()
          constructor fuer streaming
ClassicObjectContainer(org.ozoneDB.OzoneCompatible _target, ObjectID _objID, Permissions _permissions)
          constructor; name ist optional
 
Method Summary
protected  void abortTarget(Transaction ta)
           
protected  org.ozoneDB.OzoneCompatible activatedObject()
          Liefert referenz auf das eigentliche objekt; das objekt wird nachgeladen, wenn es gerade nicht aktiv ist; waehrend einer update-ta wird nur der clone bearbeitet und somit auch nicht nachgeladen
 DxCollection allLockers()
          Gibt collection mit entweder dem writeLocker oder allen readLockern, d.h.
protected  ClusterID clusterID()
           
protected  void commitTarget(Transaction ta)
           
protected  void createShadow()
           
 void deleteTarget()
           
 boolean equals(java.lang.Object obj)
          True, wenn beide auf ein OzoneCompatible mit gleicher ID verweisen.
 void finalizeTarget()
           
 ObjectID id()
           
 java.lang.Object invokeTarget(Env env, java.lang.String methodName, java.lang.String sig, java.lang.Object[] args)
           
 boolean isCreated()
           
 boolean isDeleted()
           
protected  void loadExternal(java.io.ObjectInput in)
          Aus stream lesen - fuer ClusterSpace.
 int lockLevel(Transaction ta)
           
private  java.lang.reflect.Method methodFor(java.lang.String methodName, java.lang.String sig, java.lang.Object[] args)
          Search the method with the specified name and signature.
 java.lang.String name()
           
 void nameTarget(java.lang.String _name)
           
 void notifyAllTAs(Transaction ta)
           
protected  java.lang.Class objectClass()
           
 org.ozoneDB.OzoneProxy ozoneProxy()
          Return a proxy for the receiver.
 Permissions permissions()
           
 void readExternal(java.io.ObjectInput in)
          Aus stream lesen - fuer DxDiskHashtable.
protected  void setClusterID(ClusterID _clusterID)
           
 void setName(java.lang.String _name)
           
protected  org.ozoneDB.OzoneCompatible setObject(org.ozoneDB.OzoneCompatible obj)
          Setzen oder loeschen des objektes.
protected  void setOwner(User newOwner)
           
protected  void storeExternal(java.io.ObjectOutput out)
          In stream schreiben.
 org.ozoneDB.OzoneCompatible target()
          Liefert referenz auf das eigentliche objekt.
 org.ozoneDB.OzoneCompatible targetClone()
          Build a copy of the encap object.
 org.ozoneDB.OzoneCompatible targetShadow()
           
 void touch()
           
protected  int touchCount()
           
protected  boolean touched()
           
protected  long touchTime()
           
protected  void upgradeLockLevel(Transaction ta, int lockLevel)
           
 void writeExternal(java.io.ObjectOutput out)
          In stream schreiben - fuer DxDiskHashtable
 
Methods inherited from class org.ozoneDB.DxLib.DxObject
clone, isLess
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ozoneDB.core.ObjectContainer
createTarget, database, ensureGarbageCollectionLevel, getGarbageCollectionLevel, invokeTarget, isPinned, lock, modTime, pin, setTarget, state, targetClass, unpin
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
magic number for streaming

See Also:
Constant Field Values

subSerialVersionUID

protected static final byte subSerialVersionUID
See Also:
Constant Field Values

methodTable

private static DxHashMap methodTable
global method cache


keepObjectsAlive

protected static boolean keepObjectsAlive
objekte werden nach transaktion nicht geloescht


env

protected transient Env env
The environment of this object.


clusterSpace

protected transient ClusterSpace clusterSpace

permissions

protected Permissions permissions
permissions


target

protected org.ozoneDB.OzoneCompatible target
null, if not activted


targetShadow

protected org.ozoneDB.OzoneCompatible targetShadow

targetBackup

protected byte[] targetBackup

touchTime

protected long touchTime
time of last invoke


touchCount

protected short touchCount

touched

protected boolean touched

name

protected java.lang.String name
a possible name for the object


objID

protected ObjectID objID
the id of the object


clusterID

protected ClusterID clusterID
the cluster id where the object is stored


lock

protected Lock lock
the lock of the object


deleted

protected boolean deleted

created

protected boolean created
Constructor Detail

ClassicObjectContainer

public ClassicObjectContainer()
constructor fuer streaming


ClassicObjectContainer

public ClassicObjectContainer(org.ozoneDB.OzoneCompatible _target,
                              ObjectID _objID,
                              Permissions _permissions)
constructor; name ist optional

Method Detail

equals

public boolean equals(java.lang.Object obj)
True, wenn beide auf ein OzoneCompatible mit gleicher ID verweisen.

Specified by:
equals in interface ObjectContainer
Overrides:
equals in class java.lang.Object
Returns:
True if obj and receiver point to the same target object.

finalizeTarget

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

id

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

isCreated

public boolean isCreated()

deleteTarget

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

isDeleted

public boolean isDeleted()

invokeTarget

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

touch

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

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

nameTarget

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

permissions

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

targetClone

public org.ozoneDB.OzoneCompatible targetClone()
                                        throws java.lang.Exception
Build a copy of the encap object. This is based on serialization, so no clone() method must be implemented by OzoneObjects.

Specified by:
targetClone in interface ObjectContainer
java.lang.Exception

ozoneProxy

public org.ozoneDB.OzoneProxy ozoneProxy()
Description copied from interface: ObjectContainer
Return a proxy for the receiver.

Specified by:
ozoneProxy in interface ObjectContainer
Returns:
Proxy for this object.

lockLevel

public int lockLevel(Transaction ta)

allLockers

public DxCollection allLockers()
Gibt collection mit entweder dem writeLocker oder allen readLockern, d.h. alle potentiell behindernden transaktionen

Specified by:
allLockers in interface Lockable

notifyAllTAs

public void notifyAllTAs(Transaction ta)

targetShadow

public org.ozoneDB.OzoneCompatible targetShadow()

target

public org.ozoneDB.OzoneCompatible target()
Liefert referenz auf das eigentliche objekt. darf nicht targetShadow beruecksichtigen, da ClusterSPace darauf aufbaut.

Specified by:
target in interface ObjectContainer

setObject

protected org.ozoneDB.OzoneCompatible setObject(org.ozoneDB.OzoneCompatible obj)
Setzen oder loeschen des objektes. commit() ist unteilbar, deshalb kein snchronized. Achtung: object ist evtl. gerade geclustert und muss vorher eingelagert werden; das darf nicht hier gemacht werden, da diese methode auch vom store benutzt wird.


setOwner

protected void setOwner(User newOwner)

touchCount

protected int touchCount()

touched

protected boolean touched()

touchTime

protected long touchTime()

clusterID

protected ClusterID clusterID()

setClusterID

protected void setClusterID(ClusterID _clusterID)

objectClass

protected java.lang.Class objectClass()
                               throws java.lang.Exception
java.lang.Exception

activatedObject

protected org.ozoneDB.OzoneCompatible activatedObject()
                                               throws java.lang.Exception
Liefert referenz auf das eigentliche objekt; das objekt wird nachgeladen, wenn es gerade nicht aktiv ist; waehrend einer update-ta wird nur der clone bearbeitet und somit auch nicht nachgeladen

java.lang.Exception

commitTarget

protected void commitTarget(Transaction ta)

abortTarget

protected void abortTarget(Transaction ta)

upgradeLockLevel

protected void upgradeLockLevel(Transaction ta,
                                int lockLevel)
                         throws java.lang.Exception
java.lang.Exception

createShadow

protected void createShadow()
                     throws java.lang.Exception
java.lang.Exception

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
In stream schreiben - fuer DxDiskHashtable

Specified by:
writeExternal in interface java.io.Externalizable
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Aus stream lesen - fuer DxDiskHashtable. objID ist normalerweise referenz auf objID in object

Specified by:
readExternal in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException

storeExternal

protected void storeExternal(java.io.ObjectOutput out)
                      throws java.io.IOException
In stream schreiben. wird vom ClusterSpace verwendet.

java.io.IOException

loadExternal

protected void loadExternal(java.io.ObjectInput in)
                     throws java.io.IOException,
                            java.lang.ClassNotFoundException
Aus stream lesen - fuer ClusterSpace. objID ist normalerweise referenz auf objID in object

java.io.IOException
java.lang.ClassNotFoundException

methodFor

private java.lang.reflect.Method methodFor(java.lang.String methodName,
                                           java.lang.String sig,
                                           java.lang.Object[] args)
                                    throws java.lang.Exception
Search the method with the specified name and signature. Ones a method has been invoked it is stored in a global cache that holds the method objects of all database classes.

java.lang.Exception

ozone core API

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