모듈이 있는 컴포넌트는 WebSphere® ESB 클러스터의 모든 노드에서 컴포넌트를 사용할 수 있습니다.
ServiceManager serviceManager = new ServiceManager();
InputStream myReferences = new FileInputStream("MyReferences.references"); ServiceManager serviceManager = new ServiceManager(myReferences);
StockQuote stockQuote = (StockQuote)serviceManager.locateService("stockQuote");
Service stockQuote = (Service)serviceManager.locateService("stockQuote");
public class MyValueImpl implements MyValue { public float myValue throws MyValueException { ServiceManager serviceManager = new ServiceManager(); // variables Customer customer = null; float quote = 0; float value = 0; // invoke CustomerInfo cInfo = (StockQuote)serviceManager.locateService("stockQuote"); customer = cInfo.getCustomerInfo(customerID); if (customer.getErrorMsg().equals("")) { // invoke StockQuote sQuote = (StockQuote)serviceManager.locateService("stockQuote"); Ticket ticket = sQuote.getQuote(customer.getSymbol()); // … do something else … quote = sQuote.getQuoteResponse(ticket, Service.WAIT); // assign value = quote * customer.getNumShares(); } else { // throw throw new MyValueException(customer.getErrorMsg()); } // reply return value; } }