Developing service components
Develop service components to provide reusable logic to multiple applications within your
server.
Before you begin
About this task
Note: A
single service component can contain multiple interfaces.
Procedure
Examples of developing components
This example shows a synchronous service component that implements a single method, CustomerInfo.
The first section defines the interface to the service component that implements a method called
getCustomerInfo.
public interface CustomerInfo {
public Customer getCustomerInfo(String customerID);
}The following block of code implements the service
component.
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;
}
}The following section is the implementation of the class associated with
StockQuote.
public class StockQuoteImpl implements StockQuote {
public float getQuote(String symbol) {
return 100.0f;
}
}
This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-03-13 12:15