Java Reference
In-Depth Information
Listing 4-17.
public class UnderwritingRemoteBean extends AbstractStatelessSessionBean {
public void underwriteNewPolicy(String productCd, String name, int age)
throws RemoteException {
//implement business rule
//invoke Entity beans
protected void onEjbCreate() throws CreateException {
//use for post initialisation tasks
To register as a session bean and subscribe to the container services, the Java classes
must be supplemented with metadata information. The metadata information is pro-
vided in the form of XML deployment descriptors. The first deployment descriptor is
ejb-jar.xml , which describes the bean and system services it requires. In this case, the
bean requires transactional services for all its methods, as shown in Listing 4-18.
Listing 4-18. ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="2.1" xmlns=""
<home> å
<remote> å
<ejb-class> å
Search WWH ::

Custom Search