|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.presents.dobj.DEvent
public abstract class DEvent
A distributed object event is dispatched whenever any modification is made to a distributed object. It can also be dispatched purely for notification purposes, without making any modifications to the object that defines the delivery group (the object's subscribers).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
Streamable.Closure |
| Field Summary | |
|---|---|
protected Transport |
_actualTransport
The actual transport with which the event was transmitted (null if as yet unknown). |
protected int |
_soid
The oid of the client that generated this event. |
protected int |
_toid
The oid of the object that is the target of this event. |
protected Transport |
_transport
The transport parameters. |
long |
eventId
This event's "number". |
protected static DSet.Entry |
UNSET_OLD_ENTRY
Used to differentiate between null meaning we haven't initialized our old entry and null being the actual old entry. |
protected static Object |
UNSET_OLD_VALUE
Used to differentiate between null meaning we haven't initialized our old value and null being the actual old value. |
| Constructor Summary | |
|---|---|
DEvent(int targetOid)
Constructs a new distributed object event that pertains to the specified distributed object. |
|
| Method Summary | |
|---|---|
boolean |
alreadyApplied()
If this event applies itself immediately to the distributed object on the server and then NOOPs later when applyToObject(com.threerings.presents.dobj.DObject) is called, it should return true from this method. |
abstract boolean |
applyToObject(DObject target)
Applies the attribute modifications represented by this event to the specified target object. |
Transport |
getActualTransport()
Returns the actual transport with which the event was transmitted, or null if
not yet known. |
int |
getSourceOid()
Returns the object id of the client that generated this event. |
int |
getTargetOid()
Returns the oid of the object that is the target of this event. |
Transport |
getTransport()
Returns the transport parameters. |
boolean |
isPrivate()
Some events are used only internally on the server and need not be broadcast to subscribers, proxy or otherwise. |
void |
noteActualTransport(Transport transport)
Notes the actual transport with which the event was transmitted. |
protected void |
notifyListener(Object listener)
Events with associated listener interfaces should implement this function and notify the supplied listener if it implements their event listening interface. |
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. |
String |
toString()
|
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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public transient long eventId
protected int _toid
protected transient int _soid
protected transient Transport _transport
protected transient Transport _actualTransport
protected static final Object UNSET_OLD_VALUE
protected static final DSet.Entry UNSET_OLD_ENTRY
| Constructor Detail |
|---|
public DEvent(int targetOid)
transport - a hint as to the type of transport desired for the event.| Method Detail |
|---|
public int getTargetOid()
public boolean isPrivate()
public boolean alreadyApplied()
applyToObject(com.threerings.presents.dobj.DObject) is called, it should return true from this method.
If it will modify the object during its applyToObject(com.threerings.presents.dobj.DObject) call, it should return false.
public abstract boolean applyToObject(DObject target)
throws ObjectAccessException
ObjectAccessException - thrown if there is any problem applying the event to the
object (invalid attribute, etc.).public int getSourceOid()
public void setTargetOid(int targetOid)
public void setSourceOid(int sourceOid)
public DEvent setTransport(Transport transport)
public Transport getTransport()
public void noteActualTransport(Transport transport)
public Transport getActualTransport()
null if
not yet known.
protected void notifyListener(Object listener)
AttributeChangedEvent will notify listeners that implement AttributeChangeListener.
public String toString()
toString in class Objectprotected void toString(StringBuilder buf)
super.toString()) to append the derived class specific event information to the
string buffer.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||