In the draft Java EE 7 platform spec, section EE 5.16 "Application Server Instance Name" states that:
A component may access the name of the application server instance in which it is executing using the pre-defined JNDI name java:comp/InstanceName. This name is represented by a String object. If the application has been deployed into a clustered application server, this name identifies the application server instance within the cluster. If the application server is not clustered, it is the empty string.
This issue requests the implementation of this feature.