Much work on generalizing the notion of message "transport" and
allowing the use of annotations to customize transport for DObject fields and service/receiver methods. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5099 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -28,6 +28,8 @@ import com.threerings.presents.client.InvocationReceiver.Registration;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.dobj.InvocationNotificationEvent;
|
||||
|
||||
import com.threerings.presents.net.Transport;
|
||||
|
||||
/**
|
||||
* Provides basic functionality used by all invocation sender classes.
|
||||
*/
|
||||
@@ -39,6 +41,16 @@ public abstract class InvocationSender
|
||||
*/
|
||||
public static void sendNotification (
|
||||
ClientObject target, String receiverCode, int methodId, Object[] args)
|
||||
{
|
||||
sendNotification(target, receiverCode, methodId, args, Transport.DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests that the specified invocation notification be packaged up and sent to the supplied
|
||||
* target client.
|
||||
*/
|
||||
public static void sendNotification (
|
||||
ClientObject target, String receiverCode, int methodId, Object[] args, Transport transport)
|
||||
{
|
||||
// convert the receiver hash id into the code used on this
|
||||
// specific client
|
||||
@@ -55,7 +67,8 @@ public abstract class InvocationSender
|
||||
|
||||
// create and dispatch an invocation notification event
|
||||
target.postEvent(
|
||||
new InvocationNotificationEvent(target.getOid(), rreg.receiverId, methodId, args));
|
||||
new InvocationNotificationEvent(
|
||||
target.getOid(), rreg.receiverId, methodId, args, transport));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user