Develop service components to provide reusable logic to multiple applications within your server.
public interface CustomerInfo { public Customer getCustomerInfo(String customerID); }
public class CustomerInfoImpl implements CustomerInfo { public Customer getCustomerInfo(String customerID) { Customer cust = new Customer(); cust.setCustNo(customerID); cust.setFirstName("Victor"); cust.setLastName("Hugo"); cust.setSymbol("IBM"); cust.setNumShares(100); cust.setPostalCode(10589); cust.setErrorMsg(""); return cust; } }
public interface StockQuote { public float getQuote(String symbol); }
public class StockQuoteImpl implements StockQuote { public float getQuote(String symbol) { return 100.0f; } }
public interface StockQuoteAsync { // deferred response public Ticket getQuoteAsync(String symbol); public float getQuoteResponse(Ticket ticket, long timeout); // callback public Ticket getQuoteAsync(String symbol, StockQuoteCallback callback); }
public interface StockQuoteCallback { public void onGetQuoteResponse(Ticket ticket, float quote); }
Last updated: Tue Feb 21 17:21:49 2006
(c) Copyright IBM Corporation 2005.
This information center is powered by Eclipse technology (http://www.eclipse.org)