blob: 5c19406d8214bea755f701bb27bc4b29c573a3ae [file] [log] [blame]
<html lang=en>
<head>
<meta name="Generated by Rational Rose model" content="D:\work\WTP\org.eclipse.jst.j2ee.core\rose\j2ee.mdl">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Description" content="The method element is used to denote a method of an enterprise bean's home or remote interface, or a set of methods. The ejb-name element must be the name of one of the enterprise beans in declared in the deployment descriptor; the optional method-intf element allows to distinguish between a method with the same signature that is defined in both the home and remote interface; the method-name element specifies the method name; and the optional method-params elements identify a single method among multiple methods with an overloaded method name. There are three possible styles of the method element syntax: 1. method ejb-name EJBNAME /ejb-name method-name * /method-name /method This style is used to refer to all the methods of the specified enterprise bean's home and remote interfaces. 2. method ejb-name EJBNAME /ejb-name method-name METHOD /method-name /method This style is used to refer to the specified method of the specified enterprise bean. If there are multiple methods with the same overloaded name, the element of this style refers to all the methods with the overloaded name. 3. method ejb-name EJBNAME /ejb-name method-name METHOD /method-name method-params method-param PARAM-1 /method-param method-param PARAM-2 /method-param ... method-param PARAM-n /method-param /method-params method This style is used to refer to a single method within a set of methods with an overloaded name. PARAM-1 through PARAM-n are the fully-qualified Java types of the method's input parameters (if the method has no input arguments, the method-params element contains no method-param elements). Arrays are specified by the array element's type, followed by one or more pair of square brackets (e.g. int[][]). Used in: method-permission and container-transaction Examples: Style 1: The following method element refers to all the methods of the EmployeeService bean's home and remote interfaces: method ejb-name EmployeeService /ejb-name method-name * /method-name /method Style 2: The following method element refers to all the create methods of the EmployeeService bean's home interface: method ejb-name EmployeeService /ejb-name method-name create /method-name /method Style 3: The following method element refers to the create(String firstName, String LastName) method of the EmployeeService bean's home interface. method ejb-name EmployeeService /ejb-name method-name create /method-name method-params method-param java.lang.String /method-param method-param java.lang.String /method-param /method-params /method The following example illustrates a Style 3 element with more complex parameter types. The method foobar(char s, int i, int[] iar, mypackage.MyClass mycl, mypackage.MyClass[][] myclaar) would be specified as: method ejb-name EmployeeService /ejb-name method-name foobar /method-name method-params method-param char /method-param method-param int /method-param method-param int[] /method-param method-param mypackage.MyClass /method-param method-param mypackage.MyClass[][] /method-param /method-params /method The optional method-intf element can be used when it becomes necessary to differentiate between a method defined in the home interface and a method with the same name and signature that is defined in the remote interface. For example, the method element method ejb-name EmployeeService /ejb-name method-intf Remote /method-intf method-name create /method-name method-params method-param java.lang.String /method-param method-param java.lang.String /method-param /method-params /method can be used to differentiate the create(String, String) method defined in the remote interface from the create(String, String) method defined in the home interface, which would be defined as method ejb-name EmployeeService /ejb-name method-intf Home /method-intf method-name create /method-name method-params method-param java.lang.String /method-param method-param java.lang.String /method-param /method-params /method ">
<meta name="KeyWords" content="MethodElement,Class MethodElement,j2ee,model j2ee,">
<a href="../../root.html" target=_top><IMG SRC="../../webviewer/home.gif"BORDER=0></a>
</head>
<body bgcolor = "#FFFFFF">
<p><font FACE="Arial, Geneva" SIZE=3><b>Class&nbsp;MethodElement&nbsp;{Analysis}</b></font></p>
<font FACE="Arial, Geneva" SIZE=2><b>Documentation</b></font><BR><font FACE="Arial, Geneva" SIZE=2>The&nbsp;method&nbsp;element&nbsp;is&nbsp;used&nbsp;to&nbsp;denote&nbsp;a&nbsp;method&nbsp;of&nbsp;an&nbsp;enterprise&nbsp;bean's
<BR>home&nbsp;or&nbsp;remote&nbsp;interface,&nbsp;or&nbsp;a&nbsp;set&nbsp;of&nbsp;methods.&nbsp;The&nbsp;ejb-name&nbsp;element
<BR>must&nbsp;be&nbsp;the&nbsp;name&nbsp;of&nbsp;one&nbsp;of&nbsp;the&nbsp;enterprise&nbsp;beans&nbsp;in&nbsp;declared&nbsp;in&nbsp;the
<BR>deployment&nbsp;descriptor;&nbsp;the&nbsp;optional&nbsp;method-intf&nbsp;element&nbsp;allows&nbsp;to
<BR>distinguish&nbsp;between&nbsp;a&nbsp;method&nbsp;with&nbsp;the&nbsp;same&nbsp;signature&nbsp;that&nbsp;is&nbsp;defined&nbsp;in
<BR>both&nbsp;the&nbsp;home&nbsp;and&nbsp;remote&nbsp;interface;&nbsp;the&nbsp;method-name&nbsp;element&nbsp;specifies
<BR>the&nbsp;method&nbsp;name;&nbsp;and&nbsp;the&nbsp;optional&nbsp;method-params&nbsp;elements&nbsp;identify&nbsp;a
<BR>single&nbsp;method&nbsp;among&nbsp;multiple&nbsp;methods&nbsp;with&nbsp;an&nbsp;overloaded&nbsp;method&nbsp;name.
<BR>
<BR>There&nbsp;are&nbsp;three&nbsp;possible&nbsp;styles&nbsp;of&nbsp;the&nbsp;method&nbsp;element&nbsp;syntax:
<BR>
<BR>1.&nbsp; &lt;method&gt;
<BR> &lt;ejb-name&gt;EJBNAME&lt;/ejb-name&gt;
<BR>&nbsp;&nbsp;&nbsp; &lt;method-name&gt;*&lt;/method-name&gt;
<BR> &lt;/method&gt;
<BR>
<BR>&nbsp;&nbsp;&nbsp;This&nbsp;style&nbsp;is&nbsp;used&nbsp;to&nbsp;refer&nbsp;to&nbsp;all&nbsp;the&nbsp;methods&nbsp;of&nbsp;the&nbsp;specified
<BR>&nbsp;&nbsp;&nbsp;enterprise&nbsp;bean's&nbsp;home&nbsp;and&nbsp;remote&nbsp;interfaces.
<BR>
<BR>2.&nbsp; &lt;method&gt;
<BR> &lt;ejb-name&gt;EJBNAME&lt;/ejb-name&gt;
<BR>&nbsp;&nbsp;&nbsp; &lt;method-name&gt;METHOD&lt;/method-name&gt;
<BR> &lt;/method&gt;&gt;
<BR>
<BR>&nbsp;&nbsp;&nbsp;This&nbsp;style&nbsp;is&nbsp;used&nbsp;to&nbsp;refer&nbsp;to&nbsp;the&nbsp;specified&nbsp;method&nbsp;of&nbsp;the
<BR>&nbsp;&nbsp;&nbsp;specified&nbsp;enterprise&nbsp;bean.&nbsp;If&nbsp;there&nbsp;are&nbsp;multiple&nbsp;methods&nbsp;with
<BR>&nbsp;&nbsp;&nbsp;the&nbsp;same&nbsp;overloaded&nbsp;name,&nbsp;the&nbsp;element&nbsp;of&nbsp;this&nbsp;style&nbsp;refers&nbsp;to
<BR>&nbsp;&nbsp;&nbsp;all&nbsp;the&nbsp;methods&nbsp;with&nbsp;the&nbsp;overloaded&nbsp;name.
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>3.&nbsp; &lt;method&gt;
<BR> &lt;ejb-name&gt;EJBNAME&lt;/ejb-name&gt;
<BR>&nbsp;&nbsp;&nbsp; &lt;method-name&gt;METHOD&lt;/method-name&gt;
<BR> &lt;method-params&gt;
<BR>&nbsp;&nbsp;&nbsp; &lt;method-param&gt;PARAM-1&lt;/method-param&gt;
<BR>&nbsp;&nbsp;&nbsp; &lt;method-param&gt;PARAM-2&lt;/method-param&gt;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...
<BR>&nbsp;&nbsp;&nbsp; &lt;method-param&gt;PARAM-n&lt;/method-param&gt;
<BR> &lt;/method-params&gt;
<BR> &lt;method&gt;
<BR>
<BR>&nbsp;&nbsp;&nbsp;This&nbsp;style&nbsp;is&nbsp;used&nbsp;to&nbsp;refer&nbsp;to&nbsp;a&nbsp;single&nbsp;method&nbsp;within&nbsp;a&nbsp;set&nbsp;of
<BR>&nbsp;&nbsp;&nbsp;methods&nbsp;with&nbsp;an&nbsp;overloaded&nbsp;name.&nbsp;PARAM-1&nbsp;through&nbsp;PARAM-n&nbsp;are&nbsp;the
<BR>&nbsp;&nbsp;&nbsp;fully-qualified&nbsp;Java&nbsp;types&nbsp;of&nbsp;the&nbsp;method's&nbsp;input&nbsp;parameters&nbsp;(if
<BR>&nbsp;&nbsp;&nbsp;the&nbsp;method&nbsp;has&nbsp;no&nbsp;input&nbsp;arguments,&nbsp;the&nbsp;method-params&nbsp;element
<BR>&nbsp;&nbsp;&nbsp;contains&nbsp;no&nbsp;method-param&nbsp;elements).&nbsp;Arrays&nbsp;are&nbsp;specified&nbsp;by&nbsp;the
<BR>&nbsp;&nbsp;&nbsp;array&nbsp;element's&nbsp;type,&nbsp;followed&nbsp;by&nbsp;one&nbsp;or&nbsp;more&nbsp;pair&nbsp;of&nbsp;square
<BR>&nbsp;&nbsp;&nbsp;brackets&nbsp;(e.g.&nbsp;int[][]).
<BR>
<BR>
<BR>Used&nbsp;in:&nbsp;method-permission&nbsp;and&nbsp;container-transaction
<BR>
<BR>Examples:
<BR>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;Style&nbsp;1:&nbsp;The&nbsp;following&nbsp;method&nbsp;element&nbsp;refers&nbsp;to&nbsp;all&nbsp;the&nbsp;methods&nbsp;of
<BR> the&nbsp;EmployeeService&nbsp;bean's&nbsp;home&nbsp;and&nbsp;remote&nbsp;interfaces:
<BR>
<BR> &lt;method&gt;
<BR> &lt;ejb-name&gt;EmployeeService&lt;/ejb-name&gt;
<BR> &lt;method-name&gt;*&lt;/method-name&gt;
<BR> &lt;/method&gt;
<BR>
<BR> Style&nbsp;2:&nbsp;The&nbsp;following&nbsp;method&nbsp;element&nbsp;refers&nbsp;to&nbsp;all&nbsp;the&nbsp;create
<BR> methods&nbsp;of&nbsp;the&nbsp;EmployeeService&nbsp;bean's&nbsp;home&nbsp;interface:
<BR>
<BR>&nbsp;&nbsp;&nbsp;&nbsp; &lt;method&gt;
<BR> &lt;ejb-name&gt;EmployeeService&lt;/ejb-name&gt;
<BR> &lt;method-name&gt;create&lt;/method-name&gt;
<BR> &lt;/method&gt;
<BR>
<BR> Style&nbsp;3:&nbsp;The&nbsp;following&nbsp;method&nbsp;element&nbsp;refers&nbsp;to&nbsp;the
<BR> create(String&nbsp;firstName,&nbsp;String&nbsp;LastName)&nbsp;method&nbsp;of&nbsp;the
<BR> &nbsp; EmployeeService&nbsp;bean's&nbsp;home&nbsp;interface.
<BR>
<BR>&nbsp;&nbsp;&nbsp;&nbsp; &lt;method&gt;
<BR> &lt;ejb-name&gt;EmployeeService&lt;/ejb-name&gt;
<BR> &lt;method-name&gt;create&lt;/method-name&gt;
<BR> &lt;method-params&gt;
<BR> &lt;method-param&gt;java.lang.String&lt;/method-param&gt;
<BR> &lt;method-param&gt;java.lang.String&lt;/method-param&gt;
<BR> &lt;/method-params&gt;
<BR> &lt;/method&gt;
<BR>
<BR>
<BR> The&nbsp;following&nbsp;example&nbsp;illustrates&nbsp;a&nbsp;Style&nbsp;3&nbsp;element&nbsp;with
<BR> more&nbsp;complex&nbsp;parameter&nbsp;types.&nbsp;The&nbsp;method
<BR> foobar(char&nbsp;s,&nbsp;int&nbsp;i,&nbsp;int[]&nbsp;iar,&nbsp;mypackage.MyClass&nbsp;mycl,
<BR> mypackage.MyClass[][]&nbsp;myclaar)
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;would&nbsp;be&nbsp;specified&nbsp;as:
<BR>
<BR>&nbsp;&nbsp;&nbsp;&nbsp; &lt;method&gt;
<BR> &lt;ejb-name&gt;EmployeeService&lt;/ejb-name&gt;
<BR> &lt;method-name&gt;foobar&lt;/method-name&gt;
<BR> &lt;method-params&gt;
<BR> &lt;method-param&gt;char&lt;/method-param&gt;
<BR> &lt;method-param&gt;int&lt;/method-param&gt;
<BR> &lt;method-param&gt;int[]&lt;/method-param&gt;
<BR> &lt;method-param&gt;mypackage.MyClass&lt;/method-param&gt;
<BR> &lt;method-param&gt;mypackage.MyClass[][]&lt;/method-param&gt;
<BR> &lt;/method-params&gt;
<BR> &lt;/method&gt;
<BR>
<BR> The&nbsp;optional&nbsp;method-intf&nbsp;element&nbsp;can&nbsp;be&nbsp;used&nbsp;when&nbsp;it&nbsp;becomes
<BR>&nbsp;&nbsp;&nbsp;necessary&nbsp;to&nbsp;differentiate&nbsp;between&nbsp;a&nbsp;method&nbsp;defined&nbsp;in&nbsp;the&nbsp;home
<BR>&nbsp;&nbsp;&nbsp;interface&nbsp;and&nbsp;a&nbsp;method&nbsp;with&nbsp;the&nbsp;same&nbsp;name&nbsp;and&nbsp;signature&nbsp;that&nbsp;is
<BR>&nbsp;&nbsp;&nbsp;defined&nbsp;in&nbsp;the&nbsp;remote&nbsp;interface.
<BR>
<BR> For&nbsp;example,&nbsp;the&nbsp;method&nbsp;element
<BR>
<BR>&nbsp;&nbsp;&nbsp; &lt;method&gt;
<BR> &lt;ejb-name&gt;EmployeeService&lt;/ejb-name&gt;
<BR> &lt;method-intf&gt;Remote&lt;/method-intf&gt;
<BR> &lt;method-name&gt;create&lt;/method-name&gt;
<BR> &lt;method-params&gt;
<BR> &lt;method-param&gt;java.lang.String&lt;/method-param&gt;
<BR> &lt;method-param&gt;java.lang.String&lt;/method-param&gt;
<BR> &lt;/method-params&gt;
<BR> &lt;/method&gt;
<BR>
<BR> can&nbsp;be&nbsp;used&nbsp;to&nbsp;differentiate&nbsp;the&nbsp;create(String,&nbsp;String)&nbsp;method
<BR>&nbsp;&nbsp;&nbsp;defined&nbsp;in&nbsp;the&nbsp;remote&nbsp;interface&nbsp;from&nbsp;the&nbsp;create(String,&nbsp;String)
<BR>&nbsp;&nbsp;&nbsp;method&nbsp;defined&nbsp;in&nbsp;the&nbsp;home&nbsp;interface,&nbsp;which&nbsp;would&nbsp;be&nbsp;defined&nbsp;as
<BR>
<BR>&nbsp;&nbsp;&nbsp; &lt;method&gt;
<BR> &lt;ejb-name&gt;EmployeeService&lt;/ejb-name&gt;
<BR> &lt;method-intf&gt;Home&lt;/method-intf&gt;
<BR> &lt;method-name&gt;create&lt;/method-name&gt;
<BR> &lt;method-params&gt;
<BR> &lt;method-param&gt;java.lang.String&lt;/method-param&gt;
<BR> &lt;method-param&gt;java.lang.String&lt;/method-param&gt;
<BR> &lt;/method-params&gt;
<BR> &lt;/method&gt;
<BR></font><BR><BR>
</body>
</html>