On second thought, let's configure the standalone client reference via an
optional injection. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6414 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -42,7 +42,7 @@ import com.samskivert.util.StringUtil;
|
|||||||
|
|
||||||
import com.threerings.io.Streamable;
|
import com.threerings.io.Streamable;
|
||||||
|
|
||||||
import com.threerings.presents.client.InvocationDirector;
|
import com.threerings.presents.client.Client;
|
||||||
import com.threerings.presents.data.ClientObject;
|
import com.threerings.presents.data.ClientObject;
|
||||||
import com.threerings.presents.data.InvocationCodes;
|
import com.threerings.presents.data.InvocationCodes;
|
||||||
import com.threerings.presents.data.InvocationMarshaller;
|
import com.threerings.presents.data.InvocationMarshaller;
|
||||||
@@ -94,17 +94,6 @@ public class InvocationManager
|
|||||||
log.debug("Created invocation service object", "oid", _invoid);
|
log.debug("Created invocation service object", "oid", _invoid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the invocation director to install in created marshallers. This is used in standalone
|
|
||||||
* mode, where marshallers are not streamed (usually, the director reference is set on
|
|
||||||
* unstreaming).
|
|
||||||
*/
|
|
||||||
public void setInvocationDirector (InvocationDirector invdir)
|
|
||||||
{
|
|
||||||
// TODO: change references in existing marshallers?
|
|
||||||
_invdir = invdir;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the object id of the invocation services object.
|
* Returns the object id of the invocation services object.
|
||||||
*/
|
*/
|
||||||
@@ -184,7 +173,8 @@ public class InvocationManager
|
|||||||
T marsh;
|
T marsh;
|
||||||
try {
|
try {
|
||||||
marsh = mclass.newInstance();
|
marsh = mclass.newInstance();
|
||||||
marsh.init(_invoid, invCode, _invdir);
|
marsh.init(_invoid, invCode, _standaloneClient == null ?
|
||||||
|
null : _standaloneClient.getInvocationDirector());
|
||||||
} catch (IllegalAccessException ie) {
|
} catch (IllegalAccessException ie) {
|
||||||
throw new RuntimeException(ie);
|
throw new RuntimeException(ie);
|
||||||
} catch (InstantiationException ie) {
|
} catch (InstantiationException ie) {
|
||||||
@@ -284,7 +274,8 @@ public class InvocationManager
|
|||||||
|
|
||||||
// create the marshaller and initialize it
|
// create the marshaller and initialize it
|
||||||
T marsh = dispatcher.createMarshaller();
|
T marsh = dispatcher.createMarshaller();
|
||||||
marsh.init(_invoid, invCode, _invdir);
|
marsh.init(_invoid, invCode, _standaloneClient == null ?
|
||||||
|
null : _standaloneClient.getInvocationDirector());
|
||||||
|
|
||||||
// register the dispatcher
|
// register the dispatcher
|
||||||
_dispatchers.put(invCode, dispatcher);
|
_dispatchers.put(invCode, dispatcher);
|
||||||
@@ -450,8 +441,8 @@ public class InvocationManager
|
|||||||
/** Used to generate monotonically increasing provider ids. */
|
/** Used to generate monotonically increasing provider ids. */
|
||||||
protected int _invCode;
|
protected int _invCode;
|
||||||
|
|
||||||
/** The invocation director reference to install in created marshallers (if any). */
|
/** A reference to the standalone client, if any. */
|
||||||
protected InvocationDirector _invdir;
|
@Inject(optional=true) protected Client _standaloneClient;
|
||||||
|
|
||||||
/** The distributed object manager we're working with. */
|
/** The distributed object manager we're working with. */
|
||||||
protected PresentsDObjectMgr _omgr;
|
protected PresentsDObjectMgr _omgr;
|
||||||
|
|||||||
Reference in New Issue
Block a user