next up previous contents index
Next: 19 Programmation dynamique Up: Java: Le langage Previous: 17 Les types

Subsections

18 Programmation système

18.1 La classe java.lang.ClassLoader

 
   public abstract class ClassLoader {
      protected ClassLoader()
      public Class loadClass(String name) throws ClassNotFoundException
      protected abstract Class loadClass(String name, boolean resolve) throws ClassNotFoundException
      protected final Class defineClass(byte data[], int offset, int length)
      protected final Class defineClass(String name, byte data[], int offset, int length)
      protected final void resolveClass(Class c)
      protected final Class findSystemClass(String name) throws ClassNotFoundException
      protected final void setSigners(Class cl, Object signers[])
      protected final Class findLoadedClass(String name)
      public static final InputStream getSystemResourceAsStream(String name)
      public static final URL getSystemResource(String name)
      public InputStream getResourceAsStream(String name)
      public URL getResource(String name)
   }

18.2 La classe java.lang.Process

 
   public abstract class Process {
      public Process()
      public abstract OutputStream getOutputStream()
      public abstract InputStream getInputStream()
      public abstract InputStream getErrorStream()
      public abstract int waitFor() throws InterruptedException
      public abstract int exitValue()
      public abstract void destroy()
   }

18.3 La classe java.lang.Runtime

 
   public class Runtime {
      public static Runtime getRuntime()
      public void exit(int status)
      public static void runFinalizersOnExit(boolean value)
      public Process exec(String command) throws IOException
      public Process exec(String command, String envp[]) throws IOException
      public Process exec(String cmdarray[]) throws IOException
      public Process exec(String cmdarray[], String envp[]) throws IOException
      public native long freeMemory()
      public native long totalMemory()
      public native void gc()
      public native void runFinalization()
      public native void traceInstructions(boolean on)
      public native void traceMethodCalls(boolean on)
      public synchronized void load(String filename)
      public synchronized void loadLibrary(String libname)
      public InputStream getLocalizedInputStream(InputStream in)
      public OutputStream getLocalizedOutputStream(OutputStream out)
   }

18.4 La classe java.lang.System

 
   class System {
      public static final InputStream in
      public static final PrintStream out
      public static final PrintStream err
     
      public static void setIn(InputStream in)
      public static void setOut(PrintStream out)
      public static void setErr(PrintStream err)
      public static void setSecurityManager(SecurityManager s)
      public static SecurityManager getSecurityManager()
      public static native long currentTimeMillis()
      public static native void arraycopy(Object src, int src_position, Object dst, int dst_position, int length)
      public static native int identityHashCode(Object x)
      public static Properties getProperties()
      public static void setProperties(Properties props)
      public static String getProperty(String key)
      public static String getProperty(String key, String def)
      public static String getenv(String name)
      public static void exit(int status)
      public static void gc()
      public static void runFinalization()
      public static void runFinalizersOnExit(boolean value)
      public static void load(String filename)
      public static void loadLibrary(String libname)
   }
La classe System définit un ensemble de champs et méthodes statiques; ses contructeurs sont privés et il n'est donc pas possible de créer des instance de cette classe.

Cette classe définit les entrése sorties standard: System.in, System.out et System.err. Les méthodes print, println et write de classe PrintStream sont utilisées pour effectuer des sorties. Pour plus de précisions, se reporter au chapitre sur les entres sorties

18.5 La classe java.lang.Compiler

 
   public final class Compiler {
       public static native boolean compileClass(Class clazz)
       public static native boolean compileClasses(String string)
       public static native Object command(Object any)
       public static native void enable()
       public static native void disable()
   }

18.6 La classe java.lang.SecurityManager

 
public abstract class SecurityManager {
      protected boolean inCheck
      protected SecurityManager()
      public boolean getInCheck()
      protected native Class[] getClassContext()
      protected native ClassLoader currentClassLoader()
      protected Class currentLoadedClass()
      protected native int classDepth(String name)
      protected native int classLoaderDepth()
      protected boolean inClass(String name)
      protected boolean inClassLoader()
      public Object getSecurityContext()
      public void checkCreateClassLoader()
      public void checkAccess(Thread g)
      public void checkAccess(ThreadGroup g)
      public void checkExit(int status)
      public void checkExec(String cmd)
      public void checkLink(String lib)
      public void checkRead(FileDescriptor fd)
      public void checkRead(String file)
      public void checkRead(String file, Object context)
      public void checkWrite(FileDescriptor fd)
      public void checkWrite(String file)
      public void checkDelete(String file)
      public void checkConnect(String host, int port)
      public void checkConnect(String host, int port, Object context)
      public void checkListen(int port)
      public void checkAccept(String host, int port)
      public void checkMulticast(InetAddress maddr)
      public void checkMulticast(InetAddress maddr, byte ttl)
      public void checkPropertiesAccess()
      public void checkPropertyAccess(String key)
      public boolean checkTopLevelWindow(Object window)
      public void checkPrintJobAccess()
      public void checkSystemClipboardAccess()
      public void checkAwtEventQueueAccess()
      public void checkPackageAccess(String pkg)
      public void checkPackageDefinition(String pkg)
      public void checkSetFactory()
      public void checkMemberAccess(Class clazz, int which)
      public void checkSecurityAccess(String action)
      public ThreadGroup getThreadGroup()
   }



Touraivane
6/12/1998