Place managers may need a chance to clean up after a failed permissions

check; so we give them a callback for such contingencies.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1780 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-10-06 03:31:16 +00:00
parent f3385ad3a8
commit 061c73c64e
2 changed files with 14 additions and 2 deletions
@@ -1,5 +1,5 @@
//
// $Id: PlaceManager.java,v 1.37 2002/10/06 00:44:58 mdb Exp $
// $Id: PlaceManager.java,v 1.38 2002/10/06 03:31:16 mdb Exp $
package com.threerings.crowd.server;
@@ -187,6 +187,15 @@ public class PlaceManager
return null;
}
/**
* Called if the permissions check failed, to give place managers a
* chance to do any cleanup that might be necessary due to their early
* initialization or permissions checking code.
*/
protected void permissionsFailed ()
{
}
/**
* Called by the place manager after the place object has been
* successfully created.
@@ -1,5 +1,5 @@
//
// $Id: PlaceRegistry.java,v 1.23 2002/10/06 02:37:58 mdb Exp $
// $Id: PlaceRegistry.java,v 1.24 2002/10/06 03:31:16 mdb Exp $
package com.threerings.crowd.server;
@@ -111,6 +111,9 @@ public class PlaceRegistry
// if it fails any permissions checks
String errmsg = pmgr.checkPermissions();
if (errmsg != null) {
// give the place manager a chance to clean up after its early
// initialization process
pmgr.permissionsFailed();
throw new InvocationException(errmsg);
}