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 閱讀(263) 評論(0)  編輯  收藏 所屬分類: SBS Series
          主站蜘蛛池模板: 淳化县| 阿鲁科尔沁旗| 广灵县| 获嘉县| 栾城县| 定西市| 苗栗市| 乌审旗| 海伦市| 游戏| 梁河县| 乐至县| 福清市| 泊头市| 冷水江市| 平度市| 昌都县| 丹棱县| 正蓝旗| 衡南县| 灵璧县| 武汉市| 彰化县| 调兵山市| 彭山县| 廉江市| 竹北市| 灵丘县| 嵊泗县| 霍山县| 湘乡市| 潼南县| 吉隆县| 得荣县| 凤凰县| 宣化县| 合阳县| 石狮市| 浙江省| 千阳县| 高州市|