📄 classicstore.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-2000 by SMB GmbH. All rights reserved.//// $Id: ClassicStore.java,v 1.8 2000/10/28 16:55:17 daniela Exp $package org.ozoneDB.core.classicStore;import java.io.*;import org.ozoneDB.DxLib.*;import org.ozoneDB.*;import org.ozoneDB.core.*;import org.ozoneDB.util.*;/** * ClassicStore acts as the mediator (director) of the classicStore module * especially for ClusterSpace, ObjectSpace, PersistentSpace. Currently it * serves only as container for the references but this should change in the * future to decouple class implementations. */public final class ClassicStore extends Object implements Store { /** */ protected Env env; protected ObjectSpace objectSpace; /** */ public ClassicStore() { } /** */ public void init( Env _env ) { env = _env; objectSpace = new ObjectSpace( _env ); } /** */ public void startup() throws Exception { env.logWriter.newEntry( this, "startup...", LogWriter.INFO ); objectSpace.startup(); } /** */ public void shutdown() throws Exception { env.logWriter.newEntry( this, "shutdown...", LogWriter.INFO ); objectSpace.shutdown(); } /** */ public ObjectContainer newContainer( Transaction ta, OzoneCompatible target, ObjectID objID, Permissions permissions ) throws Exception { return objectSpace.newContainer( ta, target, objID, permissions ); } /** */ public ObjectContainer containerForID( Transaction ta, ObjectID id ) throws Exception { return objectSpace.objectForID( id ); } /** * @param name The object name to search for. * @param ta * @return The object container for the name or null. */ public ObjectContainer containerForName( Transaction ta, String name ) throws Exception { return objectSpace.objectForName( name ); } /** * @param ta * @param container * @param name */ public void nameContainer( Transaction ta, ObjectContainer container, String name ) throws PermissionDeniedExc { try { objectSpace.nameObject( container, name ); } catch (ClassicStoreExc e) { throw new PermissionDeniedExc( e.toString() ); } } /** */ public void join( Transaction ta, ObjectContainer container, int lockLevel ) throws Exception { //System.out.println ("join: " + container.id()); ClassicObjectContainer classicCon = (ClassicObjectContainer)container; classicCon.upgradeLockLevel( ta, lockLevel ); ta.idTable.addForKey( classicCon, classicCon.id() ); } /** * @param ta Transaction that will be commited. */ public void prepareCommitTransaction( Transaction ta ) throws Exception { objectSpace.prepareCommitObjects( ta ); } /** */ public void commitTransaction( Transaction ta ) { objectSpace.commitObjects( ta ); } /** * @param ta ID of the comitting transaction. * @param created * @param modified */ public void abortTransaction( Transaction ta ) { try { objectSpace.abortObjects( ta ); } catch (Exception e) { env.logWriter.newEntry( this, "Abort of transaction " + ta.taID() + " failed !\n" + e, LogWriter.ERROR ); } } /** */ public void upgradeLockLevel( Transaction ta, ObjectContainer container, int lockLevel ) throws Exception { ((ClassicObjectContainer)container).upgradeLockLevel( ta, lockLevel ); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -