ozone core API

org.ozoneDB.core
Interface ObjectContainer

All Superinterfaces:
Lockable
All Known Implementing Classes:
AbstractObjectContainer

public interface ObjectContainer
extends Lockable

Together with the StoreManager interface this is part of the StoreManager back-end API.

An ObjectContainer wraps a target (database) object and decorates it with functionality needed by the database system, such as the corresponding object ID. Also, the ObjectContainer is the delegate for the methods defined by OzoneCompatible.

Version:
$Revision: 1.7 $Date: 2003/04/06 13:57:33 $
Author:
SMB, Medium.net

Field Summary
static java.lang.String IMPLNAME_POSTFIX
           
static java.lang.String PROXYNAME_POSTFIX
           
static int STATE_CLEAN
           
static int STATE_CREATED
           
static int STATE_DELETED
           
static int STATE_MODIFIED
           
static int STATE_READ
           
 
Method Summary
 void createTarget(Env env, java.lang.Class cl, java.lang.String sig, java.lang.Object[] args)
           
 org.ozoneDB.OzoneInterface database()
           
 void deleteTarget()
           
 int ensureGarbageCollectionLevel(int newGarbageCollectionLevel)
          Ensures that the garbageCollectionLevel is at least the given currentGarbageCollectionLevel.
 boolean equals(java.lang.Object obj)
           
 int getGarbageCollectionLevel()
          Returns the garbageCollectionLevel this ObjectContainer has reached due to (not) calling ensureGarbageCollectionLevel(int).
 ObjectID id()
           
 void invokeOnActivate()
           
 void invokeOnPassivate()
           
 java.lang.Object invokeTarget(Env env, int methodIndex, java.lang.Object[] args)
           
 java.lang.Object invokeTarget(Env env, java.lang.String methodName, java.lang.String sig, java.lang.Object[] args)
           
 boolean isPinned()
          Returns wether this ObjectContainer is pinned.
 Lock lock()
           
 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)
           
 org.ozoneDB.OzoneProxy ozoneProxy()
          Return a proxy for the receiver.
 Permissions permissions()
           
 void pin()
          Pins this ObjectContainer.
 void requireWriteLocking()
           
 void setName(java.lang.String _name)
           
 void setShouldCallOnActivate(boolean shouldOnActivateBeCalled)
           
 void setShouldCallOnPassivate(boolean shouldOnPassivateBeCalled)
           
 void setTarget(org.ozoneDB.OzoneCompatible _target)
           
 boolean shouldOnActivateBeCalled()
           
 boolean shouldOnPassivateBeCalled()
           
 int state()
          Return the current state of the container.
 org.ozoneDB.OzoneCompatible target()
           
 java.lang.Class targetClass()
           
 org.ozoneDB.OzoneCompatible targetClone()
           
 void touch()
           
 void unpin()
          Unpins this ObjectContainer.
 
Methods inherited from interface org.ozoneDB.core.dr.Lockable
allLockers
 

Field Detail

PROXYNAME_POSTFIX

public static final java.lang.String PROXYNAME_POSTFIX
See Also:
Constant Field Values

IMPLNAME_POSTFIX

public static final java.lang.String IMPLNAME_POSTFIX
See Also:
Constant Field Values

STATE_CLEAN

public static final int STATE_CLEAN
See Also:
Constant Field Values

STATE_READ

public static final int STATE_READ
See Also:
Constant Field Values

STATE_MODIFIED

public static final int STATE_MODIFIED
See Also:
Constant Field Values

STATE_CREATED

public static final int STATE_CREATED
See Also:
Constant Field Values

STATE_DELETED

public static final int STATE_DELETED
See Also:
Constant Field Values
Method Detail

state

public int state()
Return the current state of the container. Possible return values are the STATE constants defined in this class. A container can only be in one of these states at one time. The state of a container can only be raised during one transaction. So, if a container is created (STATE_CREATED) during a transaction, the state can become STATE_DELETED only.

Returns:
The state of the container.

modTime

public long modTime()
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.


lock

public Lock lock()

touch

public void touch()

setName

public void setName(java.lang.String _name)

name

public java.lang.String name()

setTarget

public void setTarget(org.ozoneDB.OzoneCompatible _target)

target

public org.ozoneDB.OzoneCompatible target()

targetClass

public java.lang.Class targetClass()

createTarget

public void createTarget(Env env,
                         java.lang.Class cl,
                         java.lang.String sig,
                         java.lang.Object[] args)
                  throws java.lang.Exception
Throws:
java.lang.Exception

invokeTarget

public java.lang.Object invokeTarget(Env env,
                                     java.lang.String methodName,
                                     java.lang.String sig,
                                     java.lang.Object[] args)
                              throws java.lang.Exception
Throws:
java.lang.Exception

invokeTarget

public java.lang.Object invokeTarget(Env env,
                                     int methodIndex,
                                     java.lang.Object[] args)
                              throws java.lang.Exception
Throws:
java.lang.Exception

deleteTarget

public void deleteTarget()

nameTarget

public void nameTarget(java.lang.String _name)

targetClone

public org.ozoneDB.OzoneCompatible targetClone()
                                        throws java.lang.Exception
Throws:
java.lang.Exception

equals

public boolean equals(java.lang.Object obj)
Returns:
True if obj and receiver point to the same target object.

ozoneProxy

public org.ozoneDB.OzoneProxy ozoneProxy()
Return a proxy for the receiver.

Returns:
Proxy for this object.

id

public ObjectID id()

database

public org.ozoneDB.OzoneInterface database()

permissions

public Permissions permissions()

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.


unpin

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

Specified by:
unpin in interface Lockable

isPinned

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


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

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).


shouldOnActivateBeCalled

public boolean shouldOnActivateBeCalled()

invokeOnActivate

public void invokeOnActivate()

invokeOnPassivate

public void invokeOnPassivate()

shouldOnPassivateBeCalled

public boolean shouldOnPassivateBeCalled()

requireWriteLocking

public void requireWriteLocking()

setShouldCallOnPassivate

public void setShouldCallOnPassivate(boolean shouldOnPassivateBeCalled)

setShouldCallOnActivate

public void setShouldCallOnActivate(boolean shouldOnActivateBeCalled)

ozone core API

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