Summary

Today you wrote your first enterprise bean. You wrote the home interface, component interface, enterprise bean class, and application exception for a stateless session bean. The remote home interface extends the javax.ejb.EJBHome interface and contains a single create method. The remote interface extends javax.ejb.EJBObject and contains the business methods callable by the client. The enterprise bean class implements the javax.ejb.SessionBean interface. In addition, it implements the ejbCreate method and business methods defined in the remote interface. The deployment descriptor for a session bean includes information such as the bean's name, home interface, component interface, bean class, and its subtype. You learned how to package and deploy the enterprise bean. You also wrote and ran a client that accesses the enterprise bean.

You learned about the types of exceptions: application exceptions and system exceptions. Application exceptions, such as javax.ejb.CreateException, indicate an error in business logic to the client. System exceptions, such as java.rmi.RemoteException, indicate an error with the services that support an application and the EJB container may destroy the bean instance.

The process of writing, packaging, and deploying enterprise bean files is similar for other types of enterprise beans as well. You'll use this procedure in the following days.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.80.100