diff --git a/src/main/java/com/threerings/crowd/server/PlaceManager.java b/src/main/java/com/threerings/crowd/server/PlaceManager.java index e956e000f..573e95a6e 100644 --- a/src/main/java/com/threerings/crowd/server/PlaceManager.java +++ b/src/main/java/com/threerings/crowd/server/PlaceManager.java @@ -546,7 +546,7 @@ public class PlaceManager _plobj.removeListener(_deathListener); // clear out our invocation service registrations - for (InvocationMarshaller marsh : _marshallers) { + for (InvocationMarshaller marsh : _marshallers) { _invmgr.clearDispatcher(marsh); } @@ -815,7 +815,7 @@ public class PlaceManager /** A list of services registered with {@link #addProvider} which will be automatically * cleared when this manager shuts down. */ - protected List _marshallers = Lists.newArrayList(); + protected List> _marshallers = Lists.newArrayList(); /** Used to keep a canonical copy of the occupant info records. */ protected HashIntMap _occInfo = new HashIntMap(); diff --git a/src/main/java/com/threerings/crowd/server/PlaceManagerDelegate.java b/src/main/java/com/threerings/crowd/server/PlaceManagerDelegate.java index 72d8027c2..ab444678d 100644 --- a/src/main/java/com/threerings/crowd/server/PlaceManagerDelegate.java +++ b/src/main/java/com/threerings/crowd/server/PlaceManagerDelegate.java @@ -115,7 +115,7 @@ public class PlaceManagerDelegate * Registers an invocation provider and notes the registration such that it will be * automatically cleared when our parent manager shuts down. */ - protected T addProvider ( + protected > T addProvider ( InvocationProvider prov, Class mclass) { return _plmgr.addProvider(prov, mclass); @@ -125,7 +125,7 @@ public class PlaceManagerDelegate * Registers an invocation dispatcher and notes the registration such that it will be * automatically cleared when our parent manager shuts down. */ - protected T addDispatcher (InvocationDispatcher disp) + protected > T addDispatcher (InvocationDispatcher disp) { return _plmgr.addDispatcher(disp); } diff --git a/src/main/java/com/threerings/presents/client/Client.java b/src/main/java/com/threerings/presents/client/Client.java index 7aa7933ee..e93bd9bad 100644 --- a/src/main/java/com/threerings/presents/client/Client.java +++ b/src/main/java/com/threerings/presents/client/Client.java @@ -21,8 +21,6 @@ package com.threerings.presents.client; -import static com.threerings.presents.Log.log; - import java.security.PublicKey; import java.util.HashSet; @@ -49,6 +47,8 @@ import com.threerings.presents.net.PongResponse; import com.threerings.presents.net.ThrottleUpdatedMessage; import com.threerings.presents.util.SecureUtil; +import static com.threerings.presents.Log.log; + /** * Through the client object, a connection to the system is established and maintained. The client * object maintains two separate threads (a reader and a writer) by which all network traffic is @@ -416,7 +416,7 @@ public class Client } int scount = _bstrap.services.size(); for (int ii = 0; ii < scount; ii++) { - InvocationService service = _bstrap.services.get(ii); + InvocationService service = _bstrap.services.get(ii); if (sclass.isInstance(service)) { return sclass.cast(service); } diff --git a/src/main/java/com/threerings/presents/client/RegistrationService.java b/src/main/java/com/threerings/presents/client/RegistrationService.java index e0bea2840..86019dc66 100644 --- a/src/main/java/com/threerings/presents/client/RegistrationService.java +++ b/src/main/java/com/threerings/presents/client/RegistrationService.java @@ -22,12 +22,14 @@ package com.threerings.presents.client; import com.threerings.presents.client.InvocationReceiver.Registration; +import com.threerings.presents.data.ClientObject; /** - * Adds a receiver registration for a client that doesn't use DObject and thereby can't - * use the registration set on ClientObject. + * Adds a receiver registration for a client that doesn't use DObject and thereby can't use the + * registration set on ClientObject. */ public interface RegistrationService + extends InvocationService { void registerReceiver(Registration registration); } diff --git a/src/main/java/com/threerings/presents/data/RegistrationMarshaller.java b/src/main/java/com/threerings/presents/data/RegistrationMarshaller.java index 0fd8382bd..c97917a92 100644 --- a/src/main/java/com/threerings/presents/data/RegistrationMarshaller.java +++ b/src/main/java/com/threerings/presents/data/RegistrationMarshaller.java @@ -35,7 +35,7 @@ import com.threerings.presents.client.RegistrationService; */ @Generated(value={"com.threerings.presents.tools.cpp.GenCPPServiceTask"}, comments="Derived from RegistrationService.java.") -public class RegistrationMarshaller extends InvocationMarshaller +public class RegistrationMarshaller extends InvocationMarshaller implements RegistrationService { /** The method id used to dispatch {@link #registerReceiver} requests. */ diff --git a/src/main/java/com/threerings/presents/net/BootstrapData.java b/src/main/java/com/threerings/presents/net/BootstrapData.java index bd1924233..f4d821a07 100644 --- a/src/main/java/com/threerings/presents/net/BootstrapData.java +++ b/src/main/java/com/threerings/presents/net/BootstrapData.java @@ -41,5 +41,5 @@ public class BootstrapData extends SimpleStreamableObject public int clientOid; /** A list of handles to invocation services. */ - public List services; + public List> services; } diff --git a/src/main/java/com/threerings/presents/peer/server/PeerManager.java b/src/main/java/com/threerings/presents/peer/server/PeerManager.java index e24a140ad..cded01364 100644 --- a/src/main/java/com/threerings/presents/peer/server/PeerManager.java +++ b/src/main/java/com/threerings/presents/peer/server/PeerManager.java @@ -21,6 +21,8 @@ package com.threerings.presents.peer.server; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.util.Collections; import java.util.Iterator; import java.util.Map; @@ -28,9 +30,6 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; - import com.google.common.base.Function; import com.google.common.base.Predicates; import com.google.common.collect.Iterables; @@ -38,6 +37,7 @@ import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.google.inject.Inject; import com.google.inject.Injector; + import com.samskivert.util.ArrayIntSet; import com.samskivert.util.ChainedResultListener; import com.samskivert.util.Interval; @@ -55,8 +55,6 @@ import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; import com.threerings.io.Streamable; -import com.threerings.presents.peer.data.DObjectAddress; - import com.threerings.util.Name; import com.threerings.presents.annotation.PeerInvoker; @@ -64,16 +62,13 @@ import com.threerings.presents.client.Client; import com.threerings.presents.client.InvocationService; import com.threerings.presents.data.ClientObject; import com.threerings.presents.dobj.DObject; -import com.threerings.presents.dobj.EntryAddedEvent; -import com.threerings.presents.dobj.EntryRemovedEvent; -import com.threerings.presents.dobj.EntryUpdatedEvent; import com.threerings.presents.dobj.ObjectAccessException; -import com.threerings.presents.dobj.SetListener; import com.threerings.presents.dobj.Subscriber; import com.threerings.presents.net.DownstreamMessage; import com.threerings.presents.net.Message; import com.threerings.presents.peer.client.PeerService; import com.threerings.presents.peer.data.ClientInfo; +import com.threerings.presents.peer.data.DObjectAddress; import com.threerings.presents.peer.data.NodeObject; import com.threerings.presents.peer.data.PeerAuthName; import com.threerings.presents.peer.data.PeerMarshaller; diff --git a/src/main/java/com/threerings/presents/peer/util/PeerUtil.java b/src/main/java/com/threerings/presents/peer/util/PeerUtil.java index d1bc3a83a..9cd747342 100644 --- a/src/main/java/com/threerings/presents/peer/util/PeerUtil.java +++ b/src/main/java/com/threerings/presents/peer/util/PeerUtil.java @@ -24,7 +24,6 @@ package com.threerings.presents.peer.util; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; - import java.util.HashMap; import com.google.common.collect.Maps; @@ -52,7 +51,7 @@ public class PeerUtil * @param svc the implementation of the corresponding subclass of {@link InvocationService} * @param client the client to pass to the service methods */ - public static + public static > S createProviderProxy (Class clazz, final T svc, final Client client) { return clazz.cast(Proxy.newProxyInstance( diff --git a/src/main/java/com/threerings/presents/server/InvocationDispatcher.java b/src/main/java/com/threerings/presents/server/InvocationDispatcher.java index f72de11da..b714c94ea 100644 --- a/src/main/java/com/threerings/presents/server/InvocationDispatcher.java +++ b/src/main/java/com/threerings/presents/server/InvocationDispatcher.java @@ -29,7 +29,7 @@ import static com.threerings.presents.Log.log; /** * Provides the base class via which invocation service requests are dispatched. */ -public abstract class InvocationDispatcher +public abstract class InvocationDispatcher> implements InvocationManager.Dispatcher { /** The invocation provider for whom we're dispatching. */ diff --git a/src/main/java/com/threerings/presents/server/InvocationManager.java b/src/main/java/com/threerings/presents/server/InvocationManager.java index 702dd7c90..b4d02c2ed 100644 --- a/src/main/java/com/threerings/presents/server/InvocationManager.java +++ b/src/main/java/com/threerings/presents/server/InvocationManager.java @@ -107,7 +107,7 @@ public class InvocationManager * @param provider the provider to be registered. * @param mclass the class of the invocation marshaller generated for the service. */ - public T registerProvider ( + public > T registerProvider ( InvocationProvider provider, Class mclass) { return registerProvider(provider, mclass, null); @@ -123,7 +123,7 @@ public class InvocationManager * groups. You must collect shared marshaller into as fine grained a set of groups as necessary * and have different types of clients specify the list of groups they need. */ - public T registerProvider ( + public > T registerProvider ( final InvocationProvider provider, Class mclass, String group) { _omgr.requireEventThread(); // sanity check @@ -238,7 +238,7 @@ public class InvocationManager * * @param dispatcher the dispatcher to be registered. */ - public T registerDispatcher ( + public > T registerDispatcher ( InvocationDispatcher dispatcher) { return registerDispatcher(dispatcher, null); @@ -247,7 +247,7 @@ public class InvocationManager /** * @deprecated use {@link #registerDispatcher(InvocationDispatcher)}. */ - @Deprecated public T registerDispatcher ( + @Deprecated public > T registerDispatcher ( InvocationDispatcher dispatcher, boolean bootstrap) { return registerDispatcher(dispatcher, null); @@ -263,7 +263,7 @@ public class InvocationManager * groups. You must collect shared dispatchers into as fine grained a set of groups as * necessary and have different types of clients specify the list of groups they need. */ - public T registerDispatcher ( + public > T registerDispatcher ( InvocationDispatcher dispatcher, String group) { _omgr.requireEventThread(); // sanity check @@ -294,7 +294,7 @@ public class InvocationManager * Clears out a dispatcher registration. This should be called to free up resources when an * invocation service is no longer going to be used. */ - public void clearDispatcher (InvocationMarshaller marsh) + public void clearDispatcher (InvocationMarshaller marsh) { _omgr.requireEventThread(); // sanity check @@ -312,9 +312,9 @@ public class InvocationManager /** * Constructs a list of all bootstrap services registered in any of the supplied groups. */ - public List getBootstrapServices (String[] bootGroups) + public List> getBootstrapServices (String[] bootGroups) { - List services = Lists.newArrayList(); + List> services = Lists.newArrayList(); for (String group : bootGroups) { services.addAll(_bootlists.get(group)); } @@ -450,7 +450,7 @@ public class InvocationManager protected IntMap _dispatchers = IntMaps.newHashIntMap(); /** Maps bootstrap group to lists of services to be provided to clients at boot time. */ - protected Multimap _bootlists = ArrayListMultimap.create(); + protected Multimap> _bootlists = ArrayListMultimap.create(); /** Tracks recently registered services so that we can complain informatively if a request * comes in on a service we don't know about. */