Java Reference
In-Depth Information
Using scripting languages to wrap CLI execution
JBoss AS 7 has introduced a new CLI remote API that acts as a facade for the CLI public
API. The core class that acts as a bridge between these two APIs is the scriptsup-
port.CLI class that is contained in the JBOSS_HOME/bin/client/jboss-cli-
client.jar file.
Thanks to this API, you can execute CLI commands using lots of different languages such
as Jython, Groovy, or JavaScript. Since Jython is also the de facto management standard
for other application servers, such as Oracle, WebLogic, and WebSphere, we will use it to
perform some basic management tasks.
Note
Jython is an implementation of Python for JVM. Jython is extremely useful because it
provides the productivity features of a mature scripting language while running on a JVM.
Unlike a Python program, a Jython program can run in any environment that supports a
JVM.
Jython is invoked using the jython script, which is a short script that invokes your local
JVM, running the Java class file, org.python.util.jython .
The first thing you need to do in order to get started is download the Jython installer from
http://www.jython.org/downloads.html .
Run the installer with the following command:
java -jar jython-installer-2.5.3.jar
Next, add the JYTHON_HOME/bin folder (for example, C:\jython2.5.3\bin ) to
the system path and add the jboss-cli-client.jar file to the system, CLASSPATH .
For example, in Windows, use the given command:
set JYTHON_HOME= C:\jython2.5.3
set PATH=%PATH%;%JYTHON_HOME%\bin
set
CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\bin\client\jboss-cli-client.jar;.
Search WWH ::




Custom Search