锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲日本va中文字幕久久,91在线网站,第九色区av在线http://www.aygfsteel.com/ahanflw/zh-cnSat, 17 May 2025 11:41:46 GMTSat, 17 May 2025 11:41:46 GMT60ArcGIS Engine 瀹屾暣渚嬪瓙鐨勬簮鐮?Java鐗?http://www.aygfsteel.com/ahanflw/archive/2008/06/15/207985.html鑼冭仈浼?/dc:creator>鑼冭仈浼?/author>Sun, 15 Jun 2008 02:30:00 GMThttp://www.aygfsteel.com/ahanflw/archive/2008/06/15/207985.htmlhttp://www.aygfsteel.com/ahanflw/comments/207985.htmlhttp://www.aygfsteel.com/ahanflw/archive/2008/06/15/207985.html#Feedback312http://www.aygfsteel.com/ahanflw/comments/commentRss/207985.htmlhttp://www.aygfsteel.com/ahanflw/services/trackbacks/207985.html ArcGIS Engine9.2
浣滆卐mail:ahanflw@gmail.com
濡傛湁闂鍙互鍔燪Q緹わ細36144791

婧愮爜涓嬭澆鍦板潃錛歨ttp://www.hfbook.net/eBooks/47.aspx



]]>
EJB3.0+JBOSS4.0.5GA闆嗙兢http://www.aygfsteel.com/ahanflw/archive/2008/05/22/202260.html鑼冭仈浼?/dc:creator>鑼冭仈浼?/author>Thu, 22 May 2008 12:57:00 GMThttp://www.aygfsteel.com/ahanflw/archive/2008/05/22/202260.htmlhttp://www.aygfsteel.com/ahanflw/comments/202260.htmlhttp://www.aygfsteel.com/ahanflw/archive/2008/05/22/202260.html#Feedback6http://www.aygfsteel.com/ahanflw/comments/commentRss/202260.htmlhttp://www.aygfsteel.com/ahanflw/services/trackbacks/202260.html鏈嶅姟鍣ㄧ浠g爜錛?

HelloWorld.java錛?br />

1import javax.ejb.Remote;
2
3@Remote
4public interface HelloWorld {
5 public String sayHello(String s);
6}

7


HelloWorldBean.java

 1import javax.ejb.Stateless;
 2
 3import org.jboss.annotation.ejb.Clustered;
 4
 5import cn.HelloWorld;
 6
 7@Stateless
 8@Clustered
 9public class HelloWorldBean implements HelloWorld {
10
11    public String sayHello(String s) {
12        System.out.println(s);
13        return s;
14    }

15    
16}

 

涓婇潰絎?琛岀殑@Clustered鏄繀欏葷殑錛屽洜涓烘垜浠渶瑕佷嬌鐢⊿tateless Bean鐨勯泦緹ゅ姛鑳姐?br />
鍒嗗埆鍦↖P鍦板潃涓?192.168.1.88鍜?92.168.1.99鏈哄櫒涓婇潰瀹夎JBOSS4.0.5GA,JBOSS4.0.5鍙互鍘諱笅杞芥枃浠跺悕涓簀boss-installer-1.2.0.GA.jar鐨勫畨瑁咃紝瀹夎鐨勬椂鍊欓夋嫨ejb3-clustered,鍐嶄笅闈㈡湁涓姝ユ椂閫夋嫨Advance,鍐嶅湪Name杈撳叆妗嗚緭鍏ll,鍏跺畠榛樿灝卞彲浠ヤ簡銆?br />
涓ゅ彴鏈哄櫒涓婇潰閮藉畨瑁呭ソ涔嬪悗錛屽垎鍒湪涓ゅ彴鏈哄櫒涓婇潰鍚姩jboss,鍚姩鐨勬椂鍊欓渶瑕佸姞鍙傛暟錛氬IP涓?92.168.1.88鐨勬満鍣ㄥ惎鍔↗BOSS,鍒欎負錛歳un -c all -b 192.168.1.88

褰撲袱鍙版満鍣ㄧ殑JBOSS閮芥甯稿惎鍔ㄥ悗錛屽皢涓婇潰鐨凷tateless Bean鎵撳寘鎴恓ar鍖咃紝鍙戝竷鍒板叾涓竴鍙?JBOSS_HOME%\server\all\farm鐩綍涓嬮潰錛岃繖鏍烽泦緹や腑鐨勫叾瀹冪粨鐐瑰皢鑷姩鍙戝竷榪欎釜jar鍖呫?br />
褰撳彂甯冨畬鎴愪箣鍚庯紝鎴戜滑緙栧啓瀹㈡埛绔細

Client.java

 1import java.util.Properties;
 2
 3import javax.naming.InitialContext;
 4import javax.naming.NamingException;
 5
 6public class Client {
 7
 8    public static void main(String[] args) {
 9        Properties prop = new Properties();
10        prop.setProperty("java.naming.factory.initial",
11                "org.jnp.interfaces.NamingContextFactory");
12        prop.setProperty("java.naming.factory.url.pkgs",
13                "org.jboss.naming:org.jnp.interfaces");
14        prop.setProperty("java.naming.provider.url",
15                "192.168.1.88:1099,192.168.1.99:1099");
16
17        try {
18            InitialContext ict = new InitialContext(prop);
19            HelloWorld helloWorld = (HelloWorld) ict
20                    .lookup("HelloWorldBean/remote");
21            for (int i = 0; i < 10; i++{
22                helloWorld.sayHello("HelloWorld");
23            }

24        }
 catch (NamingException e) {
25            e.printStackTrace();
26        }

27    }

28}

29

 

涓婇潰榪欎釜瀹㈡埛绔厤緗簡JBOSS鏈嶅姟鍣↖P鍦板潃鍙婄鍙o紝璋冪敤榪滅▼鎺ュ彛鐨凥elloWorldBean,騫惰繛緇皟鐢?0嬈ayHello鏂規硶銆傚湪JBOSS鎺у埗鍙頒笂闈㈠彲浠ョ湅鍒版墦鍗板嚭HelloWorld銆?br />

紼嬪簭榪愯緇撴灉鍙戠幇錛氬湪192.168.1.88 鐨凧BOSS鎺у埗鍙頒笂闈㈡墦鍗板嚭4涓狧elloWorld,鍙︿竴涓狫BOSS鎺у埗鍙頒笂闈㈠垯鎵撳嵃鍑?涓狧elloWorld銆傚姞璧鋒潵姝eソ10涓狧elloWorld錛屽彲浠ュ彂鐜頒袱鍙癑BOSS宸茬粡瀹炵幇浜嗚礋杞藉潎琛°?br />
闆嗙兢涓殑浠諱綍涓涓粨鐐規寕鎺変箣鍚庯紝紼嬪簭閮藉彲浠ユ甯歌繍琛岋紝





 





]]>
主站蜘蛛池模板: 通州区| 龙井市| 道孚县| 慈溪市| 平山县| 和龙市| 筠连县| 蒲江县| 渝北区| 泽库县| 大荔县| 渝中区| 茶陵县| 盐源县| 井冈山市| 宁阳县| 东阿县| 固阳县| 桃园县| 恩平市| 株洲市| 东台市| 岐山县| 长岭县| 桑日县| 武夷山市| 昌江| 嵊泗县| 班戈县| 紫云| 永丰县| 宣汉县| 宜宾县| 久治县| 偏关县| 莱芜市| 普陀区| 山东省| 加查县| 常德市| 宝山区|