7
votes

Facing the programming for the wsadmin scripting client I see that you can use both jacl and jython.

I've the same level of confidence with both two languages.

I'm wondering if, in the specific of wsadmin programming , there are advantages of using one language over the other; such as robustness, availability of examples or libraries for websphere administration, or something like that arisen from your experience in the use and building of this kind of scripts.

2

2 Answers

9
votes

Jython is the language to prefer:

  • Rational Application Developer has tooling support for Jyton (Jython editor, debugger, command completition, and ability to test your scripts against your test server inside IDE).
  • WebSphere administrative console provides console command assistance; it gives you scripting equivalents of the operations you perform using administrative console in case you want to automate them. This assistance uses Jython as language.
  • Even if Jacl had been the default language for wsadmin, IBM promotes Jython for future, and even provided a tool to convert Jacl scripts to Jython. Quoting from description of this tool at given link;

When selecting a scripting language, Jython is the strategic direction as the administration scripting language for WebSphere Application Server because future enhancements of the scripting language is focused on the use of Jython.

8
votes

I'm not trying to question any of previous responses, just add some facts.

Although Jython is the "strategic" directions, Jacl has been there since WAS v4. In WAS v8.5 it is still the default (and deprecated!).

The administrative API was written with Jacl in mind. With Jython one you have to do tricks like this one to get server list as list:

for srv in AdminConfig.list('Server').splitlines():
    print srv

whereas in Jacl one can simply do this:

foreach srv [$AdminConfig list Server] {
    puts $srv
}

Obviously, many AdminConfig and AdminControl methods return lists as newline-separated string.

IBM has really cornered itself with Jython and Jacl. They're still using Jython 2.1 (released in 2002, even in the latest and greatest WAS v8.5). Jacl isn't actively supported by the community. The API is Jacl-friendly, wasn't rewritten for Jython. Lots of client solutions are based on the tricks you have to do in Jython, there's plenty of Jacl-based solutions. Even IBM internally has a plenty of dependencies on that legacy. This might be the reason why Jacl is deprecated since WAS v5.1 and still default.

In short:

  • If you're going to write a small script for a specific task, Jacl may be more convenient for you (since you've mentioned that you're comfortable with both Python and Tcl)
  • Should you however be interested in developing larger framework for managing your WAS infrastructure, then Jython with its object-orientation may be a better option. But don't expect too much from that version of Jython - it's quite buggy and you won't be able to use too many Python libraries simply because they dropped Python2.1 support loooong time ago.

The conclusion is: it's not that simple answer (which means that you've asked a good question).