Source Listing

Following is a full listing of all source code used in this runnable example.

Implementation Resources

BankLocalBusiness.java

package org.jboss.ejb3.examples.ch17.transactions.api; import java.math.BigDecimal; import org.jboss.ejb3.examples.ch17.transactions.entity.Account; /** * Defines the contract for a bank * * @author <a href="mailto:andrew.rubinger@jboss.org">ALR</a> * @version $Revision: $ */ public interface BankLocalBusiness { //--------------------------------------------------------------------------|| // Constants ---------------------------------------------------------------|| //--------------------------------------------------------------------------|| /** * JNDI Name to which we'll bind */ String JNDI_NAME = "BankLocalBusiness"; //--------------------------------------------------------------------------|| // Contracts ---------------------------------------------------------------|| //--------------------------------------------------------------------------|| /** * Withdraws the specified amount from the account with * the specified ID, returning the new balance. * @param amount * @throws IllegalArgumentException If the amount is not specified, the account * ID is not valid, or the amount to be withdrawn is less than 0 * @throws InsufficientBalanceException If the amount to be withdrawn is greater * than the value of {@link Account#getBalance()}. */ BigDecimal withdraw(long accountId, BigDecimal amount) throws IllegalArgument Exception, InsufficientBalanceException; ...

Get Enterprise JavaBeans 3.1, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.