java.lang.Object
java.util.Observable
org.vrspace.server.VRObject
org.vrspace.server.DBObject
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- AuthInfo, PassiveDBObject, PrivateDBObject, PublicDBObject
- public class DBObject
- extends VRObject
DBObject defines methodes for database storage.
When processing a request, sets the field value and stores itself into
database, if one is specified.
|
Field Summary |
protected DB |
db
|
|
Constructor Summary |
DBObject()
|
DBObject(DB db)
This constructor implies autocommit, that is, sendEvent will
immediately store changed object into the database. |
|
Method Summary |
void |
delete(DB db)
Deletes itself from the database. |
java.lang.Object |
get(DB db,
long id)
Fetches the object having db_id = id from the database db |
protected void |
put()
store this into the database |
void |
put(DB db)
Stores (insert/update) the object into database db |
void |
sendEvent(Request r)
Forwards request r to other clients, listeners added by Dispatcher. |
| Methods inherited from class org.vrspace.server.VRObject |
arrayToString, canRead, canWrite, clone, equals, fieldToText, fromString, fromText, getClassName, getField, getFields, getId, getID, getMemebers, hasField, hasMethod, isNew, lock, lockClass, newInstance, sendResponse, setField, setField, setField, setFields, setFields, setValue, stringToArray, toString, toText, toText, toText, unlock, unlockClass |
db
protected DB db
DBObject
public DBObject()
DBObject
public DBObject(DB db)
- This constructor implies autocommit, that is, sendEvent will
immediately store changed object into the database.
put
public void put(DB db)
throws java.lang.Exception
- Stores (insert/update) the object into database db
put
protected void put()
- store this into the database
get
public java.lang.Object get(DB db,
long id)
throws java.lang.Exception
- Fetches the object having db_id = id from the database db
delete
public void delete(DB db)
throws java.lang.Exception
- Deletes itself from the database.
sendEvent
public void sendEvent(Request r)
throws RequestException
- Forwards request r to other clients, listeners added by Dispatcher.
Sets the field r.eventName to r.eventValue.
I field does not exist, forwards event anyway.
Stores itself into the database if one is set.
Throws RequestException if request target is another object, or if
database exception occured.
Calls setValue() method which actualy forwards the event.
- Overrides:
sendEvent in class VRObject