|
Home > Archive > WebSphere Application Server > August 2006 > get VirtualHost configuration from WAS Java API
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
get VirtualHost configuration from WAS Java API
|
|
|
| Hi, the only ways I've found to get the lists of virtual hosts defined in a cell, using the Java API, is (code is in jython):
#first
cs = ConfigServiceProxy(adminClient)
on = ConfigServiceHelper.createObjectName(None, "VirtualHost", None);
res= cs.queryConfigObjects(None, None, on, None);
#second
cs = ConfigServiceProxy(adminClient)
l2 = cs.resolve(None,"VirtualHost")
Both work, but as we have a very large configuration schema (a cell with 4 nodes, and more than 20 AS in each one), querying with a "None" scope (afaik, virtual hosts are defined at a top level scope) it takes very long to retrieve the list of virtual hos
ts, due to the configuration size.
So asking to the configService Mbean is the only way I found to get the list of virtual hosts. Have you got any hint about doing this in any other way? maybe directly reading .xml configuration files?
Thanks in advance
| |
|
| I don't know, if i understand your problem correctly. Is this possible a solution ?
/wsadmin.sh -c "\$AdminConfig list VirtualHost" |grep default5151_cell |cut -f 1 -d "("
| |
|
| Well, in fact I'm trying to do exactly that, but from a jython servlet, not from wsadmin. In the Java API there's not an straight AdminConfig object, but you can query for anything using the ConfigService interface, which seems to be quite slow when the c
onfiguration is large and the scope is "all the cell". Thanks anyway
|
|
|
|
|