Monday, 30 September 2013

wsadmin automatic arrays

Probably obvious and common in many languages but I hadn't realised how helpful jython was in this area.  If you run a command that returns an array, and assign whats returned to a variable, that variable will automatically be an array as is demonstrated below:

wsadmin>perfList = AdminControl.queryNames('type=Perf,*').split(lineSeparator)

Now perfList can be accessed as an array, for example

wsadmin>print perfList[3]

or

wsadmin>for p in perfList:
wsadmin>        print p



No comments:

Post a Comment