Fixed up the didShutdown() business which was happening twice; moved the

delegation into the base callback methods.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1001 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-02-14 18:08:53 +00:00
parent 573939b483
commit 88a4dc157a
@@ -1,5 +1,5 @@
// //
// $Id: PlaceManager.java,v 1.26 2002/02/13 03:21:28 mdb Exp $ // $Id: PlaceManager.java,v 1.27 2002/02/14 18:08:53 mdb Exp $
package com.threerings.crowd.server; package com.threerings.crowd.server;
@@ -105,13 +105,6 @@ public class PlaceManager
_config = config; _config = config;
_omgr = omgr; _omgr = omgr;
// initialize our delegates
applyToDelegates(new DelegateOp() {
public void apply (PlaceManagerDelegate delegate) {
delegate.didInit(_config);
}
});
// let derived classes do initialization stuff // let derived classes do initialization stuff
didInit(); didInit();
} }
@@ -125,6 +118,12 @@ public class PlaceManager
*/ */
protected void didInit () protected void didInit ()
{ {
// initialize our delegates
applyToDelegates(new DelegateOp() {
public void apply (PlaceManagerDelegate delegate) {
delegate.didInit(_config);
}
});
} }
/** /**
@@ -142,13 +141,6 @@ public class PlaceManager
// we'll need to hear about place object events // we'll need to hear about place object events
plobj.addListener(this); plobj.addListener(this);
// let our delegates know that we've started up
applyToDelegates(new DelegateOp() {
public void apply (PlaceManagerDelegate delegate) {
delegate.didStartup(_plobj);
}
});
// let our derived classes do their thang // let our derived classes do their thang
didStartup(); didStartup();
} }
@@ -161,6 +153,12 @@ public class PlaceManager
*/ */
protected void didStartup () protected void didStartup ()
{ {
// let our delegates know that we've started up
applyToDelegates(new DelegateOp() {
public void apply (PlaceManagerDelegate delegate) {
delegate.didStartup(_plobj);
}
});
} }
/** /**
@@ -171,16 +169,6 @@ public class PlaceManager
{ {
// destroy the object and everything will follow from that // destroy the object and everything will follow from that
CrowdServer.omgr.destroyObject(_plobj.getOid()); CrowdServer.omgr.destroyObject(_plobj.getOid());
// let our delegates know that we've shut down
applyToDelegates(new DelegateOp() {
public void apply (PlaceManagerDelegate delegate) {
delegate.didShutdown();
}
});
// let our derived classes do their thang
didShutdown();
} }
/** /**
@@ -191,6 +179,12 @@ public class PlaceManager
*/ */
protected void didShutdown () protected void didShutdown ()
{ {
// let our delegates know that we've shut down
applyToDelegates(new DelegateOp() {
public void apply (PlaceManagerDelegate delegate) {
delegate.didShutdown();
}
});
} }
/** /**
@@ -373,7 +367,7 @@ public class PlaceManager
// unregister ourselves // unregister ourselves
_registry.unmapPlaceManager(this); _registry.unmapPlaceManager(this);
// let our derived classes shut themselves down // let our derived classes and delegates shut themselves down
didShutdown(); didShutdown();
} }