From the IBM Information Center:
You can use WebSphere variables to provide settings for any string of data type attributes that are contained in the product configuration files.
Because applications cannot directly access WebSphere variables, if you define a WebSphere variable inside the application, an error message such as "Unknown variable" is generated. If you are referencing the WebSphere variable from within the application, include the following method in the application to extend the string using the WebSphere variable:
private String expandVariable(String s) throws javax.management.JMException { com.ibm.websphere.management.AdminService as = com.ibm.websphere.management.AdminServiceFactory.getAdminService (); String server = as.getProcessName(); java.util.Set result = as.queryNames(new javax.management.ObjectName("*:*,type=AdminOperations,process=" + server), null); return (String)as.invoke((javax.management.ObjectName) result.iterator().next(),"expandVariable",new Object[] {"${"+s+"}"}, new String[] {"java.lang.String"});
source share