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:
@@ -92,7 +92,7 @@ public class Streamer
|
||||
createStreamers();
|
||||
}
|
||||
|
||||
Streamer stream = (Streamer)_streamers.get(target);
|
||||
Streamer stream = _streamers.get(target);
|
||||
if (stream == null) {
|
||||
// make sure this is a streamable class
|
||||
if (!isStreamable(target)) {
|
||||
@@ -108,11 +108,9 @@ public class Streamer
|
||||
// create our streamer in a privileged block so that it can
|
||||
// introspect on the to be streamed class
|
||||
try {
|
||||
stream = (Streamer) AccessController.doPrivileged(
|
||||
new PrivilegedExceptionAction() {
|
||||
public Object run ()
|
||||
throws IOException
|
||||
{
|
||||
stream = AccessController.doPrivileged(
|
||||
new PrivilegedExceptionAction<Streamer>() {
|
||||
public Streamer run () throws IOException {
|
||||
return new Streamer(target);
|
||||
}
|
||||
});
|
||||
@@ -376,7 +374,8 @@ public class Streamer
|
||||
} catch (Exception e) {
|
||||
String errmsg = "Failure reading streamable field " +
|
||||
"[class=" + _target.getName() +
|
||||
", field=" + field.getName() + "]";
|
||||
", field=" + field.getName() +
|
||||
", error=" + e.getMessage() + "]";
|
||||
throw (IOException) new IOException(errmsg).initCause(e);
|
||||
}
|
||||
}
|
||||
@@ -460,7 +459,7 @@ public class Streamer
|
||||
*/
|
||||
protected static void createStreamers ()
|
||||
{
|
||||
_streamers = new HashMap();
|
||||
_streamers = new HashMap<Class,Streamer>();
|
||||
|
||||
// register all of the basic streamers
|
||||
int bscount = BasicStreamers.BSTREAMER_TYPES.length;
|
||||
@@ -495,7 +494,7 @@ public class Streamer
|
||||
|
||||
/** Contains the mapping from class names to configured streamer
|
||||
* instances. */
|
||||
protected static HashMap _streamers;
|
||||
protected static HashMap<Class,Streamer> _streamers;
|
||||
|
||||
/** The name of the custom reader method. */
|
||||
protected static final String READER_METHOD_NAME = "readObject";
|
||||
|
||||
Reference in New Issue
Block a user