More style changes.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5248 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-07-22 13:02:13 +00:00
parent 09f8a25876
commit c743432676
38 changed files with 155 additions and 193 deletions
@@ -32,5 +32,5 @@ public interface OccupantOp
/** /**
* Called with the occupant info for each occupant in the location. * Called with the occupant info for each occupant in the location.
*/ */
public void apply (OccupantInfo info); void apply (OccupantInfo info);
} }
@@ -142,7 +142,7 @@ public class PlaceRegistry
{ {
final Iterator<PlaceManager> itr = _pmgrs.values().iterator(); final Iterator<PlaceManager> itr = _pmgrs.values().iterator();
return new Iterator<PlaceObject>() { return new Iterator<PlaceObject>() {
public boolean hasNext (){ public boolean hasNext () {
return itr.hasNext(); return itr.hasNext();
} }
public PlaceObject next () { public PlaceObject next () {
@@ -246,7 +246,7 @@ public class PlaceRegistry
throws Exception throws Exception
{ {
@SuppressWarnings("unchecked") Class<? extends PlaceManager> clazz = @SuppressWarnings("unchecked") Class<? extends PlaceManager> clazz =
(Class<? extends PlaceManager>) Class.forName(config.getManagerClassName()); (Class<? extends PlaceManager>)Class.forName(config.getManagerClassName());
return _injector.getInstance(clazz); return _injector.getInstance(clazz);
} }
@@ -37,17 +37,17 @@ public interface CrowdContext extends PresentsContext
/** /**
* Returns a reference to the location director. * Returns a reference to the location director.
*/ */
public LocationDirector getLocationDirector (); LocationDirector getLocationDirector ();
/** /**
* Returns a reference to the occupant director. * Returns a reference to the occupant director.
*/ */
public OccupantDirector getOccupantDirector (); OccupantDirector getOccupantDirector ();
/** /**
* Provides access to the chat director. * Provides access to the chat director.
*/ */
public ChatDirector getChatDirector (); ChatDirector getChatDirector ();
/** /**
* When the client enters a new place, the location director creates a * When the client enters a new place, the location director creates a
@@ -64,12 +64,12 @@ public interface CrowdContext extends PresentsContext
* won't be displayed (via a call to this function) until we have * won't be displayed (via a call to this function) until we have
* fully entered the place and are ready for user interaction. * fully entered the place and are ready for user interaction.
*/ */
public void setPlaceView (PlaceView view); void setPlaceView (PlaceView view);
/** /**
* When the client leaves a place, the place controller will remove * When the client leaves a place, the place controller will remove
* any place view it set previously via {@link #setPlaceView} with a * any place view it set previously via {@link #setPlaceView} with a
* call to this method. * call to this method.
*/ */
public void clearPlaceView (PlaceView view); void clearPlaceView (PlaceView view);
} }
@@ -54,19 +54,19 @@ public interface ClientObserver extends SessionObserver
* we are simply reporting intermediate status (we might be falling back to an alternative port * we are simply reporting intermediate status (we might be falling back to an alternative port
* or delaying our auto-retry attempt due to server overload). * or delaying our auto-retry attempt due to server overload).
*/ */
public void clientFailedToLogon (Client client, Exception cause); void clientFailedToLogon (Client client, Exception cause);
/** /**
* Called when the connection to the server went away for some unexpected reason. This will be * Called when the connection to the server went away for some unexpected reason. This will be
* followed by a call to {@link #clientDidLogoff}. * followed by a call to {@link #clientDidLogoff}.
*/ */
public void clientConnectionFailed (Client client, Exception cause); void clientConnectionFailed (Client client, Exception cause);
/** /**
* Called when an abortable logoff request is made. If the observer returns false from this * Called when an abortable logoff request is made. If the observer returns false from this
* method, the client will abort the logoff request. * method, the client will abort the logoff request.
*/ */
public boolean clientWillLogoff (Client client); boolean clientWillLogoff (Client client);
/** /**
* Called after the client is completely logged off from a successful session and is ready to * Called after the client is completely logged off from a successful session and is ready to
@@ -74,5 +74,5 @@ public interface ClientObserver extends SessionObserver
* terminated, not after a logon attempt failed as that failure will be reported by {@link * terminated, not after a logon attempt failed as that failure will be reported by {@link
* #clientFailedToLogon}. * #clientFailedToLogon}.
*/ */
public void clientDidClear (Client client); void clientDidClear (Client client);
} }
@@ -21,23 +21,19 @@
package com.threerings.presents.client; package com.threerings.presents.client;
import com.samskivert.util.StringUtil;
import static com.threerings.presents.Log.log; import static com.threerings.presents.Log.log;
/** /**
* Provides the basic functionality used to dispatch invocation * Provides the basic functionality used to dispatch invocation notification events.
* notification events.
*/ */
public abstract class InvocationDecoder public abstract class InvocationDecoder
{ {
/** The receiver for which we're decoding and dipatching /** The receiver for which we're decoding and dipatching notifications. */
* notifications. */
public InvocationReceiver receiver; public InvocationReceiver receiver;
/** /**
* Returns the generated hash code that is used to identify this * Returns the generated hash code that is used to identify this invocation notification
* invocation notification service. * service.
*/ */
public abstract String getReceiverCode (); public abstract String getReceiverCode ();
@@ -46,8 +42,7 @@ public abstract class InvocationDecoder
*/ */
public void dispatchNotification (int methodId, Object[] args) public void dispatchNotification (int methodId, Object[] args)
{ {
log.warning("Requested to dispatch unknown method " + log.warning("Requested to dispatch unknown method", "receiver", receiver,
"[receiver=" + receiver + ", methodId=" + methodId + "methodId", methodId, "args", args);
", args=" + StringUtil.toString(args) + "].");
} }
} }
@@ -22,10 +22,9 @@
package com.threerings.presents.client; package com.threerings.presents.client;
/** /**
* Serves as the base interface for invocation services. An invocation * Serves as the base interface for invocation services. An invocation service can be defined by
* service can be defined by extending this interface and defining service * extending this interface and defining service methods, as well as response listeners (which must
* methods, as well as response listeners (which must extend {@link * extend {@link InvocationListener}). For example:
* InvocationListener}). For example:
* *
* <pre> * <pre>
* public interface LocationService extends InvocationService * public interface LocationService extends InvocationService
@@ -35,39 +34,30 @@ package com.threerings.presents.client;
* public interface MoveListener extends InvocationListener * public interface MoveListener extends InvocationListener
* { * {
* // Called in response to a successful moveTo() request. * // Called in response to a successful moveTo() request.
* public void moveSucceeded (PlaceConfig config); * void moveSucceeded (PlaceConfig config);
* } * }
* *
* // Requests that this client's body be moved to the specified * // Requests that this client's body be moved to the specified location.
* // location.
* // * //
* // @param placeId the object id of the place object to which the * // @param placeId the object id of the place object to which the body should be moved.
* // body should be moved. * // @param listener the listener that will be informed of success or failure.
* // @param listener the listener that will be informed of success or * void moveTo (int placeId, MoveListener listener);
* // failure.
* public void moveTo (int placeId, MoveListener listener);
* } * }
* </pre> * </pre>
* *
* From this interface, a <code>LocationProvider</code> interface will be * From this interface, a <code>LocationProvider</code> interface will be generated which should be
* generated which should be implemented by whatever server entity that * implemented by whatever server entity that will actually provide the server side of this
* will actually provide the server side of this invocation service. That * invocation service. That provider interface would look like the following:
* provider interface would look like the following:
* *
* <pre> * <pre>
* public interface LocationProvider extends InvocationProvider * public interface LocationProvider extends InvocationProvider
* { * {
* // Requests that this client's body be moved to the specified * // Requests that this client's body be moved to the specified location.
* // location.
* // * //
* // @param caller the client object of the client that invoked this * // @param caller the client object of the client that invoked this remotely callable method.
* // remotely callable method. * // @param placeId the object id of the place object to which the body should be moved.
* // @param placeId the object id of the place object to which the * // @param listener the listener that should be informed of success or failure.
* // body should be moved. * void moveTo (ClientObject caller, int placeId, MoveListener listener)
* // @param listener the listener that should be informed of success
* // or failure.
* public void moveTo (ClientObject caller, int placeId,
* MoveListener listener)
* throws InvocationException; * throws InvocationException;
* } * }
* </pre> * </pre>
@@ -75,54 +65,50 @@ package com.threerings.presents.client;
public interface InvocationService public interface InvocationService
{ {
/** /**
* Invocation service methods that require a response should take a * Invocation service methods that require a response should take a listener argument that can
* listener argument that can be notified of request success or * be notified of request success or failure. The listener argument should extend this
* failure. The listener argument should extend this interface so that * interface so that generic failure can be reported in all cases. For example:
* generic failure can be reported in all cases. For example:
* *
* <pre> * <pre>
* // Used to communicate responses to <code>moveTo</code> requests. * // Used to communicate responses to <code>moveTo</code> requests.
* public interface MoveListener extends InvocationListener * public interface MoveListener extends InvocationListener
* { * {
* // Called in response to a successful <code>moveTo</code> * // Called in response to a successful <code>moveTo</code> request.
* // request. * void moveSucceeded (PlaceConfig config);
* public void moveSucceeded (PlaceConfig config);
* } * }
* </pre> * </pre>
*/ */
public static interface InvocationListener public static interface InvocationListener
{ {
/** /**
* Called to report request failure. If the invocation services * Called to report request failure. If the invocation services system detects failure of
* system detects failure of any kind, it will report it via this * any kind, it will report it via this callback. Particular services may also make use of
* callback. Particular services may also make use of this * this callback to report failures of their own, or they may opt to define more specific
* callback to report failures of their own, or they may opt to * failure callbacks.
* define more specific failure callbacks.
*/ */
public void requestFailed (String cause); void requestFailed (String cause);
} }
/** /**
* Extends the {@link InvocationListener} with a basic success * Extends the {@link InvocationListener} with a basic success callback.
* callback.
*/ */
public static interface ConfirmListener extends InvocationListener public static interface ConfirmListener extends InvocationListener
{ {
/** /**
* Indicates that the request was successfully processed. * Indicates that the request was successfully processed.
*/ */
public void requestProcessed (); void requestProcessed ();
} }
/** /**
* Extends the {@link InvocationListener} with a basic success * Extends the {@link InvocationListener} with a basic success callback that delivers a result
* callback that delivers a result object. * object.
*/ */
public static interface ResultListener extends InvocationListener public static interface ResultListener extends InvocationListener
{ {
/** /**
* Indicates that the request was successfully processed. * Indicates that the request was successfully processed.
*/ */
public void requestProcessed (Object result); void requestProcessed (Object result);
} }
} }
@@ -32,23 +32,23 @@ public interface SessionObserver
/** /**
* Called immediately before a logon is attempted. * Called immediately before a logon is attempted.
*/ */
public void clientWillLogon (Client client); void clientWillLogon (Client client);
/** /**
* Called after the client successfully connected to and authenticated with the server. The * Called after the client successfully connected to and authenticated with the server. The
* entire object system is up and running by the time this method is called. * entire object system is up and running by the time this method is called.
*/ */
public void clientDidLogon (Client client); void clientDidLogon (Client client);
/** /**
* For systems that allow switching screen names after logon, this method is called whenever a * For systems that allow switching screen names after logon, this method is called whenever a
* screen name change takes place to report that the client object has been replaced to * screen name change takes place to report that the client object has been replaced to
* potential client-side subscribers. * potential client-side subscribers.
*/ */
public void clientObjectDidChange (Client client); void clientObjectDidChange (Client client);
/** /**
* Called after the client has been logged off of the server and has disconnected. * Called after the client has been logged off of the server and has disconnected.
*/ */
public void clientDidLogoff (Client client); void clientDidLogoff (Client client);
} }
@@ -25,8 +25,8 @@ import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationService; import com.threerings.presents.client.InvocationService;
/** /**
* Provides a means by which to obtain access to a time base object which * Provides a means by which to obtain access to a time base object which can be used to convert
* can be used to convert delta times into absolute times. * delta times into absolute times.
*/ */
public interface TimeBaseService extends InvocationService public interface TimeBaseService extends InvocationService
{ {
@@ -36,15 +36,13 @@ public interface TimeBaseService extends InvocationService
public static interface GotTimeBaseListener extends InvocationListener public static interface GotTimeBaseListener extends InvocationListener
{ {
/** /**
* Communicates the result of a successful {@link #getTimeOid} * Communicates the result of a successful {@link #getTimeOid} request.
* request.
*/ */
public void gotTimeOid (int timeOid); void gotTimeOid (int timeOid);
} }
/** /**
* Requests the oid of the specified time base object be fetched. * Requests the oid of the specified time base object be fetched.
*/ */
public void getTimeOid ( void getTimeOid (Client client, String timeBase, GotTimeBaseListener listener);
Client client, String timeBase, GotTimeBaseListener listener);
} }
@@ -33,11 +33,11 @@ public interface AccessController
* Should return true if the supplied subscriber is allowed to * Should return true if the supplied subscriber is allowed to
* subscribe to the specified object. * subscribe to the specified object.
*/ */
public boolean allowSubscribe (DObject object, Subscriber subscriber); boolean allowSubscribe (DObject object, Subscriber subscriber);
/** /**
* Should return true if the supplied event is legal for dispatch on * Should return true if the supplied event is legal for dispatch on
* the specified distributed object. * the specified distributed object.
*/ */
public boolean allowDispatch (DObject object, DEvent event); boolean allowDispatch (DObject object, DEvent event);
} }
@@ -37,5 +37,5 @@ public interface AttributeChangeListener extends ChangeListener
* *
* @param event The event that was dispatched on the object. * @param event The event that was dispatched on the object.
*/ */
public void attributeChanged (AttributeChangedEvent event); void attributeChanged (AttributeChangedEvent event);
} }
@@ -22,73 +22,61 @@
package com.threerings.presents.dobj; package com.threerings.presents.dobj;
/** /**
* The distributed object manager is responsible for managing the creation * The distributed object manager is responsible for managing the creation and destruction of
* and destruction of distributed objects and propagating dobj events to * distributed objects and propagating dobj events to the appropriate subscribers. On the client,
* the appropriate subscribers. On the client, objects are managed as * objects are managed as proxies to the real objects managed by the server, so attribute change
* proxies to the real objects managed by the server, so attribute change * requests are forwarded to the server and events coming down from the server are delivered to the
* requests are forwarded to the server and events coming down from the * local subscribers. On the server, the objects are managed directly.
* server are delivered to the local subscribers. On the server, the
* objects are managed directly.
*/ */
public interface DObjectManager public interface DObjectManager
{ {
/** /**
* Returns true if this distributed object manager is the * Returns true if this distributed object manager is the authoritative manager for the
* authoritative manager for the specified distributed object, or fals * specified distributed object, or fals if we are only providing a proxy to the object.
* if we are only providing a proxy to the object.
*/ */
public boolean isManager (DObject object); boolean isManager (DObject object);
/** /**
* Requests that the specified subscriber be subscribed to the object * Requests that the specified subscriber be subscribed to the object identified by the
* identified by the supplied object id. That subscriber will be * supplied object id. That subscriber will be notified when the object is available or if the
* notified when the object is available or if the subscription * subscription request failed.
* request failed.
* *
* @param oid The object id of the distributed object to which * @param oid The object id of the distributed object to which subscription is desired.
* subscription is desired.
* @param target The subscriber to be subscribed. * @param target The subscriber to be subscribed.
* *
* @see Subscriber#objectAvailable * @see Subscriber#objectAvailable
* @see Subscriber#requestFailed * @see Subscriber#requestFailed
*/ */
public <T extends DObject> void subscribeToObject ( <T extends DObject> void subscribeToObject (int oid, Subscriber<T> target);
int oid, Subscriber<T> target);
/** /**
* Requests that the specified subscriber be unsubscribed from the * Requests that the specified subscriber be unsubscribed from the object identified by the
* object identified by the supplied object id. * supplied object id.
* *
* @param oid The object id of the distributed object from which * @param oid The object id of the distributed object from which unsubscription is desired.
* unsubscription is desired.
* @param target The subscriber to be unsubscribed. * @param target The subscriber to be unsubscribed.
*/ */
public <T extends DObject> void unsubscribeFromObject ( <T extends DObject> void unsubscribeFromObject (int oid, Subscriber<T> target);
int oid, Subscriber<T> target);
/** /**
* Posts a distributed object event into the system. Instead of * Posts a distributed object event into the system. Instead of requesting the modification of
* requesting the modification of a distributed object attribute by * a distributed object attribute by calling the setter for that attribute on the object
* calling the setter for that attribute on the object itself, an * itself, an <code>AttributeChangedEvent</code> can be constructed and posted directly. This
* <code>AttributeChangedEvent</code> can be constructed and posted * is true for all event types and is useful for situations where one doesn't have access to
* directly. This is true for all event types and is useful for * the object in question, but needs to affect some event.
* situations where one doesn't have access to the object in question,
* but needs to affect some event.
* *
* <p> This event will be forwarded to the ultimate manager of the * <p> This event will be forwarded to the ultimate manager of the object (on the client, this
* object (on the client, this means it will be forwarded to the * means it will be forwarded to the server) where it will be checked for validity and then
* server) where it will be checked for validity and then applied to * applied to the object and dispatched to all its subscribers.
* the object and dispatched to all its subscribers.
* *
* @param event The event to be dispatched. * @param event The event to be dispatched.
*/ */
public void postEvent (DEvent event); void postEvent (DEvent event);
/** /**
* When a distributed object removes its last subscriber, it will call * When a distributed object removes its last subscriber, it will call this function to let the
* this function to let the object manager know. The manager might * object manager know. The manager might then choose to flush this object from the system or
* then choose to flush this object from the system or unregister from * unregister from some upstream manager whose object it was proxying, for example.
* some upstream manager whose object it was proxying, for example.
*/ */
public void removedLastSubscriber (DObject obj, boolean deathWish); void removedLastSubscriber (DObject obj, boolean deathWish);
} }
@@ -62,7 +62,7 @@ public class DSet<E extends DSet.Entry>
* Each entry provide an associated key which is used to determine its uniqueness in the * Each entry provide an associated key which is used to determine its uniqueness in the
* set. See the {@link DSet} class documentation for further information. * set. See the {@link DSet} class documentation for further information.
*/ */
public Comparable getKey (); Comparable getKey ();
} }
/** /**
@@ -37,5 +37,5 @@ public interface ElementUpdateListener extends ChangeListener
* *
* @param event The event that was dispatched on the object. * @param event The event that was dispatched on the object.
*/ */
public void elementUpdated (ElementUpdatedEvent event); void elementUpdated (ElementUpdatedEvent event);
} }
@@ -39,5 +39,5 @@ public interface EventListener extends ChangeListener
* *
* @param event The event that was dispatched on the object. * @param event The event that was dispatched on the object.
*/ */
public void eventReceived (DEvent event); void eventReceived (DEvent event);
} }
@@ -34,5 +34,5 @@ public interface MessageListener extends ChangeListener
* *
* @param event The event that was dispatched on the object. * @param event The event that was dispatched on the object.
*/ */
public void messageReceived (MessageEvent event); void messageReceived (MessageEvent event);
} }
@@ -22,18 +22,17 @@
package com.threerings.presents.dobj; package com.threerings.presents.dobj;
/** /**
* Implemented by entites which wish to hear about object destruction * Implemented by entites which wish to hear about object destruction events.
* events.
* *
* @see DObject#addListener * @see DObject#addListener
*/ */
public interface ObjectDeathListener extends ChangeListener public interface ObjectDeathListener extends ChangeListener
{ {
/** /**
* Called when this object has been destroyed. This will be called * Called when this object has been destroyed. This will be called <em>after</em> the event has
* <em>after</em> the event has been applied to the object. * been applied to the object.
* *
* @param event The event that was dispatched on the object. * @param event The event that was dispatched on the object.
*/ */
public void objectDestroyed (ObjectDestroyedEvent event); void objectDestroyed (ObjectDestroyedEvent event);
} }
@@ -36,7 +36,7 @@ public interface OidListListener extends ChangeListener
* *
* @param event The event that was dispatched on the object. * @param event The event that was dispatched on the object.
*/ */
public void objectAdded (ObjectAddedEvent event); void objectAdded (ObjectAddedEvent event);
/** /**
* Called when an object removed event has been dispatched on an * Called when an object removed event has been dispatched on an
@@ -45,5 +45,5 @@ public interface OidListListener extends ChangeListener
* *
* @param event The event that was dispatched on the object. * @param event The event that was dispatched on the object.
*/ */
public void objectRemoved (ObjectRemovedEvent event); void objectRemoved (ObjectRemovedEvent event);
} }
@@ -35,5 +35,5 @@ public interface ProxySubscriber extends Subscriber<DObject>
* *
* @param event The event that was dispatched on the object. * @param event The event that was dispatched on the object.
*/ */
public void eventReceived (DEvent event); void eventReceived (DEvent event);
} }
@@ -35,7 +35,7 @@ public interface RootDObjectManager extends DObjectManager, RunQueue
* Looks up and returns the requested distributed object in the dobj table, returning null if * Looks up and returns the requested distributed object in the dobj table, returning null if
* no object exists with that oid. * no object exists with that oid.
*/ */
public DObject getObject (int oid); DObject getObject (int oid);
/** /**
* Registers a distributed object instance of the supplied class with the system and assigns it * Registers a distributed object instance of the supplied class with the system and assigns it
@@ -44,7 +44,7 @@ public interface RootDObjectManager extends DObjectManager, RunQueue
* *
* @return the registered object for the caller's convenience. * @return the registered object for the caller's convenience.
*/ */
public <T extends DObject> T registerObject (T object); <T extends DObject> T registerObject (T object);
/** /**
* Requests that the specified object be destroyed. Once destroyed an object is removed from * Requests that the specified object be destroyed. Once destroyed an object is removed from
@@ -52,5 +52,5 @@ public interface RootDObjectManager extends DObjectManager, RunQueue
* *
* @param oid The object id of the distributed object to be destroyed. * @param oid The object id of the distributed object to be destroyed.
*/ */
public void destroyObject (int oid); void destroyObject (int oid);
} }
@@ -40,7 +40,7 @@ public interface SetListener<T extends DSet.Entry> extends ChangeListener
* *
* @param event The event that was dispatched on the object. * @param event The event that was dispatched on the object.
*/ */
public void entryAdded (EntryAddedEvent<T> event); void entryAdded (EntryAddedEvent<T> event);
/** /**
* Called when an entry updated event has been dispatched on an * Called when an entry updated event has been dispatched on an
@@ -49,7 +49,7 @@ public interface SetListener<T extends DSet.Entry> extends ChangeListener
* *
* @param event The event that was dispatched on the object. * @param event The event that was dispatched on the object.
*/ */
public void entryUpdated (EntryUpdatedEvent<T> event); void entryUpdated (EntryUpdatedEvent<T> event);
/** /**
* Called when an entry removed event has been dispatched on an * Called when an entry removed event has been dispatched on an
@@ -58,5 +58,5 @@ public interface SetListener<T extends DSet.Entry> extends ChangeListener
* *
* @param event The event that was dispatched on the object. * @param event The event that was dispatched on the object.
*/ */
public void entryRemoved (EntryRemovedEvent<T> event); void entryRemoved (EntryRemovedEvent<T> event);
} }
@@ -49,7 +49,7 @@ public interface Subscriber<T extends DObject>
* *
* @see DObjectManager#subscribeToObject * @see DObjectManager#subscribeToObject
*/ */
public void objectAvailable (T object); void objectAvailable (T object);
/** /**
* Called when a subscription request has failed. The nature of the * Called when a subscription request has failed. The nature of the
@@ -58,5 +58,5 @@ public interface Subscriber<T extends DObject>
* *
* @see DObjectManager#subscribeToObject * @see DObjectManager#subscribeToObject
*/ */
public void requestFailed (int oid, ObjectAccessException cause); void requestFailed (int oid, ObjectAccessException cause);
} }
@@ -35,10 +35,10 @@ public interface PeerService extends InvocationService
* Informs the node that the sending peer ratifies its acquisition or release of the specified * Informs the node that the sending peer ratifies its acquisition or release of the specified
* lock. * lock.
*/ */
public void ratifyLockAction (Client client, Lock lock, boolean acquire); void ratifyLockAction (Client client, Lock lock, boolean acquire);
/** /**
* Requests that the specified action be invoked on this server. * Requests that the specified action be invoked on this server.
*/ */
public void invokeAction (Client client, byte[] serializedAction); void invokeAction (Client client, byte[] serializedAction);
} }
@@ -91,7 +91,7 @@ public abstract class PeerManager
/** /**
* Called when some possibly cached data has changed on one of our peer servers. * Called when some possibly cached data has changed on one of our peer servers.
*/ */
public void changedCacheData (Streamable data); void changedCacheData (Streamable data);
} }
/** /**
@@ -103,25 +103,25 @@ public abstract class PeerManager
/** /**
* Called when this node has been forced to drop a lock. * Called when this node has been forced to drop a lock.
*/ */
public void droppedLock (NodeObject.Lock lock); void droppedLock (NodeObject.Lock lock);
} }
/** Used by {@link #lookupNodeDatum}. */ /** Used by {@link #lookupNodeDatum}. */
public static interface Lookup<T> public static interface Lookup<T>
{ {
public T lookup (NodeObject nodeobj); T lookup (NodeObject nodeobj);
} }
/** Used by {@link #applyToNodes}. */ /** Used by {@link #applyToNodes}. */
public static interface Operation public static interface Operation
{ {
public void apply (NodeObject nodeobj); void apply (NodeObject nodeobj);
} }
/** Used by {@link #invokeOnNodes}. */ /** Used by {@link #invokeOnNodes}. */
public static interface Function public static interface Function
{ {
public void invoke (Client client, NodeObject nodeobj); void invoke (Client client, NodeObject nodeobj);
} }
/** /**
@@ -134,13 +134,13 @@ public abstract class PeerManager
* Called when the resource lock was acquired successfully. The lock will be released * Called when the resource lock was acquired successfully. The lock will be released
* immediately after this function call finishes. * immediately after this function call finishes.
*/ */
public void run (); void run ();
/** /**
* Called when the resource lock was not acquired successfully, with the name of the peer * Called when the resource lock was not acquired successfully, with the name of the peer
* who is holding the lock (or null in case of a generic failure). * who is holding the lock (or null in case of a generic failure).
*/ */
public void fail (String peerName); void fail (String peerName);
} }
/** /**
@@ -45,11 +45,11 @@ public interface ClientFactory
* Returns the {@link PresentsClient} derived class to use for the session that authenticated * Returns the {@link PresentsClient} derived class to use for the session that authenticated
* with the supplied request. * with the supplied request.
*/ */
public Class<? extends PresentsClient> getClientClass (AuthRequest areq); Class<? extends PresentsClient> getClientClass (AuthRequest areq);
/** /**
* Returns the {@link ClientResolver} derived class to use to resolve a client with the * Returns the {@link ClientResolver} derived class to use to resolve a client with the
* specified username. * specified username.
*/ */
public Class <? extends ClientResolver> getClientResolverClass (Name username); Class <? extends ClientResolver> getClientResolverClass (Name username);
} }
@@ -68,12 +68,12 @@ public class ClientManager
/** /**
* Called with the resolved client object. * Called with the resolved client object.
*/ */
public void apply (ClientObject clobj); void apply (ClientObject clobj);
/** /**
* Called if the client resolution fails. * Called if the client resolution fails.
*/ */
public void resolutionFailed (Exception e); void resolutionFailed (Exception e);
} }
/** /**
@@ -84,13 +84,13 @@ public class ClientManager
/** /**
* Called when a client has authenticated and been resolved and has started their session. * Called when a client has authenticated and been resolved and has started their session.
*/ */
public void clientSessionDidStart (PresentsClient client); void clientSessionDidStart (PresentsClient client);
/** /**
* Called when a client has logged off or been forcibly logged off due to inactivity and * Called when a client has logged off or been forcibly logged off due to inactivity and
* has thus ended their session. * has thus ended their session.
*/ */
public void clientSessionDidEnd (PresentsClient client); void clientSessionDidEnd (PresentsClient client);
} }
/** /**
@@ -34,10 +34,10 @@ public interface ClientResolutionListener
/** /**
* Called when resolution completed successfully. * Called when resolution completed successfully.
*/ */
public void clientResolved (Name username, ClientObject clobj); void clientResolved (Name username, ClientObject clobj);
/** /**
* Called when resolution fails. * Called when resolution fails.
*/ */
public void resolutionFailed (Name username, Exception reason); void resolutionFailed (Name username, Exception reason);
} }
@@ -90,14 +90,14 @@ public class PresentsClient
* *
* @param rl when this method is finished with its business and the old client object can * @param rl when this method is finished with its business and the old client object can
* be destroyed, the result listener should be called. */ * be destroyed, the result listener should be called. */
public void changeReported (ClientObject newObji, ResultListener rl); void changeReported (ClientObject newObji, ResultListener rl);
/** Called when the user change is completed, the old client object is destroyed and all /** Called when the user change is completed, the old client object is destroyed and all
* updates are committed. */ * updates are committed. */
public void changeCompleted (ClientObject newObj); void changeCompleted (ClientObject newObj);
/** Called if some failure occurs during the user change process. */ /** Called if some failure occurs during the user change process. */
public void changeFailed (Exception cause); void changeFailed (Exception cause);
} }
/** /**
@@ -59,7 +59,7 @@ public abstract class RebootManager
* @param msLeft the approximate number of milliseconds left prior to * @param msLeft the approximate number of milliseconds left prior to
* the shutdown. * the shutdown.
*/ */
public void shutdownPlanned (int warningsLeft, long msLeft); void shutdownPlanned (int warningsLeft, long msLeft);
} }
/** /**
@@ -50,7 +50,7 @@ public class ReportManager
* @param reset if true, all accumulating stats should be reset, if false they should be * @param reset if true, all accumulating stats should be reset, if false they should be
* allowed to continue to accumulate. * allowed to continue to accumulate.
*/ */
public void appendReport (StringBuilder buffer, long now, long sinceLast, boolean reset); void appendReport (StringBuilder buffer, long now, long sinceLast, boolean reset);
} }
/** /**
@@ -45,7 +45,7 @@ public class ShutdownManager
/** /**
* Called when the server is shutting down. * Called when the server is shutting down.
*/ */
public void shutdown (); void shutdown ();
} }
public static enum Constraint { RUNS_BEFORE, RUNS_AFTER }; public static enum Constraint { RUNS_BEFORE, RUNS_AFTER };
@@ -945,7 +945,7 @@ public class ConnectionManager extends LoopingThread
/** Used to handle partial writes in {@link #writeMessage}. */ /** Used to handle partial writes in {@link #writeMessage}. */
protected static interface PartialWriteHandler protected static interface PartialWriteHandler
{ {
public void handlePartialWrite (Connection conn, ByteBuffer buffer); void handlePartialWrite (Connection conn, ByteBuffer buffer);
} }
/** /**
@@ -46,8 +46,7 @@ public interface ConnectionObserver
* @param req The auth request provided by the client. * @param req The auth request provided by the client.
* @param rsp The auth response provided to the client. * @param rsp The auth response provided to the client.
*/ */
public void connectionEstablished ( void connectionEstablished (Connection conn, AuthRequest req, AuthResponse rsp);
Connection conn, AuthRequest req, AuthResponse rsp);
/** /**
* Called if a connection fails for any reason. If a connection fails, * Called if a connection fails for any reason. If a connection fails,
@@ -58,12 +57,12 @@ public interface ConnectionObserver
* @param conn The connection in that failed. * @param conn The connection in that failed.
* @param fault The exception associated with the failure. * @param fault The exception associated with the failure.
*/ */
public void connectionFailed (Connection conn, IOException fault); void connectionFailed (Connection conn, IOException fault);
/** /**
* Called when a connection has been closed in an orderly manner. * Called when a connection has been closed in an orderly manner.
* *
* @param conn The recently closed connection. * @param conn The recently closed connection.
*/ */
public void connectionClosed (Connection conn); void connectionClosed (Connection conn);
} }
@@ -33,5 +33,5 @@ public interface MessageHandler
* Called when a complete message has been parsed from incoming * Called when a complete message has been parsed from incoming
* network data. * network data.
*/ */
public void handleMessage (UpstreamMessage message); void handleMessage (UpstreamMessage message);
} }
@@ -41,7 +41,7 @@ public interface NetEventHandler
* @return the number of bytes read from the network as a result of * @return the number of bytes read from the network as a result of
* handling this event. * handling this event.
*/ */
public int handleEvent (long when); int handleEvent (long when);
/** /**
* Called to ensure that this channel has not been idle for longer * Called to ensure that this channel has not been idle for longer
@@ -50,5 +50,5 @@ public interface NetEventHandler
* @return true if the handler is idle (in which case it will be * @return true if the handler is idle (in which case it will be
* closed shortly), false if it is not. * closed shortly), false if it is not.
*/ */
public boolean checkIdle (long now); boolean checkIdle (long now);
} }
@@ -110,8 +110,7 @@ public class GenServiceTask extends InvocationTask
} }
} }
/** Used to track services for which we should not generate a provider /** Used to track services for which we should not generate a provider interface. */
* interface. */
public class Providerless public class Providerless
{ {
public void setService (String className) public void setService (String className)
@@ -229,8 +229,7 @@ public class GenUtil extends com.samskivert.util.GenUtil
// make sure we found something // make sure we found something
if (name == null) { if (name == null) {
throw new IOException( throw new IOException("Unable to locate class or interface name in " + source + ".");
"Unable to locate class or interface name in " + source + ".");
} }
// prepend the package name to get a name we can Class.forName() // prepend the package name to get a name we can Class.forName()
@@ -27,28 +27,27 @@ import com.threerings.presents.client.Client;
import com.threerings.presents.dobj.DObjectManager; import com.threerings.presents.dobj.DObjectManager;
/** /**
* Provides access to standard services needed by code that is part of or * Provides access to standard services needed by code that is part of or uses the Presents
* uses the Presents package. * package.
*/ */
public interface PresentsContext public interface PresentsContext
{ {
/** /**
* Provides a configuration object from which various services can * Provides a configuration object from which various services can obtain configuration values
* obtain configuration values and via the properties file that forms * and via the properties file that forms the basis of the configuration object, those services
* the basis of the configuration object, those services can be * can be customized.
* customized.
*/ */
public Config getConfig (); Config getConfig ();
/** /**
* Returns a reference to the client. This reference should be valid * Returns a reference to the client. This reference should be valid for the life of the
* for the life of the application. * application.
*/ */
public Client getClient (); Client getClient ();
/** /**
* Returns a reference to the distributed object manager. This * Returns a reference to the distributed object manager. This reference is only valid for the
* reference is only valid for the duration of a session. * duration of a session.
*/ */
public DObjectManager getDObjectManager (); DObjectManager getDObjectManager ();
} }
@@ -141,7 +141,7 @@ public class SignalManager
* @return true if the signal handler should remain registered, false if it should be * @return true if the signal handler should remain registered, false if it should be
* removed. * removed.
*/ */
public boolean signalReceived (int signal); boolean signalReceived (int signal);
} }
/** /**