|
|
1.1 Does EJB specification only define interfaces? We can understand major parts of EJB by above class diagram. It shows the relationship of interfaces.
1.2 Using HelloWorld as an example, the EJB developer needs implement at least following classes:
public interface Hello extends EJBObject;
public interface HelloHome extends EJBHome;
public class HelloBean implements SessionBean (or EntityBean);
1.3 “Hello” and “HelloHome” are remote interfaces. It is the EJB container (or application server)’s responsibility to implement the remote object and stub objects. The remote object delegates remote call for the enterprise bean (here is HelloBean). Hence the container separates the enterprise bean from remote world, and adds diverse services for the enterprise bean.
1.4 The container should also implements EJBContext and EJBMetaData interfaces for a specified enterprise bean.
2.1 Application is the deployment unit. It is represented as a jar file physically, such as hello.jar.
2.2 An application contains several enterprise beans and it creates a Container instance for each enterprise bean. You can regard the container as the implementation of the EJBObject and EJBHome interfaces.
2.3 The configuration information of Enterprise beans is described in the ejb-jar.xml file. Their containers are configured in the standardjboss.xml and jboss.xml files. The ejb-jar.xml and jboss.xml files are included in the application jar file as the metadata . The standardjboss.xml defines the stand bean containers (CMP EntityBean, BMP EntityBean, Stateless SessionBean, Stateful SessionBean, Message Driven Bean).
Because the ejb-jar.xml file defines the bean type, JBoss can select the container type for an enterprise bean, then create the container instance for it.
2.4 The “deployments” field of the ContainerFactory class stores current deployed applications. ContainerFactory is a singleton object; it is used to create different containers for an application. The application server can run many applications simultaneously.
2.5 ContainerInvoker is the linkage of the remote world and the Container, and Container is the delegation of your enterprise beans.
2.6 The container is responsible to automatically persist its enterprise bean. This is the most attractive feature of EJB. The StatefulSessionPersistenceManager and EntityPersistenceManager interfaces are called by the container when it decides to persist an enterprise bean instance. Because the Stateless bean
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>
网友评论:(评论内容只代表网友观点,与本站立场无关!) |
阅读排行
|