org.ozoneDB.core
Class AbstractObjectContainer
java.lang.Object
org.ozoneDB.core.AbstractObjectContainer
- All Implemented Interfaces:
- Lockable, ObjectContainer
- Direct Known Subclasses:
- AdminObjectContainer, ClassicObjectContainer, GammaContainer, StorageObjectContainer
- public abstract class AbstractObjectContainer
- extends java.lang.Object
- implements ObjectContainer
- Version:
- $Revision: 1.15 $Date: 2003/12/07 18:20:37 $
- Author:
- SMB
Method Summary |
void |
clearState()
|
protected java.lang.reflect.Constructor |
constructorFor(Env env,
java.lang.Class cl,
java.lang.String sig)
Search the constructor with the specified signature.
|
void |
createTarget(Env env,
java.lang.Class cl,
java.lang.String sig,
java.lang.Object[] args)
|
org.ozoneDB.OzoneInterface |
database()
|
static void |
flushMethodCache()
|
protected static org.ozoneDB.Database |
getCurrentDatabase()
|
protected Transaction |
getCurrrentTransaction()
|
protected Env |
getEnv()
|
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)
|
protected java.lang.reflect.Method |
methodFor(Env env,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String sig,
java.lang.Object[] args)
Search the method with the specified name and signature. |
org.ozoneDB.OzoneProxy |
ozoneProxy()
Return a proxy for the receiver. |
void |
raiseState(int newState)
|
void |
requireWriteLocking()
|
void |
setShouldCallOnActivate(boolean shouldOnActivateBeCalled)
|
void |
setShouldCallOnPassivate(boolean shouldOnPassivateBeCalled)
|
boolean |
shouldOnActivateBeCalled()
|
boolean |
shouldOnPassivateBeCalled()
|
int |
state()
Return the current state of the container. |
org.ozoneDB.OzoneCompatible |
targetClone()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.ozoneDB.core.ObjectContainer |
deleteTarget, ensureGarbageCollectionLevel, equals, getGarbageCollectionLevel, id, isPinned, lock, modTime, name, nameTarget, permissions, pin, setName, setTarget, target, targetClass, touch, unpin |
methodTable
private static transient DxMap methodTable
classTable
private static transient DxMap classTable
theProxy
private transient org.ozoneDB.OzoneProxy theProxy
state
protected int state
shouldCallOnActivate
protected transient boolean shouldCallOnActivate
shouldCallOnPassivate
protected transient boolean shouldCallOnPassivate
AbstractObjectContainer
public AbstractObjectContainer()
state
public int state()
- Description copied from interface:
ObjectContainer
- 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.
- Specified by:
state
in interface ObjectContainer
- Returns:
- The state of the container.
raiseState
public void raiseState(int newState)
clearState
public void clearState()
database
public org.ozoneDB.OzoneInterface database()
- Specified by:
database
in interface ObjectContainer
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.
targetClone
public org.ozoneDB.OzoneCompatible targetClone()
throws java.lang.Exception
- Specified by:
targetClone
in interface ObjectContainer
- Throws:
java.lang.Exception
methodFor
protected final java.lang.reflect.Method methodFor(Env env,
java.lang.Object obj,
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. Once
a method has been invoked it is stored in a global cache that holds
the method objects of all database classes.
- Parameters:
methodName
- sig
- args
-
- Throws:
java.lang.Exception
constructorFor
protected java.lang.reflect.Constructor constructorFor(Env env,
java.lang.Class cl,
java.lang.String sig)
throws java.lang.Exception,
java.lang.NoSuchMethodException
- Search the constructor with the specified signature.
Once a constructor has been invoked it is stored in a global cache that
holds the method and constructor objects of all database classes.
- Parameters:
env
- cl
- sig
-
- Throws:
java.lang.Exception
java.lang.NoSuchMethodException
flushMethodCache
public static void flushMethodCache()
invokeTarget
public java.lang.Object invokeTarget(Env env,
java.lang.String methodName,
java.lang.String sig,
java.lang.Object[] args)
throws java.lang.Exception,
java.lang.reflect.InvocationTargetException
- Specified by:
invokeTarget
in interface ObjectContainer
- Throws:
java.lang.Exception
java.lang.reflect.InvocationTargetException
invokeTarget
public java.lang.Object invokeTarget(Env env,
int methodIndex,
java.lang.Object[] args)
throws java.lang.Exception,
java.lang.reflect.InvocationTargetException
- Specified by:
invokeTarget
in interface ObjectContainer
- Throws:
java.lang.Exception
java.lang.reflect.InvocationTargetException
invokeOnPassivate
public void invokeOnPassivate()
- Specified by:
invokeOnPassivate
in interface ObjectContainer
invokeOnActivate
public void invokeOnActivate()
- Specified by:
invokeOnActivate
in interface ObjectContainer
shouldOnActivateBeCalled
public boolean shouldOnActivateBeCalled()
- Specified by:
shouldOnActivateBeCalled
in interface ObjectContainer
shouldOnPassivateBeCalled
public boolean shouldOnPassivateBeCalled()
- Specified by:
shouldOnPassivateBeCalled
in interface ObjectContainer
setShouldCallOnActivate
public void setShouldCallOnActivate(boolean shouldOnActivateBeCalled)
- Specified by:
setShouldCallOnActivate
in interface ObjectContainer
setShouldCallOnPassivate
public void setShouldCallOnPassivate(boolean shouldOnPassivateBeCalled)
- Specified by:
setShouldCallOnPassivate
in interface ObjectContainer
createTarget
public void createTarget(Env env,
java.lang.Class cl,
java.lang.String sig,
java.lang.Object[] args)
throws java.lang.Exception
- Specified by:
createTarget
in interface ObjectContainer
- Throws:
java.lang.Exception
requireWriteLocking
public void requireWriteLocking()
- Specified by:
requireWriteLocking
in interface ObjectContainer
getEnv
protected Env getEnv()
getCurrentDatabase
protected static org.ozoneDB.Database getCurrentDatabase()
getCurrrentTransaction
protected Transaction getCurrrentTransaction()
Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.