KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > core > DbRemote > DbCommand


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Core License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: DbCommand.java,v 1.6 2002/09/18 06:54:15 per_nyfelt Exp $
8

9 package org.ozoneDB.core.DbRemote;
10
11 import org.ozoneDB.DxLib.DxObject;
12 import org.ozoneDB.core.Env;
13 import org.ozoneDB.core.Transaction;
14
15
16 /**
17  * This is the base class for command that can be send to an ozone server.
18  *
19  *
20  * @author <a HREF="http://www.softwarebuero.de/">SMB</a>
21  * @version $Revision: 1.6 $Date: 2002/09/18 06:54:15 $
22  */

23 public abstract class DbCommand extends DxObject {
24
25     /**
26      * Environment of this object. Will be set by InvokeServer.
27      */

28     public transient Env env;
29
30     /**
31      * Result of the command. This will only be used on the server side.
32      */

33     public transient Object JavaDoc result;
34
35     /**
36         The database client proxy object gate which proxy objects leaving the database must be signed on.
37         This field is valid during the call of {@link #perform}.
38     */

39     protected transient ProxyObjectGate proxyObjectGate;
40
41
42     public DbCommand() {
43     }
44
45
46     /**
47      * Perform whatever has to be done for this command. This method is called
48      * within a transaction, within a thread. The result of the command goes in
49      * the result member.
50      */

51     public abstract void perform( Transaction ta ) throws Exception JavaDoc;
52
53
54     public String JavaDoc toString() {
55         return "[" + this.getClass().getName() + "]";
56     }
57
58     public void setProxyObjectGate(ProxyObjectGate proxyObjectGate) {
59         this.proxyObjectGate = proxyObjectGate;
60     }
61
62     /**
63         Returns database client proxy object gate which proxy objects leaving the database must be signed on.
64         The return value is valid during the call of {@link #perform}.
65     */

66     protected ProxyObjectGate getProxyObjectGate() {
67         return proxyObjectGate;
68     }
69
70     /**
71         Returns wether a result should be sent to the client.
72     */

73     public boolean shouldResultBeSentToClient() {
74         return true;
75     }
76 }
77
Popular Tags