If we're going to do this, I guess we're going to do it properly. Nixed the
notion of a global group (though we implicitly define one in InvocationCodes) added a mechanism for directors (which generally handle the client side of invocation services) to register their interest in bootstrap service groups so that the whole goddamned complex business can happen magically behind the scenes. If you instantiate a director, it will automatically register interest in the service group it needs and everything will work. If you don't use the director code, you don't get the services and you can safely exclude all of that code from your client even though the services are still in use on the server (and presumably used by some other types of clients). This is going to break all the builds, which I'll soon fix. Then I'll go write all this in ActionScript. Yay! git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4552 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -26,36 +26,32 @@ import com.threerings.presents.server.InvocationManager;
|
||||
import com.threerings.presents.server.InvocationProvider;
|
||||
|
||||
import com.threerings.admin.client.AdminService;
|
||||
import com.threerings.admin.data.AdminCodes;
|
||||
|
||||
/**
|
||||
* Provides the server-side implementation of various administrator
|
||||
* services.
|
||||
* Provides the server-side implementation of various administrator services.
|
||||
*/
|
||||
public class AdminProvider implements InvocationProvider
|
||||
{
|
||||
/**
|
||||
* Constructs an admin provider and registers it with the invocation
|
||||
* manager to handle admin services. This must be called by any server
|
||||
* that wishes to make use of the admin services.
|
||||
* Constructs an admin provider and registers it with the invocation manager to handle admin
|
||||
* services. This must be called by any server that wishes to make use of the admin services.
|
||||
*/
|
||||
public static void init (InvocationManager invmgr, ConfigRegistry registry)
|
||||
{
|
||||
invmgr.registerDispatcher(
|
||||
new AdminDispatcher(new AdminProvider(registry)), true);
|
||||
new AdminDispatcher(new AdminProvider(registry)), AdminCodes.ADMIN_GROUP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles a request for the list of config objects.
|
||||
*/
|
||||
public void getConfigInfo (
|
||||
ClientObject caller, AdminService.ConfigInfoListener listener)
|
||||
public void getConfigInfo (ClientObject caller, AdminService.ConfigInfoListener listener)
|
||||
{
|
||||
// we don't have to validate the request because the user can't do
|
||||
// anything with the keys or oids unless they're an admin (we put the
|
||||
// burden of doing that checking on the creator of the config object
|
||||
// because we would otherwise need some mechanism to determine whether
|
||||
// a user is an admin and we don't want to force some primitive system
|
||||
// on the service user)
|
||||
// we don't have to validate the request because the user can't do anything with the keys
|
||||
// or oids unless they're an admin (we put the burden of doing that checking on the creator
|
||||
// of the config object because we would otherwise need some mechanism to determine whether
|
||||
// a user is an admin and we don't want to force some primitive system on the service user)
|
||||
String[] keys = _registry.getKeys();
|
||||
int[] oids = new int[keys.length];
|
||||
for (int ii = 0; ii < keys.length; ii++) {
|
||||
|
||||
Reference in New Issue
Block a user