org.superbiz.injection
Class InvoiceBean

java.lang.Object
  extended by org.superbiz.injection.InvoiceBean
All Implemented Interfaces:
Invoice

public class InvoiceBean
extends java.lang.Object
implements Invoice

This example demostrates the use of the injection of environment entries using Resource annotation.

"EJB Core Contracts and Requirements" specification section 16.4.1.1.

Version:
$Rev: 649752 $ $Date: 2008-04-19 05:59:15 +0200 (Sa, 19. Apr 2008) $

Constructor Summary
InvoiceBean()
           
 
Method Summary
 void addLineItem(LineItem item)
           
 int getMaxLineItems()
           
 void setMaxLineItems(int maxLineItems)
          Injects the maxLineItems simple environment entry through bean method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvoiceBean

public InvoiceBean()
Method Detail

setMaxLineItems

public void setMaxLineItems(int maxLineItems)
Injects the maxLineItems simple environment entry through bean method. The JavaBeans property name (not the method name) is used as the default JNDI name. By default, the JavaBeans propery name is combined with the name of the class in which the annotation is used and is used directly as the name in the bean's naming context. JNDI name for this entry would be java:comp/env/org.apache.openejb.examples.resource.InvoiceBean/maxLineItems Refer "EJB Core Contracts and Requirements" specification section 16.2.2.

Parameters:
maxLineItems -

addLineItem

public void addLineItem(LineItem item)
                 throws TooManyItemsException
Specified by:
addLineItem in interface Invoice
Throws:
TooManyItemsException

getMaxLineItems

public int getMaxLineItems()
Specified by:
getMaxLineItems in interface Invoice


Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.