Files
narya/tests/src/java/com/threerings/presents/server/TestManager.java
T
Michael Bayne 92f79dad34 Use varargs logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5451 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-21 01:52:05 +00:00

56 lines
1.6 KiB
Java

//
// $Id$
package com.threerings.presents.server;
import java.util.List;
import com.google.inject.Inject;
import com.threerings.presents.client.TestService;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.ClientManager;
import static com.threerings.presents.Log.log;
/**
* Implements the server side of the TestProvider interface.
*/
public class TestManager
implements TestProvider
{
// from interface TestProvider
public void getTestOid (ClientObject caller,
TestService.TestOidListener listener)
throws InvocationException
{
log.info("Handling get test oid [src=" + caller + "].");
// issue a test notification just for kicks
TestSender.sendTest(caller, 1, "two");
listener.gotTestOid(TestServer.testobj.getOid());
}
// from interface TestProvider
public void test (ClientObject caller, String one, int two, List<Integer> three,
TestService.TestFuncListener listener)
throws InvocationException
{
log.info("Test request", "one", one, "two", two, "three", three);
// and issue a response to this invocation request
listener.testSucceeded(one, two);
}
// from interface TestProvider
public void giveMeThePower (ClientObject caller, TestService.ConfirmListener listener)
{
log.info("Giving " + caller.who() + " the power!");
_clmgr.getClient(caller.username).setIncomingMessageThrottle(20);
listener.requestProcessed();
}
@Inject protected ClientManager _clmgr;
}