Use injected dependencies, regened services.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5206 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// $Id$
|
||||
//
|
||||
// Narya library - tools for developing networked games
|
||||
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
|
||||
// Copyright (C) 2002-2008 Three Rings Design, Inc., All Rights Reserved
|
||||
// http://www.threerings.net/code/narya/
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
@@ -23,8 +23,8 @@ package com.threerings.presents.data;
|
||||
|
||||
import com.threerings.presents.client.Client;
|
||||
import com.threerings.presents.client.TestService;
|
||||
import com.threerings.presents.data.InvocationMarshaller;
|
||||
import com.threerings.presents.dobj.InvocationResponseEvent;
|
||||
import com.threerings.presents.net.Transport;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,9 @@ import java.util.ArrayList;
|
||||
public class TestMarshaller extends InvocationMarshaller
|
||||
implements TestService
|
||||
{
|
||||
// documentation inherited
|
||||
/**
|
||||
* Marshalls results to implementations of {@link TestFuncListener}.
|
||||
*/
|
||||
public static class TestFuncMarshaller extends ListenerMarshaller
|
||||
implements TestFuncListener
|
||||
{
|
||||
@@ -45,16 +47,16 @@ public class TestMarshaller extends InvocationMarshaller
|
||||
* responses. */
|
||||
public static final int TEST_SUCCEEDED = 1;
|
||||
|
||||
// documentation inherited from interface
|
||||
// from interface TestFuncMarshaller
|
||||
public void testSucceeded (String arg1, int arg2)
|
||||
{
|
||||
_invId = null;
|
||||
omgr.postEvent(new InvocationResponseEvent(
|
||||
callerOid, requestId, TEST_SUCCEEDED,
|
||||
new Object[] { arg1, Integer.valueOf(arg2) }));
|
||||
new Object[] { arg1, Integer.valueOf(arg2) }, transport));
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@Override // from InvocationMarshaller
|
||||
public void dispatchResponse (int methodId, Object[] args)
|
||||
{
|
||||
switch (methodId) {
|
||||
@@ -70,7 +72,9 @@ public class TestMarshaller extends InvocationMarshaller
|
||||
}
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
/**
|
||||
* Marshalls results to implementations of {@link TestOidListener}.
|
||||
*/
|
||||
public static class TestOidMarshaller extends ListenerMarshaller
|
||||
implements TestOidListener
|
||||
{
|
||||
@@ -78,16 +82,16 @@ public class TestMarshaller extends InvocationMarshaller
|
||||
* responses. */
|
||||
public static final int GOT_TEST_OID = 1;
|
||||
|
||||
// documentation inherited from interface
|
||||
// from interface TestOidMarshaller
|
||||
public void gotTestOid (int arg1)
|
||||
{
|
||||
_invId = null;
|
||||
omgr.postEvent(new InvocationResponseEvent(
|
||||
callerOid, requestId, GOT_TEST_OID,
|
||||
new Object[] { Integer.valueOf(arg1) }));
|
||||
new Object[] { Integer.valueOf(arg1) }, transport));
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@Override // from InvocationMarshaller
|
||||
public void dispatchResponse (int methodId, Object[] args)
|
||||
{
|
||||
switch (methodId) {
|
||||
@@ -106,7 +110,7 @@ public class TestMarshaller extends InvocationMarshaller
|
||||
/** The method id used to dispatch {@link #getTestOid} requests. */
|
||||
public static final int GET_TEST_OID = 1;
|
||||
|
||||
// documentation inherited from interface
|
||||
// from interface TestService
|
||||
public void getTestOid (Client arg1, TestService.TestOidListener arg2)
|
||||
{
|
||||
TestMarshaller.TestOidMarshaller listener2 = new TestMarshaller.TestOidMarshaller();
|
||||
@@ -119,7 +123,7 @@ public class TestMarshaller extends InvocationMarshaller
|
||||
/** The method id used to dispatch {@link #test} requests. */
|
||||
public static final int TEST = 2;
|
||||
|
||||
// documentation inherited from interface
|
||||
// from interface TestService
|
||||
public void test (Client arg1, String arg2, int arg3, ArrayList<java.lang.Integer> arg4, TestService.TestFuncListener arg5)
|
||||
{
|
||||
TestMarshaller.TestFuncMarshaller listener5 = new TestMarshaller.TestFuncMarshaller();
|
||||
@@ -128,5 +132,4 @@ public class TestMarshaller extends InvocationMarshaller
|
||||
arg2, Integer.valueOf(arg3), arg4, listener5
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// $Id$
|
||||
//
|
||||
// Narya library - tools for developing networked games
|
||||
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
|
||||
// Copyright (C) 2002-2008 Three Rings Design, Inc., All Rights Reserved
|
||||
// http://www.threerings.net/code/narya/
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
@@ -25,14 +25,12 @@ import com.threerings.presents.client.TestService;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.data.InvocationMarshaller;
|
||||
import com.threerings.presents.data.TestMarshaller;
|
||||
import com.threerings.presents.server.InvocationDispatcher;
|
||||
import com.threerings.presents.server.InvocationException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Dispatches requests to the {@link TestProvider}.
|
||||
*/
|
||||
public class TestDispatcher extends InvocationDispatcher
|
||||
public class TestDispatcher extends InvocationDispatcher<TestMarshaller>
|
||||
{
|
||||
/**
|
||||
* Creates a dispatcher that may be registered to dispatch invocation
|
||||
@@ -43,13 +41,14 @@ public class TestDispatcher extends InvocationDispatcher
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public InvocationMarshaller createMarshaller ()
|
||||
@Override // documentation inherited
|
||||
public TestMarshaller createMarshaller ()
|
||||
{
|
||||
return new TestMarshaller();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked") // documentation inherited
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override // documentation inherited
|
||||
public void dispatchRequest (
|
||||
ClientObject source, int methodId, Object[] args)
|
||||
throws InvocationException
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// $Id$
|
||||
//
|
||||
// Narya library - tools for developing networked games
|
||||
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
|
||||
// Copyright (C) 2002-2008 Three Rings Design, Inc., All Rights Reserved
|
||||
// http://www.threerings.net/code/narya/
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it
|
||||
@@ -23,8 +23,6 @@ package com.threerings.presents.server;
|
||||
|
||||
import com.threerings.presents.client.TestService;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.server.InvocationException;
|
||||
import com.threerings.presents.server.InvocationProvider;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user