The newbean tool helps the bean writer start developing a bean by generating skeletons for all the necessary files for making a bean. Note that this tool creates only templates of the files. These templates must then be customized and the business logic written. However, the files should be compilable.
To create these templates, type newbean and enter a set of parameters in interactive mode.
newbean generates a build.xml file.
The Bean Name must start with a capital letter. Avoid the reserved names: Home, EJB, Session, Entity. This name will be used as a prefix for all filenames relative to the bean.
The Bean Type must be one of the following:
S Session Bean
E Entity Bean
MD Message-Driven Bean
The Session Type must be one of the following:
L Stateless Session Bean
F Stateful Session Bean
The Persistence manager must be one of the following:
B Bean-Managed Persistence (BMP)
C Container-Managed Persistence (CMP 1.x)
C2 Container-Managed Persistence (CMP 2.x)
The Bean Location must be one of the following:
R Remote Interfaces
L Local Interfaces
The Package name is a dot-separated string representing the package to which the bean belongs. Usually this is the same as the current directory.
The Jar name argument is the name that will be used to build the .jar file. Do not provide the .jar extension with this argument. Typically, the last part of the package name is used.
The Primary Key class is the class that represents the primary key. It is required only for Entity Beans. Its possible values are:
S java.lang.String
I java.lang.Integer
O Object (Will be chosen later)
newbean Bean Name > MyFirstBean Bean type S Session bean E Entity bean MD Message-Driven bean > E Persistance manager B Bean C Container (CMP 1.x) C2 Container (CMP 2.x) > C Bean location R Remote L Local > R Package name > truc.machin Jar name > machin Primary Key class S String I Integer O Object > S Creating bean MyFirstBean (type ECR) in package truc.machin Your bean files have been created. You can now customize them. |
-bash-2.05b$ /usr/share/jonas/bin/unix/newbean Bean Name > MySecondBean Bean type S Session bean E Entity bean MD Message-Driven bean > S Session type L Staless F Stateful > F Bean location R Remote L Local > L Package name > com.redhat.rhdb.cc.jonas Jar name > rhaps-cc-jonas Creating bean MySecondBean (type SFL) in package com.redhat.rhdb.cc.jonas Your bean files have been created. You can now customize them. |