// Jayan Kandathil (eTech, Adobe Systems Incorporated) // February 26, 2008 // for the BeanShell 1.3.0 Java scripting engine in LiveCycle 8.0.1 ( http://www.beanshell.org ) // patExecContext provides all context data for use during execution of the Script action try { // Initialize an InetAddress object InetAddress localaddr = InetAddress.getLocalHost(); // Get DNS name of the Server Node String strDNSName = localaddr.getCanonicalHostName(); // Get IP Address of the Server Node String strIPAddress = localaddr.getHostAddress(); // Initialize a Runtime object Runtime objRuntime = Runtime.getRuntime(); // Get the number of available CPU cores String strCPUCores = Integer.toString(objRuntime.availableProcessors()); // get the maximum heapsize for the JVM String strMaximumMemory = Long.toString((((objRuntime.maxMemory())/1024)/1024)); // Get current heap size usage String strMemoryUsed = Long.toString((((objRuntime.totalMemory()-objRuntime.freeMemory())/1024)/1024)); // Get the JVM Implementation Version String strJVMImplementationVersion = System.getProperty("java.vm.version"); // Get the JVM Vendor String strJVMVendor = System.getProperty("java.vm.vendor"); // Get the Server OS String strServerOS = System.getProperty("os.name"); // Get server OS Version String strServerOSVersion = System.getProperty("os.version"); // Get Server CPU Architecture String strServerOSArchitecture = System.getProperty("os.arch"); // Get User Whose Privileges the JVM Uses to Run String strJVMAuthenticationUser = System.getProperty("user.name"); // Location of java.io.tmpdir String strJavaIOTmpDir = System.getProperty("java.io.tmpdir"); // Build the XML data structure String strXML = ""; strXML = strXML + ""; strXML = strXML + "" + strDNSName + ""; strXML = strXML + "" + strIPAddress + ""; strXML = strXML + "" + strCPUCores + ""; strXML = strXML + "" + strMaximumMemory + ""; strXML = strXML + "" + strMemoryUsed + ""; strXML = strXML + "" + strJVMImplementationVersion + ""; strXML = strXML + "" + strJVMVendor + ""; strXML = strXML + "" + strServerOS + ""; strXML = strXML + "" + strServerOSVersion + ""; strXML = strXML + "" + strServerOSArchitecture + ""; strXML = strXML + "" + strJVMAuthenticationUser + ""; strXML = strXML + "" + strJavaIOTmpDir + ""; strXML = strXML + ""; // Set a process variable of type XML patExecContext.setProcessDataStringValue("/process_data/@dataXML", strXML); // Set initialized objects to garbage localaddr = null; objRuntime = null; strXML = null; } catch (e) { print( "Error Occured in activity 'Execute BeanShell Scipt': " + e ); }