Files
narya/src/main/java/com/threerings/presents/server/RegistrationDispatcher.java
T
Charlie Groves 1cb16d4173 Add RegistrationService to allow cpp clients to register receivers even though they're not using DObject
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6268 542714f4-19e9-0310-aa3c-eee0fc999fb1
2010-11-14 01:01:23 +00:00

49 lines
1.4 KiB
Java

package com.threerings.presents.server;
import javax.annotation.Generated;
import com.threerings.presents.client.InvocationReceiver;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.RegistrationMarshaller;
/**
* Dispatches requests to the {@link RegistrationProvider}.
*/
@Generated(value={"com.threerings.presents.tools.cpp.GenCPPServiceTask"},
comments="Derived from RegistrationService.java.")
public class RegistrationDispatcher extends InvocationDispatcher<RegistrationMarshaller>
{
/**
* Creates a dispatcher that may be registered to dispatch invocation
* service requests for the specified provider.
*/
public RegistrationDispatcher (RegistrationProvider provider)
{
this.provider = provider;
}
@Override
public RegistrationMarshaller createMarshaller ()
{
return new RegistrationMarshaller();
}
@Override
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
throws InvocationException
{
switch (methodId) {
case RegistrationMarshaller.REGISTER_RECEIVER:
((RegistrationProvider)provider).registerReceiver(
source, (InvocationReceiver.Registration)args[0]
);
return;
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}