📄 objectcontainer.java
字号:
// You can redistribute this software and/or modify it under the terms of
// the Ozone Core License version 1 published by ozone-db.org.
//
// The original code and portions created by SMB are
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
//
// $Id: ObjectContainer.java,v 1.7 2003/04/06 13:57:33 mediumnet Exp $
package org.ozoneDB.core;
import org.ozoneDB.*;
import org.ozoneDB.core.dr.Lockable;
/**
* Together with the {@link StoreManager} interface this is part of the
* StoreManager back-end API.<p>
*
* 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
* {@link OzoneCompatible}.
*
*
* @author <a href="http://www.softwarebuero.de/">SMB</a>
* @author <A HREF="http://www.medium.net/">Medium.net</A>
* @version $Revision: 1.7 $Date: 2003/04/06 13:57:33 $
*/
public interface ObjectContainer extends Lockable {
public final static String PROXYNAME_POSTFIX = "_Proxy";
public final static String IMPLNAME_POSTFIX = "_Impl";
// possible return values of the state() method
public final static int STATE_CLEAN = 0;
public final static int STATE_READ = 1;
public final static int STATE_MODIFIED = 2;
public final static int STATE_CREATED = 4;
public final static int STATE_DELETED = 8;
/**
* 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.
*
*
* @return The state of the container.
*/
public int state();
/**
* 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.
*/
public long modTime();
public Lock lock();
public void touch();
public void setName( String _name );
public String name();
public void setTarget( OzoneCompatible _target );
public OzoneCompatible target();
public Class targetClass();
public void createTarget( Env env, Class cl, String sig, Object[] args ) throws Exception;
public Object invokeTarget( Env env, String methodName, String sig, Object[] args ) throws Exception;
public Object invokeTarget( Env env, int methodIndex, Object[] args ) throws Exception;
public void deleteTarget();
public void nameTarget( String _name );
public OzoneCompatible targetClone() throws Exception;
/**
* @return True if obj and receiver point to the same target object.
*/
public boolean equals( Object obj );
/**
* Return a proxy for the receiver.
* @return Proxy for this object.
*/
public OzoneProxy ozoneProxy();
public ObjectID id();
public OzoneInterface database();
public Permissions permissions();
/**
Pins this ObjectContainer.
Every caller of this method must pair this call with a call to {@link #unpin}.
An ObjectContainer remains in main memory at least as long as it is pinned.
*/
public void pin();
/**
Unpins this ObjectContainer.
This method must be called exactly once for every call to {@link #pin}.
*/
public void unpin();
/**
Returns wether this ObjectContainer is pinned.
*/
public boolean isPinned();
/**
Ensures that the garbageCollectionLevel is at least the given currentGarbageCollectionLevel.
The return value is meaningful if the supplied newGarbageCollectionLevel is the currentGarbageCollectionLevel
@return
<=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
*/
public int ensureGarbageCollectionLevel(int newGarbageCollectionLevel);
/**
Returns the garbageCollectionLevel this ObjectContainer has reached due to (not) calling {@link #ensureGarbageCollectionLevel}.
*/
public int getGarbageCollectionLevel();
public boolean shouldOnActivateBeCalled();
public void invokeOnActivate();
public void invokeOnPassivate();
boolean shouldOnPassivateBeCalled();
public void requireWriteLocking();
void setShouldCallOnPassivate(boolean shouldOnPassivateBeCalled);
void setShouldCallOnActivate(boolean shouldOnActivateBeCalled);
}
// :indentSize=4:tabSize=4:noTabs=true:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -