org.objectweb.jonas_ejb.genic
Class GenIC

java.lang.Object
  extended byorg.objectweb.jonas_ejb.genic.GenIC

public class GenIC
extends java.lang.Object

This class allows to generate:

of all the Enterprise Java Beans defined in the given Deployment Descriptor.

Author:
Helene Joanin

Field Summary
static java.lang.String CMI_RMI
          CMI protocol
static java.lang.String JEREMIE
          JEREMIE protocol
static java.lang.String RMI_IIOP
          IIOP protocol
static java.lang.String RMI_JRMP
          JRMP protocol
 
Constructor Summary
GenIC(DeploymentDesc ejbJarDesc, java.lang.String dirOutputName, boolean isVerbose)
          GenIC Constructor: generates the container classes sources of each beans
 
Method Summary
 void addClassesInJar(java.lang.String jarFileName, boolean keepGenerated)
          Add the generated classes in the given ejb-jar file.
static void callClusterCompiler(java.lang.String[] args)
          Call the compiler for Cluster stubs
 void clean()
          Clean the intermediate generated files.
 void compilClasses(java.lang.String nameJavac, java.util.Vector optionsJavaC, java.util.Vector optionsRmiC, java.lang.String classpath, org.objectweb.jonas_ejb.genic.ProtocolNames protocols, boolean keepGenerated, boolean invkCmd)
          Compiles the java sources generated by the constructor I.e. : compile the classes via javac, create the stubs and skeletons for the protocols supported(RMI/JRMP, RMI/IIOP,JEREMIE) via rmic/jrmic
 void genClusterFiles(java.lang.String classpath, boolean isKeepGenerated)
          Generate the cluster stub files from the cluster config files.
static void main(java.lang.String[] args)
          GenIC allows to generate the container classes for JOnAS for the given Enterprise Java Beans.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RMI_JRMP

public static final java.lang.String RMI_JRMP
JRMP protocol

See Also:
Constant Field Values

RMI_IIOP

public static final java.lang.String RMI_IIOP
IIOP protocol

See Also:
Constant Field Values

JEREMIE

public static final java.lang.String JEREMIE
JEREMIE protocol

See Also:
Constant Field Values

CMI_RMI

public static final java.lang.String CMI_RMI
CMI protocol

See Also:
Constant Field Values
Constructor Detail

GenIC

public GenIC(DeploymentDesc ejbJarDesc,
             java.lang.String dirOutputName,
             boolean isVerbose)
      throws GenICException
GenIC Constructor: generates the container classes sources of each beans

Parameters:
ejbJarDesc - deployment descriptors of the beans
dirOutputName - path of the directory where to place the generated files (empty string "" if the output directory is the current directory)
isVerbose - if true, some traces are print
Throws:
GenICException - In error case
Method Detail

main

public static void main(java.lang.String[] args)
GenIC allows to generate the container classes for JOnAS for the given Enterprise Java Beans.

Usage: java org.objectweb.jonas_ejb.genic.GenIC -help
to print this help message

or java org.objectweb.jonas_ejb.genic.GenIC
to generate the container classes for the given EJBs.

Options include:

Input_File file name of the standard deployment descriptor (.xml ended), or file name of the EJB-jar (.jar ended).

Parameters:
args - arguments for GenIC

compilClasses

public void compilClasses(java.lang.String nameJavac,
                          java.util.Vector optionsJavaC,
                          java.util.Vector optionsRmiC,
                          java.lang.String classpath,
                          org.objectweb.jonas_ejb.genic.ProtocolNames protocols,
                          boolean keepGenerated,
                          boolean invkCmd)
                   throws GenICException
Compiles the java sources generated by the constructor I.e. :

Parameters:
nameJavac - name the javac tool to use (if null, take the standard tool)
optionsJavaC - options for the javac tool
optionsRmiC - options for the rmic tool
classpath - classpath value
protocols - names of protocols
keepGenerated - keep the generatef files or not
invkCmd - run the javac command directly by invoking the compile method of the javac compiler
Throws:
GenICException - In error case

callClusterCompiler

public static void callClusterCompiler(java.lang.String[] args)
                                throws java.lang.ClassNotFoundException,
                                       java.lang.InstantiationException,
                                       java.lang.SecurityException,
                                       java.lang.NoSuchMethodException,
                                       java.lang.IllegalArgumentException,
                                       java.lang.IllegalAccessException,
                                       java.lang.reflect.InvocationTargetException
Call the compiler for Cluster stubs

Parameters:
args - arguments of the compiler
Throws:
java.lang.ClassNotFoundException - if class is not found
java.lang.InstantiationException - if instantiation failed
java.lang.SecurityException - if security failed
java.lang.NoSuchMethodException - if the method doesnt' exist
java.lang.IllegalArgumentException - if the argument are illegal
java.lang.IllegalAccessException - if the access is illegal
java.lang.reflect.InvocationTargetException - if the invocation fail

genClusterFiles

public void genClusterFiles(java.lang.String classpath,
                            boolean isKeepGenerated)
                     throws GenICException
Generate the cluster stub files from the cluster config files.

Parameters:
classpath - classpath to use
isKeepGenerated - keep the generated files ?
Throws:
GenICException - if the cluster are not generated

addClassesInJar

public void addClassesInJar(java.lang.String jarFileName,
                            boolean keepGenerated)
                     throws GenICException
Add the generated classes in the given ejb-jar file.

Parameters:
jarFileName - name of the jar
keepGenerated - keep the generated files or not ?
Throws:
GenICException - if the classes cannot be added in the jar file

clean

public void clean()
Clean the intermediate generated files.