Server Settings With Java

Here are a couple of ways which you can determine the name of the JRun instance you are running as well as the server name of the Application server. Here at Daemon we use these quite a bit in our more complex project environments.

1
2
3
4
5
6
7
8
9
10
11
<!--- get the machine (server) name --->
<cfset variables.serverName = createObject("java", "java.net.InetAddress").localhost.getHostName() />

<!--- get the JRun instance name --->
<cfset variables.instanceName = createObject("java", "jrunx.kernel.JRun").getServerName() />

<cfoutput>
    Server: #variables.serverName#
    <br />
    JRun Instance: #variables.instanceName#
</cfoutput>

Nice :)

Comments