01: // You can redistribute this software and/or modify it under the terms of
02: // the Ozone Library License version 1 published by ozone-db.org.
03: //
04: // The original code and portions created by SMB are
05: // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
06: //
07: // $Id: OzoneCompatible.java,v 1.3 2002/07/12 09:25:11 mediumnet Exp $
08:
09: package org.ozoneDB;
10:
11: import org.ozoneDB.core.*;
12: import java.io.*;
13:
14: import org.xml.sax.ContentHandler;
15: import org.xml.sax.SAXException;
16:
17: /**
18: * All objects that are stored in ozone have to implement this interface.
19: * The easiest way to build database objects is to extend the OzoneObject class,
20: * which implements OzoneCompatible already.
21: *
22: *
23: * @author <a href="http://www.softwarebuero.de/">SMB</a>
24: * @version $Revision: 1.3 $Date: 2002/07/12 09:25:11 $
25: */
26: public interface OzoneCompatible extends Serializable,
27: OzoneCompatibleOrProxy {
28:
29: /**
30: * Set the container of the receiver. The member that holds the actual
31: * reference must be <i>transient</i>.
32: */
33: public void setContainer(ObjectContainer _container);
34:
35: /**
36: * Return the container of the receiver.
37: */
38: public ObjectContainer container();
39:
40: /**
41: * Return a proxy for the receiver.
42: */
43: public OzoneProxy self();
44:
45: /**
46: * Return the database link
47: */
48: public OzoneInterface database();
49:
50: // callback methods
51:
52: /**
53: * This method will be automaticly called when this object is created
54: * using createObject().
55: */
56: public void onCreate() throws Exception;
57:
58: /**
59: * This method will be automaticly called when this object is deleted
60: * using deleteObject(). It should delete all database objects that depend
61: * on it and that are not otherwise reachable. In other words, this is the
62: * persistent destructor of the object.
63: */
64: public void onDelete() throws Exception;
65:
66: // This Method is not needed anymore, because it is only used in ClassicStore
67: /**
68: * This method is automatically called by the ozone server to get an idea
69: * of the size of this object. The method should not return the actual
70: * current size of the object but the size the object will probably reach
71: * during its life time.
72: *
73: * @return The to be expected size of the object or -1 if a default value
74: * should be used.
75: *
76: public int size() throws Exception;
77: */
78:
79: public boolean toXML(ContentHandler ch) throws SAXException;
80:
81: }
|