Get the transport specification out of the construction path, since it's not a

streamed property of the event. It turns out to be cleaner to just set it in
the places where we know that we want a specific transport anyway.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6581 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2011-04-02 00:01:46 +00:00
parent 22330e955b
commit fc7706c79d
29 changed files with 73 additions and 121 deletions
@@ -52,10 +52,7 @@ public class AdminMarshaller extends InvocationMarshaller
// from interface ConfigInfoMarshaller // from interface ConfigInfoMarshaller
public void gotConfigInfo (String[] arg1, int[] arg2) public void gotConfigInfo (String[] arg1, int[] arg2)
{ {
_invId = null; sendResponse(GOT_CONFIG_INFO, new Object[] { arg1, arg2 });
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, GOT_CONFIG_INFO,
new Object[] { arg1, arg2 }, transport));
} }
@Override // from InvocationMarshaller @Override // from InvocationMarshaller
@@ -54,10 +54,7 @@ public class ChatMarshaller extends InvocationMarshaller
// from interface TellMarshaller // from interface TellMarshaller
public void tellSucceeded (long arg1, String arg2) public void tellSucceeded (long arg1, String arg2)
{ {
_invId = null; sendResponse(TELL_SUCCEEDED, new Object[] { Long.valueOf(arg1), arg2 });
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, TELL_SUCCEEDED,
new Object[] { Long.valueOf(arg1), arg2 }, transport));
} }
@Override // from InvocationMarshaller @Override // from InvocationMarshaller
@@ -52,10 +52,7 @@ public class LocationMarshaller extends InvocationMarshaller
// from interface MoveMarshaller // from interface MoveMarshaller
public void moveSucceeded (PlaceConfig arg1) public void moveSucceeded (PlaceConfig arg1)
{ {
_invId = null; sendResponse(MOVE_SUCCEEDED, new Object[] { arg1 });
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, MOVE_SUCCEEDED,
new Object[] { arg1 }, transport));
} }
@Override // from InvocationMarshaller @Override // from InvocationMarshaller
@@ -227,8 +227,8 @@ public class InvocationDirector
} }
// create an invocation request event // create an invocation request event
InvocationRequestEvent event = InvocationRequestEvent event = new InvocationRequestEvent(invOid, invCode, methodId, args);
new InvocationRequestEvent(invOid, invCode, methodId, args, transport); event.setTransport(transport);
// because invocation directors are used on the server, we set the source oid here so that // because invocation directors are used on the server, we set the source oid here so that
// invocation requests are properly attributed to the right client object when created by // invocation requests are properly attributed to the right client object when created by
@@ -95,9 +95,7 @@ public class InvocationMarshaller
// documentation inherited from interface // documentation inherited from interface
public void requestFailed (String cause) public void requestFailed (String cause)
{ {
_invId = null; sendResponse(REQUEST_FAILED_RSPID, cause);
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, REQUEST_FAILED_RSPID, new Object[] { cause }, transport));
} }
/** /**
@@ -134,6 +132,16 @@ public class InvocationMarshaller
} }
} }
/**
* Handles sending a response to our requester.
*/
protected void sendResponse (int methodId, Object... args)
{
_invId = null;
omgr.postEvent(new InvocationResponseEvent(callerOid, requestId, methodId, args).
setTransport(transport));
}
/** /**
* Performs type casts in a way that works for parameterized types as well as simple types. * Performs type casts in a way that works for parameterized types as well as simple types.
*/ */
@@ -161,7 +169,8 @@ public class InvocationMarshaller
{ {
_invId = null; _invId = null;
omgr.postEvent(new InvocationResponseEvent( omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, REQUEST_PROCESSED, null, transport)); callerOid, requestId, REQUEST_PROCESSED, null).
setTransport(transport));
} }
@Override @Override
@@ -192,7 +201,8 @@ public class InvocationMarshaller
{ {
_invId = null; _invId = null;
omgr.postEvent(new InvocationResponseEvent( omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, REQUEST_PROCESSED, new Object[] { result }, transport)); callerOid, requestId, REQUEST_PROCESSED, new Object[] { result }).
setTransport(transport));
} }
@Override @Override
@@ -51,10 +51,7 @@ public class TimeBaseMarshaller extends InvocationMarshaller
// from interface GotTimeBaseMarshaller // from interface GotTimeBaseMarshaller
public void gotTimeOid (int arg1) public void gotTimeOid (int arg1)
{ {
_invId = null; sendResponse(GOT_TIME_OID, new Object[] { Integer.valueOf(arg1) });
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, GOT_TIME_OID,
new Object[] { Integer.valueOf(arg1) }, transport));
} }
@Override // from InvocationMarshaller @Override // from InvocationMarshaller
@@ -25,8 +25,6 @@ import java.lang.reflect.Array;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.presents.net.Transport;
/** /**
* An attribute changed event is dispatched when a single attribute of a distributed object has * An attribute changed event is dispatched when a single attribute of a distributed object has
* changed. It can also be constructed to request an attribute change on an object and posted to * changed. It can also be constructed to request an attribute change on an object and posted to
@@ -151,12 +149,10 @@ public class AttributeChangedEvent extends NamedEvent
* @param name the name of the attribute (data member) that has changed. * @param name the name of the attribute (data member) that has changed.
* @param value the new value of the attribute (in the case of primitive types, the * @param value the new value of the attribute (in the case of primitive types, the
* reflection-defined object-alternative is used). * reflection-defined object-alternative is used).
* @param transport a hint as to the type of transport desired for the event.
*/ */
protected AttributeChangedEvent ( protected AttributeChangedEvent (int targetOid, String name, Object value, Object oldValue)
int targetOid, String name, Object value, Object oldValue, Transport transport)
{ {
super(targetOid, name, transport); super(targetOid, name);
_value = value; _value = value;
_oldValue = oldValue; _oldValue = oldValue;
} }
@@ -40,7 +40,7 @@ public class CompoundEvent extends DEvent
*/ */
public CompoundEvent (DObject target, DObjectManager omgr) public CompoundEvent (DObject target, DObjectManager omgr)
{ {
super(target.getOid(), Transport.DEFAULT); super(target.getOid());
// sanity check // sanity check
if (omgr == null) { if (omgr == null) {
@@ -56,7 +56,7 @@ public class CompoundEvent extends DEvent
/** Used when unserializing. */ /** Used when unserializing. */
public CompoundEvent () public CompoundEvent ()
{ {
super(0, Transport.DEFAULT); super(0);
} }
/** /**
@@ -143,12 +143,13 @@ public class CompoundEvent extends DEvent
} }
@Override @Override
public void setTransport (Transport transport) public DEvent setTransport (Transport transport)
{ {
super.setTransport(transport); super.setTransport(transport);
for (int ii = 0, nn = _events.size(); ii < nn; ii++) { for (int ii = 0, nn = _events.size(); ii < nn; ii++) {
_events.get(ii).setTransport(transport); _events.get(ii).setTransport(transport);
} }
return this;
} }
@Override @Override
@@ -41,10 +41,9 @@ public abstract class DEvent implements Streamable
* *
* @param transport a hint as to the type of transport desired for the event. * @param transport a hint as to the type of transport desired for the event.
*/ */
public DEvent (int targetOid, Transport transport) public DEvent (int targetOid)
{ {
_toid = targetOid; _toid = targetOid;
_transport = transport;
} }
/** /**
@@ -124,9 +123,10 @@ public abstract class DEvent implements Streamable
* mode of transport over which the event was received. When an event is sent over the * mode of transport over which the event was received. When an event is sent over the
* network, these act as a hint as to the type of transport desired. * network, these act as a hint as to the type of transport desired.
*/ */
public void setTransport (Transport transport) public DEvent setTransport (Transport transport)
{ {
_transport = transport; _transport = transport;
return this;
} }
/** /**
@@ -558,7 +558,7 @@ public class DObject
*/ */
public void postMessage (Transport transport, String name, Object... args) public void postMessage (Transport transport, String name, Object... args)
{ {
postEvent(new MessageEvent(_oid, name, args, transport)); postEvent(new MessageEvent(_oid, name, args).setTransport(transport));
} }
/** /**
@@ -871,7 +871,7 @@ public class DObject
String name, Object value, Object oldValue, Transport transport) String name, Object value, Object oldValue, Transport transport)
{ {
// dispatch an attribute changed event // dispatch an attribute changed event
postEvent(new AttributeChangedEvent(_oid, name, value, oldValue, transport)); postEvent(new AttributeChangedEvent(_oid, name, value, oldValue).setTransport(transport));
} }
/** /**
@@ -889,8 +889,8 @@ public class DObject
String name, int index, Object value, Object oldValue, Transport transport) String name, int index, Object value, Object oldValue, Transport transport)
{ {
// dispatch an attribute changed event // dispatch an attribute changed event
postEvent(new ElementUpdatedEvent( postEvent(new ElementUpdatedEvent(_oid, name, value, oldValue, index).
_oid, name, value, oldValue, index, transport)); setTransport(transport));
} }
/** /**
@@ -989,7 +989,7 @@ public class DObject
} }
} }
// dispatch an entry updated event // dispatch an entry updated event
postEvent(new EntryUpdatedEvent<T>(_oid, name, entry, oldEntry, transport)); postEvent(new EntryUpdatedEvent<T>(_oid, name, entry, oldEntry).setTransport(transport));
} }
protected boolean isAuthoritative () protected boolean isAuthoritative ()
@@ -26,8 +26,6 @@ import java.lang.reflect.Field;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.presents.net.Transport;
/** /**
* An element updated event is dispatched when an element of an array field in a distributed object * An element updated event is dispatched when an element of an array field in a distributed object
* is updated. It can also be constructed to request the update of an entry and posted to the * is updated. It can also be constructed to request the update of an entry and posted to the
@@ -48,12 +46,10 @@ public class ElementUpdatedEvent extends NamedEvent
* @param ovalue the previous value of the element (in the case of primitive types, the * @param ovalue the previous value of the element (in the case of primitive types, the
* reflection-defined object-alternative is used). * reflection-defined object-alternative is used).
* @param index the index in the array of the updated element. * @param index the index in the array of the updated element.
* @param transport a hint as to the type of transport desired for the event.
*/ */
public ElementUpdatedEvent ( public ElementUpdatedEvent (int targetOid, String name, Object value, Object ovalue, int index)
int targetOid, String name, Object value, Object ovalue, int index, Transport transport)
{ {
super(targetOid, name, transport); super(targetOid, name);
_value = value; _value = value;
_oldValue = ovalue; _oldValue = ovalue;
_index = index; _index = index;
@@ -23,8 +23,6 @@ package com.threerings.presents.dobj;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.presents.net.Transport;
/** /**
* An entry added event is dispatched when an entry is added to a {@link DSet} attribute of a * An entry added event is dispatched when an entry is added to a {@link DSet} attribute of a
* distributed entry. It can also be constructed to request the addition of an entry to a set and * distributed entry. It can also be constructed to request the addition of an entry to a set and
@@ -47,7 +45,7 @@ public class EntryAddedEvent<T extends DSet.Entry> extends EntryEvent<T>
*/ */
public EntryAddedEvent (int targetOid, String name, T entry) public EntryAddedEvent (int targetOid, String name, T entry)
{ {
super(targetOid, name, Transport.DEFAULT); super(targetOid, name);
_entry = entry; _entry = entry;
} }
@@ -21,8 +21,6 @@
package com.threerings.presents.dobj; package com.threerings.presents.dobj;
import com.threerings.presents.net.Transport;
/** /**
* A common parent class for DSet entry events. * A common parent class for DSet entry events.
*/ */
@@ -33,11 +31,10 @@ public abstract class EntryEvent<T extends DSet.Entry> extends NamedEvent
* *
* @param targetOid the object id of the object in question. * @param targetOid the object id of the object in question.
* @param name the name associated with this event. * @param name the name associated with this event.
* @param transport a hint as to the type of transport desired for the event.
*/ */
public EntryEvent (int targetOid, String name, Transport transport) public EntryEvent (int targetOid, String name)
{ {
super(targetOid, name, transport); super(targetOid, name);
} }
/** /**
@@ -21,8 +21,6 @@
package com.threerings.presents.dobj; package com.threerings.presents.dobj;
import com.threerings.presents.net.Transport;
import static com.threerings.presents.Log.log; import static com.threerings.presents.Log.log;
/** /**
@@ -48,7 +46,7 @@ public class EntryRemovedEvent<T extends DSet.Entry> extends EntryEvent<T>
*/ */
public EntryRemovedEvent (int targetOid, String name, Comparable<?> key, T oldEntry) public EntryRemovedEvent (int targetOid, String name, Comparable<?> key, T oldEntry)
{ {
super(targetOid, name, Transport.DEFAULT); super(targetOid, name);
_key = key; _key = key;
_oldEntry = oldEntry; _oldEntry = oldEntry;
} }
@@ -23,8 +23,6 @@ package com.threerings.presents.dobj;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.presents.net.Transport;
import static com.threerings.presents.Log.log; import static com.threerings.presents.Log.log;
/** /**
@@ -46,11 +44,10 @@ public class EntryUpdatedEvent<T extends DSet.Entry> extends EntryEvent<T>
* @param name the name of the attribute in which to update the specified entry. * @param name the name of the attribute in which to update the specified entry.
* @param entry the entry to update. * @param entry the entry to update.
* @param oldEntry the previous value of the entry. * @param oldEntry the previous value of the entry.
* @param transport a hint as to the type of transport desired for the event.
*/ */
public EntryUpdatedEvent (int targetOid, String name, T entry, T oldEntry, Transport transport) public EntryUpdatedEvent (int targetOid, String name, T entry, T oldEntry)
{ {
super(targetOid, name, transport); super(targetOid, name);
_entry = entry; _entry = entry;
_oldEntry = oldEntry; _oldEntry = oldEntry;
} }
@@ -23,8 +23,6 @@ package com.threerings.presents.dobj;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.presents.net.Transport;
/** /**
* Used to dispatch an invocation notification from the server to a client. * Used to dispatch an invocation notification from the server to a client.
* *
@@ -41,12 +39,10 @@ public class InvocationNotificationEvent extends DEvent
* @param methodId the id of the method to be invoked. * @param methodId the id of the method to be invoked.
* @param args the arguments for the method. This array should contain only values of valid * @param args the arguments for the method. This array should contain only values of valid
* distributed object types. * distributed object types.
* @param transport a hint as to the type of transport desired for the event.
*/ */
public InvocationNotificationEvent ( public InvocationNotificationEvent (int targetOid, short receiverId, int methodId, Object[] args)
int targetOid, short receiverId, int methodId, Object[] args, Transport transport)
{ {
super(targetOid, transport); super(targetOid);
_receiverId = receiverId; _receiverId = receiverId;
_methodId = (byte)methodId; _methodId = (byte)methodId;
_args = args; _args = args;
@@ -23,8 +23,6 @@ package com.threerings.presents.dobj;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.presents.net.Transport;
/** /**
* Used to dispatch an invocation request from the client to the server. * Used to dispatch an invocation request from the client to the server.
* *
@@ -41,12 +39,10 @@ public class InvocationRequestEvent extends DEvent
* @param methodId the id of the method to be invoked. * @param methodId the id of the method to be invoked.
* @param args the arguments for the method. This array should contain only values of valid * @param args the arguments for the method. This array should contain only values of valid
* distributed object types. * distributed object types.
* @param transport a hint as to the type of transport desired for the event.
*/ */
public InvocationRequestEvent ( public InvocationRequestEvent (int targetOid, int invCode, int methodId, Object[] args)
int targetOid, int invCode, int methodId, Object[] args, Transport transport)
{ {
super(targetOid, transport); super(targetOid);
_invCode = invCode; _invCode = invCode;
_methodId = (byte)methodId; _methodId = (byte)methodId;
_args = args; _args = args;
@@ -22,7 +22,6 @@
package com.threerings.presents.dobj; package com.threerings.presents.dobj;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.presents.net.Transport; import com.threerings.presents.net.Transport;
/** /**
@@ -41,17 +40,23 @@ public class InvocationResponseEvent extends DEvent
* @param methodId the method to be invoked. * @param methodId the method to be invoked.
* @param args the arguments for the method. This array should contain only values of valid * @param args the arguments for the method. This array should contain only values of valid
* distributed object types. * distributed object types.
* @param transport a hint as to the type of transport desired for the event.
*/ */
public InvocationResponseEvent ( public InvocationResponseEvent (int targetOid, int requestId, int methodId, Object[] args)
int targetOid, int requestId, int methodId, Object[] args, Transport transport)
{ {
super(targetOid, transport); super(targetOid);
_requestId = (short)requestId; _requestId = (short)requestId;
_methodId = (byte)methodId; _methodId = (byte)methodId;
_args = args; _args = args;
} }
/** @deprecated Regenerate your services. */
@Deprecated
public InvocationResponseEvent (int targetOid, int requestId, int methodId, Object[] args,
Transport transport)
{
this(targetOid, requestId, methodId, args);
}
/** /**
* Returns the invocation request id associated with this response. * Returns the invocation request id associated with this response.
*/ */
@@ -23,8 +23,6 @@ package com.threerings.presents.dobj;
import com.samskivert.util.StringUtil; import com.samskivert.util.StringUtil;
import com.threerings.presents.net.Transport;
/** /**
* A message event is used to dispatch a message to all subscribers of a distributed object without * A message event is used to dispatch a message to all subscribers of a distributed object without
* actually changing any of the fields of the object. A message has a name, by which different * actually changing any of the fields of the object. A message has a name, by which different
@@ -43,11 +41,10 @@ public class MessageEvent extends NamedEvent
* @param name the name of the message event. * @param name the name of the message event.
* @param args the arguments for this message. This array should contain only values of valid * @param args the arguments for this message. This array should contain only values of valid
* distributed object types. * distributed object types.
* @param transport a hint as to the type of transport desired for the event.
*/ */
public MessageEvent (int targetOid, String name, Object[] args, Transport transport) public MessageEvent (int targetOid, String name, Object[] args)
{ {
super(targetOid, name, transport); super(targetOid, name);
_args = args; _args = args;
} }
@@ -21,8 +21,6 @@
package com.threerings.presents.dobj; package com.threerings.presents.dobj;
import com.threerings.presents.net.Transport;
/** /**
* A common parent class for all events that are associated with a name * A common parent class for all events that are associated with a name
* (in some cases a field name, in other cases just an identifying name). * (in some cases a field name, in other cases just an identifying name).
@@ -35,11 +33,10 @@ public abstract class NamedEvent extends DEvent
* *
* @param targetOid the object id of the object in question. * @param targetOid the object id of the object in question.
* @param name the name associated with this event. * @param name the name associated with this event.
* @param transport a hint as to the type of transport desired for the event.
*/ */
public NamedEvent (int targetOid, String name, Transport transport) public NamedEvent (int targetOid, String name)
{ {
super(targetOid, transport); super(targetOid);
_name = name; _name = name;
} }
@@ -21,8 +21,6 @@
package com.threerings.presents.dobj; package com.threerings.presents.dobj;
import com.threerings.presents.net.Transport;
/** /**
* An object added event is dispatched when an object is added to an <code>OidList</code> attribute * An object added event is dispatched when an object is added to an <code>OidList</code> attribute
* of a distributed object. It can also be constructed to request the addition of an oid to an * of a distributed object. It can also be constructed to request the addition of an oid to an
@@ -42,7 +40,7 @@ public class ObjectAddedEvent extends NamedEvent
*/ */
public ObjectAddedEvent (int targetOid, String name, int oid) public ObjectAddedEvent (int targetOid, String name, int oid)
{ {
super(targetOid, name, Transport.DEFAULT); super(targetOid, name);
_oid = oid; _oid = oid;
} }
@@ -21,8 +21,6 @@
package com.threerings.presents.dobj; package com.threerings.presents.dobj;
import com.threerings.presents.net.Transport;
/** /**
* An object destroyed event is dispatched when an object has been removed * An object destroyed event is dispatched when an object has been removed
* from the distributed object system. It can also be constructed to * from the distributed object system. It can also be constructed to
@@ -39,7 +37,7 @@ public class ObjectDestroyedEvent extends DEvent
*/ */
public ObjectDestroyedEvent (int targetOid) public ObjectDestroyedEvent (int targetOid)
{ {
super(targetOid, Transport.DEFAULT); super(targetOid);
} }
@Override @Override
@@ -21,8 +21,6 @@
package com.threerings.presents.dobj; package com.threerings.presents.dobj;
import com.threerings.presents.net.Transport;
/** /**
* An object removed event is dispatched when an object is removed from an <code>OidList</code> * An object removed event is dispatched when an object is removed from an <code>OidList</code>
* attribute of a distributed object. It can also be constructed to request the removal of an oid * attribute of a distributed object. It can also be constructed to request the removal of an oid
@@ -42,7 +40,7 @@ public class ObjectRemovedEvent extends NamedEvent
*/ */
public ObjectRemovedEvent (int targetOid, String name, int oid) public ObjectRemovedEvent (int targetOid, String name, int oid)
{ {
super(targetOid, name, Transport.DEFAULT); super(targetOid, name);
_oid = oid; _oid = oid;
} }
@@ -21,8 +21,6 @@
package com.threerings.presents.dobj; package com.threerings.presents.dobj;
import com.threerings.presents.net.Transport;
/** /**
* A release lock event is dispatched at the end of a chain of events to release a lock that is * A release lock event is dispatched at the end of a chain of events to release a lock that is
* intended to prevent some application defined activity from happening until those events have * intended to prevent some application defined activity from happening until those events have
@@ -44,7 +42,7 @@ public class ReleaseLockEvent extends NamedEvent
*/ */
public ReleaseLockEvent (int targetOid, String name) public ReleaseLockEvent (int targetOid, String name)
{ {
super(targetOid, name, Transport.DEFAULT); super(targetOid, name);
} }
@Override @Override
@@ -21,8 +21,6 @@
package com.threerings.presents.dobj; package com.threerings.presents.dobj;
import com.threerings.presents.net.Transport;
/** /**
* A message event that only goes to the server. If generated on the server then it never leaves * A message event that only goes to the server. If generated on the server then it never leaves
* the server. * the server.
@@ -40,7 +38,7 @@ public class ServerMessageEvent extends MessageEvent
*/ */
public ServerMessageEvent (int targetOid, String name, Object[] args) public ServerMessageEvent (int targetOid, String name, Object[] args)
{ {
super(targetOid, name, args, Transport.DEFAULT); super(targetOid, name, args);
} }
@Override @Override
@@ -63,9 +63,9 @@ public abstract class InvocationSender
// "methodId", methodId, "args", args); // "methodId", methodId, "args", args);
// create and dispatch an invocation notification event // create and dispatch an invocation notification event
target.postEvent( target.postEvent(new InvocationNotificationEvent(
new InvocationNotificationEvent( target.getOid(), rreg.receiverId, methodId, args).
target.getOid(), rreg.receiverId, methodId, args, transport)); setTransport(transport));
} }
} }
} }
@@ -53,7 +53,6 @@ import com.threerings.presents.dobj.ObjectRemovedEvent;
import com.threerings.presents.dobj.OidList; import com.threerings.presents.dobj.OidList;
import com.threerings.presents.dobj.RootDObjectManager; import com.threerings.presents.dobj.RootDObjectManager;
import com.threerings.presents.dobj.Subscriber; import com.threerings.presents.dobj.Subscriber;
import com.threerings.presents.net.Transport;
import static com.threerings.presents.Log.log; import static com.threerings.presents.Log.log;
@@ -927,7 +926,7 @@ public class PresentsDObjectMgr
public AccessObjectEvent (int oid, Subscriber<T> target, int action) public AccessObjectEvent (int oid, Subscriber<T> target, int action)
{ {
super(DUMMY_OID, Transport.DEFAULT); // target the bogus object super(DUMMY_OID); // target the bogus object
_oid = oid; _oid = oid;
_target = target; _target = target;
_action = action; _action = action;
@@ -32,10 +32,7 @@ public class {{name}}Marshaller extends InvocationMarshaller
// from interface {{listenerName}}Marshaller // from interface {{listenerName}}Marshaller
public void {{method.name}} ({{getArgList}}) public void {{method.name}} ({{getArgList}})
{ {
_invId = null; sendResponse({{code}}, new Object[] { {{getWrappedArgList}} });
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, {{code}},
new Object[] { {{getWrappedArgList}} }, transport));
} }
{{/methods}} {{/methods}}
@@ -53,10 +53,7 @@ public class TestMarshaller extends InvocationMarshaller
// from interface TestFuncMarshaller // from interface TestFuncMarshaller
public void testSucceeded (String arg1, int arg2) public void testSucceeded (String arg1, int arg2)
{ {
_invId = null; sendResponse(TEST_SUCCEEDED, new Object[] { arg1, Integer.valueOf(arg2) });
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, TEST_SUCCEEDED,
new Object[] { arg1, Integer.valueOf(arg2) }, transport));
} }
@Override // from InvocationMarshaller @Override // from InvocationMarshaller
@@ -88,10 +85,7 @@ public class TestMarshaller extends InvocationMarshaller
// from interface TestOidMarshaller // from interface TestOidMarshaller
public void gotTestOid (int arg1) public void gotTestOid (int arg1)
{ {
_invId = null; sendResponse(GOT_TEST_OID, new Object[] { Integer.valueOf(arg1) });
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, GOT_TEST_OID,
new Object[] { Integer.valueOf(arg1) }, transport));
} }
@Override // from InvocationMarshaller @Override // from InvocationMarshaller