Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 15151 invoked from network); 24 Jan 2007 22:45:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Jan 2007 22:45:28 -0000 Received: (qmail 35417 invoked by uid 500); 24 Jan 2007 22:45:34 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 35372 invoked by uid 500); 24 Jan 2007 22:45:33 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 35361 invoked by uid 99); 24 Jan 2007 22:45:32 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jan 2007 14:45:32 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Jan 2007 14:45:26 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id C9AA51A981A; Wed, 24 Jan 2007 14:45:05 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r499600 - /geronimo/samples/trunk/calculator-stateless-pojo/calculator-stateless-war/src/main/webapp/sample-docu.jsp Date: Wed, 24 Jan 2007 22:45:05 -0000 To: scm@geronimo.apache.org From: prasad@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070124224505.C9AA51A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: prasad Date: Wed Jan 24 14:45:04 2007 New Revision: 499600 URL: http://svn.apache.org/viewvc?view=rev&rev=499600 Log: * modify docu text for dependency injection section Modified: geronimo/samples/trunk/calculator-stateless-pojo/calculator-stateless-war/src/main/webapp/sample-docu.jsp Modified: geronimo/samples/trunk/calculator-stateless-pojo/calculator-stateless-war/src/main/webapp/sample-docu.jsp URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/calculator-stateless-pojo/calculator-stateless-war/src/main/webapp/sample-docu.jsp?view=diff&rev=499600&r1=499599&r2=499600 ============================================================================== --- geronimo/samples/trunk/calculator-stateless-pojo/calculator-stateless-war/src/main/webapp/sample-docu.jsp (original) +++ geronimo/samples/trunk/calculator-stateless-pojo/calculator-stateless-war/src/main/webapp/sample-docu.jsp Wed Jan 24 14:45:04 2007 @@ -82,17 +82,19 @@

A POJO as a business interface

- Notice the stateless session bean Calculator.java implements + Notice that the stateless session bean Calculator.java implements just a simple java interface and not an EJB component interface like EJBObject, EJBLocalObject or java.rmi.Remote.

Dependency Injection

- The servlet CalculatorServlet.java declares an instance variable - whose type is the same as the business interface of the session bean. In earlier versions, the servlet would have done a JNDI lookup of the bean's home interface in the - component's environment. It then would have had to create the instance using the create method of the home interface. However, with Java EE 5.0, the servlet can just declare - its dependency on the bean by just annotating the instance variable with the @EJB annotation. At runtime, when the servlet instance is created, the container injects - (or provides) an instance of an object that implements the business interface. + Notice that the servlet CalculatorServlet.java + declares an instance variable whose an @EJB annotation. The variable is that of a session bean and it's type is the same as that of it's business interface. + In earlier versions, the servlet would have done a JNDI lookup of the bean's home interface in the component's environment. + It then would have had to create the instance using the create method of the home interface. + However in Java EE 5.0, the servlet can just declare its dependency on the bean by just annotating the instance variable with the @EJB annotation. + When the servlet instance is created during runtime, the container automatically initializes these annotated variables with an instance of an object that implements the business interface. + This initialization occurs before any business methods are invoked on the bean instance and after the time the the bean’s EJBContext is set.

No deployment descriptor