From 061c73c64eb2319234a9a4dfcf678d691592f085 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sun, 6 Oct 2002 03:31:16 +0000 Subject: [PATCH] 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 --- .../com/threerings/crowd/server/PlaceManager.java | 11 ++++++++++- .../com/threerings/crowd/server/PlaceRegistry.java | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/java/com/threerings/crowd/server/PlaceManager.java b/src/java/com/threerings/crowd/server/PlaceManager.java index 877ece406..7a1ffb819 100644 --- a/src/java/com/threerings/crowd/server/PlaceManager.java +++ b/src/java/com/threerings/crowd/server/PlaceManager.java @@ -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. diff --git a/src/java/com/threerings/crowd/server/PlaceRegistry.java b/src/java/com/threerings/crowd/server/PlaceRegistry.java index 5f03a5d13..baba69aa4 100644 --- a/src/java/com/threerings/crowd/server/PlaceRegistry.java +++ b/src/java/com/threerings/crowd/server/PlaceRegistry.java @@ -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); }