13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

500Chapter 22Building an EJBExample 22.4 Sample local interfacepackage com.jadol.budgetpro;import javax.ejb.*;import java.rmi.*;/*** Local Interface for the M<strong>on</strong>ey EJB*/public interfaceM<strong>on</strong>eyLocalextends EJBLocalObject{// the methods which we will call} // interface M<strong>on</strong>eyLocalExample 22.5 Sample local home interfacepackage com.jadol.budgetpro;import javax.ejb.*;import java.rmi.*;/*** Local Home Interface*/public interfaceM<strong>on</strong>eyLocalHomeextends EJBLocalHome{public M<strong>on</strong>eyLocalcreate()throws CreateExcepti<strong>on</strong>;} // interface M<strong>on</strong>eyLocalHomeand a local home interface (Example 22.5). The local interface is in place of theremote interface and extends EJBLocalObject. The local home interface is inplace of the remote home interface and extends EJBLocalHome.Why bother? Well, there’s no need to marshal and unmarshal all that dataif the calls are staying <strong>on</strong> the same host. This saves executi<strong>on</strong> time. Perhapsmore importantly, since the arguments d<strong>on</strong>’t have to be marshaled and

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!