[prev in list] [next in list] [prev in thread] [next in thread]
List: jboss-cvs-commits
Subject: [jboss-cvs] jboss-ejb3/docs/tutorial/ejb21_client_adaptors ...
From: Bill DeCoste <bdecoste () jboss ! com>
Date: 2005-09-30 18:30:56
Message-ID: E1ELPeq-0000cN-8f () committer01 ! frg ! pub ! inap ! atl ! jboss ! com
[Download RAW message or body]
User: bdecoste
Date: 05/09/30 14:30:56
Added: docs/tutorial/ejb21_client_adaptors
ejb21_client_adaptors.html
ejb21_client_adaptors.wiki
Log:
tutorials for ejb2.1 client adaptors
Revision Changes Path
1.1 date: 2005/09/30 18:30:56; author: bdecoste; state: \
Exp;jboss-ejb3/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.html
Index: ejb21_client_adaptors.html
===================================================================
<html>
<body>
<p>
<h2>EJB 2.1 Client Adaptors</h2>
EJB 3.0 is backward compatible to EJB 2.x clients and supports the use of local and \
remote home interfaces as well as initialization methods (e.g. ejbCreate()). This \
capability is configured through annotations and/or through deployment descriptors. \
Take a look at <a href="src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session1Bean.java">Session1Bean.java</a>. \
Note that the class is annotated with <tt>@RemoteHome</tt> and the ejbCreate() \
method is annotated with <tt>@Init</tt>. The former annotation indicates that the \
bean provides a EJB 2.1 style home interface. The latter annotation indicates that \
when the create() method is invoked from the home interface, the bean is initialized \
via the ejbCreate method. Note that the initializion method name is not restricted \
to ejbCreate(). </p><p>
<a href="src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2Bean.java">Session2Bean.java</a> \
illustrates the use of a local home interface.
</p><p>
Similiarly, <a href="src/org/jboss/tutorial/ejb21_client_adaptors/bean/DeploymentDescriptorSession1Bean.java">DeploymentDescriptorSession1Bean.java</a> \
and <a href="src/org/jboss/tutorial/ejb21_client_adaptors/bean/DeploymentDescriptorSession2Bean.java">DeploymentDescriptorSession2Bean.java</a>
mimic the behavior of the first two beans, but use deployment descriptors to \
indicate the home interface(s) and initialization method(s). </p><p>
Take a look at <a href="META-INF/ejb-jar.xml">ejb-jar.xml</a>. Note the "home" and \
"local-home" tags that indicate the respective home interfaces. Also, note the \
"init-list" tag that indicates the initialization method(s) executed when beans are \
created via the home interface(s).
<h4>Building and Running</h4>
To build and run the example, make sure you have <tt>ejb3.deployer</tt> installed \
in JBoss 4.0.x and have JBoss running. See the reference manual on how to install \
EJB 3.0. <pre>
Unix: $ export JBOSS_HOME=<where your jboss 4.0 distribution is>
Windows: $ set JBOSS_HOME=<where your jboss 4.0 distribution is>
$ ant
$ ant run
run:
[java] Session1 init value is initialized
[java] Session2 init value is initialized
[java] DeploymentDescriptor Session1 init value is initialized
[java] DeploymentDescriptor Session2 init value is initialized
</pre>
</p><p>
<h4>Jar structure</h4>
EJB 3.0 beans must be packaged in a JAR file with the suffix <tt>.ejb3</tt>. \
Running the ant script above creates a JAR file within the deploy/ directory of \
JBoss. All that needs to be in that jar is your server-side class files. So \
basically just the CalculatorBean and the interfaces it implements. JBoss will \
automatically browse the JAR file to determine if any EJBs are annotated by any \
classes within it. THere is no precompilation step. </p><p>
</p><p>
</p><p>
</p><p>
</p>
</body>
</html>
1.1 date: 2005/09/30 18:30:56; author: bdecoste; state: \
Exp;jboss-ejb3/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.wiki
Index: ejb21_client_adaptors.wiki
===================================================================
!!!EJB 2.1 Client Adaptors
EJB 3.0 is backward compatible to EJB 2.x clients and supports the use of local and \
remote home interfaces as well as initialization methods (e.g. ejbCreate()). This \
capability is configured through annotations and/or through deployment descriptors. \
Take a look at [Session1Bean.java|src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session1Bean.java]. \
Note that the class is annotated with {{@RemoteHome}} and the ejbCreate() method is \
annotated with {{@Init}}. The former annotation indicates that the bean provides a \
EJB 2.1 style home interface. The latter annotation indicates that when the create() \
method is invoked from the home interface, the bean is initialized via the ejbCreate \
method. Note that the initializion method name is not restricted to ejbCreate().
[Session2Bean.java|src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2Bean.java] \
illustrates the use of a local home interface.
Similiarly, [DeploymentDescriptorSession1Bean.java|src/org/jboss/tutorial/ejb21_client_adaptors/bean/DeploymentDescriptorSession1Bean.java] \
and [DeploymentDescriptorSession2Bean.java|src/org/jboss/tutorial/ejb21_client_adaptors/bean/DeploymentDescriptorSession2Bean.java]
mimic the behavior of the first two beans, but use deployment descriptors to \
indicate the home interface(s) and initialization method(s).
Take a look at [ejb-jar.xml|META-INF/ejb-jar.xml]. Note the "home" and "local-home" \
tags that indicate the respective home interfaces. Also, note the "init-list" tag \
that indicates the initialization method(s) executed when beans are created via the \
home interface(s).
!Building and Running
To build and run the example, make sure you have {{ejb3.deployer}} installed in \
JBoss 4.0.x and have JBoss running. See the reference manual on how to install EJB \
3.0. {{{
Unix: $ export JBOSS_HOME=<where your jboss 4.0 distribution is>
Windows: $ set JBOSS_HOME=<where your jboss 4.0 distribution is>
$ ant
$ ant run
run:
[java] Session1 init value is initialized
[java] Session2 init value is initialized
[java] DeploymentDescriptor Session1 init value is initialized
[java] DeploymentDescriptor Session2 init value is initialized
}}}
The INFO message you can ignore. It will be fixed in later releases of JBoss 4.0.
!Jar structure
EJB 3.0 beans must be packaged in a JAR file with the suffix {{.ejb3}}. Running \
the ant script above creates a JAR file within the deploy/ directory of JBoss. All \
that needs to be in that jar is your server-side class files. So basically just the \
CalculatorBean and the interfaces it implements. JBoss will automatically browse the \
JAR file to determine if any EJBs are annotated by any classes within it. THere is \
no precompilation step.
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
jboss-cvs-commits mailing list
jboss-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-cvs-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic