class CacheManagerShutdownAction : public CacheManagerAction {
public:
virtual void run (StoreEntry *sentry);
+ CacheManagerShutdownAction();
};
class CacheManagerActionList : public Vector<CacheManagerAction *> {
//via the singleton, but it's syntactic hackery
//TODO: fix so that ActionTable uses a Command pattern and thus
// function calls are properly object-wrapped
- static void ShutdownCommand(StoreEntry *unused);
static void ReconfigureCommand(StoreEntry *sentry);
static void MenuCommand(StoreEntry *sentry);
static void OfflineToggleCommand(StoreEntry *sentry);
delete(ActionsList); //TODO: Laaazy. Will be moved to class member
ActionsList = new CacheManagerActionList;
registerAction("menu", "This Cachemanager Menu", MenuCommand, 0, 1);
- registerAction("shutdown",
- "Shut Down the Squid Process",
- ShutdownCommand, 1, 1);
registerAction("reconfigure",
"Reconfigure the Squid Process",
ReconfigureCommand, 1, 1);
registerAction("offline_toggle",
"Toggle offline_mode setting",
OfflineToggleCommand, 1, 1);
+ registerAction(new CacheManagerShutdownAction);
}
void
StateFree(mgr);
}
-/// \ingroup CacheManagerInternal
-void
-CacheManager::ShutdownCommand(StoreEntry *unused)
-{
- debugs(16, 0, "Shutdown by command.");
- shut_down(0);
-}
void CacheManagerShutdownAction::run(StoreEntry *sentry)
{
debugs(16, 0, "Shutdown by command.");
shut_down(0);
}
+CacheManagerShutdownAction::CacheManagerShutdownAction() : CacheManagerAction("shutdown","Shut Down the Squid Process", 1, 1) { }
/// \ingroup CacheManagerInternal
void