Java Reference
In-Depth Information
Here's the same command for Linux:
export PATH=$PATH:/usr/data/jython2.5.3/bin
Ok, now we will create our first script that will basically return the JNDI view of our ap-
plication server.
Be aware that Jython, just like Python, uses indentation to determine the code structure in-
stead of using braces or keywords. Therefore, do not use them randomly. An IDE might
help you with this—for Python you can use, for example, Vim with python-mode ( ht-
tps:// ) or Eclipse with the PyDev extension ( ht-
tp:// ) .
Create a file named containing the following code:
from import CLI
cli = CLI.newInstance()
cli.cmd("cd /subsystem=naming")
result = cli.cmd(":jndi-view")
response = result.getResponse()
print 'JNDI VIEW ======================= '
print response
Now execute the script with the following code:
As you can see, the code is very self-explanatory; we are importing the class, which is used to send commands
Search WWH ::

Custom Search