blob: 3f8164f1709bc9a129b9bb6e7df6e417ec87a932 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="Copyright (c) 2000, 2011 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-2.0/. Contributors: IBM Corporation - initial API and implementation" />
<meta name="DC.rights.owner" content="(C) Copyright 2000, 2011" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="task" name="DC.Type" />
<meta name="DC.Title" content="Creating a message-driven bean using the wizard" />
<meta name="abstract" content="You can use the Create Message-Driven Bean wizard to create a message-driven bean in your EJB project." />
<meta name="description" content="You can use the Create Message-Driven Bean wizard to create a message-driven bean in your EJB project." />
<meta content="EJB 3.0, message-driven bean, creating, Message-driven bean" name="DC.subject" />
<meta content="EJB 3.0, message-driven bean, creating, Message-driven bean" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="../topics/tecrtpro.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="tcreatingsessionbean" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
<title>Creating a message-driven bean using the wizard</title>
</head>
<body id="tcreatingsessionbean"><a name="tcreatingsessionbean"><!-- --></a>
<h1 class="topictitle1">Creating a message-driven bean using the wizard</h1>
<div><p>You can use the <span class="uicontrol">Create Message-Driven Bean</span> wizard
to create a message-driven bean in your EJB project.</p>
<div class="section"><p>The main difference between a message-driven bean and a session
bean is that a message-driven bean has no local or remote interface. Instead,
it has only a bean class. To create a message-driven bean within your EJB
project, follow these steps:</p>
</div>
<ol>
<li class="stepexpand"><span>In the Java™ EE perspective, right-click your EJB Project, and
select <span class="menucascade"><span class="uicontrol">File</span> &gt; <span class="uicontrol">New</span>
&gt; <span class="uicontrol">Message-Driven Bean</span></span>. The Create Message-Driven
wizard appears.</span></li>
<li class="stepexpand"><span>In the <span class="uicontrol">Project</span> field, ensure that your EJB
Project name appears.</span></li>
<li class="stepexpand"><span>In the <span class="uicontrol">Folder</span> field, select the source folder
for the new bean.</span></li>
<li class="stepexpand"><span>In the <span class="uicontrol">Java package</span> field, type the package
name for the new bean.</span></li>
<li class="stepexpand"><span>In the <strong>Class name</strong> field, type the name that you want to
assign to the session bean. By convention, bean names should begin with an
uppercase letter.</span> <div class="note"><span class="notetitle">Note:</span> 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.</div>
</li>
<li class="stepexpand"><span>In the <strong>Superclass</strong> field, <span class="uicontrol">Browse</span> to
find a Superclass to add to your Session bean.</span></li>
<li class="stepexpand"><span>In the <span class="uicontrol">Destination Name</span> field, type the
name of your message destination.</span></li>
<li class="stepexpand"><span>In the <span class="uicontrol">JMS</span> field, Select JMS if you want
to use Java Messaging Service, and in the <span class="uicontrol">Destination Type</span> field,
select the type of destination.</span> <ul>
<li>Queue</li>
<li>Topic</li>
</ul>
</li>
<li class="stepexpand"><span>Click <span class="uicontrol">Next</span>.</span></li>
<li class="stepexpand"><span>On the Message-Driven Bean information page, you may change the
values of some of the Session bean elements: </span> <ul>
<li><em>Optional</em>: In the <span class="uicontrol">EJB Name</span> field, you can
change the value of your EJB name that you assigned in the previous page.</li>
<li><em>Optional</em>: In the <span class="uicontrol">Transaction Type</span> field,
select the type of Session bean you want to create (Container or Bean).</li>
<li><em>Optional</em>: In the <span class="uicontrol">Interfaces</span> field, you can
add or remove Business Interfaces that you created in the previous wizard
page.</li>
<li><em>Optional</em>: In the <span class="uicontrol">Which method stubs would you like to
create?</span> field, you can create one or both of these methods: <ul>
<li>Inherited abstract methods</li>
<li>Constructors from superclass</li>
</ul>
</li>
</ul>
</li>
<li class="stepexpand"><span>Click <span class="uicontrol">Finish</span>.</span></li>
<li class="stepexpand"><span>In the Java class editor, your new Message-driven bean appears,
with the @MessageDriven annotation and the required import statements.</span>
</li>
</ol>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/tecrtpro.html" title="An EJB project is used to organize the resources contained in an EJB module.">Creating EJB projects</a></div>
</div>
</div>
</body>
</html>