I am deploying an EAR file to the IBM WebSpehre server 6.1 – I want to be able to access the EAR application name which is stored in the deployment file under ‘display-name’. Looking through stack overflow posts on related subjects, I’ve been able to gather that this is possible via the Java MBean API – or IBM’s WAS API – Problem is I cannot find a place where these API lists are summarized, i.e. cannot figure out which one to begin looking at. I could hardcode the WAS install location and find the file by looking in the ‘installedApps’ directory, but this is not dynamic.
Does anyone have any experience working with these APIs? Any other way to dynamically find the deployed EAR’s display name?
EDIT – I should add that the reason I would like this information is to dynamically load our properties files – that are named by the following convention “EARAppName.properties” – so you see there IS a reasonable ‘rationale’ behind desiring this information in my application
EDIT 2 – I should also note that this app will always be deployed on a WAS – but in the case that it isnt, a generic non-proprietary solution would be preferred, but not necessary at this moment.
EDIT 3 – What I want to accomplish: Is there a way to dynamically find the deployed EAR’s display name from within the application code?
If the whole reason for this objective is reading properties files, then I would recommend a different approach.
Use WebSphere Shared Library.
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tcws_sharedlib.html
For each deployed EAR have a separate directory containing properties files that needs to be accessed by that EAR.
Create shared library entry for each directory containing properties file.
From EAR create shared library reference to required shared library.
.
However below links may be of some help to you for your approach:
Managing applications through programming
Interface AppManagement