Session Bean for Speed-based progressive learning (II.)

Source: Internet
Author: User

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****************

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.