org.glite.wmsui.apij
Class Api

java.lang.Object
  extended byorg.glite.wmsui.apij.Api

public class Api
extends java.lang.Object

The Api class provides static native implementation of common C/C++ operation not generally allowed by the JVM It also internally implements the methods used RB-LB c++ classes

Version:
0.1
Author:
Alessandro Maraschini

Constructor Summary
Api()
          Default constructor
 
Method Summary
static java.lang.String getEnv(java.lang.String key)
          Static native System Info Method: retrieve the environment specified variable
static int getPid()
          Static native System Info Method: retrieve the current process pid
static int getUid()
          Static native System Info Method: retrieve the user id number
static void setEnv(java.lang.String key, java.lang.String value)
          Static native System Info Method: Set the specified Environment variable
static int shadow(java.lang.String command)
          Static native System Method: Execute the command specified and returns its exit code
static void unsetEnv(java.lang.String key)
          Static native System Info Method: Unset the specified Environment variable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Api

public Api()
Default constructor

Method Detail

getPid

public static int getPid()
Static native System Info Method: retrieve the current process pid


shadow

public static int shadow(java.lang.String command)
Static native System Method: Execute the command specified and returns its exit code

Parameters:
command - the executable command to be launched as a standard C process
Returns:
the integer value of the exit code returned by the launched process

getEnv

public static java.lang.String getEnv(java.lang.String key)
Static native System Info Method: retrieve the environment specified variable

Parameters:
key - the name of the variable to be retrieved
Returns:
the integer corresponding to the id of the executed process

getUid

public static int getUid()
Static native System Info Method: retrieve the user id number

Returns:
the User identification number on the current system

setEnv

public static void setEnv(java.lang.String key,
                          java.lang.String value)
Static native System Info Method: Set the specified Environment variable

Parameters:
key - the name of the environment variable to set
value - the value of the environment variable to be set

unsetEnv

public static void unsetEnv(java.lang.String key)
Static native System Info Method: Unset the specified Environment variable

Parameters:
key - the name of the environment variable to unset