BeanDeployer User's Guide
Introduction
The BeanDeployer tool is an ejb-jar file editor.
The ejb-jar file is the standard format for packaging enterprise beans,
as defined in the Enterprise JavaBeans specifications.
The ejb-jar file format is the contract between the Bean Provider and the
Application Assembler, and between the Application Assembler and the Deployer.
The ejb-jar file contains the XML deployment descriptor in the format
defined by the Enterprise JavaBeans specification. This standard deployment
descriptor must be stored with the name META-INF/ejb-jar.xml in the ejb-jar file.
Moreover, for JOnAS, the ejb-jar file contains the JOnAS specific XML deployment
descriptor in the format defined in the JOnAS documentation. This JOnAS specific
deployment descriptor must be stored with the name META-INF/jonas-ejb-jar.xml
in the ejb-jar file.
The ejb-jar file also includes the class files of the beans.
The BeanDeployer tool is a graphical editor of ejb-jar file which allows to:
- edit the standard XML deployment descriptor META-INF/ejb-jar.xml
of the ejb-jar file,
- edit the JOnAS specific XML deployment descriptor META-INF/jonas-ejb-jar.xml,
of the ejb-jar file,
- add or remove some class files in the ejb-jar file,
- generate the ejb-jar file.
In this document, the reader will find a brief description of the graphical interface
of BeanDeployer, following by two examples which show how to create the ejb-jar files
associated to the JOnAS examples.
Main principles
The main window of BeanDeployer is composed of:
- a menu bar,
- a tree which represents the structure of the ejb-jar file and the structure
of each XML deployment descriptors, the standard one and the JOnAS specific one;
the tree's structure of the XML deployment descriptors parts, is exactly copy on the
structure of the XML files;
- a panel associated to the current selected node in the tree.
For each node type, the associated panel is different.
Here is an example of the main window of the BeanDeployer tool:

The sb JOnAS example
This chapter shows, step by step, how to generate an ejb-jar file for the sb JOnAS
example with the BeanDeployer tool.
Launch the BeanDeployer tool
- The BeanDeployer tool can be launched via the
BeanDeployer
command.
Create an Ejb-Jar
- From the File menu, select New Ejb Jar
- Then click on the META-INF/ejb-jar.xml node,
- And in the associated panel of this node, specify the information as it is described
in the following screen:

Create the session bean Op
- From the Bean menu, select New Bean
- In the dialog box that appears, specify the information as it is described
in the following screen:

- Then click on the session_Op node,
- And in the associated panel of this node, specify the information as it is described
in the following screen:

- Lastly click on the jonas-session_Op node,
- And in the associated panel of this node, specify the JOnAS specific information as
it is described in the following screen:

Define the environment entry 'prop1'
- Click on the session_Op node,
- From the Insert menu, select Insert env-entry,
- And in the associated panel of the node ENV, specify the information as
it is described in the following screen:

Define the container-transaction for the Op bean methods
- Click on the assembly-descriptor node,
- From the Insert menu, select Insert container-transaction,
- And in the associated panel of the node TX, specify the information as
it is described in the following screen:

- Then click on the method node,
- And in the associated panel of this node, specify the information as
it is described in the following screen:

To associate a different transactionnal attribute to a specific method,
you should define an other container-transaction.
Insert class files
- Click on the Ejb Jar node,
- From the Insert menu, select Insert file,
- In the dialog box that appears, click on the ... to have the
File chooser panel:

- Then, select the classes of the bean,
(JOnAS examples should have been previously compiled):

- Lastly specify the name of the package of the classes of the bean Op

Save the ejb-jar file
- Click on the Ejb Jar node,
- From the File menu, select Save,
- In the dialog box that appears, choose the ejb-jar file name:

The ejb jar tree structure
- The ejb jar tree structure of the sb JOnAS example is:

