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
This commit is contained in:
Michael Bayne
2007-11-10 04:41:01 +00:00
parent baa664bd11
commit abeeef4d10
2 changed files with 12 additions and 13 deletions
@@ -194,6 +194,7 @@ public class PlaceManager
if (_delegates == null) { if (_delegates == null) {
_delegates = new ArrayList<PlaceManagerDelegate>(); _delegates = new ArrayList<PlaceManagerDelegate>();
} }
delegate.setPlaceManager(this);
_delegates.add(delegate); _delegates.add(delegate);
} }
@@ -26,24 +26,22 @@ import com.threerings.crowd.data.PlaceConfig;
import com.threerings.crowd.data.PlaceObject; import com.threerings.crowd.data.PlaceObject;
/** /**
* Provides an extensible mechanism for encapsulating delegated * Provides an extensible mechanism for encapsulating delegated functionality that works with the
* functionality that works with the place services. * place services.
* *
* <p> Thanks to Java's lack of multiple inheritance, it will likely * <p> Thanks to Java's lack of multiple inheritance, it will likely become necessary to factor
* become necessary to factor certain services that might be used by a * certain services that might be used by a variety of {@link PlaceManager} derived classes into
* variety of {@link PlaceManager} derived classes into delegate classes * delegate classes because they do not fit into the single inheritance hierarchy that makes sense
* because they do not fit into the single inheritance hierarchy that * for a particular application. To facilitate this process, this delegate class is provided which
* makes sense for a particular application. To facilitate this process, * the standard place manager can be made to call out to for all of the standard methods.
* 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 public class PlaceManagerDelegate
{ {
/** /**
* Provides the delegate with a reference to the manager for which it * Called by the place manager when this delegate is registered with it. This will happen
* is delegating. * before any calls to {@link #didInit}, etc.
*/ */
public PlaceManagerDelegate (PlaceManager plmgr) public void setPlaceManager (PlaceManager plmgr)
{ {
_plmgr = plmgr; _plmgr = plmgr;
} }
@@ -98,7 +96,7 @@ public class PlaceManagerDelegate
} }
/** /**
* Invokes {PlaceManager#where}. * Invokes {@link PlaceManager#where}.
*/ */
public String where () public String where ()
{ {