There are three types of Enterprise JavaBeans – entity, session, and message-driven. Entity beans model real-world business or data elements and can be accessed by multiple clients. Session beans represent processes and tasks. Entity beans are persistent, but session beans do not have a persistent state. A message-driven bean is a stateless bean that responds to requests placed by clients using the Java Message Service (JMS). Both message-driven and session beans can be used to perform tasks and manage interaction between enterprise beans. However, unlike session beans, message-driven beans don't have a component interface that defines what methods can be invoked.
To develop an EJB, you need to define a bean implementation class and, if using an entity bean, a primary key class. The component interface defines the bean's business methods, whereas the home interface includes the methods required to create, find, and remove a bean. A client accesses a session or entity bean indirectly through the EJB object, which is generated by the EJB home, an EJB object factory. In addition to referencing your bean, the EJB object takes care of system-level management tasks. The EJB object class – which implements the bean's component interface – and the EJB home – which implements the bean's home interface – are both automatically generated by the container during deployment.
Tuesday, November 21, 2006
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment