The basis of cluster support for Presents servers. All servers in a cluster
make connections to other servers in the cluster and can exchange events (in a limited fashion). This is different than Liz's project wherein servers share an oid space and one can interchangably work with distributed objects from any server. This package provides a means by which certain services (by default, presence and chat) can be communicated between servers to allow communication between players scattered around a bunch of otherwise independent server instances. This is less general purpose but also less likely to encourage people to write code that tightly couples multiple servers and then falls over because it generates gobs of network traffic as events are flung willy nilly behind the scenes. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4238 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -26,7 +26,11 @@ import java.util.Iterator;
|
||||
import com.threerings.util.Name;
|
||||
|
||||
import com.threerings.presents.dobj.RootDObjectManager;
|
||||
import com.threerings.presents.net.AuthRequest;
|
||||
import com.threerings.presents.server.ClientFactory;
|
||||
import com.threerings.presents.server.ClientResolver;
|
||||
import com.threerings.presents.server.InvocationManager;
|
||||
import com.threerings.presents.server.PresentsClient;
|
||||
import com.threerings.presents.server.PresentsServer;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
@@ -51,11 +55,15 @@ public class CrowdServer extends PresentsServer
|
||||
// do the presents server initialization
|
||||
super.init();
|
||||
|
||||
// configure the client manager to use our client
|
||||
clmgr.setClientClass(CrowdClient.class);
|
||||
|
||||
// configure the client manager to use our resolver
|
||||
clmgr.setClientResolverClass(CrowdClientResolver.class);
|
||||
// configure the client manager to use our bits
|
||||
clmgr.setClientFactory(new ClientFactory() {
|
||||
public PresentsClient createClient (AuthRequest areq) {
|
||||
return new CrowdClient();
|
||||
}
|
||||
public ClientResolver createClientResolver (Name username) {
|
||||
return new CrowdClientResolver();
|
||||
}
|
||||
});
|
||||
|
||||
// configure the dobject manager with our access controller
|
||||
omgr.setDefaultAccessController(CrowdObjectAccess.DEFAULT);
|
||||
|
||||
Reference in New Issue
Block a user