The eb JOnAS example
This chapter allows to show, step by step, how to create an ejb-jar file for the eb JOnAS
example with the BeanDeployer tool.
Launch the BeanDeployer tool
- The BeanDeployer tool can be launched via the
BeanDeployer
command.
Create the Ejb-Jar
- From the File menu, select New Ejb Jar
- Then click on the META-INF/ejb-jar.xml node,
- And in the associated panel of this node, specify the information as it is described
in the following screen:

Create the entities beans AccountExpl and AccountImpl
- From the Bean menu, select New Bean
- In the dialog box that appears, specify the information as it is described
in the following screen:

- From the Bean menu, select New Bean
- In the dialog box that appears, specify the information as it is described
in the following screen:

- Then click on the entity_AccountExpl node,
- And in the associated panel of this node, specify the JOnAS specific information
as it is described in the following screen:

- Then click on the jonas-entity_AccountExpl node,
- And in the associated panel of this node, specify the JOnAS specific information
as it is described in the following screen:

- Click on the entity_AccountImpl node,
- And in the associated panel of this node, specify the information as it is described
in the following screen:

- Lastly click on the jonas-entity_AccountImpl node,
- And in the associated panel of this node, specify the JOnAS specific information
as it is described in the following screen:

Define the reference of the resource used by the bean AccountExpl
- Click on the entity_AccountExpl node,
- From the Insert menu, select Insert resource-ref,
- And in the associated panel of the node RES-REF, specify the information as
it is described in the following screen:

- Then click on the jonas-entity_AccountExpl node,
- From the Insert menu, select Insert resource-ref,
- And in the associated panel of this node , specify the information
for the jonas-resource as it is described in the following screen:

Define the container-managed fields of the bean AccountImpl
- The following steps have to be done for each container-managed field of the
bean AccountImpl.
- Click on the entity_AccountImpl node,
- From the Insert menu, select Insert cmp-field,
- And in the associated panel of the node CMPF, specify the information as
it is described in the following screen:



Define the mapping for the persistence for the AccountImpl bean
The needed mapping information is the mapping of the bean fields to the database
table columns, and the description of each finder method.
- Click on the jonas-entity_AccountImpl node,
- From the Insert menu, select Insert jdbc-mapping,
- And in the associated panel of this node, specify the information as
it is described in the following screen:

- Click on the jdbc-mapping node,
- From the Insert menu, select Insert finder-method-jdbc-mapping,
- And in the associated panel of this node, specify the information as
it is described in the following screen:

- Click on the jdbc-mapping node,
- From the Insert menu, select Insert finder-method-jdbc-mapping,
- And in the associated panel of this node, specify the information as
it is described in the following screen:

Define the container-transaction for the AccountExpl bean methods
- Click on the assembly-descriptor node,
- From the Insert menu, select Insert container-transaction,
- And in the associated panel of the node TX, specify the information as
it is described in the following screen:

- Then click on the method node,
- And in the associated panel of this node, specify the information as
it is described in the following screen:

To associate a different transactionnal attribute to a specific method,
you should define an other container-transaction.
Define the container-transaction for the AccountImpl bean methods
- Click on the assembly-descriptor node,
- From the Insert menu, select Insert container-transaction,
- And in the associated panel of the node TX, specify the information as
it is described in the following screen:

- Then click on the method node,
- And in the associated panel of this node, specify the information as
it is described in the following screen:

To associate a different transactionnal attribute to a specific method,
you should define an other container-transaction.
Insert class files
- Click on the Ejb Jar node,
- From the Insert menu, select Insert file,
- In the dialog box that appears, click on the ... to have the
File chooser panel:

- Then, select the classes of the bean,
(JOnAS examples should have been previously compiled):

- Lastly specify the name of the package of the classes of AccountExpl and AccountImpl
beans

Save the ejb-jar file
- Click on the Ejb Jar node,
- From the File menu, select Save,
- In the dialog box that appears, choose the ejb-jar file name:

The ejb jar tree structure
- The ejb jar tree structure of the eb JOnAS example is:
