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 : Initial developer, Christophe Ney (Lutris Technologies) : Fix to handle arguments containing white spaces., Guillaume Riviere : Fix the addClassesInJar() method (on David, the Stub/Skel classes names are different)., Dean Jennings : Remove System Exit (called now from server), Sami Lehtinen : use of java.util.jar api instead of jar command

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.
 void clean()
          Clean the intermediate generated files.
 void compilClasses(java.lang.String nameJavac, java.util.List optionsJavaC, java.util.List optionsRmiC, java.lang.String classpath, org.objectweb.jonas_ejb.genic.ProtocolNames protocols, boolean keepGenerated, boolean invkCmd, boolean nofastrmic)
          Compiles the java sources generated by the constructor I.e.
protected  java.lang.String convertName(java.lang.String name)
          Convert a name from any format in Jar filename format
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.List optionsJavaC,
                          java.util.List optionsRmiC,
                          java.lang.String classpath,
                          org.objectweb.jonas_ejb.genic.ProtocolNames protocols,
                          boolean keepGenerated,
                          boolean invkCmd,
                          boolean nofastrmic)
                   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
nofastrmic - don't use Fast rmic to generate Stubs/Tie
Throws:
GenICException - In error case

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

convertName

protected java.lang.String convertName(java.lang.String name)
Convert a name from any format in Jar filename format

Parameters:
name - filename to be converted
Returns:
converted filename

clean

public void clean()
Clean the intermediate generated files.