on 12-15-2006 5:07 PM
Hi,
can anyone tell me how I can retrieve server name / node number in a WD application?
( something similar like it is done here
/people/michael.nicholls/blog/2006/06/21/which-portal-server-node-am-i-running-on
for a portal application)
My application is running on a WAS without a portal.
Regards
Christof
Hi,
The code in the blog is pure java code, meaning it will work for WD.
Try the following code for displaying all system keys and values (the keys/values should contain what you're looking for)
Enumeration enum = System.getProperties().keys();
while (enum.hasMoreElements()) {
String prop = (String) enum.nextElement();
wdComponentAPI.getMessageManager().reportSuccess(prop + "--> " + System.getProperty(prop));
}
BTW,
SLD & J2EE are not always the same machine, it depends on your configuration.
Omri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
thanks for your replies.
I guess I can get via
System.getProperties().keys();
the key SAPINFO that contains the information I need.
Regards
Christof
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can obtain the cluster name as follows
WDSystemLandscape.getCurrentJ2EEClusterName());
or
WDSystemLandscape.getSLDHost();
WDSystemLandscape.getSLDPort();
or
This is what i do to find the current server the application is running on.
WDDeployableObjectPart d = wdComponentAPI.getDeployableObjectPart();
try{
String url = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getApplication().getDeployableObjectPart());
wdContext.currentContextElement().setHostName(url.substring(0,url.indexOf("/", 7)));
}catch(WDURLException e){
}
The above code sets the context element with the current hostname for example,
Most of the times the rest of the url for uwl should be similar across all application servers, which could be concatenated to the above path.
Hope this helps
Peace
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.