From abeeef4d10731bef32311992bdbd7b39a3ae2d53 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sat, 10 Nov 2007 04:41:01 +0000 Subject: [PATCH] PlaceManagerDelegate no longer takes its target manager in its constructor but rather is configured with it when added to the manager as a delegate. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4868 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/crowd/server/PlaceManager.java | 1 + .../crowd/server/PlaceManagerDelegate.java | 24 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/java/com/threerings/crowd/server/PlaceManager.java b/src/java/com/threerings/crowd/server/PlaceManager.java index 1aae96dbb..82293062e 100644 --- a/src/java/com/threerings/crowd/server/PlaceManager.java +++ b/src/java/com/threerings/crowd/server/PlaceManager.java @@ -194,6 +194,7 @@ public class PlaceManager if (_delegates == null) { _delegates = new ArrayList(); } + delegate.setPlaceManager(this); _delegates.add(delegate); } diff --git a/src/java/com/threerings/crowd/server/PlaceManagerDelegate.java b/src/java/com/threerings/crowd/server/PlaceManagerDelegate.java index 5af817278..05c41aa00 100644 --- a/src/java/com/threerings/crowd/server/PlaceManagerDelegate.java +++ b/src/java/com/threerings/crowd/server/PlaceManagerDelegate.java @@ -26,24 +26,22 @@ import com.threerings.crowd.data.PlaceConfig; import com.threerings.crowd.data.PlaceObject; /** - * Provides an extensible mechanism for encapsulating delegated - * functionality that works with the place services. + * Provides an extensible mechanism for encapsulating delegated functionality that works with the + * place services. * - *

Thanks to Java's lack of multiple inheritance, it will likely - * become necessary to factor certain services that might be used by a - * variety of {@link PlaceManager} derived classes into delegate classes - * because they do not fit into the single inheritance hierarchy that - * makes sense for a particular application. To facilitate this process, - * this delegate class is provided which the standard place manager can be - * made to call out to for all of the standard methods. + *

Thanks to Java's lack of multiple inheritance, it will likely become necessary to factor + * certain services that might be used by a variety of {@link PlaceManager} derived classes into + * delegate classes because they do not fit into the single inheritance hierarchy that makes sense + * for a particular application. To facilitate this process, this delegate class is provided which + * the standard place manager can be made to call out to for all of the standard methods. */ public class PlaceManagerDelegate { /** - * Provides the delegate with a reference to the manager for which it - * is delegating. + * Called by the place manager when this delegate is registered with it. This will happen + * before any calls to {@link #didInit}, etc. */ - public PlaceManagerDelegate (PlaceManager plmgr) + public void setPlaceManager (PlaceManager plmgr) { _plmgr = plmgr; } @@ -98,7 +96,7 @@ public class PlaceManagerDelegate } /** - * Invokes {PlaceManager#where}. + * Invokes {@link PlaceManager#where}. */ public String where () {