Have the RebootManager do its shutdown via the ShutdownManager. Nix the
PresentsServer legacy shutdown stuff. We'll wire that up in the legacy servers themselves. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5157 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -51,7 +51,6 @@ import static com.threerings.presents.Log.log;
|
|||||||
*/
|
*/
|
||||||
@Singleton
|
@Singleton
|
||||||
public class PresentsServer
|
public class PresentsServer
|
||||||
implements ShutdownManager.Shutdowner
|
|
||||||
{
|
{
|
||||||
/** Configures dependencies needed by the Presents services. */
|
/** Configures dependencies needed by the Presents services. */
|
||||||
public static class Module extends AbstractModule
|
public static class Module extends AbstractModule
|
||||||
@@ -142,9 +141,6 @@ public class PresentsServer
|
|||||||
injector.getInstance(NativeSignalHandler.class).init();
|
injector.getInstance(NativeSignalHandler.class).init();
|
||||||
}
|
}
|
||||||
|
|
||||||
// register with the shutdown manager to provide legacy centralized shutdown support
|
|
||||||
_shutmgr.registerShutdowner(this);
|
|
||||||
|
|
||||||
// configure the dobject manager with our access controller
|
// configure the dobject manager with our access controller
|
||||||
_omgr.setDefaultAccessController(createDefaultObjectAccessController());
|
_omgr.setDefaultAccessController(createDefaultObjectAccessController());
|
||||||
|
|
||||||
@@ -225,11 +221,6 @@ public class PresentsServer
|
|||||||
omgr.run();
|
omgr.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
// from interface ShutdownManager.Shutdowner
|
|
||||||
public void shutdown ()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called once the invoker and distributed object manager have both completed processing all
|
* Called once the invoker and distributed object manager have both completed processing all
|
||||||
* remaining events and are fully shutdown. <em>Note:</em> this is called as the last act of
|
* remaining events and are fully shutdown. <em>Note:</em> this is called as the last act of
|
||||||
|
|||||||
@@ -183,9 +183,9 @@ public abstract class RebootManager
|
|||||||
/**
|
/**
|
||||||
* Provides us with our dependencies.
|
* Provides us with our dependencies.
|
||||||
*/
|
*/
|
||||||
protected RebootManager (PresentsServer server, RootDObjectManager omgr)
|
protected RebootManager (ShutdownManager shutmgr, RootDObjectManager omgr)
|
||||||
{
|
{
|
||||||
_server = server;
|
_shutmgr = shutmgr;
|
||||||
_omgr = omgr;
|
_omgr = omgr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,8 +233,7 @@ public abstract class RebootManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
// that's it! do the reboot
|
// that's it! do the reboot
|
||||||
log.info("Performing automatic server reboot/shutdown, " +
|
log.info("Performing automatic server reboot/shutdown, as scheduled by: " + _initiator);
|
||||||
"as scheduled by: " + _initiator);
|
|
||||||
broadcast("m.rebooting_now");
|
broadcast("m.rebooting_now");
|
||||||
|
|
||||||
// wait 1 second, then do it
|
// wait 1 second, then do it
|
||||||
@@ -243,7 +242,7 @@ public abstract class RebootManager
|
|||||||
// ...but we then post a LongRunnable...
|
// ...but we then post a LongRunnable...
|
||||||
_omgr.postRunnable(new PresentsDObjectMgr.LongRunnable() {
|
_omgr.postRunnable(new PresentsDObjectMgr.LongRunnable() {
|
||||||
public void run () {
|
public void run () {
|
||||||
_server.shutdown();
|
_shutmgr.shutdown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -312,8 +311,8 @@ public abstract class RebootManager
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The server we will reboot. */
|
/** Our shutdown manager, which is how we will reboot. */
|
||||||
protected PresentsServer _server;
|
protected ShutdownManager _shutmgr;
|
||||||
|
|
||||||
/** Our distributed object manager. */
|
/** Our distributed object manager. */
|
||||||
protected RootDObjectManager _omgr;
|
protected RootDObjectManager _omgr;
|
||||||
|
|||||||
Reference in New Issue
Block a user