From bb0bd7cc52b30ec8bab389726c4ed6162230a227 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 13 Sep 2002 06:41:34 +0000 Subject: [PATCH] Added convenience method for posting a message event to a distributed object. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1681 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/presents/dobj/DObject.java | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/java/com/threerings/presents/dobj/DObject.java b/src/java/com/threerings/presents/dobj/DObject.java index bec562d65..0ecaef4e9 100644 --- a/src/java/com/threerings/presents/dobj/DObject.java +++ b/src/java/com/threerings/presents/dobj/DObject.java @@ -1,5 +1,5 @@ // -// $Id: DObject.java,v 1.47 2002/08/14 19:07:55 mdb Exp $ +// $Id: DObject.java,v 1.48 2002/09/13 06:41:34 mdb Exp $ package com.threerings.presents.dobj; @@ -438,6 +438,27 @@ public class DObject implements Streamable } } + /** + * Posts a message event on this distrubuted object. + */ + public void postMessage (String name, Object[] args) + { + postEvent(new MessageEvent(_oid, name, args)); + } + + /** + * Posts the specified event either to our dobject manager or to the + * compound event for which we are currently transacting. + */ + public void postEvent (DEvent event) + { + if (_tevent != null) { + _tevent.postEvent(event); + } else { + _omgr.postEvent(event); + } + } + /** * Returns true if this object is active and registered with the * distributed object system. If an object is created via @@ -496,19 +517,6 @@ public class DObject implements Streamable return buf.append("]").toString(); } - /** - * Posts the specified event either to our dobject manager or to the - * compound event for which we are currently transacting. - */ - public void postEvent (DEvent event) - { - if (_tevent != null) { - _tevent.postEvent(event); - } else { - _omgr.postEvent(event); - } - } - /** * Begins a transaction on this distributed object. In some * situations, it is desirable to cause multiple changes to