CHAPTER 9 SCRIPTING AND JSR 223 181
182 CHAPTER 9 SCRIPTING AND JSR 223 Assuming you start with a matching language, you are then in interactive mode with the script runner. > jrunscript js> Just enter your JavaScript interactively and it will be evaluated. You can also have the tool evaluate whole files by using the -f option from the command line. Get Your Pnuts Here JavaScript isn t the only scripting engine available, just the only one that ships with Mustang. Pronounced like peanuts, Pnuts is another engine that works with JSR 223. It s available from https://pnuts.dev.java.net. You can find configuration information at http://pnuts.org/snapshot/latest/extensions/jsr223/doc/index.html. Hopefully, by the time Mustang ships, other scripting languages, such as Ruby or PHP, will be available in a JSR 223 installable configuration. Note JSR 274 is about the BeanShell scripting language. It s not part of Mustang, but supposedly works alongside JSR 223. The Groovy programming language is JSR 241. It s not part of Mustang, either. Summary From what appears to be a long way from where JSR 223 started, Mustang gets a common scripting framework for integrating scripting engines with the Java platform. From evaluating the scripting source, to compiling and invoking, your Java programs can be bilingual with full object transparency between the two languages. In fact, you can even implement interfaces on the fly in the scripting language if you want to, without even generating .class files. As you get started with scripting, be sure to test your scripts in the command-line support tool. The book s final chapter looks at the last big additions to Mustang improvements in the pluggable annotation processing area. First introduced with Java 1.5, the metadata facility allows the marking of attributes for classes, interfaces, fields, and methods. In Chapter 10, you ll discover the additional features available for the processing of your types and elements.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Java Web Hosting services