The Trading Session Bean

The Trading session bean performs most of the back-end work for storing buy and put orders and registering completed trades. Listing 21.3 shows the remote interface for the bean.

Listing 21.3. Source Code for Trading.java
 package jwsunleashed.trading.ejb; import java.rmi.*; import javax.ejb.*; public interface Trading extends EJBObject { public TradeResult put(String stock, int shares, int price) throws RemoteException; public TradeResult buy(String stock, int shares, int price) throws RemoteException; public TradeResult retractPut(int putID) throws RemoteException; public TradeResult retractBuy(int buyID) throws RemoteException; public TradeResult getPutStatus(int putID) throws RemoteException; public TradeResult getBuyStatus(int ...

Get Java™ Web Services Unleashed 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.