Java Reference
In-Depth Information
<prop key="java.naming.factory.initial">
<prop key="java.naming.provider.url">
<prop key="java.naming.factory.url.pkgs">
You will need to alter the session facade (shown earlier in Listing 4-17) to delegate to
the application service that implements the business logic. Listing 4-24 shows the modi-
fied implementation class. Note that the onEjbCreate method now gets involved in doing
something useful. It retrieves the POJO business service object from the Spring applica-
tion context associated with this EJB. The constant in the business interface supplies the
value of the key used to look up the application service bean.
Listing 4-24.
public class UnderwritingRemoteBean extends AbstractStatelessSessionBean {
private final String SERVICE_BEAN_KEY = "uwrAppService";
private UnderwritingApplicationService uwrAppService;
public void underwriteNewPolicy(String productCd, String name, int age)
throws RemoteException {
//delegate to application service
uwrAppService.underwriteNewPolicy(productCd, name, age);
Search WWH ::

Custom Search