kaos.core.util
Class ExecEnvUtility

java.lang.Object
  extended by kaos.core.util.ExecEnvUtility

public class ExecEnvUtility
extends java.lang.Object

This class provides information about the execution environment configuration. $Revision: 1.1.1.1 $


Method Summary
static java.lang.String getHostIP()
          Return the host IP address.
static java.lang.String getHostName()
          Return the name of the host.
static java.lang.String getVMID()
          Return a unique String representing VM id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHostIP

public static java.lang.String getHostIP()
Return the host IP address. The InetAddress.getLocalHost() is a security sensitive operation. As such, for runs with SecurityManager, it invokes a security check that requires java.net.SocketPermission "{host}", "resolve" for all callers in the call chain. In the case of a KAoS agent that would include the framework classes and the agent application classes. In the KAoS security implementation, we treat the framework code as trusted and would like to allow access to all secure resources needed by the framework, independently of the agent application-specific permissions. By marking this framework code as "privileged" (wrapping it in the PrivilegedAction, as done below) we achieve our goal and relax the requirement that the agent code has to have permissions for all framework secure operations. (For more info on PrivilegedActions, check the Sun's documentation on "API for Privileged Blocks"). getHostIP() method will be successfully executed as long as the framework code will have the java.net.SocketPermission "{host}", "resolve" permission. The agent's code then calling this method does not have to have the above permission.


getHostName

public static java.lang.String getHostName()
Return the name of the host. The InetAddress.getLocalHost() is a security sensitive operation. As such, for runs with SecurityManager, it invokes a security check that requires java.net.SocketPermission "{host}", "resolve" for all callers in the call chain. In the case of a KAoS agent, that would include the framework classes and the agent application classes. In the KAoS security implementation, we treat the framework code as trusted and would like to allow access to all secure resources needed by the framework, independently of the agent application-specific permissions. By marking this framework code as "privileged" (wrapping it in the PrivilegedAction, as done below) we achieve our goal and we relax the requirement that the agent code has to have permissions for all framework secure operations. (For more info on PrivilegedActions, check the Sun's documentation on "API for Privileged Blocks"). getHostName() method will be successfully executed as long as the framework code will have the java.net.SocketPermission "{host}", "resolve" permission. The agent's code then calling this method does not have to have the above permission.


getVMID

public static java.lang.String getVMID()
Return a unique String representing VM id.