Bureaucracy review updates and hello world test
* Fleshed out client-side Agent class, made abstract * Delegate the creation of the bureau director to subclasses of BureauClient * Moved BureauDirector's BureauReceiver and Subscriber implementations to anonymous classes that delegate to protected methods. * Use SafeSubscriber * Added new service method for notiyfing the server when the creation of an agent fails so that the registry is not perpetually waiting * Made BureauCredentials more conformant * Made BureauRegistry respond properly to client logging off * Got rid of superfluous uses of safeToString * Changed Launcher to CommandGenerator and now use ProcessBuilder and copyMergedOutput * Changed bureau process parameters to server name and port instead of URL git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5030 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -24,15 +24,35 @@ package com.threerings.bureau.data;
|
||||
import com.threerings.presents.net.Credentials;
|
||||
import com.threerings.util.Name;
|
||||
|
||||
/**
|
||||
* Extends the basic credentials to provide bureau-specific fields.
|
||||
*/
|
||||
public class BureauCredentials extends Credentials
|
||||
{
|
||||
/**
|
||||
* The token to pass to the server when logging in. This is usually just passed to the bureau
|
||||
* on the command line to guard against outside connections being established. */
|
||||
* on the command line to guard against outside connections being established.
|
||||
*/
|
||||
public String sessionToken;
|
||||
|
||||
/**
|
||||
* Creates an empty credentials for streaming. Should not be used directly.
|
||||
*/
|
||||
public BureauCredentials ()
|
||||
{
|
||||
super(new Name("$$$BUREAU$$$"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new credentials for a specific bureau.
|
||||
*/
|
||||
public BureauCredentials (String bureauId)
|
||||
{
|
||||
super(new Name("@@bureau:" + bureauId + "@@"));
|
||||
}
|
||||
|
||||
// inherit documentation - from Object
|
||||
public String toString ()
|
||||
{
|
||||
return super.toString() + ", token=" + sessionToken;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +47,19 @@ public class BureauMarshaller extends InvocationMarshaller
|
||||
});
|
||||
}
|
||||
|
||||
/** The method id used to dispatch {@link #agentCreationFailed} requests. */
|
||||
public static final int AGENT_CREATION_FAILED = 2;
|
||||
|
||||
// from interface BureauService
|
||||
public void agentCreationFailed (Client arg1, int arg2)
|
||||
{
|
||||
sendRequest(arg1, AGENT_CREATION_FAILED, new Object[] {
|
||||
Integer.valueOf(arg2)
|
||||
});
|
||||
}
|
||||
|
||||
/** The method id used to dispatch {@link #agentDestroyed} requests. */
|
||||
public static final int AGENT_DESTROYED = 2;
|
||||
public static final int AGENT_DESTROYED = 3;
|
||||
|
||||
// from interface BureauService
|
||||
public void agentDestroyed (Client arg1, int arg2)
|
||||
@@ -59,7 +70,7 @@ public class BureauMarshaller extends InvocationMarshaller
|
||||
}
|
||||
|
||||
/** The method id used to dispatch {@link #bureauInitialized} requests. */
|
||||
public static final int BUREAU_INITIALIZED = 3;
|
||||
public static final int BUREAU_INITIALIZED = 4;
|
||||
|
||||
// from interface BureauService
|
||||
public void bureauInitialized (Client arg1, String arg2)
|
||||
|
||||
Reference in New Issue
Block a user