Skip to content

Commit

Permalink
bean types of EJBs
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin King committed Jan 7, 2010
1 parent e7d84f2 commit 3d54bce
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions reference/en-US/beans.xml
Expand Up @@ -113,8 +113,8 @@

<para>
A bean type is a user-defined class or interface; a type that is client-visible. If the bean is an EJB
session bean, the bean type is the <literal>@Local</literal> interface or bean-class local view. A bean may
have multiple bean types. For example, the following bean has four bean types:
session bean, the bean type is the <literal>@Local</literal> interface or bean-class local view. A bean
may have multiple bean types. For example, the following bean has four bean types:
</para>

<programlisting role="JAVA"><![CDATA[public class BookShop
Expand Down Expand Up @@ -144,8 +144,10 @@ public class BookShopBean

<note>
<para>
Most bean types you can probably figure out. One gotcha is primitive types. All primitive types are assumed
to be identical to their corresponding wrapper types in <literal>java.lang</literal>.
The bean types of a session bean include local interfaces and the bean class local view (if any).
EJB remote interfaces are not considered bean types of a session bean. You can't inject an EJB using
its remote interface unless you define a <emphasis>resource</emphasis>, which we'll meet in
<xref linkend="resources"/>.
</para>
</note>

Expand Down Expand Up @@ -345,8 +347,8 @@ class ShoppingCart implements Serializable { ... }]]></programlisting>

</section>

<!-- TODO the alternative section needs to be spruced up to support the text that comes in subsequent chapters. The
reader needs to feel confident than they would know how to create an alternative and enable it. -->
<!-- TODO the alternative section needs to be spruced up to support the text that comes in subsequent chapters.
The reader needs to feel confident than they would know how to create an alternative and enable it. -->
<section>
<title>Alternatives</title>

Expand Down Expand Up @@ -701,6 +703,14 @@ public class RandomNumberGenerator {
</listitem>
</itemizedlist>

<note>
<para>
Producer methods and fields may have a primitive bean type. For the purpose of resolving dependencies,
primitive types are considered to be identical to their corresponding wrapper types in
<literal>java.lang</literal>.
</para>
</note>

<para>
If the producer method has method parameters, the container will look for a bean that satisfies the type
and qualifiers of each parameter and pass it to the method automatically&#8212;another form of
Expand Down

0 comments on commit 3d54bce

Please sign in to comment.