📄 ozonecompatible.java
字号:
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library 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: OzoneCompatible.java,v 1.11 2003/04/11 13:38:53 per_nyfelt Exp $
package org.ozoneDB;
import org.ozoneDB.core.*;
import java.io.*;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
/**
* All objects that are stored in ozone have to implement this interface.
* The easiest way to build database objects is to extend the OzoneObject class,
* which implements OzoneCompatible already.
*
*
* @author <a href="http://www.softwarebuero.de/">SMB</a>
* @author Per Nyfelt
* @version $Revision: 1.11 $Date: 2003/04/11 13:38:53 $
*/
public interface OzoneCompatible extends Serializable,OzoneCompatibleOrProxy {
/**
* Set the container of the receiver. The member that holds the actual
* reference must be <i>transient</i>.
*/
public void setContainer( ObjectContainer _container );
/**
* Return the container of the receiver.
*/
public ObjectContainer container();
/**
* Return a proxy for the receiver.
*/
public OzoneProxy self();
/**
* Return the database link
*/
public OzoneInterface database();
// callback methods
/**
* This method will be automaticly called when this object is created
* using createObject().
*/
public void onCreate();
/**
This method will be automatically called after this object is
loaded (deserialized) from storage.
<DIV>
Note that there is currently a race condition: If another transaction tries to invoke
a method on this object as well, it may succeed before this method completes.
Thus, it is likely, but not guaranteed, that onActivate() is called before any other
method of the object. This may be fixed in the future.
</DIV>
<DIV>
This method may be called with this object being read-locked. That means, that you may
not, by default, change any member of this object (more precisely: of any object being member
of this {@link ObjectContainer}). If you detect within onActivate() that you need to change something,
you need to call {@link org.ozoneDB.OzoneObject#requireWriteLocking} before the first change.
Then, the lock is upgraded to write-locking.
</DIV>
You may not throw declared exceptions, because the method which tries to access you does not know that you do so.
*/
public void onActivate();
/**
This method will be automaticly called emediately before this object is
stored (serialized) to storage.
This method will currently not be called.
*/
public void onPassivate();
/**
* This method will be automaticly called when this object is deleted
* using deleteObject(). It should delete all database objects that depend
* on it and that are not otherwise reachable. In other words, this is the
* persistent destructor of the object.
*/
public void onDelete();
// This Method is not needed anymore, because it is only used in ClassicStore
/**
* This method is automatically called by the ozone server to get an idea
* of the size of this object. The method should not return the actual
* current size of the object but the size the object will probably reach
* during its life time.
*
* @return The to be expected size of the object or -1 if a default value
* should be used.
*
public int size() throws Exception;
*/
public boolean toXML( ContentHandler ch ) throws SAXException;
}
// :indentSize=4:tabSize=4:noTabs=true:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -