예제 #1
0
 public CommandRunner(ServiceManager svc, ExtensionClientManager extmgr)
 {
     _svc = svc;
     _extmgr = extmgr;
     Add(ExecCommand.Get());
     Add(RestartCommand.Get());
 }
예제 #2
0
        public ScriptRunner(ServiceManager svc, ExtensionClientManager clientManager)
        {
            _svc = svc;
            _clientManager = clientManager;
            _engine.DisableSecurity();
            _engine.SetFunction("__svc_jsonCall", new Func<string, string, string>(ServiceManagerJsonCall));
            _engine.SetFunction("__ext_jsonCall", new Func<string, string, string, string>(ExtensionJsonCall));

            _preScript = string.Concat(
                Resources.json2,
                Resources.scriptrunner,
                JavaScriptInterface.GenerateJavaScriptWrapper(svc),
                clientManager.GetJavaScriptWrappers()
            );
            try
            {
                _engine.Run(_preScript);
            }
            catch(Exception ex)
            {
                LastException = ex;
            }
        }
예제 #3
0
 public CronManager(ServiceManager svc)
 {
     _svc = svc;
     Init();
 }