org.objectweb.fractal.juliak.platform
Class PlatformJSE

java.lang.Object
  extended by org.objectweb.fractal.juliak.platform.PlatformJSE
All Implemented Interfaces:
PlatformItf

public class PlatformJSE
extends Object
implements PlatformItf

This class contains the implementation of the PlatformItf interface for the Java SE platform.

Since:
2.5
Author:
Lionel Seinturier

Constructor Summary
PlatformJSE()
           
 
Method Summary
 Class defineClass(String name, byte[] b)
          Define a new class.
 void dumpClassToFile(String dirname, String classname, byte[] b)
          Utility method to write the bytecode from a class to a file.
 Object getLoader()
          Return the loader used by Juliak for loading classes.
 InputStream getResourceAsStream(String name)
          Load a ressource.
 Class loadClass(String name)
          Load a class.
 void setLoader(Object cl)
          Set the loader to be used by Juliak for loading classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlatformJSE

public PlatformJSE()
Method Detail

setLoader

public void setLoader(Object cl)
Set the loader to be used by Juliak for loading classes.

Specified by:
setLoader in interface PlatformItf
Parameters:
cl - the loader. This parameter must implement ClassLoader. It is declared as an Object in order to be compliant with the Java ME CLDC version of Juliak.

getLoader

public Object getLoader()
Return the loader used by Juliak for loading classes.

Specified by:
getLoader in interface PlatformItf
Returns:
the loader. This parameter must implement ClassLoader. It is declared as an Object in order to be compliant with the Java ME CLDC version of Juliak.

loadClass

public Class loadClass(String name)
                throws ClassNotFoundException
Load a class.

Specified by:
loadClass in interface PlatformItf
Throws:
ClassNotFoundException

getResourceAsStream

public InputStream getResourceAsStream(String name)
Load a ressource.

Specified by:
getResourceAsStream in interface PlatformItf

defineClass

public Class defineClass(String name,
                         byte[] b)
Define a new class.

Specified by:
defineClass in interface PlatformItf

dumpClassToFile

public void dumpClassToFile(String dirname,
                            String classname,
                            byte[] b)
                     throws IOException
Utility method to write the bytecode from a class to a file. This method creates the directory structure corresponding to package names.

Specified by:
dumpClassToFile in interface PlatformItf
Parameters:
dirname - the root directory name
classname - the name of the class
b - the bytecode
Throws:
IOException