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 // keep track of this
_plobj = plobj; _plobj = plobj;
// create and register a speaker service instance that clients can // we usually want to create and register a speaker service instance
// use to speak in this place // that clients can use to speak in this place
SpeakMarshaller speakService = if (shouldCreateSpeakService()) {
(SpeakMarshaller)_invmgr.registerDispatcher( plobj.setSpeakService((SpeakMarshaller) _invmgr.registerDispatcher(
new SpeakDispatcher(new SpeakProvider(_plobj, this)), false); new SpeakDispatcher(new SpeakProvider(plobj, this)), false));
plobj.setSpeakService(speakService); }
// we'll need to hear about place object events // we'll need to hear about place object events
plobj.addListener(this); plobj.addListener(this);
@@ -269,6 +269,15 @@ public class PlaceManager
didStartup(); 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 * Derived classes should override this (and be sure to call
* <code>super.didStartup()</code>) to perform any startup time * <code>super.didStartup()</code>) to perform any startup time
@@ -295,7 +304,9 @@ public class PlaceManager
CrowdServer.omgr.destroyObject(_plobj.getOid()); CrowdServer.omgr.destroyObject(_plobj.getOid());
// clear out our services // 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 // make sure we don't have any shutdowner in the queue
cancelShutdowner(); cancelShutdowner();