Tools Reference Guide

The tools provided with JOnAS are described in this chapter.
newbean
Bean generator
GenIC
Container classes generator
JonasAdmin
Administration Server (described in the Administration Guide chapter)

newbean

Synopsis

newbean [beanName] [beanType] [package] [primkey]

Description

The newbean utility helps the bean writer to start developing a bean by generating skeletons for all the necessary files to make a bean. Note that this tool only create templates of the files. You need anyway to customize them and to write your business logic. However, the files should be compilable.

You can just type newbean or supply 1, 2, 3, or all parameters. In case of missing parameters, an interactive mode helps to supply them.

After running newbean on each bean of your package, you must make a Makefile by joining all the ".mk" generated files.
 

The beanName is a name that must start with a capital letter. Avoid the reserved names: Home, EJB, Session, Entity. It will be used as prefix for all filenames relative to the bean.

The beanType must be one of the following:

ec    Entity with container managed persistence
eb    Entity with bean managed persistence
sl     Session bean Stateless
sf     Session bean Stateful
The package is a dot separated string representing the package to which the bean belongs. Usually this looks like the current directory.

The primkey is the class representing the primary key. Only needed for entity beans. Possible values are:

s    java.lang.String
i     java.lang.Integer
o    Object (Will be chosen later)

Example

newbean Person ec tests.beans.tel s
 

GenIC

Synopsis

GenIC [Options] <InputFileName>

Description

The GenIC utility generates the container classes that implement from the given Enterprise JavaBean(s) for JOnAS.
The InputFileName is either the file name of a serialized deployment descriptor of a bean, or the file name of a ejb-jar file.
The GenIC utility :
- firstly, generates the sources of the container classes,
- secondly, compiles these classes by way of the java compiler, and
- lastly , generates stubs and skeletons for those remote objects by way of the rmi compiler.

Options

-d directory
Specifies the root directory of the class hierarchy.
You can use this option to specify a destination directory for the generated files.
If the -d option is not used, the package hierarchy of the target class is ignored, and the generated files are placed in the current directory.
-keepgenerated
Do not delete intermediate generated files.
-javacopts options
Specifies the options to pass to the java compiler.
-rmiopts options
Specifies the options to pass to the rmi compiler.
-verbose
Displays additional information about command execution.

Example

GenIC -d . sb.jar
generates container classes of all the Entreprise JavaBeans included in the sb.jar file.
All the files of the sb.jar file are extracted to the current directory.
The container classes are saved in the root directory ./<package_dir>.

Environment

CLASSPATH
must include the paths of the directories where the Enterprise Bean's classes may be found.