newbean
The NewBean tool 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 creates templates of the files. You need anyway to customize them and to write your business logic. However, the files should be compilable.
You must just type NewBean and enter a set of parameters in an interactive mode.
After running newbean on each bean of your package, you must make a Makefile by joining all the *.mk generated files.
The Bean Name 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 Bean Type must be one of the following:
S
Entity beanE
Session beanMD
Message Driven beanThe Session Type must be one of the following:
L
Stateless Session BeanF
Stateful Session BeanThe Persistance manager must be one of the following:
C
Container Managed PersistanceB
Bean Managed PersistanceThe Bean Location must be one of the following:
R
Remote InterfacesL
Local InterfacesThe Package Name is a dot separated string representing the package to which the bean belongs. Usually this looks like the current directory.
The Jar Name argument is the name that will be used to build the .jar file. Do not provide here the .jar extension. Usually, we take the last part of the package name.
The primkey is the class representing the primary key. Only needed for entity beans. Possible values are:
s
java.lang.Stringi
java.lang.Integero
Object (Will be chosen later)
NewBean Bean Name > MyEntity Bean type S Session bean E Entity bean MD Message-Driven bean > E Persistance manager C Container B Bean > 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 MyEntity (type ECR) in package truc.machin Your bean files have been created. You can now customize them.
registry [ <port> ]
The registry tool creates and starts a remote object registry on the specified port on the current host, depending the ORB type defined in the JOnAS configuration, (RMI or Jeremie).
If the port is omitted, the registry is started on port 1099 on RMI, or on port 1234 on Jeremie.
Note that by default the registry is collocated in the same JVM as the EJBServer. So in this case, this tools have not to be used.
port
- Port number.
The registry command may be typically run in the background:
registry &
on Unix, orstart registry
on Windows.
CheckEnv [ Options ]
The CheckEnv tool verifies the JOnAS configuration coherence, and displays the content of the configuration files which are used.
-help
- Displays the usage of the CheckEnv command.
CheckEnv
The result of this command may depend on the current directory from where it is launched.
(Existence of a jonas.properties file in the current directory, or existence of the . (dot) path in the class path).
EJBServer [ Options ]
Launch the JOnAS Server
-D<property>=<value>
- All the JOnAS properties which can be defined in the jonas.properties file, may also be set by the way of this standard -D option of the java tool.
The EJBServer command may be typically run in the background:
EJBServer &
on Unix, orstart EJBServer
on Windows.
The result of this command may depend on the current directory from where it is launched.
(Existence of a jonas.properties file in the current directory)
GenIC [ Options ] <InputFileName>
The GenIC utility generates the container classes for JOnAS from the given Enterprise Java Beans.
The InputFileName is either the file name of an ejb-jar file or the file name of a XML deployment descriptor of beans.
The GenIC utility :
- - firstly, generates the sources of the container classes for all the beans defined in the deployment descriptor,
- - secondly, compiles these classes by way of the java compiler,
- - thirdly, generates stubs and skeletons for those remote objects by way of the rmi compiler, and
- - lastly, if the InputFile is an ejb-jar file, adds the generated classes in this ejb-jar file.
-d directory-javac options
- 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.
- If the InputFile is an ejb-jar file, the generated classes are added in the ejb-jar file, unless the -noaddinjar option is set.
-javacopts options
- Specifies the java compiler name to use (javac by default).
-keepgenerated
- Specifies the options to pass to the java compiler.
-noaddinjar
- Do not delete intermediate generated files.
-nocompil
- If the InputFile is an ejb-jar file, do not add the generated classes in the ejb-jar file.
-rmiopts options
- Do not compile the generated sources files via the java and rmi compilers.
-secpropag
- Specifies the options to pass to the rmi compiler.
-verbose
- For generating stubs and skeletons that provide propagation of the Security context as well as the transaction context.
- Displays additional information about command execution.
GenIC -d ../../classes sb.xml
generates container classes of all the Entreprise JavaBeans defined in the sb.xml file. Classes are generated in the ../../classes directory respecting the classes hirarchy.
GenIC sb.jar
generates container classes of all the Entreprise JavaBeans defined in the sb.jar file and added the generated classes in this ejb-jar file.
If InputFile is a XML deployment descriptor, the classpath must include the paths of the directories where the Enterprise Bean's classes may be found, and the path of the directory specified by the -d option.
If InputFile is an ejb-jar file, the classpath must include the path of the directory specified by the -d option.
JmsServer
Launch the Joram Server (ie the MOM) with its default options.
none
The JmsServer command may be typically run in the background:
JmsServer &
on Unix, orstart JmsServer
on Windows.
JonasAdmin is a tool that performs some administration tasks on a running JOnAS Server (ie EJBServer).
There are two modes to use this tool: a command mode and an interactive one.
The command JonasAdmin
without argument
(or with only the option -n <jonas-name>
)
run the tool in interactive mode.
The fonctions performed by the JonasAdmin tool are summarized in the table below:
Functionnalities | Command Mode | Interactive Mode |
Dynamically creates a new JOnAS container and adds beans in it | -a fileName |
addbeans |
Lists the properties of the EJB server | -e |
env |
run the garbage collector in EJBServer | -gc |
gc |
Shows the usage of the JonasAdmin command | -? or -h
|
help |
Lists the registered JNDI names | -j |
jndinames |
Lists the types of beans currently loaded by the EJB server | -l |
listbeans |
Identify an EJBServer | -n jonasName |
name |
Quit JonasAdmin | non applicable | quit |
Dynamically remove a JOnAS container and all its beans | -r fileName |
removebeans |
Stops the EJB server | -s |
stop |
Synchronizes entity bean instances on EJBServer | -sync |
sync |
List or Set trace level in EJBServer | -t topic |
trace |
Set default transaction timeout (in seconds) in EJBServer | -tt timeout |
ttimeout |
By default (without -n <jonas-name>
option),
JonasAdmin access to the EJBServer whose name is jonas
(jonas.name
property in jonas.properties
file)
The detailed usage of this tool is provided in the following.
- JonasAdmin
- JonasAdmin -n jonas-name
- JonasAdmin [ -n jonas-name ] [ options ]
The first, run JonasAdmin in interactive mode, on EJBServer whose name is
jonas-name
.The second, run JonasAdmin in interactive mode, on EJBServer whose name is
jonas-name
.The third, run JonasAdmin in command mode, the task performed depends on the selected option.
addbeans <beans-file-name>
- Dynamically creates a new JOnAS container.
The beans-file-name should be the name of a standard XML deployment descriptor file or an ejb-jar file.
If the file name has a relative path, this path is relative from where the EJB server has been launched or also relative to the $JONAS_ROOT/ejbjars directory in case of ejb-jar file.env
- Lists the properties of the EJB server.
gc
- Run the garbage collector in the current EJBServer
help
- Gives the summary of the options.
jndinames
- Lists the registered JNDI names.
listbeans
- Lists the beans currently loaded by the EJB server.
name
- Change the default EJBServer on which the following commands will apply.
quit
- Quit JonasAdmin
removebeans <beans-file-name>
- Dynamically remove the JOnAS container identified by beans-file-name.
stop
- Stops the EJB server.
sync
- Synchronizes the entity bean instances on current EJBServer. Notice that this concerns only the instances that are not involved in a transaction.
trace
- List trace filters in current EJBServer.
trace <topic>
- Set topic level to DEBUG.
ttimeout <seconds>
- Changes default timeout for transactions
JonasAdmin -j
- Lists the JNDI names currently registered by the EJB server.
JonasAdmin -n myserver -a myfile
- Make available in the EJBServer identified by the
jonas.name
,myserver
, the EJBs indentified by thejonas.service.ejb.descriptors
property inmyfile
file.
RAXml2Prop [ Options ] <InputFileName>
The RAXml2Prop utility generates a resource adapter configuration properties file from a
ra.xml
file (Resource adapter deployment descriptor).The InputFileName is the file name of a XML deployment descriptor of the resource adapter.
-? or -help options-j options
- Gives the summary of the options.
-o
- It is a mandatory option. It specifies the JNDI name of the connection factory. This name corresponds to the name of the <jndi-name> element of the <jonas-resource> element in the JOnAS specific deployment descriptor. This name is use by the resource service for registering in JNDI the connection factory corresponding to this resource adapter.
-verbose
- Specifies the name of the generated file. If this option is not present the output is on
System.out
.
- verbose mode. Displays on standard
System.out
the deployment descriptor of the resource adapter .
RAXml2Prop -o MyRA.properties -j adapt_1 ra.xmlgenerates the
MyRA.properties
file from the ra.xml file.
the propertyjndiname adapt_1
has been inserted inMyRA.properties
file.