Allow subclasses to not create a speak service if they should so desire.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3644 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2005-07-06 17:47:51 +00:00
parent 9f470a4205
commit 3820456813
@@ -255,12 +255,12 @@ public class PlaceManager
// keep track of this
_plobj = plobj;
// create and register a speaker service instance that clients can
// use to speak in this place
SpeakMarshaller speakService =
(SpeakMarshaller)_invmgr.registerDispatcher(
new SpeakDispatcher(new SpeakProvider(_plobj, this)), false);
plobj.setSpeakService(speakService);
// we usually want to create and register a speaker service instance
// that clients can use to speak in this place
if (shouldCreateSpeakService()) {
plobj.setSpeakService((SpeakMarshaller) _invmgr.registerDispatcher(
new SpeakDispatcher(new SpeakProvider(plobj, this)), false));
}
// we'll need to hear about place object events
plobj.addListener(this);
@@ -269,6 +269,15 @@ public class PlaceManager
didStartup();
}
/**
* @return true if we should create a speaker service for our place object
* so that clients can use it to speak in this place.
*/
protected boolean shouldCreateSpeakService ()
{
return true;
}
/**
* Derived classes should override this (and be sure to call
* <code>super.didStartup()</code>) to perform any startup time
@@ -295,7 +304,9 @@ public class PlaceManager
CrowdServer.omgr.destroyObject(_plobj.getOid());
// clear out our services
_invmgr.clearDispatcher(_plobj.speakService);
if (_plobj.speakService != null) {
_invmgr.clearDispatcher(_plobj.speakService);
}
// make sure we don't have any shutdowner in the queue
cancelShutdowner();