Sun River
          Topics about Java SE, Servlet/JSP, JDBC, MultiThread, UML, Design Pattern, CSS, JavaScript, Maven, JBoss, Tomcat, ...
          posts - 78,comments - 0,trackbacks - 0

          Step1: Definition of Remote Interface
          ????????????? public interface Count extends EJBObject{
          ????????????????????????public int count() throws RomoteException;
          ????????????????????? }
          Step2: Definition of Home Interface
          ???????????????public interface CountHome extends EJBHome {
          ????????????????????????Count create(int val) throws RemoteException, CreateException;
          ????????????????????? }
          Step3: Definition of?Bean Class
          ???????????????Public class CountBean implements SessionBeam {
          ??????????????????????????public int val;
          ???????????????????????????public int count() {
          ??????????????????????????????System.out.println("count()");
          ????????????????????????????? return ++val;
          ??????????????????????????????}
          ?????????????? public void ejbCreate(int val) throws CreateException {
          ????????????????????????????this.val=val;
          ??????????????????????????? System.out.println("ejbCreate()");
          ???????????????????????? }
          ???????????????? public void ejbRemove(){};
          ???????????????? public void ejbActivate(){};
          ???????????????? public void ejbPassivate(){};
          ???????????????? public void setSessionContext(SessionContext ctx){};
          ????????? }

          Step4: Definition of ejb-jar.xml

          ?????????????????? <ejb-jar>
          ????????????????????? <enterprise-beans>
          ??????????????????????? <session>
          ?????????????????????????? <ejb-name>Count</ejb-name>
          ??????????????????????????? <home>CountHome</home>
          ??????????????????????????? <remote>Count</remote>
          ??????????????????????????? <ejb-class>CountBean</ejb-class>
          ??????????????????????????? <session-type>Stateful</session-type>
          ??????????????????????????? <transaction-type>Container</transaction-type>
          ??????????????????????? </session>
          ????????????????????? </enterprise-beans>
          ????????????????????</ejb-jar>????????????????????

          ????????

          posted on 2006-09-24 06:45 Sun River 閱讀(269) 評論(0)  編輯  收藏 所屬分類: SBS Series
          主站蜘蛛池模板: 台东市| 霍邱县| 海林市| 绍兴县| 宁都县| 东乌| 武城县| 娄烦县| 沛县| 无棣县| 吉安市| 湖口县| 宣恩县| 海阳市| 龙泉市| 济南市| 辽源市| 安达市| 米泉市| 庄浪县| 焦作市| 桐乡市| 和硕县| 安远县| 湾仔区| 九龙县| 濉溪县| 龙游县| 习水县| 吴桥县| 雅江县| 宁城县| 石景山区| 双柏县| 杭锦后旗| 彭阳县| 平武县| 阿合奇县| 辽阳市| 六安市| 铜山县|