锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久亚洲AV无码专区桃色,亚洲午夜久久久久久久久久,久久久久亚洲爆乳少妇无http://m.tkk7.com/fastzch/category/43096.htmlI Love Java As My Life!zh-cnSun, 26 Sep 2010 10:28:19 GMTSun, 26 Sep 2010 10:28:19 GMT60浣跨敤ANT鎵歸噺緙栬瘧Flex搴旂敤鍜屾ā鍧楋紙Use ANT to batch compiling application and modules of Flex)http://m.tkk7.com/fastzch/archive/2010/09/26/332885.htmlRobin's Java WorldRobin's Java WorldSun, 26 Sep 2010 00:51:00 GMThttp://m.tkk7.com/fastzch/archive/2010/09/26/332885.htmlhttp://m.tkk7.com/fastzch/comments/332885.htmlhttp://m.tkk7.com/fastzch/archive/2010/09/26/332885.html#Feedback0http://m.tkk7.com/fastzch/comments/commentRss/332885.htmlhttp://m.tkk7.com/fastzch/services/trackbacks/332885.html
<target name="compileUI" >
        
<echo message="start to compile Flex UI" />
        
<for param="file">
            
<path>
                
<fileset dir="${flexsrc.dir}">
                    
<include name="**/*.mxml" />
                
</fileset>
            
</path>
            
<sequential>        
                
<propertyregex override="yes" property="compile.target.name" input="@{file}" regexp="(.*)src(.*)(mxml)" replace="\1bin\2swf" />
               
 <mxmlc file="@{file}" output="${compile.target.name}"
                    services
="${service.file}" context-root="${context.root}">
                    
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
                    
<static-link-runtime-shared-libraries>false</static-link-runtime-shared-libraries>
                    
<source-path path-element="${flexsrc.dir}" />
                    
<!-- use incremental compiling-->
                    
<compiler.incremental>true</compiler.incremental>
                    
<compiler.debug>false</compiler.debug>
                    
                    
<!-- 鎸囧畾澶栭儴渚濊禆搴撴枃浠?榪欎簺搴撴枃浠跺皢涓嶄細緙栬瘧榪涚洰鏍嘢WF涓?nbsp;-->
                    
<compiler.external-library-path dir="${flexlib.dir}">
                        
<include name="**/*.swc" />
                    
</compiler.external-library-path>
                
</mxmlc>
                
<!-- 娓呴櫎緙撳瓨鏂囦歡 -->
                
<!--
                <delete file="${compile.target.name}.cache" />
                
-->
                
<echo message="Compiled @{file} =====>>   ${compile.target.name}" />
                
            
</sequential>
        
</for>

    
</target>


娉ㄦ剰浜嬮」錛?br /> 1錛屽繀欏諱嬌鐢╝nt-contrib鍖呮潵鏀寔for浠誨姟錛屼嬌鐢╢or浠誨姟鏃訛紝鍒繕浜嗗涓嬪0鏄庯細
<path id="ant.classpath">
        
<fileset dir="${ant.lib.dir}">
            
<include name="*.jar" />
        
</fileset>
    
</path>
    
<taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="ant.classpath" />

2錛岀紪璇戞瘡涓猰xml鏃訛紝鍙敤propertyregex鏉ュ緱鍒皁utput鏂囦歡鍚嶏紝
3錛宻ource-path涓瀹氫笉鑳藉啓閿欙紝鎴栭殢渚垮啓錛屽鏋滆繖鏍風殑璇濓紝浼氬嚭鐜板涓嬮敊璇細
              Error: A file found in a source-path must have the same package structure
4錛屽鏋滃湪榪愯鐨勮繃紼嬩腑鍑虹幇Java heap size鎴杙ermGen涓嶈凍鐨勬儏鍐碉紝鍙互鎸囧畾濡備笅緋葷粺鍙傛暟錛?br />               ANT_OPTS=-XX:MaxPermSize=256M -Xmx1024m

Robin's Java World 2010-09-26 08:51 鍙戣〃璇勮
]]>
Flex涓甫鏈変笁縐嶇姸鎬丆heckBox鐨凾ree鐨勫疄鐜?/title><link>http://m.tkk7.com/fastzch/archive/2010/09/15/332027.html</link><dc:creator>Robin's Java World</dc:creator><author>Robin's Java World</author><pubDate>Tue, 14 Sep 2010 23:58:00 GMT</pubDate><guid>http://m.tkk7.com/fastzch/archive/2010/09/15/332027.html</guid><wfw:comment>http://m.tkk7.com/fastzch/comments/332027.html</wfw:comment><comments>http://m.tkk7.com/fastzch/archive/2010/09/15/332027.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/fastzch/comments/commentRss/332027.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/fastzch/services/trackbacks/332027.html</trackback:ping><description><![CDATA[     鎽樿: 甯稿父浼氱敤鍒板甫鏈?縐嶇姸鎬丆heckBox鐨勬爲褰㈢粍浠訛紝姣斿鍦ㄦ潈闄愮鐞嗕腑錛屾垨鑰呮槸鍦板尯閫夋嫨涓瓑絳夛紝濡備笅鍥撅細 涓嶅璇磋垂璇濅簡錛岀洿鎺ヨ繘鍏ヤ富棰橈紝鐪嬬湅濡備綍瀹炵幇銆傚叾瀹炲湪Flex涓紝鍙敤鑷繁瀹炵幇涓涓猅reeItemRenderer灝卞彲浠ヤ簡錛屼唬鐮佸涓嬶細 package com.robin {     import flash.events...  <a href='http://m.tkk7.com/fastzch/archive/2010/09/15/332027.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/fastzch/aggbug/332027.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/fastzch/" target="_blank">Robin's Java World</a> 2010-09-15 07:58 <a href="http://m.tkk7.com/fastzch/archive/2010/09/15/332027.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Flex4 bug -- Context Menu涓彍鍗曢」Label涓嶈兘甯ettings瀛楁牱http://m.tkk7.com/fastzch/archive/2010/05/05/320147.htmlRobin's Java WorldRobin's Java WorldWed, 05 May 2010 12:35:00 GMThttp://m.tkk7.com/fastzch/archive/2010/05/05/320147.htmlhttp://m.tkk7.com/fastzch/comments/320147.htmlhttp://m.tkk7.com/fastzch/archive/2010/05/05/320147.html#Feedback0http://m.tkk7.com/fastzch/comments/commentRss/320147.htmlhttp://m.tkk7.com/fastzch/services/trackbacks/320147.html浠婂ぉ鍦ㄥ紑鍙慒lex鐨勫簲鐢ㄦ椂錛屽彂鐜頒竴涓狥lex4鐨刡ug錛屽嵆Context Menu涓彍鍗曢」Label涓嶈兘甯ettings瀛楁牱銆?br />
浠g爜濡備笅錛?/p>
                var addSettingItem:ContextMenuItem = new ContextMenuItem("Add Control Setting", true);
                var saveSettingItem:ContextMenuItem = new ContextMenuItem("Save Control Setting", true);
                var saveAll:ContextMenuItem = new ContextMenuItem("Save All Control Settings", true);
                addSettingItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItem_addSettingItemSelect);
                saveAll.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItem_saveAllSettingItemSelect);
                saveSettingItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItem_saveSettingItemSelect);
                rightClickContextMenu.hideBuiltInItems();
                rightClickContextMenu.customItems = [addSettingItem, saveSettingItem, saveAll];

