Java Reference
In-Depth Information
<props>
<prop key="java.naming.factory.initial">
org.jnp.interfaces.NamingContextFactory
</prop>
<prop key="java.naming.provider.url">
jnp://localhost:1099
</prop>
<prop key="java.naming.factory.url.pkgs">
org.jboss.naming.client
</prop>
</props>
</property>
</bean>
</beans>
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. UnderwritingRemoteBean.java
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