blob: 1a4dea27f78a383566196ae569131970c59b79b3 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--Arbortext, Inc., 1988-2006, v.4002-->
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
"task.dtd">
<task id="tsessbeanwiz" xml:lang="en-us">
<title>Creating a, EJB 3.0 session bean using the wizard</title>
<shortdesc>You can use the <uicontrol>Create Session Bean</uicontrol> wizard
to create a session bean in your EJB project.</shortdesc>
<prolog><metadata>
<keywords><indexterm>EJB 3.0<indexterm>session bean<indexterm>creating</indexterm></indexterm></indexterm>
<indexterm>Session bean<indexterm>EJB 3.0<indexterm>creating</indexterm></indexterm></indexterm>
</keywords>
</metadata></prolog>
<taskbody>
<context>Here are the steps to create a session bean in an EJB project:</context>
<steps>
<step><cmd>In the <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm"
trademark="Java">Java</tm> EE perspective, right-click your EJB Project, and
select <menucascade><uicontrol>File</uicontrol><uicontrol>New</uicontrol>
<uicontrol>Session Bean</uicontrol></menucascade>. The Create Session Bean
wizard appears.</cmd></step>
<step><cmd>In the <uicontrol>Project</uicontrol> field, ensure that your EJB
Project name appears.</cmd></step>
<step><cmd>In the <uicontrol>Folder</uicontrol> field, select the source folder
for the new bean.</cmd></step>
<step><cmd>In the <uicontrol>Java package</uicontrol> field, type the package
name for the new bean.</cmd></step>
<step><cmd>In the <b>Class name</b> field, type the name that you want to
assign to the session bean. By convention, bean names should begin with an
uppercase letter.</cmd><info><note>You can use Unicode characters for the
bean name, but Unicode characters are not supported for enterprise bean packages
and classes associated with enterprise beans.</note></info></step>
<step><cmd>In the <b>Superclass</b> field, <uicontrol>Browse</uicontrol> to
find a Superclass to add to your Session bean.</cmd></step>
<step><cmd>In the <b>State Type</b> field, select the type of Session bean
you want to create. Valid options are</cmd><info><ul>
<li>Stateless</li>
<li>Stateful</li>
</ul></info></step>
<step><cmd><i>Optional</i>In the <uicontrol>Create Business Interface</uicontrol> field,
select <uicontrol>Local</uicontrol> or <uicontrol>Remote</uicontrol> if you
want to include these interfaces.</cmd></step>
<step><cmd>Click <uicontrol>Next</uicontrol>.</cmd></step>
<step><cmd>On the Session Bean information page, you may change the values
of some of the Session bean elements: </cmd><info><ul>
<li><i>Optional</i>: In the <uicontrol>EJB Name</uicontrol> field, you can
change the value of your EJB name that you assigned in the previous page.</li>
<li><i>Optional</i>: In the <uicontrol>Mapped Name</uicontrol> field, type
a value for your EJB Mappedname.</li>
<li><i>Optional</i>: In the <uicontrol>Transaction Type</uicontrol> field,
select the type of Session bean you want to create (Container or Bean).</li>
<li><i>Optional</i>: In the <uicontrol>Business Interfaces</uicontrol> field,
you can add or remove Business Interfaces that you created in the previous
wizard page.</li>
</ul></info></step>
<step><cmd>Click <uicontrol>Finish</uicontrol>.</cmd></step>
<step><cmd>In the <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm"
trademark="Java">Java</tm> class editor, your new Session bean appears, with
the @Stateless annotation and the required import statements.</cmd><info></info>
</step>
</steps>
</taskbody>
</task>