緇撴灉鏃犺鎬庢牱錛?#8220;Save All Control Settings”鑿滃崟欏瑰氨鏄嚭涓嶆潵錛屾敼涓?#8220;Save All Control Setting”灝卞彲浠ヤ簡銆傜湡鏄伆甯哥伆甯哥殑濂囨?#8230;…

鐚滄兂涓涓嬶紝鏄笉鏄洜涓篎lash鍙抽敭鑿滃崟涓湰鏉ュ氨鍖呭惈鏈変竴欏?#8220;Settings...”鐨勫師鍥狅紵

Robin's Java World 2010-05-05 20:35 鍙戣〃璇勮
]]>
BlazeDS鑷畾涔夎璇佷笌鏉冮檺鎺у埗http://m.tkk7.com/fastzch/archive/2010/04/28/319555.htmlRobin's Java WorldRobin's Java WorldWed, 28 Apr 2010 01:56:00 GMThttp://m.tkk7.com/fastzch/archive/2010/04/28/319555.htmlhttp://m.tkk7.com/fastzch/comments/319555.htmlhttp://m.tkk7.com/fastzch/archive/2010/04/28/319555.html#Feedback1http://m.tkk7.com/fastzch/comments/commentRss/319555.htmlhttp://m.tkk7.com/fastzch/services/trackbacks/319555.html闃呰鍏ㄦ枃

Robin's Java World 2010-04-28 09:56 鍙戣〃璇勮
]]>
BlazeDS緇撳悎Tomcat榪涜鏉冮檺鎺у埗http://m.tkk7.com/fastzch/archive/2010/04/27/319428.htmlRobin's Java WorldRobin's Java WorldTue, 27 Apr 2010 01:56:00 GMThttp://m.tkk7.com/fastzch/archive/2010/04/27/319428.htmlhttp://m.tkk7.com/fastzch/comments/319428.htmlhttp://m.tkk7.com/fastzch/archive/2010/04/27/319428.html#Feedback0http://m.tkk7.com/fastzch/comments/commentRss/319428.htmlhttp://m.tkk7.com/fastzch/services/trackbacks/319428.html 鐜錛?br /> BlazeDS 3.2.0.3978
Tomcat 6.0.29 (鏈緥鍦═omcat 5.5涓笉鑳芥甯歌繍琛岋紝鍥犱負Tomcat 5.5鐨刢ontext閮ㄥ垎鐨勮璁′笌6.0涓嶄竴鏍?
Java5

1錛屽湪service-config.xml涓姞鍏ヨ璇佸拰瑙掕壊錛堢粍錛夌殑瀹氫箟錛?br />
<security>
        
<login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat" />
        
<security-constraint id="trusted">
        
<auth-method>Basic</auth-method>
            
<roles>
                
<role>tomcat</role>
            
</roles>
        
</security-constraint>
        
<security-constraint id="users">
            
<auth-method>Basic</auth-method>
            
<roles>
                
<role>role1</role>
                
<role>tomcat</role>
            
</roles>
        
</security-constraint>
    
</security>
闇瑕佽鏄庣殑鏄紝榪欓噷鐨剆ecurity-constraint tag鐩稿綋浜庝竴涓鑹茬粍錛屽叾id灞炴у氨鏄鑹茬粍鐨処D錛屽users瑙掕壊緇勫寘鍚玶ole1鍜宼omcat涓や釜瑙掕壊銆?br /> auth-method tag琛ㄧず璁よ瘉鐨勬柟寮忥紝Basic鍗抽噰鐢℉TTP Basic璁よ瘉鏂瑰紡錛屼篃鍙互鑷繁瀹炵幇璁よ瘉鏂瑰紡錛屽彲璋冨畾涓篊ustom錛屽叧浜庢縐嶈璇佹柟寮忥紝鎴戝皢鍦ㄧ◢鍚庡垎浜粰澶у銆?br />
榪欎簺瑙掕壊鍜岀敤鎴鳳紝鍧囪瀹氫箟鍦═omcat鐨刢onf/tomcat-users.xml閰嶇疆涓細
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<!--
  NOTE:  By default, no user is included in the "manager" role required
  to operate the "/manager" web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary.
-->
<!--
  NOTE:  The sample user and role entries below are wrapped in a comment
  and thus are ignored when reading this file. Do not forget to remove
  <!.. ..> that surrounds them.
-->

  
<role rolename="tomcat"/>
  
<role rolename="role1"/>
  
<role rolename="manager"/>
  
<user username="admin" password="admin" roles="manager"/>
  
<user username="tomcat" password="tomcat" roles="tomcat"/>
  
<user username="both" password="tomcat" roles="tomcat,role1"/>
  
<user username="role1" password="tomcat" roles="role1"/>

</tomcat-users>


2錛屽湪remote-config.xml涓厤緗叿浣撶殑destination鐨勬潈闄愮害鏉燂細
<destination id="Domain">
        
<properties>
            
<source>com.robin.service.domain.DomainService</source>
            
<include-methods>
            
<method name="getAllDomains"/>
            
<method name="addOrUpdateDomain" security-constraint="trusted"/>
            
</include-methods>
        
</properties>
        
<security>
            
<security-constraint ref="users"/>
        
</security>
    
</destination>
鍦ㄦ閰嶇疆涓紝瀹氫箟鎵鏈夌殑鏂規硶鍙鏄痷sers瑙掕壊緇勪腑鐨勭敤鎴峰嵆鍙闂紝浣嗘槸addOrUpdateDomain鏂規硶闇瑕乼rusted瑙掕壊緇勪腑鐨勭敤鎴鋒墠鑳借闂?br />
3錛屽皢BlazeDS涓嶵omcat緇撳悎鎵渚濊禆鐨刲ib澶嶅埗鍒發ib鐩綍涓紝鍖呭惈flex-tomcat-common.jar鍜宖lex-tomcat-server.jar涓や釜JAR銆?br />
4錛屼慨鏀筎omcat鐩綍涓嬬殑conf/context.xml鏂囦歡錛屽姞鍏ュ涓婥ontext錛堝湪Tomcat5.5涓棤娉曟垚鍔燂級錛?br />
<Valve className="flex.messaging.security.TomcatValve"/>

濂戒簡錛屽氨榪欎箞綆鍗曪紝閲嶅惎Tomcat錛屽嵆鍙獙璇佷簡銆?br />
鎬葷粨涓涓嬶細
1錛屽紩鍏ヤ簡瑙掕壊緇勭殑姒傚康錛岃繖涓瘮杈冨ソ銆?br /> 2錛岃鑹插拰鐢ㄦ埛瀹氫箟渚濊禆浜嶵omcat錛屾棤娉曞畾涔夊湪濡侱BMS涓紝涓嶆柟渚夸慨鏀廣?br /> 3錛岃法騫沖彴鎬т笉濂姐?br /> 4錛岃祫婧愪笌鏉冮檺鐨勬槧灝勫叧緋誨湪寮鍙戞椂宸茬粡緇戝畾姝伙紝鏃犳硶鍔ㄦ佷慨鏀廣?


PS錛?010.4.28. 鍒嗕韓緇欏ぇ瀹朵笉渚濊禆Tomcat瀹瑰櫒瀹炵幇璁よ瘉涓庢巿鏉冪殑渚嬪瓙錛屽鏈夐渶瑕侊紝璇峰弬鑰冿細銆?a id="viewpost1_TitleUrl" class="postTitle2" href="http://m.tkk7.com/fastzch/archive/2010/04/28/319555.html">BlazeDS鑷畾涔夎璇佷笌鏉冮檺鎺у埗銆?br />
鏈珺log鎵鏈夊唴瀹逛笉寰楅殢鎰忚漿杞斤紝鐗堟潈灞炰簬浣滆呮墍鏈夈傚闇杞澆璇蜂笌浣滆呰仈緋伙紙 fastzch@163.com    QQ錛?184314錛夈?br /> 鏈粡璁稿彲鐨勮漿杞斤紝鏈漢淇濈暀涓鍒囨硶寰嬫潈鐩娿?br /> 涓鐩翠互鏉ワ紝鍙戠幇鏈夋煇浜涗漢瀹屽叏涓嶅皧閲嶆垜鐨勫姵鍔ㄦ垚鏋滐紝闅忔剰杞澆錛屾彁閱掍竴涓嬮偅浜涗漢灝忓績鍝ぉ鎯逛笂瀹樺徃銆?/font>


]]>
BlazeDS Study Notes -- Channel & Endpointhttp://m.tkk7.com/fastzch/archive/2010/04/07/317619.htmlRobin's Java WorldRobin's Java WorldWed, 07 Apr 2010 02:27:00 GMThttp://m.tkk7.com/fastzch/archive/2010/04/07/317619.htmlhttp://m.tkk7.com/fastzch/comments/317619.htmlhttp://m.tkk7.com/fastzch/archive/2010/04/07/317619.html#Feedback0http://m.tkk7.com/fastzch/comments/commentRss/317619.htmlhttp://m.tkk7.com/fastzch/services/trackbacks/317619.htmlThe following example shows a RemoteObject component that defines a channel set and channel inline in MXML:
...
<RemoteObject id="ro" destination="Dest">
<mx:channelSet>
<mx:ChannelSet>
<mx:channels>
<mx:AMFChannel id="myAmf"
uri="http://myserver:2000/myapp/messagebroker/amf"/>
</mx:channels>
</mx:ChannelSet>
</mx:channelSet>
</RemoteObject>


The following example shows ActionScript code that is equivalent to the MXML code in the previous example:
private function run():void {
 ro = new RemoteObject();
 var cs:ChannelSet = new ChannelSet();
 cs.addChannel(new AMFChannel("myAmf",
 "http://servname:2000/eqa/messagebroker/amf"));
 ro.destination = "Dest";
 ro.channelSet = cs;
}

Important: When you create a channel on the client, you must still include a channel definition that specifies an endpoint class in the services-config.xml file. Otherwise, the message broker cannot pass a Flex client request to an endpoint.

 

 

Assigning channels and endpoints to a destination
1,If most of the destinations across all services use the same channels, you can define application-level default channels in the services-config.xml file, as the following example shows.
Note: Using application-level default channels is a best practice whenever possible.
<services-config ...>
...
<default-channels>
<channel ref="my-http"/>
<channel ref="my-amf"/>
</default-channels>
...
In this case, all destinations that do not define channels use a default channel. Destinations can override the
default channel setting by specifying their own channels, and services can also override it by specifying their own
default channels.
2,If most of the destinations in a service use the same channels, you can define service-level default channels, as
the following example shows:
<service ...>
...
<default-channels>
<channel ref="my-http"/>
<channel ref="my-amf"/>
</default-channels>
...
In this case, all destinations in the service that do not explicitly specify their own channels use the default
channel.
3,The destination definition can reference a channel inline, as the following example shows:
<destination id="sampleVerbose">
<channels>
<channel ref="my-secure-amf"/>
</channels>
...
</destination>

 

 

How to choosing a channel?
1, Non-polling AMF and HTTP channels
You can use AMF and HTTP channels without polling for remote procedure call (RPC) services, such as remoting service calls, proxied HTTP service calls and web service requests. These scenarios do not require the client to poll for messages or the server to push messages to the client.
2, Piggybacking on AMF and HTTP channels
The piggybacking feature enables the transport of queued messages along with responses to any messages the client sends to the server over the channel. Piggybacking provides lightweight pseudo polling, where rather than the client channel polling the server on a fixed or adaptive interval, when the client sends a non-command message to the server (using a Producer or RemoteObject object), the server sends any pending data for client messaging or data management subscriptions along with the response to the client message.
Piggybacking can also be used on a channel that has polling enabled but on a wide interval like 5 seconds or 10 seconds or more, in which case the application appears more responsive if the client is sending messages to the server. In this mode, the client sends a poll request along with any messages it sends to the server between its regularly scheduled poll requests. The channel piggybacks a poll request along with the message being sent, and the server piggybacks any pending messages for the client along with the acknowledge response to the client message.
3, Polling AMF and HTTP channels
AMF and HTTP channels support simple polling mechanisms that clients can use to request messages from the server at set intervals. A polling AMF or HTTP channel is useful when other options such as long polling or streaming channels are not acceptable and also as a fallback channel when a first choice, such as a streaming channel, is unavailable at run time.
4, Long polling AMF and HTTP channels
You can use AMF and HTTP channels in long polling mode to get pushed messages to the client when the other more efficient and real-time mechanisms are not suitable. This mechanism uses the normal application server HTTP request processing logic and works with typical J2EE deployment architectures.
You can establish long polling for any channel that uses a non-streaming AMF or HTTP endpoint by setting the polling-enabled ,  polling-interval-millis ,  wait-interval-millis , and  client-wait-interval-
millis  properties in a channel definition.
5, Streaming channels
For streaming, you can use streaming AMF or HTTP channels. Streaming AMF and HTTP channels work with streaming AMF or HTTP endpoints.

 

 


Long polling AMF and HTTP channels
In the default configuration for a polling AMF or HTTP channel, the endpoint does not wait for messages on the server. When the poll request is received, it checks whether any messages are queued for the polling client and if so, those messages are delivered in the response to the HTTP request. You configure long polling in the same way as polling, but you also must set the  wait-interval-millis ,  max-waiting-poll-requests , and client-wait-interval-millis  properties.
鍦ㄤ竴涓猵olling AMF鎴朒TTP channel榛樿閰嶇疆涓嬶紝鏈嶅姟绔痚ndpoint涓嶄細絳夊緟娑堟伅錛屽綋杞璇鋒眰琚敹鍒版椂錛屽畠媯鏌ヤ換浣曟秷鎭槸鍚︽帓闃熺瓑寰呰疆璇㈢殑瀹㈡埛绔紝濡傛灉鏄紝榪欎簺娑堟伅琚氦浠樼粰HTTP璇鋒眰鐨勫搷搴斻?br /> To achieve long polling, you set the following properties in the  properties  section of a channel definition in the services-config.xml file:
polling-enabled
polling-interval-millis
wait-interval-millis 
max-waiting-poll-requests .
client-wait-interval-millis


