O'Reilly logo

Java™ Web Services Unleashed by Mark Wutka, Joseph Weber, Arthur Ryman, K. Scott Morrison, Benoît Marchal, Matthias Kloppmann, Steven Haines, Darren Govoni, Francisco Curbera, Frank Cohen, Robert Brunner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required