helloyip
asked on
Name of Application Server
Dear all,
I have an Applicaiton server under WAS 4.0 for OS/390 with the following setting:
appserver.name=webabc
My question is: how can I get the server name (webabc) in my application? Since I have to setup serverl server with same set of application, I have to know inside the applicaiton the sever name which processed each request during runtime.
Thanks all!
I have an Applicaiton server under WAS 4.0 for OS/390 with the following setting:
appserver.name=webabc
My question is: how can I get the server name (webabc) in my application? Since I have to setup serverl server with same set of application, I have to know inside the applicaiton the sever name which processed each request during runtime.
Thanks all!
ASKER
Thanks for your reply.
I previously use properties file to store the server name for each serve. However, I am just thinking of a way that get rid of properties file. It is because I don't want to introduce server-depending properties inside the properties fle.
Is there any means to get the application server name through something like java method call so that I can get it during runtime?
I previously use properties file to store the server name for each serve. However, I am just thinking of a way that get rid of properties file. It is because I don't want to introduce server-depending properties inside the properties fle.
Is there any means to get the application server name through something like java method call so that I can get it during runtime?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Since in version 4 of websphere you have to distribute the application manually to the various application servers, just modify a property file in each ear that is called from an EJB in that application server. Then when your app is doing what it needs to do, have your app call that ejb, it gets the servername from the property file, and bingo, there you go. Of course, if you were on version 5.0, you could just make a JMX call to do it....but that is something for you to look forward to. Oh, almost forgot, make sure you WLM routing policy is perfer local, otherwise your ejb call may end up on a different box and just have 1 app server per node.
Schleus