sam.toolkit
Class Process

java.lang.Object
  |
  +--sam.toolkit.Process

public class Process
extends java.lang.Object

General-purpose utility class grouping various tools concerning processes, threads and VM.


Method Summary
static void appendClassPath(java.lang.String classPath)
          Deprecated.  
static java.lang.String[] currentCallStack()
          Gets the current call stack.
static void exit()
           
static void exit(int exitCode)
           
static java.io.File getBaseDirectory(java.io.File directory, java.lang.Package aPackage)
           
static java.io.File getBaseJarArchive(java.net.URL url)
           
static java.io.File getClassDirectory(java.lang.Class clazz)
           
static java.net.URL getClassUrl(java.lang.Class clazz)
           
static java.net.URL getClassUrl(java.lang.Class clazz, char separatorChar)
           
static java.lang.reflect.Constructor getConstructor(java.lang.Class target, java.lang.Class[] args)
          Finds out a suitable constructor inside specified class that accepts specified arguments types.
static java.lang.Thread[] getCurrentThreads()
          Gets the list of all active threads.
static java.lang.String getDefaultTemporary()
          Deprecated.  
static java.io.File getJarSourceArchive(java.lang.Class clazz)
           
static void haltIfRequired()
           
static void interrupt()
           
static void restart()
           
static void suspend()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

suspend

public static void suspend()

interrupt

public static void interrupt()

restart

public static void restart()

haltIfRequired

public static void haltIfRequired()
                           throws java.lang.InterruptedException
java.lang.InterruptedException

currentCallStack

public static java.lang.String[] currentCallStack()
Gets the current call stack. Note that this is very slow since it is implemented through exception throwing. Moreover this might be system-dependant, VM-dependant and even compiler-dependant. Thus it should only be used for debugging or possibly logging but never alter the program semantic.


getCurrentThreads

public static java.lang.Thread[] getCurrentThreads()
Gets the list of all active threads.


getJarSourceArchive

public static java.io.File getJarSourceArchive(java.lang.Class clazz)

getClassDirectory

public static java.io.File getClassDirectory(java.lang.Class clazz)

getBaseDirectory

public static java.io.File getBaseDirectory(java.io.File directory,
                                            java.lang.Package aPackage)

getBaseJarArchive

public static java.io.File getBaseJarArchive(java.net.URL url)

getClassUrl

public static java.net.URL getClassUrl(java.lang.Class clazz)

getClassUrl

public static java.net.URL getClassUrl(java.lang.Class clazz,
                                       char separatorChar)

getDefaultTemporary

public static java.lang.String getDefaultTemporary()
Deprecated.  


appendClassPath

public static void appendClassPath(java.lang.String classPath)
Deprecated.  


exit

public static void exit()

exit

public static void exit(int exitCode)

getConstructor

public static java.lang.reflect.Constructor getConstructor(java.lang.Class target,
                                                           java.lang.Class[] args)
                                                    throws java.lang.NoSuchMethodException
Finds out a suitable constructor inside specified class that accepts specified arguments types.

java.lang.NoSuchMethodException