版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、JBoss ESB學(xué)習(xí)說明6第五個ESB應(yīng)用程序自定義活動本文介紹了第四個ESB應(yīng)用程序,并介紹了第五個ESB應(yīng)用程序自定義方法。1概述此示例主要演示action類的各種用法。2新ESB項目操作過程笨拙。3 ESB配置3.1排隊消息此處創(chuàng)建兩個消息隊列,如概述中所述。在Esbcontent文件夾下,創(chuàng)建用于組織消息隊列的文件jbm-queue-service.xml。內(nèi)容包括:Xml代碼1?Xml版本= 1.0 encoding= utf-8 ?234j boss . messaging : service=server peer56j boss . messaging : service=p
2、ost office789j boss . messaging : service=server peer1011j boss . messaging : service=post office12133.2定義供應(yīng)商此處定義JMS提供程序,并定義兩個消息通道。一個用于接收客戶機(jī)發(fā)送的消息,另一個用作ESB消息通道。內(nèi)容包括:Xml代碼14151618192022233.3服務(wù)定義Xml代碼2426273.4偵聽器定義此處定義了兩個偵聽器,一個用于接收客戶端消息,另一個用于接收ESB內(nèi)部消息。其中電子用于接收客戶端消息,因此必須將is-gateway屬性設(shè)置為true。Xml代碼29303.5
3、定義Action類別以下定義了四個action:my basic action、StatefulAction、CustomConfigAction和custombeanconfiguction。其中,custombeanconfiguction類在擴(kuò)展AbstractActionLifecycle類的同時實現(xiàn)BeanConfiguredAction接口。以下是每個action的說明:3.5.1 MyBasicAction這是基本action(類似于上一實例中的action),主要用于打印輸出消息內(nèi)容。類定義如下:Java代碼31/* * * * * * * * * * * * * * * *
4、* * * * * * * * * * * * * * * * * * * * * * * * * * * *32 * project name : custom action33 *文件名3360 com . thu . AFA . ESB . JBoss ESB . action . my basic action . Java34 *版權(quán)所有3360版權(quán)所有(c) 201035 * company 3360 http:/AFA . 36 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
5、 * * * * * * * * * *37 package com . thu . AFA . ESB . JBoss ESB . action;3839 import org . JBoss . SOA . ESB . actions . abstracctactionslifecycle;40 importorg . JBoss . SOA . ESB . helper . config tree;41 importorg . JBoss . SOA . ESB . message . message;4243 /*44 * Class Name: MyBasicAction45 * D
6、escription:46 * author Afa47 * date 2010-9-1048 * version 1.049 */50 public class my basic action extends abstracctactionslifecycle51、52 protected config tree5354 public mybasicaction(配置樹配置樹)55、56 this . config tree=config tree;575859 public message no operation(message message) return message;6061
7、public message process(message message)62、63 system . out . print ln( the default process method called );6465 return message666768 public message print message(message message)throws exception69、70 system . out . print ln( message body 3360 message . getbody()。get()。tostring();7172 return message73
8、7475 public void exception handler(message message,throowable exception)76、使用77 System.out.println(! ERROR!);78 system . out . print ln(exception . get message();79 system . out . print ln( for message : );80 system . out . print ln(message . getbody()。get();81823.5.2狀態(tài)功能此類主要用于顯示在一個action配置中同時調(diào)用多個方法
9、時action的實例數(shù)。簡而言之,無論在一個action配置中調(diào)用了多少方法,都只有一個action類的實例。Java代碼83/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *84 * project name : custom action85 *文件名3360 com . thu . AFA . ESB . JBoss ESB . action . state fulaction . Java86 *版權(quán)所有3360版權(quán)所有(c) 201087 * company
10、3360 http:/AFA . 88 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *89 package com . thu . AFA . ESB . JBoss ESB . action;9091 importorg . JBoss . SOA . ESB . actions . abstracctactionslifecycle;92 importorg . JBoss . SOA . ESB . helper . config tree;9
11、3 importorg . JBoss . SOA . ESB . message . message;9495 /*96 *類別名稱3360狀態(tài)動作97 * Description:98 *99 * author Afa100 * date 2010-9-10101 * version 1.0102 */103 public class state ful action extends abstraction生命周期104105 protected config tree配置樹;106 private int count=0;107108 public stateful action(配置樹配置樹)109110 system . out . print ln( n n constructor- this . get lasts()。get name()“ n”);111計數(shù);112113 this . config tree=config tree;114115116 public message no operation(message message)1171
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 小學(xué)一年級數(shù)學(xué)口算練習(xí)題全套
- 學(xué)校瓷磚施工方案(3篇)
- 0-3歲早教保育與發(fā)展關(guān)鍵資料
- 宜昌地面施工方案(3篇)
- 橋鋼筋施工方案(3篇)
- 低溫油漆施工方案(3篇)
- 圖文展板施工方案(3篇)
- 客戶催款活動策劃方案(3篇)
- 吹沙工地施工方案(3篇)
- ups突發(fā)應(yīng)急預(yù)案(3篇)
- 嵌入式系統(tǒng)實現(xiàn)與創(chuàng)新應(yīng)用智慧樹知到期末考試答案章節(jié)答案2024年山東大學(xué)
- 無人機(jī)測試與評估標(biāo)準(zhǔn)
- 線纜及線束組件檢驗標(biāo)準(zhǔn)
- 人工智能在金融策略中的應(yīng)用
- 口述史研究活動方案
- 加工中心點檢表
- 水庫清淤工程可行性研究報告
- THBFIA 0004-2020 紅棗制品標(biāo)準(zhǔn)
- GB/T 25630-2010透平壓縮機(jī)性能試驗規(guī)程
- GB/T 19610-2004卷煙通風(fēng)的測定定義和測量原理
評論
0/150
提交評論