涓嬮潰鍒嗗埆璁蹭竴涓嬪墠闈㈡彁鍒扮殑鍑犵妯″紡錛?br /> 1)鏃犺疆璇MF銆丠TTP閫氶亾
浣犲彲浠ヤ嬌鐢ㄨ繖浜涢氶亾鏃犺疆璇㈢殑鏂瑰紡鏉ユ彁渚汻PC 鏈嶅姟錛屾瘮濡傝繙紼嬫湇鍔¤皟鐢ㄣ佷唬鐞咹TTP鏈嶅姟璋冪敤浠ュ強Web service璇鋒眰銆傝繖浜涙柟妗堜笉瑕佹眰瀹㈡埛绔疆璇俊鎭垨鑰呮湇鍔$灝嗘秷鎭?#8220;鎺?#8221;緇欏鎴風銆?br /> <!-- Simple AMF -->
<channel-definition id="samples-amf"
 type="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:8400/myapp/messagebroker/amf"
 type="flex.messaging.endpoints.AmfEndpoint"/>
</channel-definition>

<!-- Simple secure AMF -->
<channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
 <endpoint url="https://{server.name}:9100/dev/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
</channel-definition>

<!-- Simple HTTP -->
<channel-definition id="my-http"
class="mx.messaging.channels.HTTPChannel">
 <endpoint url="http://{server.name}:8400/dev/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
</channel-definition>

<!-- Simple secure HTTP -->
<channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
 <endpoint url="https://{server.name}:9100/dev/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
</channel-definition>


2)鎼澆寮廇MF銆丠TTP閫氶亾
鎼澆寮忕‘淇濈嫭绔嬩簬瀹㈡埛绔彂閫佷俊鎭埌鏈嶅姟绔垨鑰呮湇鍔$鍝嶅簲娑堟伅鍒板鎴風鐨勬暟鎹紶杈撱傛惌杞藉紡鎻愪緵浜嗚交閲忕駭鐨勫亣杞錛氫竴縐嶆瘮鍥哄畾鎴栬呴傚綋鏃墮棿闂撮殧杞鏈嶅姟绔洿濂界殑鏂瑰紡錛宻鐗瑰埆鏄綋瀹㈡埛绔彂閫佷竴涓潪鍛戒護娑堟伅鍒版湇鍔″櫒錛堜嬌鐢ㄤ竴涓敓浜ц呮垨RemoteObject瀵硅薄錛夋椂錛屾湇鍔″櫒鍙戦佷換浣曟湭紜畾鐨勬暟鎹埌瀹㈡埛绔垨鏁版嵁綆$悊璁㈤槄闅忕潃瀹㈡埛绔殑淇℃伅鍝嶅簲銆?br /> 涔熷彲浠ュ湪涓涓渶瑕佺‘淇濊疆璇紝浣嗘槸闂撮殧鍗存瘮杈冮暱錛屼緥濡?縐掓垨鑰?0縐掔敋鑷蟲洿澶氱殑閫氶亾涓嬌鐢紝鍦ㄨ繖縐嶆儏鍐典笅錛屽簲鐢ㄧ▼搴忎技涔庢洿鍔犳晱鎰熴傝繖縐嶆ā寮忎笅錛屽鎴風鐨勮疆璇㈣姹傜嫭绔嬩簬浠諱綍鍏朵粬娑堟伅鍙戦佺粰鏈嶅姟绔?/p>

3)杞AMF銆丠TTP閫氶亾
AMF銆丠TTP閫氶亾鎻愪緵浜嗙畝鍗曠殑杞鏈哄埗錛屽鎴風鍙互鐢ㄨ繖涓満鍒跺畾鏈熷彂閫佽姹傛秷鎭埌鏈嶅姟绔傚綋闀挎湡杞鎴栬呮祦閫氶亾涓嶈兘浣跨敤鏃訛紝鎴栬呬綔涓轟竴涓祦閫氶亾鐨勫鐢ㄩ氶亾鏃跺欙紝杞AMF銆丠TTP閫氶亾鏄傜敤鐨勩?br /> <!-- AMF with polling -->
<channel-definition id="samples-polling-amf" type="mx.messaging.channels.AMFChannel">
 <endpoint url="http://{server.name}:8700/dev/messagebroker/amfpolling"   type="flex.messaging.endpoints.AMFEndpoint"/>
 <properties>
  <polling-enabled>true</polling-enabled>
  <polling-interval-seconds>8</polling-interval-seconds>
 </properties>
</channel-definition>

<!-- HTTP with polling -->
<channel-definition id="samples-polling-http" type="mx.messaging.channels.HTTPChannel">
<endpoint url="http://{server.name}:8700/dev/messagebroker/httppolling"
 type="flex.messaging.endpoints.HTTPEndpoint"/>
  <properties>
 <polling-enabled>true</polling-enabled>
 <polling-interval-seconds>8</polling-interval-seconds>
  </properties>
</channel-definition>
 娉ㄦ剰錛氳繖縐嶆ā寮忎腑浣犱篃鍙互浣跨敤secure閫氶亾銆?/p>

 

 

4)  闀胯疆璇MF銆丠TTP閫氶亾
褰撳叾浠栨洿鍔犳湁鏁堢巼鐨勫疄鏃舵満鍒朵笉鍚堥傜殑鏃跺欙紝浣犲彲浠ヤ嬌鐢ˋMF鍜孒TTP閫氶亾鐨勯暱鏈熻疆璇㈡ā寮忔潵“鎺?#8221;娑堟伅鍒板鎴風銆?This mechanism uses the normal application server HTTP request processing logic and works with typical J2EE deployment architectures.榪欎竴鏈哄埗鐨勪嬌鐢ㄦ爣鍑嗗簲鐢ㄦ湇鍔″櫒鐨凥TTP璇鋒眰澶勭悊閫昏緫錛屽茍涓庡吀鍨嬬殑J2EE鏋舵瀯鍗忓悓宸ヤ綔銆?br /> You can establish long polling for any channel that uses a non-streaming AMF or HTTP endpoint by setting the polling-enabled , polling-interval-millis , wait-interval-millis , and client-wait-interval-millis properties in a channel definition; for more information, see Simple channels and endpoints .鎮ㄥ彲浠ヤ負浠諱綍閫氶亾寤虹珛闀挎湡杞鏉ヤ嬌鐢ㄧ浉搴旂鐐癸紝闇瑕佽緗竴涓嬪弬鏁幫細polling-enabled銆乸olling-interval-millis銆亀ait-interval-millis銆乧lient-w ait-interval-mills銆傛湁鍏硍ait-interval-millis鐨勬洿澶氬唴瀹硅鍙傝傿lazeds鏂囨。銆?br /> <!-- Long polling AMF -->
<channel-definition id="my-amf-longpoll" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://servername:8700/contextroot/messagebroker/myamflongpoll"
 class="flex.messaging.endpoints.AMFEndpoint"/>
  <properties>
 <polling-enabled>true</polling-enabled>
 <polling-interval-seconds>0</polling-interval-seconds>
 <wait-interval-millis>60000</wait-interval-millis>
 <client-wait-interval-millis>3000</client-wait-interval-millis>
 <max-waiting-poll-requests>100</max-waiting-poll-requests>
  </properties>
</channel-definition>

 

鍏充簬 Non-polling,Polling,Long polling鍜宻teaming鐨勪竴浜涜В閲?br /> http://www.qgy18.com/2008/08/webim-design-transport/
http://newteevee.com/2009/10/04/adobe-to-finally-support-http-streaming/

1.鐭疆璇?polling)錛氭牳蹇冩濇兂鏄鎴風瀹氭椂鍘繪湇鍔″櫒鍙栨秷鎭備負浜嗗疄鐜板嵆鏃舵晥鏋滐紝杞鐨勯棿闅斿繀欏昏璁″緱瓚沖鐭紝鍙﹀涓轟簡鎿嶄綔鐨勬祦鐣咃紝闇瑕佷嬌鐢ˋjax鏉ュ彂閫佽姹傘傛湰浜虹殑QGYWebIM灝辨槸閲囩敤鐨勬鏂規銆傝繖縐嶆柟妗堢殑浼樼偣鏄細鍚庣紼嬪簭緙栧啓姣旇緝瀹規槗錛屽彂閫佸畬鍝嶅簲淇℃伅椹笂鏂紑榪炴帴錛屼笉浼氬崰鐢ㄥお澶氭湇鍔″櫒璧勬簮銆傜己鐐規槸涓鑸儏鍐典笅錛岄綣佺殑璇鋒眰涓湁澶у崐鏄棤鐢紝榪欎簺鍐椾綑璇鋒眰鏃犲艦涓氮璐逛簡甯﹀鍜屾湇鍔″櫒璧勬簮銆傛垜浠彲浠ラ氳繃鍒ゆ柇鐢ㄦ埛鐨勬椿璺冪▼搴︽潵鍐崇瓥璇鋒眰鏈嶅姟鍣ㄧ殑闂撮殧錛屾垜鍦?1鐨勪竴涓笘瀛愭彁鍒拌繃榪欑鏂規硶錛屼絾鏄棿闅斾竴鏃﹂暱浜嗭紝娑堟伅鐨勪紶閫佸氨鏈夊歡鏃訛紝榪濊儗浜嗗嵆鏃惰亰澶╃殑鍒濊》浜嗐?/p>

2.闀胯疆璇?long-polling)錛氬熀鏈師鐞嗘槸瀹㈡埛绔悜鏈嶅姟鍣ㄥ彂閫佽姹傦紝鏈嶅姟鍣ㄦ帴鍒拌姹傚悗hold浣忚繛鎺ワ紝鐩村埌鏈夋柊娑堟伅鎵嶈繑鍥炲搷搴斾俊鎭茍鍏抽棴榪炴帴錛岃繛鎺ヨ鏂紑鏈熼棿鐢ㄦ埛鐨勬柊淇℃伅浼氳鏈嶅姟鍣ㄧ紦瀛樿搗鏉ャ傚鎴風澶勭悊瀹屽搷搴斾俊鎭悗鍐嶅悜鏈嶅姟鍣ㄥ彂閫佹柊鐨勮姹傘傝繖縐嶅仛娉曠殑浼樺娍鏄鏋滅敤鎴蜂竴鐩存病鏂版秷鎭紝瀹㈡埛绔笉浼氶綣佺殑杞鍘繪湇鍔″櫒鍙栨秷鎭紝鑺傜渷浜嗘祦閲忥紝浣嗘槸鏈嶅姟鍣ㄧ淮鎸侀暱榪炴帴鏄緢娑堣楄祫婧愮殑銆傚叿浣撳疄鐜拌搗鏉ワ紝鍓嶇榪欒竟鍩烘湰涓嶉渶瑕佷粈涔堟敼鍔紝渚濈劧鏄敤Ajax杞鍙栦俊鎭紝鍚庣闇瑕佸湪娌℃湁鏂版秷鎭椂澶勭悊涓涓嬨?/p>

3.闀胯繛鎺?streaming)錛氬叾瀹炲緢鏃╀互鍓嶅氨鏈変漢浣跨敤榪欑鎶鏈潵瀹炵幇鑱婂ぉ瀹ょ殑閫氳錛孒TTP1.1寮濮嬫敮鎸併備互鍓嶅湪欏甸潰涓祵鍏ヤ竴涓猧frame錛宨frame閲屾斁涓涓嬌鐢ㄩ暱榪炴帴欏甸潰錛屾湇鍔″櫒鏈夋柊娑堟伅灝變細鍙婃椂鐨勫湪iframe閲屽弽鏄犲嚭鏉ワ紝鍐嶄緷闈犲鎴風鐨勮剼鏈В鏋愬嚭鏉ュ氨OK浜嗐傝繖鏍峰仛涓涓瘮杈冧弗閲嶇殑闂鏄細浣跨敤 iframe璇鋒眰闀胯繛鎺ユ椂錛屾棤璁烘槸IE榪樻槸firefox閮戒細璁や負欏甸潰娌℃湁鍔犺澆瀹岃屾樉紺鴻繘搴︽潯錛屽緢闅劇湅銆備笉榪囪繖涓棶棰樻槸鍙互瑙e喅鐨勩俧irefox鏀寔浜哠treaming Ajax錛屽湪readyState涓?鐨勬椂鍊欏氨鑳芥帴鍙楁暟鎹紝鎵浠ラ棶棰樹笉澶э紱IE鍒欏彧鑳藉湪readyState涓?錛屽嵆榪炴帴鏂紑鏃舵墠鑳藉緱鍒拌繑鍥炲箋備絾鏄紵澶х殑Google宸ョ▼甯堜嬌鐢ㄤ簡涓涓猦ack鎴愬姛鐨勮В鍐充簡榪欎釜闂錛氫嬌鐢ㄤ竴涓縐頒負“htmlfile”鐨凙ctiveX錛屾妸iframe鏀懼湪榪欎釜ActiveX閲屽氨OK浜嗐?/p>

鏃犵枒錛屼嬌鐢ㄩ暱榪炴帴瀵逛簬鐢ㄦ埛鏉ヨ鏄渶濂界殑鏂規錛岀敤鎴蜂綋楠屾渶濂斤紙娑堟伅鑳藉強鏃剁殑鍒拌揪錛夈佸崰鐢ㄧ敤鎴峰甫瀹芥渶灝戯紙涓嶄細鍙戦佹棤鐢ㄧ殑璇鋒眰錛夛紝浣嗘槸浼氬鍔犳湇鍔″櫒鐨勫紑閿錛涢暱杞鏄姌涓柟妗堬紝Facebook IM 灝辨槸閲囩敤榪欑鏂規錛屼笉榪囧仛浜嗕竴鐐規敼鍔細瀹㈡埛绔彂璧風殑姣忎釜榪炴帴鏈嶅姟鍣ㄩ兘hold10S錛岃繖10S涓柊娑堟伅浼氭簮婧愪笉鏂殑榪斿洖緇欏鎴風錛?0s鍚庤繛鎺ュ叧闂紝瀹㈡埛绔彂璧蜂笅涓涓繛鎺ャ傝繖鏍峰仛鏄洜涓篎acebook鐨勭敤鎴蜂細涓嶆柇鐨勬墦寮銆佸叧闂柊欏甸潰錛屽鏋滄瘡涓〉闈㈤兘寤虹珛涓涓案涔呯殑闀胯繛鎺ワ紝浼氶樆濉炴祻瑙堝櫒鍏朵粬璇鋒眰錛屾湇鍔″櫒涔熶細鍚冧笉娑堢殑錛涚煭杞鍥犱負瀹炵幇璧鋒潵綆鍗曪紝閫傜敤浜庡皬鍨嬪簲鐢ㄣ?/p>

 

 


There is a browser-specific limit to the number of connections allowed per session. In Firefox, the limit is eight connections per session. In Internet Explorer, the limit is two connections allowed per session. Therefore, BlazeDS must limit the number of streaming connections per session on the server to stay below this limit.

 

 


Channel and endpoint recommendations

1. AMFChannel/Endpoint configured for long polling (no fallback needed)
Benifits:
Valid HTTP request/response pattern over standard ports that nothing in the network path will have trouble with.
Disadvantages:
When many messages are being pushed to the client, this configuration has the overhead of a poll round trip for every pushed message or small batch of messages queued between polls. Most applications are not pushing data so frequently for this to be a problem.
The Servlet API uses blocking IO, so you must define an upper bound for the number of long poll requests parked on the server at any single instant. If your number of clients exceeds this limit, the excess clients devolve to simple polling on the default 3- second interval with no server wait.
For example, if you server request handler thread pool has a size of 500, you could set the upper bound for waited polls to 250, 300, or 400 depending on the relative amount of non-poll requests you expect to service concurrently.

2. StreamingAMFChannel/Endpoint (in a channel set followed by the polling AMFChannel for fallback)
Benifits:
No polling overhead associated with pushing messages to the client.
Uses standard HTTP ports so firewalls do not interfere and all requests/responses are HTTP so packet inspecting proxies won’t drop the packets.
Disadvantages:
Holding onto the open request on the server and writing an infinite response is not typical HTTP behavior. HTTP proxies that buffer responses before forwarding them can effectively consume the stream. Assign the channel’s ‘connect-timeout-seconds’ property a value of 2 or 3 to detect this and trigger fallback to the next channel in your channel set.
No support for HTTP 1.0 client. If the client is 1.0, the open request is faulted and the client falls back to the next channel in its channel set.
The Servlet API uses blocking IO so as with long polling above, you must set a configured upper bound on the number of streaming connections you allow. Clients that exceed this limit are not able to open a streaming connection and will fall back to the next channel in their channel set.

3. AMFChannel/Endpoint with simple polling and piggybacking enabled (no fallback needed)
Benifits:
Valid HTTP request/response pattern over standard ports that nothing in the network path will have trouble with.
User experience feels more real-time than with simple polling on an interval.
Does not have thread resource constraints like long polling and streaming due to the blocking IO of the Servlet API.
Disadvantages:
Less real-time behavior than long polling or streaming. Requires client interaction with the
server to receive pushed data faster than the channel's configured polling interval.

 



]]>
BlazeDS Study Notes -- Achitecturehttp://m.tkk7.com/fastzch/archive/2010/04/03/317413.htmlRobin's Java WorldRobin's Java WorldSat, 03 Apr 2010 14:31:00 GMThttp://m.tkk7.com/fastzch/archive/2010/04/03/317413.htmlhttp://m.tkk7.com/fastzch/comments/317413.htmlhttp://m.tkk7.com/fastzch/archive/2010/04/03/317413.html#Feedback0http://m.tkk7.com/fastzch/comments/commentRss/317413.htmlhttp://m.tkk7.com/fastzch/services/trackbacks/317413.html Channels and channel sets
A Flex component uses a channel to communicate with a BlazeDS server. A channel set contains channels; its primary function is to provide connectivity between the Flex client and the BlazeDS server. A channel set contains channels ordered by preference. The Flex component tries to connect to the first channel in the channel set and in the case where a connection cannot be established falls back to the next channel in the list. The Flex component continues to go through the list of channels in the order in which they are specified until a connection can be established over one of the channels or the list of channels is exhausted.
Flex clients can use different channel types such as the AMFChannel and HTTPChannel. Channel selection depends on a number of factors, including the type of application you are building. If non-binary data transfer is required, you would use the HTTPChannel, which uses a non-binary format called AMFX (AMF in XML).

Messages
All messages have client-side (ActionScript) implementations and server-side (Java) implementations because the messages are serialized and deserialized on both the client and the server.

Endpoint
 It is important that the channel and the endpoint use the same message format.

MessageBroker
The MessageBroker is responsible for routing messages to services and is at the core of BlazeDS on the server. After an endpoint initially processes the request, it extracts the message from the request and passes it to the MessageBroker. The MessageBroker inspects the message's destination and passes the message to its intended service. If the destination is protected by a security constraint, the MessageBroker runs the authentication and authorization checks before passing the message along

Services and destinations
Services and destinations are the next links in the message processing chain in the BlazeDS server. The system includes four services and their corresponding destinationsBlazeDS:
•     RemotingService and RemotingDestination
•     HTPProxyService and HTTPProxyDestination
•     MessageService and MessageDestination
Services are the targets of messages from client-side Flex components. Think of destinations as instances of a service configured in a certain way. For example, a RemoteObject component is used on the Flex client to communicate with the RemotingService. In the RemoteObject component, you must specify a destination  id  property that refers to a remoting destination with certain properties, such as the class you want to invoke methods on. The mapping between client-side Flex components and BlazeDS services is as follows:
•     HTTPService and WebService communicate with HTTPProxyService/HTTPProxyDestination         (RPC services)
•     RemoteObject communicates with RemotingService/RemotingDestination    (RPC services)
•     Producer and Consumer communicate with MessageService/MessageDestination   (Message services)


Adapters and assemblers
Although the BlazeDS server comes with a rich set of adapters and assemblers to communicate with different systems, custom adapters and assemblers can be plugged into the BlazeDS server. Similarly, you do not have to create all destinations in configuration files, but instead you can create them dynamically at server startup or when the server is running.


Configuration tokens
The configuration files sometimes contain special  {server.name}  and  {server.port}  tokens. These tokens are replaced with server name and port values based on the URL from which the SWF file is served when it is accessed through a web browser from a web server. Similarly, a special  {context.root}  token is replaced with the actual context root of a web application.
Note: If you use server tokens in a configuration file for an Adobe AIR application and you compile using that file, the application will not be able to connect to the server. You can avoid this issue by configuring channels in ActionScript rather than in a configuration file.

How you define JVM options depends on the application server you use. For example, in Apache Tomcat, you can define an environment variable JAVA_OPTS that contains tokens and their values, as this code snippet shows:
JAVA_OPTS=-Dmessaging.channel=my-amf -Dmy.token=myValue

 



]]>
BlazeDS Study Notes -- Building Projecthttp://m.tkk7.com/fastzch/archive/2010/04/01/317237.htmlRobin's Java WorldRobin's Java WorldThu, 01 Apr 2010 14:31:00 GMThttp://m.tkk7.com/fastzch/archive/2010/04/01/317237.htmlhttp://m.tkk7.com/fastzch/comments/317237.htmlhttp://m.tkk7.com/fastzch/archive/2010/04/01/317237.html#Feedback0http://m.tkk7.com/fastzch/comments/commentRss/317237.htmlhttp://m.tkk7.com/fastzch/services/trackbacks/317237.htmlBuild client-side application notes:
1, Specifying the services-config.xml file in a compilation
When you compile your Flex application, you typically specify the services-config.xml configuration file to the compiler. This file defines the channel URLs that the client-side Flex application uses to communicate with the BlazeDS server. Then the channel URLs are compiled into the resultant SWF file.
Both client-side and server-side code use the services-config.xml configuration file. If you change anything in services-config.xml, you usually have to recompile your client-side applications and restart your server-side application for the changes to take effect.
In Flex Builder, the appropriate services-config.xml file is included automatically based on the BlazeDS web application that you specified in the configuration of your Flex Builder project. When you use the mxmlc compiler, use the  services  option to specify the location of the file.
Note: You can also create channel definitions at run time in ActionScript. In that case, you might be able to omit the reference to the services-config.xml configuration file from the compiler.
2, Specifying the context root in a compilation
The services-config.xml configuration file typically uses the  context.root  token to specify the context root of a
web application. At compile time, you use the compiler  context-root  option to specify that information.
During a compilation, Flex Builder automatically sets the value of the  context.root  token based on the BlazeDS
web application that you specified in the configuration of your project. When you use the mxmlc compiler, use the
context-root  option to set it.

 
How to create a Flash Builder project?
Use this procedure to create a Flex Builder project to edit one of the samples shipped with the Test Drive application.
The procedure for creating and configuring a new project is almost the same as the following procedure.
1     Start Flex Builder.
2     Select File > New > Flex Project.
3     Enter a project name. You are editing an existing application, so use the exact name of the sample folder:
testdrive-chat.
Note: If you are creating an empty project, you can name it anything that you want.
4     If you unzipped flex-src.zip in the samples directory, deselect the Use Default Location option, and specify the directory as C:\blazeds\tomcat\webapps\samples\testdrive-chat, or wherever you unzipped the file on your computer.
Note: By default, Flex Builder creates the project directory based on the project name and operating system. For example, if you are using the plug-in configuration of Flex Builder on Microsoft Windows, the default project directory is C:\Documents and Settings\USER_NAME\workspace\PROJECT_NAME.
5     Select the application type as Web application (runs in Flash Player) to configure the application to run in the browser as a Flash Player pplication.
If you are creating an AIR application, select Desktop Application (Runs In Adobe AIR). However, make sure that you do not have any server tokens in URLs in the configuration files. In the web application that ships with BlazeDS, server tokens are used in the channel endpoint URLs in the WEB-INF/flex/services-config.xml file, as the following example shows:
<endpoint
url="https://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf"
      class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
You would change that line to the following:
<endpoint url="http://your_server_name:8400/samples/messagebroker/streamingamf"
      class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
6     Select J2EE as the Application server type.
7     Select Use Remote Object Access.
8     Select LiveCycle Data Services.
9     If the option is available, deselect Create Combined Java/Flex Project With WTP.
10  Click Next.
11  Deselect Use Default Location For Local LiveCycle Data Services Server.
12  Set the root folder, root URL, and context root of your web application.
The root folder specifies the top-level directory of the web application (the directory that contains the WEB-INF directory). The root URL specifies the URL of the web application, and the context root specifies the root of the web application.
13  Make sure that your BlazeDS server is running, and click Validate Configuration to ensure that your project is valid.
14  Verify that the Compile The Application Locally In Flex Builder option is selected.
15  Clear the Output Folder field to set the directory of the compiled SWF file to the main project directory.
By default, Flex Builder writes the compiled SWF file to the bin-debug directory under the main project directory. To use a different output directory, specify it in the Output Folder field.
16  Click Next.
17  Set the name of the main application file to Chat.mxml, and click Finish.

 

 Client-side logging
For client-side logging, you directly write messages to the log file, or configure the application to write messages generated by Flex to the log file. Flash Debug Player has two primary methods of writing messages to a log file:
?     The global  trace()  method. The global trace() method prints a String to the log file. Messages can contain checkpoint information to signal that your application reached a specific line of code, or the value of a variable.
?     Logging API. The logging API, implemented by the TraceTarget class, provides a layer of functionality on top of the  trace()  method. For example, you can use the logging API to log debug, error, and warning messages generated by Flex while applications execute.
Flash Debug Player sends logging information to the flashlog.txt file. The operating system determines the location of this file, as the following table shows:
Use settings in the mm.cfg text file to configure Flash Debug Player for logging. If this file does not exist, you can create it when you first configure Flash Debug Player. The location of this file depends on your operating system.
The following table shows where to create the mm.cfg file for several operating systems:
The mm.cfg file contains many settings that you can use to control logging. The following sample mm.cfg file enables error reporting and trace logging:
ErrorReportingEnable=1
TraceOutputFileEnable=1
After you enable reporting and logging, call the  trace()  method to write a String to the flashlog.txt file, as the
following example shows:
trace("Got to checkpoint 1.");
Insert the following MXML line to enable the logging of all Flex-generated debug messages to flashlog.txt:
<mx:TraceTarget loglevel="2"/>

Server-side logging
You configure server-side logging in the logging section of the services configuration file, services-config.xml. By default, output is sent to System.out.
You set the logging level to one of the following available levels:
?     All
?     Debug
?     Info
?     Warn
?     Error
?     None
You typically set the server-side logging level to  Debug  to log all debug messages, and also all info, warning, and error messages. The following example shows a logging configuration that uses the  Debug  logging level:
<logging>
<!-- You may also use flex.messaging.log.ServletLogTarget. -->
<target class="flex.messaging.log.ConsoleTarget" level="Debug">
<properties>
<prefix>[Flex]</prefix>
<includeDate>false</includeDate>
<includeTime>false</includeTime>
<includeLevel>false</includeLevel>
<includeCategory>false</includeCategory>
</properties>
<filters>
<pattern>Endpoint</pattern>
<!--<pattern>Service.*</pattern>-->
<!--<pattern>Message.*</pattern>-->
</filters>
</target>
</logging>

 

 

You use two parameters in a channel definition to enable message processing metrics:
     <record-message-times> 
     <record-message-sizes> 
Set these parameters to  true  or  false ; the default value is  false . You can set the parameters to different values to capture only one type of metric. For example, the following channel definition specifies to capture message timing
information, but not message sizing information:
<channel-definition id="my-streaming-amf"
class="mx.messaging.channels.StreamingAMFChannel">
<endpoint
url="http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf"
class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
 <properties>
  <record-message-times>true</record-message-times>
  <record-message-sizes>false</record-message-sizes>
 </properties>
</channel-definition>



]]>
BlazeDS Study Notes -- Overview & Conceptshttp://m.tkk7.com/fastzch/archive/2010/03/31/317033.htmlRobin's Java WorldRobin's Java WorldWed, 31 Mar 2010 04:19:00 GMThttp://m.tkk7.com/fastzch/archive/2010/03/31/317033.htmlhttp://m.tkk7.com/fastzch/comments/317033.htmlhttp://m.tkk7.com/fastzch/archive/2010/03/31/317033.html#Feedback1http://m.tkk7.com/fastzch/comments/commentRss/317033.htmlhttp://m.tkk7.com/fastzch/services/trackbacks/317033.htmlFlex and AIR applications use Flex components to communicate with the BlazeDS server, including the RemoteObject, HTTPService, WebService, Producer, and Consumer components. The HTTPService, WebService, Producer, and Consumer components are part of the Flex Software Development Kit (SDK).

What's Producer?

The BlazeDS core features include the RPC services and the Messaging Service.
You can access data through client-side RPC components that include HTTP GET or POST (HTTP services), SOAP (web services), or Java objects (remote object services).
BlazeDS lets you use RemoteObject components to access remote Java objects without configuring them as SOAP-compliant web services.

Client applications that send messages are called message producers. You define a producer in a Flex application by using the Producer component. Client applications that receive messages are called message consumers. You define a consumer in a Flex application by using the Consumer component. A Consumer component subscribes to a server-side destination and receives messages that a Producer component sends to that destination. For more information on messaging, see Using the Messaging Service.


BlazeDS uses a message-based framework to send data back and forth between the client and server. BlazeDS uses two primary exchange patterns between server and client. In the first pattern, the request-response pattern, the second pattern is the publish-subscribe pattern where the server routes published messages to the set of clients that have subscribed to receive them.

 

To send messages across the network, the client uses channels. A channel encapsulates message formats, network protocols, and network behaviors to decouple them from services, destinations, and application code. A channel formats and translates messages into a network-specific form and delivers them to an endpoint on the server. 

 


Channels communicate with Java-based endpoints on the server. An endpoint unmarshals messages in a protocol-specific manner and then passes the messages in generic Java form to the message broker. The message broker determines where to send messages, and routes them to the appropriate service destination.
BlazeDS includes several types of channels, including standard and secure Action Message Format (AMF) channels and HTTP (AMFX) channels. AMF and HTTP channels support non-polling request-response patterns and client polling patterns to simulate real-time messaging. The streaming AMF and HTTP channels provide true data streaming for real-time messaging. 

 

 Configure an existing J2EE web application to support BlazeDS by performing the following steps: 
 1, Add the BlazeDS JAR files and dependent JAR files to the WEB-INF/lib directory. 
2, Edit the BlazeDS configuration files in the WEB-INF/flex directory. 
3, Define MessageBrokerServlet and a session listener in WEB-INF/web.xml.



]]>
Flash Performance Issue in None-activeX Architecture -- stutter soundhttp://m.tkk7.com/fastzch/archive/2010/03/05/314592.htmlRobin's Java WorldRobin's Java WorldFri, 05 Mar 2010 04:15:00 GMThttp://m.tkk7.com/fastzch/archive/2010/03/05/314592.htmlhttp://m.tkk7.com/fastzch/comments/314592.htmlhttp://m.tkk7.com/fastzch/archive/2010/03/05/314592.html#Feedback0http://m.tkk7.com/fastzch/comments/commentRss/314592.htmlhttp://m.tkk7.com/fastzch/services/trackbacks/314592.html
The root cause of this issue is used to extract method of Sound class for retract samples, and then play by extracted samples. You may ask me, why don't use play method of Sound class directly? I think I only answer you that it's business requirements.

Following are my test code:
package {
    
import flash.events.Event;
    
import flash.events.SampleDataEvent;
    
import flash.media.Sound;
    
import flash.net.URLRequest;
    
import flash.system.System;
    
import flash.utils.ByteArray;

    
public class Extract {
        
private var sourceSnd:Sound = new Sound();
        
private var outputSnd:Sound = new Sound();
        
private var urlReq:URLRequest = new URLRequest("11k.mp3"); //this file has 575 frames
        
//        private var urlReq:URLRequest = new URLRequest("44k.mp3");  //this file has 1150 frames
        private var samplesCount:uint = 0;

        
public function play():void {
            sourceSnd.load(urlReq);
            
//            sourceSnd.play(); // if use source sound to playing, we will not be got machine gun sound.
            sourceSnd.addEventListener(Event.COMPLETE, loaded); //use this approach, we will be got stutter.
        }


        
private function loaded(event:Event):void {
            outputSnd.addEventListener(SampleDataEvent.SAMPLE_DATA, processSound);
            outputSnd.play();
        }


        
private function processSound(event:SampleDataEvent):void {
            var bytes:ByteArray 
= new ByteArray();
            var samplesPerTime:uint 
= sourceSnd.extract(bytes, 8192);
            samplesCount 
+= samplesPerTime;
            
//            trace("samplesCount:" + samplesCount + ",samplesPerTime:" + samplesPerTime);
            event.data.writeBytes(bytes);
            
//            flash.system.System.gc();
        }


    }

}

You can refer to following test steps for reproduce stutter/machine gun sound issue:
 
1, Run/debug test application in Firefox, you will get smooth sound at once.
 
2, Open a new tab in the same window, and open a heavy load web page (for example: http://www.taobao.com)
 
3, You will get stutter when a heavy load page is loading.

If you interest in this problem also, we can study it together.


]]>
Sound Extract Method Studyhttp://m.tkk7.com/fastzch/archive/2009/12/15/305917.htmlRobin's Java WorldRobin's Java WorldTue, 15 Dec 2009 04:50:00 GMThttp://m.tkk7.com/fastzch/archive/2009/12/15/305917.htmlhttp://m.tkk7.com/fastzch/comments/305917.htmlhttp://m.tkk7.com/fastzch/archive/2009/12/15/305917.html#Feedback2http://m.tkk7.com/fastzch/comments/commentRss/305917.htmlhttp://m.tkk7.com/fastzch/services/trackbacks/305917.html The extract method like a black box, we can't know what does it do.

1, Extract low sample rate sound will be get more samples, I can't understand that why like this. I know that it will transfer all kind of sample rate to 44.1KHz, but we can't know that how to transfer?

2, MPEG wave data is not bound to a single frame, so we need overlap some frames in a SWF sound what the sound compose of some frames. the overlap size is an experience value, in general, I set it as 7 frames. The value is depend your parse frames and detail extract algorithm sometimes. Anyway, 7 is my recommendation value.

3, This method can provide some very useful function with SoundMixer class for extend your application. For instance, show wave shape, add some effect, etc.
There is a sample for show waveform:
http://www.bytearray.org/?p=329

At last, I strong recommend an open source project, this project is a stream player based on Flex platform.
http://code.google.com/p/as3mp3streamplayer/

If you had deeply researched at this method, please communication with me. thank you!
 



]]>
主站蜘蛛池模板: 亚洲黄色免费电影| 国产亚洲精品影视在线产品 | 国产精品公开免费视频| 欧洲乱码伦视频免费国产| 亚洲av无码一区二区乱子伦as| 日本免费一区二区在线观看| 亚洲av永久无码精品网址| 亚洲欧洲日产国码av系列天堂| 国产免费的野战视频| 男人j进女人p免费视频| 777亚洲精品乱码久久久久久 | 亚洲国产日韩在线成人蜜芽| 免费观看四虎精品国产永久| 日本免费在线中文字幕| 亚洲国产精品自在自线观看| 国产亚洲精品无码成人| 成人性生交大片免费看午夜a| 中文字幕无码毛片免费看| 亚洲中文字幕久久精品蜜桃| 亚洲精品国产精品乱码不卡√| 黑人粗长大战亚洲女2021国产精品成人免费视频 | 国产亚洲精品不卡在线| 黄色网址免费观看| 国产久爱免费精品视频| 亚洲中文字幕一二三四区苍井空 | 97公开免费视频| 日本免费精品一区二区三区| 亚洲国产av一区二区三区丶| 中文字幕亚洲不卡在线亚瑟| 两个人的视频高清在线观看免费| 一级有奶水毛片免费看| 亚洲av永久无码精品秋霞电影秋 | 老汉色老汉首页a亚洲| 亚洲av高清在线观看一区二区 | 免费人成视频在线观看不卡| 亚色九九九全国免费视频| 一区二区三区无码视频免费福利 | 日韩国产精品亚洲а∨天堂免| 亚洲色成人网一二三区| 亚洲精品成人无码中文毛片不卡| 国产成人精品男人免费|