Repository: flex-blazeds Updated Branches: refs/heads/4.8.0 5be16a282 -> 012fad7c7
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/team/features/messaging/sendsubscribeconstraint/messaging_AMF_Poll_SendSubscribeConstraint.mxml ---------------------------------------------------------------------- diff --git a/attic/apps/team/features/messaging/sendsubscribeconstraint/messaging_AMF_Poll_SendSubscribeConstraint.mxml b/attic/apps/team/features/messaging/sendsubscribeconstraint/messaging_AMF_Poll_SendSubscribeConstraint.mxml index 8d50c15..a1c8fa5 100755 --- a/attic/apps/team/features/messaging/sendsubscribeconstraint/messaging_AMF_Poll_SendSubscribeConstraint.mxml +++ b/attic/apps/team/features/messaging/sendsubscribeconstraint/messaging_AMF_Poll_SendSubscribeConstraint.mxml @@ -1,104 +1,104 @@ -<?xml version="1.0"?> -<!-- - - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" - creationComplete="creationCompleteHandler();"> - - <!-- An example that uses a destination protected by send and subscribe constraint --> - <mx:Panel id="mainPanel" height="100%" width="100%"> - <mx:HBox> - <mx:Label text="Producer"/> - <mx:Button label="Send Foo{counter}" click="sendMessage()"/> - <mx:Button label="Disconnect" click="producer.disconnect();" enabled="{producer.connected}"/> - <mx:CheckBox label="Connected?" selected="{producer.connected}"/> - </mx:HBox> - <mx:HBox> - <mx:Label text="Consumer"/> - <mx:Button label="Subcribe" click="consumer.subscribe();" enabled="{!consumer.subscribed}"/> - <mx:Button label="Unsubscribe" click="consumer.unsubscribe();" enabled="{consumer.subscribed}"/> - <mx:Button label="Disconnect" click="consumer.disconnect();" enabled="{consumer.connected}"/> - <mx:Button label="Logout" click="consumer.logout()" enabled="{consumer.authenticated}"/> - <mx:CheckBox label="Connected?" selected="{consumer.connected}"/> - <mx:CheckBox label="Subscribed?" selected="{consumer.subscribed}"/> - </mx:HBox> - <mx:Button label="Reset credentials" click="setCredentials()"/> - <mx:Button label="Clear" click='ta.text = ""'/> - <mx:TextArea id="ta" width="100%" height="100%"/> - </mx:Panel> - - <mx:Producer id="producer" - destination="messaging_AMF_Poll_SendSubscribeConstraint" - fault="faultHandler(event)"/> - - <mx:Consumer id="consumer" - destination="messaging_AMF_Poll_SendSubscribeConstraint" - fault="faultHandler(event)" - message="messageHandler(event)"/> - - <mx:Script> - <![CDATA[ - import mx.messaging.events.MessageFaultEvent; - import mx.messaging.events.MessageEvent; - import mx.messaging.messages.AsyncMessage; - import mx.messaging.Producer; - import mx.messaging.Consumer; - - import mx.logging.Log; - import mx.logging.targets.TraceTarget; - - [Bindable] - public var counter:int = 0; - - private function creationCompleteHandler():void - { - var target:TraceTarget = new TraceTarget(); - target.includeLevel = true; - target.filters = ["mx.messaging.*", "mx.rpc.*"]; - Log.addTarget(target); - - // Set credentials as the destination is protected by send and - // subscribe constraints. - setCredentials(); - } - - private function setCredentials():void - { - producer.setCredentials("sampleuser", "samplepassword"); - consumer.setCredentials("sampleuser", "samplepassword"); - } - - private function sendMessage():void - { - var msg:AsyncMessage = new AsyncMessage(); - msg.body = "Foo" + counter++; - producer.send(msg); - } - - private function messageHandler(event:MessageEvent):void - { - ta.text += "Consumer received message: "+ event.message.body + "\n"; - } - - private function faultHandler(event:MessageFaultEvent):void - { - ta.text += "Received fault: " + event.faultString + "\n"; - } - ]]> - </mx:Script> +<?xml version="1.0"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" + creationComplete="creationCompleteHandler();"> + + <!-- An example that uses a destination protected by send and subscribe constraint --> + <mx:Panel id="mainPanel" height="100%" width="100%"> + <mx:HBox> + <mx:Label text="Producer"/> + <mx:Button label="Send Foo{counter}" click="sendMessage()"/> + <mx:Button label="Disconnect" click="producer.disconnect();" enabled="{producer.connected}"/> + <mx:CheckBox label="Connected?" selected="{producer.connected}"/> + </mx:HBox> + <mx:HBox> + <mx:Label text="Consumer"/> + <mx:Button label="Subcribe" click="consumer.subscribe();" enabled="{!consumer.subscribed}"/> + <mx:Button label="Unsubscribe" click="consumer.unsubscribe();" enabled="{consumer.subscribed}"/> + <mx:Button label="Disconnect" click="consumer.disconnect();" enabled="{consumer.connected}"/> + <mx:Button label="Logout" click="consumer.logout()" enabled="{consumer.authenticated}"/> + <mx:CheckBox label="Connected?" selected="{consumer.connected}"/> + <mx:CheckBox label="Subscribed?" selected="{consumer.subscribed}"/> + </mx:HBox> + <mx:Button label="Reset credentials" click="setCredentials()"/> + <mx:Button label="Clear" click='ta.text = ""'/> + <mx:TextArea id="ta" width="100%" height="100%"/> + </mx:Panel> + + <mx:Producer id="producer" + destination="messaging_AMF_Poll_SendSubscribeConstraint" + fault="faultHandler(event)"/> + + <mx:Consumer id="consumer" + destination="messaging_AMF_Poll_SendSubscribeConstraint" + fault="faultHandler(event)" + message="messageHandler(event)"/> + + <mx:Script> + <![CDATA[ + import mx.messaging.events.MessageFaultEvent; + import mx.messaging.events.MessageEvent; + import mx.messaging.messages.AsyncMessage; + import mx.messaging.Producer; + import mx.messaging.Consumer; + + import mx.logging.Log; + import mx.logging.targets.TraceTarget; + + [Bindable] + public var counter:int = 0; + + private function creationCompleteHandler():void + { + var target:TraceTarget = new TraceTarget(); + target.includeLevel = true; + target.filters = ["mx.messaging.*", "mx.rpc.*"]; + Log.addTarget(target); + + // Set credentials as the destination is protected by send and + // subscribe constraints. + setCredentials(); + } + + private function setCredentials():void + { + producer.setCredentials("sampleuser", "samplepassword"); + consumer.setCredentials("sampleuser", "samplepassword"); + } + + private function sendMessage():void + { + var msg:AsyncMessage = new AsyncMessage(); + msg.body = "Foo" + counter++; + producer.send(msg); + } + + private function messageHandler(event:MessageEvent):void + { + ta.text += "Consumer received message: "+ event.message.body + "\n"; + } + + private function faultHandler(event:MessageFaultEvent):void + { + ta.text += "Received fault: " + event.faultString + "\n"; + } + ]]> + </mx:Script> </mx:Application> \ No newline at end of file
