⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adminobjectcontainer.java

📁 Java的面向对象数据库系统的源代码
💻 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: AdminObjectContainer.java,v 1.4 2002/09/18 06:54:16 per_nyfelt Exp $

package org.ozoneDB.core.admin;

import org.ozoneDB.DxLib.DxCollection;
import org.ozoneDB.OzoneCompatible;
import org.ozoneDB.core.*;
import org.ozoneDB.util.LogWriter;


/**
 * @author <a href="http://www.softwarebuero.de/">SMB</a>
 * @version $Revision: 1.4 $Date: 2002/09/18 06:54:16 $
 */
public class AdminObjectContainer extends AbstractObjectContainer {

    protected final static long serialVersionUID = 1L;

    protected Env		env;

    protected OzoneCompatible	target;

    protected ObjectID		objID;

    protected String		name;

    protected Lock		lock;

    protected Permissions	permissions;


    public AdminObjectContainer() {
    }


    public AdminObjectContainer( Env _env, OzoneCompatible _target, ObjectID _objID ) {
        state = STATE_CREATED;
        target = _target;
        objID = _objID;
        env = _env;
        env.logWriter.newEntry( this, "admin container created...", LogWriter.INFO );
    }


    public long modTime() {
        throw new RuntimeException( "Not supported: modTime()" );
    }


    public Class targetClass() {
        return target.getClass();
    }


    public void setTarget( OzoneCompatible _target ) {
        if (target != null) {
            target.setContainer( null );
        }
        target = _target;
        target.setContainer( this );
    }


    public OzoneCompatible target() {
        return target;
    }


    public void touch() {
    }


    public Lock lock() {
        return lock;
    }


    public void updateLockLevel( Transaction ta ) throws Exception {
        if (env.logWriter.hasTarget( LogWriter.DEBUG3 )) {
            env.logWriter.newEntry( this, "upgradeLockLevel(): ", LogWriter.DEBUG3 );
        }
        throw new RuntimeException( "Not supported: updateLockLevel()" );
    }


    public Permissions permissions() {
        return permissions;
    }


    public int lockLevel( Transaction ta ) {
        return lock.level( ta );
    }


    public Object invokeTarget( Env env, String methodName, String sig, Object[] args ) throws Exception {
        if (env.logWriter.hasTarget( LogWriter.DEBUG3 )) {
            env.logWriter.newEntry( this, "invokeTarget(): ", LogWriter.DEBUG3 );
        }
        return super.invokeTarget( env, methodName, sig, args );
    }


    public void deleteTarget() {
        if (env.logWriter.hasTarget( LogWriter.DEBUG3 )) {
            env.logWriter.newEntry( this, "deleteTarget(): ", LogWriter.DEBUG3 );
        }
        throw new RuntimeException( "Not supported: deleteTarget()" );
    }


    public void nameTarget( String _name ) {
        if (env.logWriter.hasTarget( LogWriter.DEBUG3 )) {
            env.logWriter.newEntry( this, "nameTarget(): ", LogWriter.DEBUG3 );
        }
        throw new RuntimeException( "Not supported: nameTarget()" );
    }


    public DxCollection allLockers() {
        throw new RuntimeException( "Not supported: allLockers()" );
    }


    public boolean equals( Object obj ) {
        if (obj != null && obj instanceof AdminObjectContainer) {
            AdminObjectContainer rhs = (AdminObjectContainer)obj;
            return objID.equals( rhs.objID );
        }
        return false;
    }


    public ObjectID id() {
        return objID;
    }


    public String name() {
        return name;
    }


    public void setName( String _name ) {
        name = _name;
    }

	/**
		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() {
		return false;
	}

    /**
    	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) {
    	return 1;
    }

    /**
    	Returns the garbageCollectionLevel this ObjectContainer has reached due to (not) calling {@link #ensureGarbageCollectionLevel}.
    */
    public int getGarbageCollectionLevel() {
    	// Hope this will never be called.
    	return 0;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -