org.objectweb.jonas_ejb.genic.GenIC Class Reference

List of all members.

Public Member Functions

 GenIC (DeploymentDesc ejbJarDesc, String dirOutputName, boolean isVerbose) throws GenICException
void compilClasses (String nameJavac, List optionsJavaC, List optionsRmiC, String classpath, ProtocolNames protocols, boolean keepGenerated, boolean invkCmd) throws GenICException
void genClusterFiles (String classpath, boolean isKeepGenerated, boolean isInvokeCmd) throws GenICException
void addClassesInJar (String jarFileName, boolean keepGenerated) throws GenICException
void clean ()

Static Public Member Functions

void main (String[] args)
void callClusterCompiler (String[] args) throws ClassNotFoundException, InstantiationException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException

Static Public Attributes

final String RMI_JRMP = "jrmp"
final String RMI_IIOP = "iiop"
final String JEREMIE = "jeremie"
final String CMI_RMI = "cmi"

Protected Member Functions

String convertName (String name)

Package Functions

void trace (String msg)

Static Package Functions

void usage ()
void info (String msg)
void warning (String msg)
void error (String msg)
void fatalError (String msg, Exception e)
void fatalError (Exception e)
void printException (Exception e, PrintStream out)
String createTempDir () throws IOException
void getFilesList (String dir, ArrayList list, boolean onlyClass)

Detailed Description

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

Definition at line 97 of file GenIC.java.


Constructor & Destructor Documentation

org.objectweb.jonas_ejb.genic.GenIC.GenIC DeploymentDesc  ejbJarDesc,
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
Exceptions:
GenICException In error case

Definition at line 480 of file GenIC.java.

References org.objectweb.jonas_ejb.genic.BeanSources.generate(), org.objectweb.jonas_ejb.genic.BeanSources.getEjbName(), org.objectweb.jonas_ejb.genic.BeanSources.getNoRemoteJavas(), org.objectweb.jonas_ejb.genic.BeanSources.getWrpHomeClassName(), org.objectweb.jonas_ejb.genic.BeanSources.getWrpHomeClusterConfFileName(), org.objectweb.jonas_ejb.genic.BeanSources.getWrpHomeFileName(), org.objectweb.jonas_ejb.genic.BeanSources.getWrpRemoteClassName(), org.objectweb.jonas_ejb.genic.BeanSources.getWrpRemoteFileName(), org.objectweb.jonas_ejb.genic.BeanSources.getWrpServiceEndpointClassName(), and org.objectweb.jonas_ejb.genic.BeanSources.getWrpServiceEndpointFileName().

Here is the call graph for this function:


Member Function Documentation

void org.objectweb.jonas_ejb.genic.GenIC.addClassesInJar 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 ?
Exceptions:
GenICException if the classes cannot be added in the jar file

Definition at line 892 of file GenIC.java.

Referenced by org.objectweb.jonas_ejb.genic.GenIC.main().

void org.objectweb.jonas_ejb.genic.GenIC.callClusterCompiler String[]  args  )  throws ClassNotFoundException, InstantiationException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException [static]
 

Call the compiler for Cluster stubs

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

Definition at line 832 of file GenIC.java.

void org.objectweb.jonas_ejb.genic.GenIC.clean  ) 
 

Clean the intermediate generated files.

Definition at line 1013 of file GenIC.java.

Referenced by org.objectweb.jonas_ejb.genic.GenIC.main().

void org.objectweb.jonas_ejb.genic.GenIC.compilClasses String  nameJavac,
List  optionsJavaC,
List  optionsRmiC,
String  classpath,
ProtocolNames  protocols,
boolean  keepGenerated,
boolean  invkCmd
throws GenICException
 

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
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
Exceptions:
GenICException In error case

Definition at line 659 of file GenIC.java.

References org.objectweb.common.Cmd.addArgument(), org.objectweb.common.Cmd.addArguments(), org.objectweb.common.Cmd.run(), and org.objectweb.common.Cmd.toString().

Referenced by org.objectweb.jonas_ejb.genic.GenIC.main().

Here is the call graph for this function:

String org.objectweb.jonas_ejb.genic.GenIC.convertName String  name  )  [protected]
 

Convert a name from any format in Jar filename format

Parameters:
name filename to be converted
Returns:
converted filename

Definition at line 912 of file GenIC.java.

String org.objectweb.jonas_ejb.genic.GenIC.createTempDir  )  throws IOException [static, package]
 

Create a cleaned temporary directory.

Returns:
the temp directory file name
Exceptions:
IOException if a temp directory cannot be created.

Definition at line 1142 of file GenIC.java.

void org.objectweb.jonas_ejb.genic.GenIC.error String  msg  )  [static, package]
 

Display the specified error message.

Parameters:
msg the error message to display

Definition at line 1089 of file GenIC.java.

void org.objectweb.jonas_ejb.genic.GenIC.fatalError Exception  e  )  [static, package]
 

Display the specified error message and exits with an EXIT_FAILURE status.

Parameters:
e the error to display

Definition at line 1109 of file GenIC.java.

void org.objectweb.jonas_ejb.genic.GenIC.fatalError String  msg,
Exception  e
[static, package]
 

Display the specified error message and exits with an EXIT_FAILURE status.

Parameters:
msg the error message to display
e the exception raised

Definition at line 1099 of file GenIC.java.

Referenced by org.objectweb.jonas_ejb.genic.GenIC.main().

void org.objectweb.jonas_ejb.genic.GenIC.genClusterFiles String  classpath,
boolean  isKeepGenerated,
boolean  isInvokeCmd
throws GenICException
 

Generate the cluster stub files from the cluster config files.

Parameters:
classpath classpath to use
isKeepGenerated keep the generated files ?
isInvokeCmd invoke the compiler instead of command exec
Exceptions:
GenICException if the cluster are not generated

Definition at line 850 of file GenIC.java.

Referenced by org.objectweb.jonas_ejb.genic.GenIC.main().

void org.objectweb.jonas_ejb.genic.GenIC.getFilesList String  dir,
ArrayList  list,
boolean  onlyClass
[static, package]
 

Get the list file names recursively of the given directory

Parameters:
dir the directory used to list files
list list to store filenames
onlyClass stores only class or not ?

Definition at line 1157 of file GenIC.java.

void org.objectweb.jonas_ejb.genic.GenIC.info String  msg  )  [static, package]
 

Display the specified message.

Parameters:
msg the message to display

Definition at line 1073 of file GenIC.java.

void org.objectweb.jonas_ejb.genic.GenIC.main String[]  args  )  [static]
 

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 <options><input_file>
to generate the container classes for the given EJBs.

Options include:

  • -d <output_dir>specify where to place the generated files
  • -noaddinjar do not add the generated classes in the given ejb-jar file
  • -classpath <path> define the classpath to be used to compile classes
  • -nocompil do not compile the generated source files via the java and rmi compilers
  • -novalidation parse the XML deployment descriptors without validation
  • -javac <opt>specify the name of the java compiler to use
  • -javacopts <opt>specify the options to pass to the java compiler
  • -rmicopts <opt>specify the options to pass to the rmi compiler
  • -protocols list of protocol, separated by comma
  • -keepgenerated do not delete intermediate generated source files
  • -verbose
  • -invokecmd invoke, in some case, directly the method of the java class corresponding to the command

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

Definition at line 220 of file GenIC.java.

References org.objectweb.jonas_ejb.genic.GenIC.addClassesInJar(), org.objectweb.jonas_ejb.genic.GenIC.clean(), org.objectweb.jonas_ejb.genic.GenIC.compilClasses(), org.objectweb.jonas_ejb.genic.GenIC.fatalError(), org.objectweb.jonas_ejb.genic.GenIC.genClusterFiles(), org.objectweb.jonas.server.JClassLoader.getClassPath(), and org.objectweb.jonas_ejb.genic.ProtocolNames.isSupported().

Here is the call graph for this function:

void org.objectweb.jonas_ejb.genic.GenIC.printException Exception  e,
PrintStream  out
[static, package]
 

Display the exception and its nested exception if exists, on the given printstream.

Parameters:
e the exception to display
out the PrintStream on which the exception has to displayed

Definition at line 1121 of file GenIC.java.

void org.objectweb.jonas_ejb.genic.GenIC.trace String  msg  )  [package]
 

Display the specified message only if verbose.

Parameters:
msg the message to display

Definition at line 1061 of file GenIC.java.

void org.objectweb.jonas_ejb.genic.GenIC.usage  )  [static, package]
 

Display the usage

Definition at line 1025 of file GenIC.java.

void org.objectweb.jonas_ejb.genic.GenIC.warning String  msg  )  [static, package]
 

Display the specified warning message.

Parameters:
msg the warning message to display

Definition at line 1081 of file GenIC.java.


Member Data Documentation

final String org.objectweb.jonas_ejb.genic.GenIC.CMI_RMI = "cmi" [static]
 

CMI protocol

Definition at line 117 of file GenIC.java.

final String org.objectweb.jonas_ejb.genic.GenIC.JEREMIE = "jeremie" [static]
 

JEREMIE protocol

Definition at line 112 of file GenIC.java.

final String org.objectweb.jonas_ejb.genic.GenIC.RMI_IIOP = "iiop" [static]
 

IIOP protocol

Definition at line 107 of file GenIC.java.

final String org.objectweb.jonas_ejb.genic.GenIC.RMI_JRMP = "jrmp" [static]
 

JRMP protocol

Definition at line 102 of file GenIC.java.


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:11:46 2005 for JOnAS by  doxygen 1.3.9.1