Manuel L. Santillan | 168ab57 | 2006-09-12 16:38:16 +0000 | [diff] [blame] | 1 | Mishell provides an interactive console
|
| 2 | that executes scripts in different scripting languages.
|
| 3 | Running mishell:
|
Manuel L. Santillan | 2045b0c | 2006-09-27 23:10:46 +0000 | [diff] [blame] | 4 | JRE 6 is needed (because of javax.script). Mishell provides some built-in commands and interprets ruby, javascript or any other language that you
|
Manuel L. Santillan | 168ab57 | 2006-09-12 16:38:16 +0000 | [diff] [blame] | 5 | configure. You can also load scripts with the load command. Type 'help' for available commands.
|
Manuel L. Santillan | 168ab57 | 2006-09-12 16:38:16 +0000 | [diff] [blame] | 6 | You can see an example of configuring Felix for launching both Jmood and mishell in the same OSGi platform in the FelixLauncher
|
| 7 | class in the src/test/java dir. Remember to change the paths to match your installation.
|
| 8 |
|
| 9 | The initial object that is exported to the scripting engine is a JMoodProxyManager that extends
|
| 10 | the general-purpose MBeanProxyManager (from the jmxintrospector project) to simplify working with JMood.
|
| 11 | For example, when running on OSGi with JMood you can add the mbeans by typing:
|
Manuel L. Santillan | 2045b0c | 2006-09-27 23:10:46 +0000 | [diff] [blame] | 12 | $manager.addLocalServer(nil) #Ruby NOTE: This has been fixed in latest versions and should be fixed
|
Manuel L. Santillan | 168ab57 | 2006-09-12 16:38:16 +0000 | [diff] [blame] | 13 | or
|
| 14 | manager.addLocalServer(null) //Javascript
|
| 15 | And you issue commands like
|
| 16 | $manager.objects.each{|mbean| puts mbean.objectName} #this lists the objectnames for all mbeans known to the shell
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 | IMPORTANT:
|
| 22 | Dependencies that need to be manually installed:
|
| 23 | 1. It needs Java 6 to work (as it depends on javax.script API).
|
| 24 | Once that API is stable and released standalone, it should also work in Java 5.
|
Manuel L. Santillan | 2045b0c | 2006-09-27 23:10:46 +0000 | [diff] [blame] | 25 | 2. It needs JMX introspector.
|
Manuel L. Santillan | c8ff15c | 2006-09-27 23:33:00 +0000 | [diff] [blame] | 26 | By default, the only available engine is the javascript bundled with Java 6. To add new ones, you need to
|
| 27 | install the bundles. For example for ruby:
|
| 28 | - It needs classes from com.sun.jruby.* and from org.jruby. The easiest way is to bundle both together
|
Manuel L. Santillan | 2045b0c | 2006-09-27 23:10:46 +0000 | [diff] [blame] | 29 | and export both packages in order to run ruby.
|
Manuel L. Santillan | 168ab57 | 2006-09-12 16:38:16 +0000 | [diff] [blame] | 30 | - The binding is available at https://scripting.dev.java.net/ and licensed
|
| 31 | under the BSD license. Download the jsr223-engines.[zip|tar.gz]
|
| 32 | and install the jruby-engine.jar
|
| 33 | - JRuby is available at http://dist.codehaus.org/jruby/ under a tri-license: CPL/LGPL/GPL
|
| 34 | located at engines/jruby/build/jruby-engine.jar. JRuby implementation
|
| 35 | 4. If you want to use any other language, you should:
|
Manuel L. Santillan | 2045b0c | 2006-09-27 23:10:46 +0000 | [diff] [blame] | 36 | - Create and install a bundle (or more) that contain the necessary classes and export the packages.
|
Manuel L. Santillan | 168ab57 | 2006-09-12 16:38:16 +0000 | [diff] [blame] | 37 |
|
| 38 |
|