Merry Christmas to the server CPUs. It occurred to me that we could
accomplish our "previous value" support in the distributed object system without using reflection and could also avoid using reflection in the case where we have already applied the event on the server (which is generally the case on the server). Rather than hacking up the gendobj script, I took this opportunity also to rewrite the DObject generation script as an Ant task and in doing so, implemented another recent idea which is that we can just augment the FooObject.java file instead of having a separate .dobj and .java file. You'd think it was spring there's so much cleaning going on. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3284 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Requests that the specified entry be added to the
|
||||
* <code>$field</code> set. The set will not change until the event is
|
||||
* actually propagated through the system.
|
||||
*/
|
||||
public void addTo$upfield (DSet.Entry elem)
|
||||
{
|
||||
requestEntryAdd($capfield, $field, elem);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests that the entry matching the supplied key be removed from
|
||||
* the <code>$field</code> set. The set will not change until the
|
||||
* event is actually propagated through the system.
|
||||
*/
|
||||
public void removeFrom$upfield (Comparable key)
|
||||
{
|
||||
requestEntryRemove($capfield, $field, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests that the specified entry be updated in the
|
||||
* <code>$field</code> set. The set will not change until the event is
|
||||
* actually propagated through the system.
|
||||
*/
|
||||
public void update$upfield (DSet.Entry elem)
|
||||
{
|
||||
requestEntryUpdate($capfield, $field, elem);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests that the <code>$field</code> field be set to the
|
||||
* specified value. Generally one only adds, updates and removes
|
||||
* entries of a distributed set, but certain situations call for a
|
||||
* complete replacement of the set value. The local value will be
|
||||
* updated immediately and an event will be propagated through the
|
||||
* system to notify all listeners that the attribute did
|
||||
* change. Proxied copies of this object (on clients) will apply the
|
||||
* value change when they received the attribute changed notification.
|
||||
*/
|
||||
public void set$upfield ($type $field)
|
||||
{
|
||||
requestAttributeChange($capfield, $field, this.$field);
|
||||
this.$field = $field;
|
||||
}
|
||||
Reference in New Issue
Block a user