Basic Guice compliance.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@614 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2008-06-07 17:45:30 +00:00
parent 2090bcdfeb
commit 0a2b8b8f52
9 changed files with 80 additions and 59 deletions
@@ -38,24 +38,24 @@ import com.threerings.parlor.tourney.data.TourneyConfig;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.server.InvocationException;
import com.threerings.presents.server.PresentsServer;
import com.threerings.presents.server.ShutdownManager;
import com.threerings.presents.data.ClientObject;
/**
* An extensible tournament manager.
*/
public abstract class TourniesManager
implements TourniesProvider, PresentsServer.Shutdowner
implements TourniesProvider, ShutdownManager.Shutdowner
{
public TourniesManager (ConnectionProvider conprov)
/**
* Initializes the tournies manager and starts its periodic update task.
*/
public void init (ConnectionProvider conprov)
throws PersistenceException
{
_tournrep = new TourneyRepository(conprov, getDBIdent());
loadTourneyConfigs();
}
public void init ()
{
_interval = new Interval(getRunQueue()) {
public void expired () {
updateTournies();
@@ -64,13 +64,13 @@ public abstract class TourniesManager
_interval.schedule(getIntervalDelay(), true);
}
// documentation inherited from interface PresentsServer.Shutdowner
// from interface ShutdownManager.Shutdowner
public void shutdown ()
{
_interval.cancel();
}
// documentation inherited from interface TourniesService
// from interface TourniesService
public void createTourney (ClientObject caller, TourneyConfig config,
final InvocationService.ResultListener listener)
throws InvocationException
@@ -78,6 +78,11 @@ public abstract class TourniesManager
makeTourney(config, listener);
}
protected TourniesManager (ShutdownManager shutmgr)
{
shutmgr.registerShutdowner(this);
}
/**
* Called to actually create a tourney once it has been validated and the prize has been
* reserved.