|
Last Modified: 2003.12.03
Your First EJBif we want to develop a ejb named hello, steps below will be done. Concrete codes are in %JFOX_HOME%/examples/src. 1.define remote interface, Hello.java 2.define home interface, HelloHome.java 3.implement Hello EJB,HelloBean.java 4.implement Meta class, HelloMeta.java 5.package all of files using jar commmand , copy it to %JFOX_HOME%deploy, then finish deployment. Among these steps, first three steps are similar with steps of normal ejb development. The forth step is particular . a meta class replaces ejb-jar.xml so development can be simplified. Content of HelloMeta.java is
We can see that HelloMeta.java implemnet EJBMeta interface and implement a method getEJBMetaInfo(). This method returns EJBMetaHelper.simpleStatelessMetaInfo(HelloHome.class); the method use HelloHome. class as parameter. SimpleStatelessMetaInfo method returns a simple config Stateless EJBMeta. This EJBMeta is displayed underside
After write HelloMeta, a complete ejb compenent is finished. package all of files using jar commmand ,
copy it to %JFOX_HOME%deploy, then finish deployment.
If we want to change Hello to a Stateful SessionBean ( this change doesnot happen frequently), we will modify HelloMeta class, change EJBMetaHelper.simpleStatelessMetaInfo(HelloHome.class) to EJBMetaHelper.simpleStatefulMetaInfo(HelloHome.class),then compiler, package and deploy again . is it simple? |