Configuration Bean
The Enterprise JavaBean is that you don't run it, you configure it. Depending on the container you use, you use a packaging tool to create a jar file that contains an EJB class, an XML configuration description file, and a helper class.
But to really understand the EJB, it's best to try it yourself.
Each EJB manufacturer supports its own configuration tool. Although some tools may be more useful, most of them use the same pattern. This article will use the Sun's Java 2 Enterprise Edition SDK to package and configure the beans. The Java EE SDK Configuration tool is called Deploytool, in the SDK's Bin directory.
After starting Deploytool, select New Application in the File menu. In the New Application dialog box, enter the name of the ear (Enterprise Archive) file you want to create (the ear file is a jar file for Java application). Figure 6.1 Shows the dialog box information for the Hello World session bean.
Figure 6.1****************
Then select the new Enterprise Bean from the File menu. If necessary, you can modify the display name of the jar file.
In the New Enterprise Bean Wizard, press the Add button in the lower-right corner (near the content area). A dialog box, shown in Figure 6.2, will be displayed, select the class file that makes up the EJB in the dialog box, select Helloworldsession.class, Helloworldsessionhome.class and Helloworldsessionimpl. class file, click the Add button.
Figure 6.2****************
Next, you tell Deploytool Enterprise Bean class, home interface, and remote interface classes to use. You can set the bean's display name, which is used only in Deploytool, and you must tell the tool whether the bean is a session bean or entity bean, and if it is a session bean, it is stateless or stateful. Figure 6.3 shows the configuration item for the Hello World Bean.
Figure 6.3****************