|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.presents.dobj.DEvent
com.threerings.presents.dobj.CompoundEvent
public class CompoundEvent
Used to manage and submit groups of events on a collection of distributed objects in a single transaction.
DObject.startTransaction()| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
Streamable.Closure |
| Field Summary | |
|---|---|
protected StreamableArrayList<DEvent> |
_events
A list of the events associated with this compound event. |
protected DObjectManager |
_omgr
The object manager that we'll post ourselves to when we're committed. |
protected DObject |
_target
The object for which we're managing a transaction. |
| Fields inherited from class com.threerings.presents.dobj.DEvent |
|---|
_actualTransport, _soid, _toid, _transport, eventId, UNSET_OLD_ENTRY, UNSET_OLD_VALUE |
| Constructor Summary | |
|---|---|
CompoundEvent()
Used when unserializing. |
|
CompoundEvent(DObject target,
DObjectManager omgr)
Constructs a compound event and prepares it for operation. |
|
| Method Summary | |
|---|---|
boolean |
applyToObject(DObject target)
Applies the attribute modifications represented by this event to the specified target object. |
void |
cancel()
Cancels this transaction. |
protected void |
clearTarget()
Calls out to our target object, clearing its transaction reference. |
void |
commit()
Commits this transaction by posting this event to the distributed object event queue. |
List<DEvent> |
getEvents()
Returns the list of events contained within this compound event. |
void |
postEvent(DEvent event)
Posts an event to this transaction. |
void |
setSourceOid(int sourceOid)
Do not call this method. |
void |
setTargetOid(int targetOid)
Do not call this method. |
DEvent |
setTransport(Transport transport)
Sets the transport parameters. |
protected void |
toString(StringBuilder buf)
This should be overridden by derived classes (which should be sure to call super.toString()) to append the derived class specific event information to the
string buffer. |
| Methods inherited from class com.threerings.presents.dobj.DEvent |
|---|
alreadyApplied, getActualTransport, getSourceOid, getTargetOid, getTransport, isPrivate, noteActualTransport, notifyListener, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected transient DObjectManager _omgr
protected transient DObject _target
protected StreamableArrayList<DEvent> _events
| Constructor Detail |
|---|
public CompoundEvent(DObject target,
DObjectManager omgr)
public CompoundEvent()
| Method Detail |
|---|
public void postEvent(DEvent event)
public List<DEvent> getEvents()
public void commit()
public void cancel()
public void setSourceOid(int sourceOid)
DEvent
setSourceOid in class DEventpublic void setTargetOid(int targetOid)
DEvent
setTargetOid in class DEventpublic DEvent setTransport(Transport transport)
DEvent
setTransport in class DEvent
public boolean applyToObject(DObject target)
throws ObjectAccessException
DEvent
applyToObject in class DEventObjectAccessException - thrown if there is any problem applying the event to the
object (invalid attribute, etc.).protected void clearTarget()
protected void toString(StringBuilder buf)
DEventsuper.toString()) to append the derived class specific event information to the
string buffer.
toString in class DEvent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||