diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2013-02-14 22:54:45 +0100 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2013-02-14 22:54:45 +0100 |
| commit | 65ed02984f004ce736744e56540bc04324f311c4 (patch) | |
| tree | 6cbdc7f8f2975301042f07ef37ff4743c51a6c4e /src/main/resources | |
| parent | 48027b943a833f6639ddce33178a5694529ac91a (diff) | |
Fold script console environment into Script.
Add support for 'textFiles/consoleScript.lang.txt' console function
declarations in kernel and modules.
Use that context for ScriptConsole network consoles and new ShellConsole
client process.
Diffstat (limited to 'src/main/resources')
| -rw-r--r-- | src/main/resources/textFiles/consoleHelp.txt | 15 | ||||
| -rw-r--r-- | src/main/resources/textFiles/consoleScript.javascript.txt | 19 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/main/resources/textFiles/consoleHelp.txt b/src/main/resources/textFiles/consoleHelp.txt new file mode 100644 index 0000000..57a0655 --- /dev/null +++ b/src/main/resources/textFiles/consoleHelp.txt @@ -0,0 +1,15 @@ +Cristal console
+---------------
+Commands entered here are directly parsed by the beanshell engine. You can call methods directly on these pre-loaded objects:
+proxy - the EntityProxyManager
+storage - the TransactionManager
+db - the ClusterStorageManager
+lookup - the LDAPLookup (server context)
+orb - the ORB
+user - the current logged in user, or the system user if connected to the server console
+
+Built-in commands:
+log(level) - Change the log level of your stream.
+help() - View this message.
+version() - View kernel and module versions.
+shutdown() - Stop this CRISTAL instance.
diff --git a/src/main/resources/textFiles/consoleScript.javascript.txt b/src/main/resources/textFiles/consoleScript.javascript.txt new file mode 100644 index 0000000..9c68553 --- /dev/null +++ b/src/main/resources/textFiles/consoleScript.javascript.txt @@ -0,0 +1,19 @@ +function log(level) { + com.c2kernel.utils.Logger.removeLogStream(output); + com.c2kernel.utils.Logger.addLogStream(output, level); +} +function help() { + var help = com.c2kernel.utils.Resource.getAllTextResources("textFiles/consoleHelp.txt").values().iterator(); + while (help.hasNext()) + println(help.next()); +} +function version() { + print("Kernel version: "+com.c2kernel.utils.Resource.getKernelVersion()); + print("Modules loaded: "+com.c2kernel.process.Gateway.getModuleManager().getModuleVersions()); +} +function shutdown() { + if (com.c2kernel.process.AbstractMain.runningAsWrapper) + org.tanukisoftware.wrapper.WrapperManager.stop(0); + else + com.c2kernel.process.StandardClient.close(); +} |
