flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [30/51] [partial] BlazeDS Donation from Adobe Systems Inc
Date Fri, 25 Apr 2014 05:34:28 GMT
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/testdrive-httpservice/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-httpservice/build.xml b/apps/samples/WEB-INF/flex-src/testdrive-httpservice/build.xml
new file mode 100755
index 0000000..fb5da7d
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-httpservice/build.xml
@@ -0,0 +1,81 @@
+<?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.
+
+-->
+<project name="samples.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples.war" value="${basedir}/apps/samples"/>
+    <property name="context.root" value="samples" />
+    <property name="application.name" value="Testdrive - HTTPService" />
+    <property name="application.file" value="main" />
+    <property name="application.bin.dir" value="${samples.war}/testdrive-httpservice" />
+    <property name="application.src.dir" value="${samples.war}/WEB-INF/flex-src/testdrive-httpservice/src" />
+
+    <target name="main" depends="clean,compile-swf" />
+    
+    <target name="compile-swf">
+
+        <taskdef resource="flexTasks.tasks" classpath="${basedir}/ant/lib/flexTasks.jar" />
+        
+        <property name="FLEX_HOME" value="${basedir}"/>
+
+        <mxmlc file="${application.src.dir}/${application.file}.mxml" 
+            output="${application.bin.dir}/${application.file}.swf"
+            actionscript-file-encoding="UTF-8"
+            keep-generated-actionscript="false"
+            incremental="false"
+            services="${samples.war}/WEB-INF/flex/services-config.xml"
+            context-root="${context.root}" 
+            locale="en_US">
+            <load-config filename="${basedir}/frameworks/flex-config.xml"/>
+            <license product="flexbuilder3" serial-number="${env.fb3_license}"/>
+            <source-path path-element="${basedir}/frameworks"/>
+            <external-library-path/>
+            <metadata>
+                <publisher name="${manifest.Implementation-Vendor}" />
+                <creator name="${manifest.Implementation-Vendor}" />
+            </metadata>
+        </mxmlc>
+
+        <html-wrapper title="${application.name}"
+            height="100%"
+            width="100%"
+            application="app"
+            swf="${application.file}"
+            version-major="10"
+            version-minor="0"
+            version-revision="0"
+            express-install="true"
+            output="${application.bin.dir}"/>
+
+        <copy todir="${application.bin.dir}">
+            <fileset dir="${application.src.dir}" includes="*.jsp"/>
+        </copy>
+        
+    </target>
+
+    <target name="clean" description="--> Removes jars and classes">
+        <delete quiet="true" includeemptydirs="true">
+            <fileset dir="${application.bin.dir}" includes="*.swf,index.html,*.jsp"/>
+            <fileset dir="${application.bin.dir}/history" />
+        </delete>
+    </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/testdrive-httpservice/src/catalog.jsp
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-httpservice/src/catalog.jsp b/apps/samples/WEB-INF/flex-src/testdrive-httpservice/src/catalog.jsp
new file mode 100755
index 0000000..eb86d2b
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-httpservice/src/catalog.jsp
@@ -0,0 +1,42 @@
+<!--
+  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.
+-->
+<%@page import="flex.samples.product.ProductService, 
+				flex.samples.product.Product, 
+				java.util.List"%>
+<?xml version="1.0" encoding="utf-8"?>
+<catalog>
+<%
+	ProductService srv = new ProductService();
+	List list = null;
+	list = srv.getProducts();
+	Product product;
+	for (int i=0; i<list.size(); i++)
+	{
+		product = (Product) list.get(i);
+%>	
+    <product productId="<%= product.getProductId()%>">
+        <name><%= product.getName() %></name>
+        <description><%= product.getDescription() %></description>
+        <price><%= product.getPrice() %></price>
+        <image><%= product.getImage() %></image>
+        <category><%= product.getCategory() %></category>
+        <qtyInStock><%= product.getQtyInStock() %></qtyInStock>
+    </product>
+<%
+	}
+%>
+</catalog>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/testdrive-httpservice/src/main.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-httpservice/src/main.mxml b/apps/samples/WEB-INF/flex-src/testdrive-httpservice/src/main.mxml
new file mode 100755
index 0000000..609130b
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-httpservice/src/main.mxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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" backgroundColor="#FFFFFF">
+	
+	<mx:HTTPService id="srv" destination="catalog" useProxy="true"/>
+
+	<mx:DataGrid dataProvider="{srv.lastResult.catalog.product}" width="100%" height="100%"/> 
+	
+	<mx:Button label="Get Data" click="srv.send()"/>
+	
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/testdrive-remoteobject/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-remoteobject/build.xml b/apps/samples/WEB-INF/flex-src/testdrive-remoteobject/build.xml
new file mode 100755
index 0000000..198f89f
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-remoteobject/build.xml
@@ -0,0 +1,77 @@
+<?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.
+
+-->
+<project name="samples.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples.war" value="${basedir}/apps/samples"/>
+    <property name="context.root" value="samples" />
+    <property name="application.name" value="Testdrive - RemoteObject" />
+    <property name="application.file" value="main" />
+    <property name="application.bin.dir" value="${samples.war}/testdrive-remoteobject" />
+    <property name="application.src.dir" value="${samples.war}/WEB-INF/flex-src/testdrive-remoteobject/src" />
+
+    <target name="main" depends="clean,compile-swf" />
+    
+    <target name="compile-swf">
+
+        <taskdef resource="flexTasks.tasks" classpath="${basedir}/ant/lib/flexTasks.jar" />
+        
+        <property name="FLEX_HOME" value="${basedir}"/>
+
+        <mxmlc file="${application.src.dir}/${application.file}.mxml" 
+            output="${application.bin.dir}/${application.file}.swf"
+            actionscript-file-encoding="UTF-8"
+            keep-generated-actionscript="false"
+            incremental="false"
+            services="${samples.war}/WEB-INF/flex/services-config.xml"
+            context-root="${context.root}" 
+            locale="en_US">
+            <load-config filename="${basedir}/frameworks/flex-config.xml"/>
+            <license product="flexbuilder3" serial-number="${env.fb3_license}"/>
+            <source-path path-element="${basedir}/frameworks"/>
+            <external-library-path/>
+            <metadata>
+                <publisher name="${manifest.Implementation-Vendor}" />
+                <creator name="${manifest.Implementation-Vendor}" />
+            </metadata>
+        </mxmlc>
+
+        <html-wrapper title="${application.name}"
+            height="100%"
+            width="100%"
+            application="app"
+            swf="${application.file}"
+            version-major="10"
+            version-minor="0"
+            version-revision="0"
+            express-install="true"
+            output="${application.bin.dir}"/>
+
+    </target>
+
+    <target name="clean" description="--> Removes jars and classes">
+        <delete quiet="true" includeemptydirs="true">
+            <fileset dir="${application.bin.dir}" includes="*.swf,index.html"/>
+            <fileset dir="${application.bin.dir}/history" />
+        </delete>
+    </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/testdrive-remoteobject/src/main.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-remoteobject/src/main.mxml b/apps/samples/WEB-INF/flex-src/testdrive-remoteobject/src/main.mxml
new file mode 100755
index 0000000..43d8fb6
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-remoteobject/src/main.mxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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" backgroundColor="#FFFFFF">
+	
+	<mx:RemoteObject id="srv" destination="product"/>
+	
+	<mx:DataGrid dataProvider="{srv.getProducts.lastResult}" width="100%" height="100%"/> 
+
+	<mx:Button label="Get Data" click="srv.getProducts()"/>	
+		
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/testdrive-update/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-update/build.xml b/apps/samples/WEB-INF/flex-src/testdrive-update/build.xml
new file mode 100755
index 0000000..540070c
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-update/build.xml
@@ -0,0 +1,77 @@
+<?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.
+
+-->
+<project name="samples.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples.war" value="${basedir}/apps/samples"/>
+    <property name="context.root" value="samples" />
+    <property name="application.name" value="Testdrive - Update" />
+    <property name="application.file" value="main" />
+    <property name="application.bin.dir" value="${samples.war}/testdrive-update" />
+    <property name="application.src.dir" value="${samples.war}/WEB-INF/flex-src/testdrive-update/src" />
+
+    <target name="main" depends="clean,compile-swf" />
+    
+    <target name="compile-swf">
+
+        <taskdef resource="flexTasks.tasks" classpath="${basedir}/ant/lib/flexTasks.jar" />
+        
+        <property name="FLEX_HOME" value="${basedir}"/>
+
+        <mxmlc file="${application.src.dir}/${application.file}.mxml" 
+            output="${application.bin.dir}/${application.file}.swf"
+            actionscript-file-encoding="UTF-8"
+            keep-generated-actionscript="false"
+            incremental="false"
+            services="${samples.war}/WEB-INF/flex/services-config.xml"
+            context-root="${context.root}" 
+            locale="en_US">
+            <load-config filename="${basedir}/frameworks/flex-config.xml"/>
+            <license product="flexbuilder3" serial-number="${env.fb3_license}"/>
+            <source-path path-element="${basedir}/frameworks"/>
+            <external-library-path/>
+            <metadata>
+                <publisher name="${manifest.Implementation-Vendor}" />
+                <creator name="${manifest.Implementation-Vendor}" />
+            </metadata>
+        </mxmlc>
+
+        <html-wrapper title="${application.name}"
+            height="100%"
+            width="100%"
+            application="app"
+            swf="${application.file}"
+            version-major="10"
+            version-minor="0"
+            version-revision="0"
+            express-install="true"
+            output="${application.bin.dir}"/>
+
+    </target>
+
+    <target name="clean" description="--> Removes jars and classes">
+        <delete quiet="true" includeemptydirs="true">
+            <fileset dir="${application.bin.dir}" includes="*.swf,index.html"/>
+            <fileset dir="${application.bin.dir}/history" />
+        </delete>
+    </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/testdrive-update/src/Product.as
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-update/src/Product.as b/apps/samples/WEB-INF/flex-src/testdrive-update/src/Product.as
new file mode 100755
index 0000000..abd704b
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-update/src/Product.as
@@ -0,0 +1,44 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package
+{
+	[Bindable]
+	[RemoteClass(alias="flex.samples.product.Product")]
+	public class Product
+	{
+		public function Product()
+		{
+		}
+
+		public var productId:int;
+
+		public var name:String;
+
+		public var description:String;
+
+		public var image:String;
+
+		public var category:String;
+
+		public var price:Number;
+
+		public var qtyInStock:int;
+
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/testdrive-update/src/ProductForm.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-update/src/ProductForm.mxml b/apps/samples/WEB-INF/flex-src/testdrive-update/src/ProductForm.mxml
new file mode 100755
index 0000000..911e2e8
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-update/src/ProductForm.mxml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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:Panel xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
+	title="Details" width="100%" height="100%">
+	
+	<Product id="product"
+		name="{productName.text}"
+		category="{category.text}"
+		price="{Number(price.text)}"
+		image="{image.text}"
+		description="{description.text}"/>
+
+	<mx:RemoteObject id="srv" destination="product"/>
+
+	<mx:Form width="100%">
+	
+		<mx:FormItem label="Name">
+			<mx:TextInput id="productName" text="{product.name}"/>
+		</mx:FormItem>
+	
+		<mx:FormItem label="Category">
+			<mx:TextInput id="category" text="{product.category}"/>
+		</mx:FormItem>
+		
+		<mx:FormItem label="Image">
+			<mx:TextInput id="image" text="{product.image}"/>
+		</mx:FormItem>
+		
+		<mx:FormItem label="Price">
+			<mx:TextInput id="price" text="{product.price}"/>
+		</mx:FormItem>
+	
+		<mx:FormItem label="Description" width="100%">
+			<mx:TextArea id="description" text="{product.description}" width="100%" height="100"/>
+		</mx:FormItem>
+		
+	</mx:Form>
+
+	<mx:ControlBar>
+		<mx:Button label="Update" click="srv.update(product);"/>
+	</mx:ControlBar>
+
+</mx:Panel>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/testdrive-update/src/main.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-update/src/main.mxml b/apps/samples/WEB-INF/flex-src/testdrive-update/src/main.mxml
new file mode 100755
index 0000000..5096478
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-update/src/main.mxml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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" xmlns="*" layout="horizontal"
+	creationComplete="srv.getProducts()">
+	
+	<mx:RemoteObject id="srv" destination="product"/>
+	
+	<mx:Panel title="Catalog" width="100%" height="100%">
+		<mx:DataGrid id="list" dataProvider="{srv.getProducts.lastResult}" width="100%" height="100%"/> 
+	</mx:Panel>
+	
+	<ProductForm product="{Product(list.selectedItem)}"/>
+	
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/testdrive-webservice/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-webservice/build.xml b/apps/samples/WEB-INF/flex-src/testdrive-webservice/build.xml
new file mode 100755
index 0000000..8f08dfa
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-webservice/build.xml
@@ -0,0 +1,81 @@
+<?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.
+
+-->
+<project name="samples.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples.war" value="${basedir}/apps/samples"/>
+    <property name="context.root" value="samples" />
+    <property name="application.name" value="Testdrive - WebService" />
+    <property name="application.file" value="main" />
+    <property name="application.bin.dir" value="${samples.war}/testdrive-webservice" />
+    <property name="application.src.dir" value="${samples.war}/WEB-INF/flex-src/testdrive-webservice/src" />
+
+    <target name="main" depends="clean,compile-swf" />
+    
+    <target name="compile-swf">
+
+        <taskdef resource="flexTasks.tasks" classpath="${basedir}/ant/lib/flexTasks.jar" />
+        
+        <property name="FLEX_HOME" value="${basedir}"/>
+
+        <mxmlc file="${application.src.dir}/${application.file}.mxml" 
+            output="${application.bin.dir}/${application.file}.swf"
+            actionscript-file-encoding="UTF-8"
+            keep-generated-actionscript="false"
+            incremental="false"
+            services="${samples.war}/WEB-INF/flex/services-config.xml"
+            context-root="${context.root}" 
+            locale="en_US">
+            <load-config filename="${basedir}/frameworks/flex-config.xml"/>
+            <license product="flexbuilder3" serial-number="${env.fb3_license}"/>
+            <source-path path-element="${basedir}/frameworks"/>
+            <external-library-path/>
+            <metadata>
+                <publisher name="${manifest.Implementation-Vendor}" />
+                <creator name="${manifest.Implementation-Vendor}" />
+            </metadata>
+        </mxmlc>
+
+        <html-wrapper title="${application.name}"
+            height="100%"
+            width="100%"
+            application="app"
+            swf="${application.file}"
+            version-major="10"
+            version-minor="0"
+            version-revision="0"
+            express-install="true"
+            output="${application.bin.dir}"/>
+
+        <copy todir="${application.bin.dir}">
+            <fileset dir="${application.src.dir}" includes="*.jsp"/>
+        </copy>
+        
+    </target>
+
+    <target name="clean" description="--> Removes jars and classes">
+        <delete quiet="true" includeemptydirs="true">
+            <fileset dir="${application.bin.dir}" includes="*.swf,index.html,*.jsp"/>
+            <fileset dir="${application.bin.dir}/history" />
+        </delete>
+    </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/testdrive-webservice/src/main.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-webservice/src/main.mxml b/apps/samples/WEB-INF/flex-src/testdrive-webservice/src/main.mxml
new file mode 100755
index 0000000..4208a96
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-webservice/src/main.mxml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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" backgroundColor="#FFFFFF">
+	
+	<mx:WebService id="srv" destination="ws-catalog" useProxy="true" showBusyCursor="true"/>
+	
+	<mx:DataGrid dataProvider="{srv.getCategories.lastResult}" width="100%" height="100%">
+		<mx:columns>
+			<mx:DataGridColumn dataField="categoryId" headerText="Category Id"/>
+			<mx:DataGridColumn dataField="categoryName" headerText="Category Name"/>
+		</mx:columns>
+	</mx:DataGrid>
+	
+	<mx:Button label="Get Data" click="srv.getCategories()"/>
+	
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/traderdesktop/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/traderdesktop/build.xml b/apps/samples/WEB-INF/flex-src/traderdesktop/build.xml
new file mode 100755
index 0000000..b27bf96
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/traderdesktop/build.xml
@@ -0,0 +1,81 @@
+<?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.
+
+-->
+<project name="samples.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples.war" value="${basedir}/apps/samples"/>
+    <property name="context.root" value="samples" />
+    <property name="application.name" value="Trader Desktop" />
+    <property name="application.file" value="traderdesktop" />
+    <property name="application.bin.dir" value="${samples.war}/traderdesktop" />
+    <property name="application.src.dir" value="${samples.war}/WEB-INF/flex-src/traderdesktop/src" />
+
+    <target name="main" depends="clean,compile-swf" />
+    
+    <target name="compile-swf">
+
+        <taskdef resource="flexTasks.tasks" classpath="${basedir}/ant/lib/flexTasks.jar" />
+        
+        <property name="FLEX_HOME" value="${basedir}"/>
+
+        <mxmlc file="${application.src.dir}/${application.file}.mxml" 
+            output="${application.bin.dir}/${application.file}.swf"
+            actionscript-file-encoding="UTF-8"
+            keep-generated-actionscript="false"
+            incremental="false"
+            services="${samples.war}/WEB-INF/flex/services-config.xml"
+            context-root="${context.root}" 
+            locale="en_US">
+            <load-config filename="${basedir}/frameworks/flex-config.xml"/>
+            <license product="flexbuilder3" serial-number="${env.fb3_license}"/>
+            <source-path path-element="${basedir}/frameworks"/>
+            <external-library-path/>
+            <metadata>
+                <publisher name="${manifest.Implementation-Vendor}" />
+                <creator name="${manifest.Implementation-Vendor}" />
+            </metadata>
+        </mxmlc>
+
+        <html-wrapper title="${application.name}"
+            height="100%"
+            width="100%"
+            application="app"
+            swf="${application.file}"
+            version-major="10"
+            version-minor="0"
+            version-revision="0"
+            express-install="true"
+            output="${application.bin.dir}"/>
+        
+        <copy todir="${application.bin.dir}">
+            <fileset dir="${application.src.dir}" includes="*.jsp"/>
+        </copy>
+        
+    </target>
+
+    <target name="clean" description="--> Removes jars and classes">
+        <delete quiet="true" includeemptydirs="true">
+            <fileset dir="${application.bin.dir}" includes="*.swf,index.html,*.jsp"/>
+            <fileset dir="${application.bin.dir}/history" />
+        </delete>
+    </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/traderdesktop/src/BackgroundColorRenderer.as
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/traderdesktop/src/BackgroundColorRenderer.as b/apps/samples/WEB-INF/flex-src/traderdesktop/src/BackgroundColorRenderer.as
new file mode 100755
index 0000000..d6245f7
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/traderdesktop/src/BackgroundColorRenderer.as
@@ -0,0 +1,55 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package {
+
+    import mx.controls.Label;
+    import flash.display.Graphics;
+
+	public class BackgroundColorRenderer extends Label {
+		
+		public static var symbol:String;
+
+		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+	 	{
+			super.updateDisplayList(unscaledWidth, unscaledHeight);
+	 		
+	 		var g:Graphics = graphics;
+	 		
+			g.clear();
+
+			if (data && data.date && data.symbol == symbol)
+			{
+				if( data.change && data.change >= 0 ) 
+				{
+					g.beginFill(0x009900, 0.5);
+					g.drawRect(0, 0, unscaledWidth, unscaledHeight);
+		 			g.endFill();
+				} 
+				else 
+				{
+					g.beginFill(0xFF0000, 0.5);
+					g.drawRect(0, 0, unscaledWidth, unscaledHeight);
+		 			g.endFill();
+				}
+			}
+
+		}
+  	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/traderdesktop/src/ColorRenderer.as
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/traderdesktop/src/ColorRenderer.as b/apps/samples/WEB-INF/flex-src/traderdesktop/src/ColorRenderer.as
new file mode 100755
index 0000000..93a6553
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/traderdesktop/src/ColorRenderer.as
@@ -0,0 +1,40 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package {
+
+    import mx.controls.Label;
+    import mx.controls.dataGridClasses.*;
+
+	public class ColorRenderer extends Label {
+
+		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+	 	{
+			super.updateDisplayList(unscaledWidth, unscaledHeight);
+			if (data && listData && data[DataGridListData(listData).dataField] < 0)
+			{
+	 			setStyle("color", 0xFF0000);
+	 	    }
+	 	    else
+	 	    {
+	 			setStyle("color", 0x009900);
+	 	    }
+		}
+  	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/traderdesktop/src/main.css
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/traderdesktop/src/main.css b/apps/samples/WEB-INF/flex-src/traderdesktop/src/main.css
new file mode 100755
index 0000000..fe9b240
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/traderdesktop/src/main.css
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+@namespace mx "library://ns.adobe.com/flex/mx";
+
+mx|Application { 
+	padding-top: 16;
+	padding-bottom: 16;
+	padding-left: 16;
+	padding-right: 16;
+	vertical-gap: 4;
+}
+mx|Panel
+{
+	borderColor: #006699;
+	borderAlpha: 0.6;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/traderdesktop/src/samples/portfolio/Stock.as
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/traderdesktop/src/samples/portfolio/Stock.as b/apps/samples/WEB-INF/flex-src/traderdesktop/src/samples/portfolio/Stock.as
new file mode 100755
index 0000000..6950d95
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/traderdesktop/src/samples/portfolio/Stock.as
@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package samples.portfolio
+{
+	[RemoteClass(alias="flex.samples.marketdata.Stock")]
+	[Bindable]
+	public class Stock
+	{	    
+		public var symbol:String;
+		public var name:String;
+		public var low:Number;
+		public var high:Number;
+		public var open:Number;
+		public var last:Number;
+		public var change:Number = 0;
+		public var date:Date;
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/traderdesktop/src/startfeed.jsp
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/traderdesktop/src/startfeed.jsp b/apps/samples/WEB-INF/flex-src/traderdesktop/src/startfeed.jsp
new file mode 100755
index 0000000..07547ab
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/traderdesktop/src/startfeed.jsp
@@ -0,0 +1,26 @@
+<!--
+  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.
+-->
+<%@page import="flex.samples.marketdata.Feed"%>
+<%
+	try {
+		Feed feed = new Feed();
+		feed.start();
+		out.println("Feed Started");
+	} catch (Exception e) {
+		out.println("A problem occured while starting the feed: "+e.getMessage());
+	}
+%>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/traderdesktop/src/stopfeed.jsp
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/traderdesktop/src/stopfeed.jsp b/apps/samples/WEB-INF/flex-src/traderdesktop/src/stopfeed.jsp
new file mode 100755
index 0000000..300aaf8
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/traderdesktop/src/stopfeed.jsp
@@ -0,0 +1,26 @@
+<!--
+  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.
+-->
+<%@page import="flex.samples.marketdata.Feed"%>
+<%
+	try {
+		Feed feed = new Feed();
+		feed.stop();
+		out.println("Feed Stopped");
+	} catch (Exception e) {
+		out.println("A problem occured while stopping the feed: "+e.getMessage());
+	}
+%>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/traderdesktop/src/traderdesktop.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/traderdesktop/src/traderdesktop.mxml b/apps/samples/WEB-INF/flex-src/traderdesktop/src/traderdesktop.mxml
new file mode 100755
index 0000000..b2a9b9c
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/traderdesktop/src/traderdesktop.mxml
@@ -0,0 +1,241 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+  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" xmlns="*" 
+	backgroundGradientColors="[#FFFFFF,#FFFFFF]"
+	layout="horizontal" horizontalAlign="left" verticalGap="8" 
+	creationComplete="initApp()">
+
+	<mx:Style source="main.css"/>
+
+	<mx:Script>
+		<![CDATA[
+			import mx.messaging.channels.HTTPChannel;
+			import mx.messaging.channels.AMFChannel;
+			import mx.controls.Alert;
+			import mx.collections.ArrayCollection;
+			import mx.messaging.Channel;
+			import mx.messaging.ChannelSet;
+			import mx.messaging.config.ServerConfig;
+			import mx.messaging.events.MessageEvent;
+			import samples.portfolio.Stock;
+			import mx.messaging.Consumer;
+	
+			private var consumers:Object;		
+	
+			[Bindable]
+			private var items:ArrayCollection;
+	
+			private var stockMap:Object;
+			
+			private function initApp():void
+			{
+				var channelSet:ChannelSet = ServerConfig.getChannelSet("market-data-feed");
+				channels.dataProvider = channelSet.channelIds;
+				consumers = new Object();
+				stockMap = new Object();
+				items = new ArrayCollection();
+				initializeWatchList(["IBM", "JBLU", "ADBE", "GE", "C"]);
+				displayChannelInfo();
+			}
+			
+			private function deleteSymbol():void
+			{
+				var symbol:String = dg.selectedItem.symbol;
+				unsubscribe(symbol);
+				items.removeItemAt(dg.selectedIndex);
+				delete stockMap[symbol];
+			}
+			
+			public function initializeWatchList(list:Array):void
+			{
+				for (var i:int=0; i<list.length; i++)
+				{
+					addSymbol(list[i]);	
+				}
+			}
+			
+			private function addSymbol(symbol:String):void
+			{
+				if (symbol == null || symbol == "")
+				{
+					Alert.show("Cannot add an empty symbol");
+					return;
+				}
+	
+				symbol = symbol.toUpperCase();
+				if (stockMap.hasOwnProperty(symbol))
+				{
+					Alert.show("Symbol '" + symbol + "' is already in the list");
+					return;
+				}
+	
+				var stock:Stock = new Stock();
+				stock.symbol = symbol;
+				stockMap[symbol] = stock;
+				items.addItem(stock);
+				subscribe(symbol);
+			}
+			
+			private function subscribe(symbol:String):void
+			{
+				var consumer:Consumer = new Consumer();
+				consumer.destination = "market-data-feed";
+				consumer.subtopic = symbol;
+				consumer.channelSet = new ChannelSet([channels.selectedItem]);
+				consumer.addEventListener(MessageEvent.MESSAGE, messageHandler);
+				consumer.subscribe();
+				consumers[symbol] = consumer;
+			}
+			
+			private function unsubscribe(symbol:String):void
+			{
+				if (consumers[symbol])
+				{
+					var consumer:Consumer = consumers[symbol];
+					consumer.removeEventListener(MessageEvent.MESSAGE, messageHandler);
+					if (consumer.subscribed)
+					{
+						consumer.unsubscribe();
+					}
+					consumer.channelSet.disconnectAll();
+					consumers[symbol] = null;
+				}
+			}
+	
+			private function channelChange():void
+			{
+				displayChannelInfo();	
+
+				var i:int;
+				// Get rid of all the subscriptions that use the previously selected channel 
+				for (i=0; i<items.length; i++)
+				{
+					unsubscribe(items.getItemAt(i).symbol)
+				}
+				
+				// Subscribe using the newly selected channel
+				for (i=0; i<items.length; i++)
+				{
+					subscribe(items.getItemAt(i).symbol)
+				}
+			}
+	
+			private function displayChannelInfo():void
+			{
+				var channel:Object = ServerConfig.getChannel(channels.selectedItem as String);
+				channelId.text = channel.id;
+				channelClass.text = getQualifiedClassName(channel);
+				endpoint.text = channel.endpoint;
+				if (channel is AMFChannel || channel is HTTPChannel)
+				{
+					pollingEnabled.text = channel.pollingEnabled;
+					pollingInterval.text = channel.pollingInterval;
+				}
+				else
+				{
+					pollingEnabled.text = "n/a";
+					pollingInterval.text = "n/a";
+				}
+				perClientSettings.visible = channel.id.indexOf("per-client") >= 0;
+			}
+			
+			private function messageHandler(event:MessageEvent):void 
+			{
+				var changedStock:Stock = event.message.body as Stock;
+				var stock:Stock = stockMap[changedStock.symbol];
+				
+				BackgroundColorRenderer.symbol = changedStock.symbol;
+				
+				if (stock)
+				{
+					stock.open = changedStock.open;
+					stock.change = changedStock.change;
+					stock.last = changedStock.last;
+					stock.high = changedStock.high;
+					stock.low = changedStock.low;
+					stock.date = changedStock.date;
+				}
+	        }
+			
+			private function formatNumber(item:Object, column:DataGridColumn):String
+			{
+				return nf.format(item[column.dataField]);
+			}
+			
+			// Only used for the per-client-qos channels
+			private function setDelay():void
+			{
+				configSrv.setAttribute("market-data-delay", delay.text);
+			}
+
+		
+		]]>
+	</mx:Script>
+	
+	<!-- Only used for the per-client-qos channels to provide per-client config values --> 
+	<mx:RemoteObject id="configSrv" destination="flex-client-qos-config"/>
+	
+	<mx:NumberFormatter id="nf" precision="2"/>
+
+	<mx:Panel title="Watch List" width="400" height="400">
+		<mx:DataGrid id="dg" dataProvider="{items}" width="100%" height="100%">
+			<mx:columns>
+				<mx:DataGridColumn headerText="Symbol" dataField="symbol" width="80"/>
+				<mx:DataGridColumn headerText="Open" dataField="open" labelFunction="formatNumber" textAlign="right" width="60"/>
+				<mx:DataGridColumn headerText="Last" dataField="last" itemRenderer="BackgroundColorRenderer" labelFunction="formatNumber" textAlign="right" width="60"/>
+				<mx:DataGridColumn headerText="Change" dataField="change" itemRenderer="ColorRenderer" labelFunction="formatNumber" textAlign="right" width="60"/>
+				<mx:DataGridColumn headerText="High" dataField="high" labelFunction="formatNumber" textAlign="right" width="60"/>
+				<mx:DataGridColumn headerText="Low" dataField="low" labelFunction="formatNumber" textAlign="right" width="60"/>
+			</mx:columns>
+		</mx:DataGrid>
+		<mx:ControlBar>
+			<mx:TextInput id="symbol" enter="addSymbol(symbol.text);symbol.text='';" width="50"/>
+			<mx:Button label="Add Symbol" click="addSymbol(symbol.text);symbol.text='';"/>
+			<mx:Spacer width="100%"/>
+			<mx:Button label="Delete Symbol" click="deleteSymbol()" enabled="{dg.selectedItem}"/>
+		</mx:ControlBar>
+	</mx:Panel>
+	
+	<mx:Form>
+		<mx:FormItem label="Select a channel">
+			<mx:ComboBox id="channels" change="channelChange()"/>
+		</mx:FormItem>
+		<mx:FormItem label="Channel Id">
+			<mx:Label id="channelId"/>
+		</mx:FormItem>
+		<mx:FormItem label="Channel Class">
+			<mx:Label id="channelClass"/>
+		</mx:FormItem>
+		<mx:FormItem label="Endpoint">
+			<mx:Label id="endpoint"/>
+		</mx:FormItem>
+		<mx:FormItem label="Polling Enabled">
+			<mx:Label id="pollingEnabled"/>
+		</mx:FormItem>
+		<mx:FormItem label="Polling Interval (millis)">
+			<mx:Label id="pollingInterval"/>
+		</mx:FormItem>
+		<mx:FormItem id="perClientSettings" label="Custom (Per Client) Quote Delay" direction="horizontal">
+			<mx:TextInput id="delay" width="80" text="5000"/>
+			<mx:Button label="Apply" click="setDelay()"/>
+		</mx:FormItem>
+	</mx:Form>
+	
+</mx:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex/messaging-config.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex/messaging-config.xml b/apps/samples/WEB-INF/flex/messaging-config.xml
new file mode 100755
index 0000000..31422b0
--- /dev/null
+++ b/apps/samples/WEB-INF/flex/messaging-config.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+  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.
+
+-->
+<service id="message-service" class="flex.messaging.services.MessageService">
+
+    <adapters>
+        <adapter-definition id="actionscript" class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" default="true" />
+        <adapter-definition id="jms" class="flex.messaging.services.messaging.adapters.JMSAdapter"/>
+    </adapters>
+    
+    <default-channels>
+		<channel ref="my-streaming-amf"/>
+		<channel ref="my-polling-amf"/>
+    </default-channels>
+
+    <destination id="feed">
+    	<!-- Destination specific channel configuration can be defined if needed
+        <channels>
+            <channel ref="my-streaming-amf"/>
+        </channels>        
+         -->
+    </destination>
+
+    <destination id="chat"/>
+
+    <destination id="dashboard"/>
+    
+    <destination id="market-data-feed">
+        <properties>
+            <server>
+                <allow-subtopics>true</allow-subtopics>
+                <subtopic-separator>.</subtopic-separator>s
+            </server>
+        </properties>
+        <channels>
+			<channel ref="my-polling-amf"/>
+			<channel ref="my-streaming-amf"/>
+            <channel ref="per-client-qos-polling-amf"/>
+        </channels>        
+    </destination>    
+
+</service>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex/proxy-config.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex/proxy-config.xml b/apps/samples/WEB-INF/flex/proxy-config.xml
new file mode 100755
index 0000000..34324da
--- /dev/null
+++ b/apps/samples/WEB-INF/flex/proxy-config.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+  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.
+
+-->
+<service id="proxy-service" class="flex.messaging.services.HTTPProxyService">
+
+    <properties>
+        <connection-manager>
+            <max-total-connections>100</max-total-connections>
+            <default-max-connections-per-host>2</default-max-connections-per-host>
+        </connection-manager>
+
+        <allow-lax-ssl>true</allow-lax-ssl>
+    </properties>
+
+    <default-channels>
+        <channel ref="my-http"/>
+        <channel ref="my-amf"/>
+    </default-channels>
+
+    <adapters>
+        <adapter-definition id="http-proxy" class="flex.messaging.services.http.HTTPProxyAdapter" default="true"/>
+        <adapter-definition id="soap-proxy" class="flex.messaging.services.http.SOAPProxyAdapter"/>
+    </adapters>
+
+    <destination id="DefaultHTTP">
+		<properties>
+		</properties>
+    </destination>
+    
+    <destination id="catalog">
+		<properties>
+			<url>/{context.root}/testdrive-httpservice/catalog.jsp</url>
+		</properties>
+    </destination>
+
+    <destination id="ws-catalog">
+        <properties>
+            <wsdl>http://feeds.adobe.com/webservices/mxna2.cfc?wsdl</wsdl>
+            <soap>http://feeds.adobe.com/webservices/mxna2.cfc</soap>
+        </properties>
+        <adapter ref="soap-proxy"/>
+    </destination>
+    
+</service>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex/remoting-config.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex/remoting-config.xml b/apps/samples/WEB-INF/flex/remoting-config.xml
new file mode 100755
index 0000000..acee9e3
--- /dev/null
+++ b/apps/samples/WEB-INF/flex/remoting-config.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+  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.
+
+-->
+<service id="remoting-service"
+    class="flex.messaging.services.RemotingService">
+
+    <adapters>
+        <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
+    </adapters>
+
+    <default-channels>
+        <channel ref="my-amf"/>
+    </default-channels>
+
+    <destination id="product">
+        <properties>
+            <source>flex.samples.product.ProductService</source>
+        </properties>
+    </destination>
+    
+    <destination id="productService">
+        <properties>
+            <source>flex.samples.dcd.product.ProductService</source>
+        </properties>
+    </destination>
+
+    <destination id="chat-room-service">
+        <properties>
+            <source>flex.samples.runtimeconfig.ChatRoomService</source>
+            <scope>application</scope>
+        </properties>
+    </destination>
+
+    <destination id="flex-client-qos-config" channels="per-client-qos-polling-amf">
+        <properties>
+            <source>flex.samples.qos.FlexClientConfigService</source>
+        </properties>
+    </destination>
+    
+  </service>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex/services-config.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex/services-config.xml b/apps/samples/WEB-INF/flex/services-config.xml
new file mode 100755
index 0000000..c8b7d15
--- /dev/null
+++ b/apps/samples/WEB-INF/flex/services-config.xml
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+  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.
+
+-->
+<services-config>
+
+    <services>
+        
+        <service class="flex.samples.DatabaseCheckService" id="hsqldb" />
+        
+        <service-include file-path="remoting-config.xml" />
+        <service-include file-path="proxy-config.xml" />
+        <service-include file-path="messaging-config.xml" />
+        
+	    <service class="flex.samples.runtimeconfig.EmployeeRuntimeRemotingDestination" id="runtime-employee-ro" />
+
+    	<!-- 
+    	Application level default channels. Application level default channels are 
+    	necessary when a dynamic destination is being used by a service component
+    	and no ChannelSet has been defined for the service component. In that case,
+    	application level default channels will be used to contact the destination.
+        -->   
+        <default-channels>
+           <channel ref="my-amf"/>
+        </default-channels>
+    
+	</services>
+
+
+    <security>
+        <security-constraint id="sample-users">
+            <auth-method>Custom</auth-method>
+            <roles>
+                <role>sampleusers</role>
+            </roles>
+        </security-constraint>
+
+		<login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>        
+        <!-- Uncomment the correct app server
+        <login-command class="flex.messaging.security.TomcatLoginCommand" server="JBoss"/>
+        <login-command class="flex.messaging.security.JRunLoginCommand" server="JRun"/>
+        <login-command class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/>
+        <login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/>        
+        -->
+    </security>
+
+    <channels>
+    
+        <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"/>
+        </channel-definition>
+    
+        <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
+            <properties>
+                <polling-enabled>false</polling-enabled>
+            </properties>
+        </channel-definition>
+
+        <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
+            <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
+            <properties>
+            	<add-no-cache-headers>false</add-no-cache-headers>
+            </properties>
+        </channel-definition>
+
+        <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
+            <properties>
+                <polling-enabled>true</polling-enabled>
+                <polling-interval-seconds>4</polling-interval-seconds>
+            </properties>
+        </channel-definition>
+
+        <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
+        </channel-definition>
+
+        <channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
+            <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
+            <properties>
+            	<add-no-cache-headers>false</add-no-cache-headers>
+            </properties>
+        </channel-definition>
+
+        <channel-definition id="per-client-qos-polling-amf" class="mx.messaging.channels.AMFChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/qosamfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
+            <properties>
+                <polling-enabled>true</polling-enabled>
+                <polling-interval-millis>500</polling-interval-millis>
+                <flex-client-outbound-queue-processor class="flex.samples.qos.CustomDelayQueueProcessor">
+                    <properties>
+                        <flush-delay>5000</flush-delay>
+                    </properties>
+                </flex-client-outbound-queue-processor>
+            </properties>
+        </channel-definition>
+
+    </channels>
+
+    <logging>
+        <!-- You may also use flex.messaging.log.ServletLogTarget -->
+        <target class="flex.messaging.log.ConsoleTarget" level="Error">
+            <properties>
+                <prefix>[BlazeDS] </prefix>
+                <includeDate>false</includeDate>
+                <includeTime>false</includeTime>
+                <includeLevel>true</includeLevel>
+                <includeCategory>false</includeCategory>
+            </properties>
+            <filters>
+                <pattern>Endpoint.*</pattern>
+                <pattern>Service.*</pattern>
+                <pattern>Configuration</pattern>
+            </filters>
+        </target>
+    </logging>
+
+    <system>
+        <redeploy>
+            <enabled>true</enabled>
+            <watch-interval>20</watch-interval>
+            <watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file>
+            <watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file>
+            <watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file>
+            <watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file>            
+            <touch-file>{context.root}/WEB-INF/web.xml</touch-file>
+        </redeploy>
+    </system>
+
+</services-config>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/src/flex/samples/ConnectionHelper.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/ConnectionHelper.java b/apps/samples/WEB-INF/src/flex/samples/ConnectionHelper.java
new file mode 100755
index 0000000..67f2abc
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/ConnectionHelper.java
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ */
+package flex.samples;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+public class ConnectionHelper
+{
+	private String url;
+	private static ConnectionHelper instance;
+
+	private ConnectionHelper()
+	{
+		try {
+			Class.forName("org.hsqldb.jdbcDriver");
+			url = "jdbc:hsqldb:hsql://localhost:9002/flexdemodb";
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	public static Connection getConnection() throws SQLException {
+		if (instance == null) {
+			instance = new ConnectionHelper();
+		}
+		try {
+			return DriverManager.getConnection(instance.url);
+		} catch (SQLException e) {
+			throw e;
+		}
+	}
+	
+	public static void close(Connection connection)
+	{
+		try {
+			if (connection != null) {
+				connection.close();
+			}
+		} catch (SQLException e) {
+			e.printStackTrace();
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/src/flex/samples/DAOException.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/DAOException.java b/apps/samples/WEB-INF/src/flex/samples/DAOException.java
new file mode 100755
index 0000000..4a06b6b
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/DAOException.java
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+package flex.samples;
+
+public class DAOException extends RuntimeException
+{
+	static final long serialVersionUID = -1881205326938716446L;
+
+	public DAOException(String message)
+	{
+		super(message);
+	}
+
+	public DAOException(Throwable cause)
+	{
+		super(cause);
+	}
+
+	public DAOException(String message, Throwable cause)
+	{
+		super(message, cause);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/src/flex/samples/DatabaseCheckService.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/DatabaseCheckService.java b/apps/samples/WEB-INF/src/flex/samples/DatabaseCheckService.java
new file mode 100755
index 0000000..936ed85
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/DatabaseCheckService.java
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+package flex.samples;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import flex.messaging.config.ConfigMap;
+import flex.messaging.services.AbstractBootstrapService;
+
+public class DatabaseCheckService extends AbstractBootstrapService
+{
+    public void initialize(String id, ConfigMap properties)
+    {
+    	Connection c = null;
+    	try 
+    	{	
+    		// Check that the database is running...
+    		c = ConnectionHelper.getConnection();
+    		// ... if yes return
+    		return;
+    	}
+    	catch (SQLException e)
+    	{
+    		System.out.println("******************************************************************************");
+    		System.out.println("*                                                                            *");
+    		System.out.println("*  Unable to connect to the samples database.                                *");
+    		System.out.println("*  You must start the samples database before you can run the samples.       *");
+    		System.out.println("*  To start the samples database:                                            *");
+    		System.out.println("*    1. Open a command prompt and go to the {install-dir}/sampledb dir       *");
+    		System.out.println("*    2. Run startdb.bat (Windows) or startdb.sh (Unix-based systems)         *");
+    		System.out.println("*                                                                            *");
+    		System.out.println("******************************************************************************");
+    	} 
+    	finally
+    	{
+    		ConnectionHelper.close(c);
+    	}
+    	
+    }
+
+    public void start()
+    {
+    }
+
+
+    public void stop()
+    {
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/src/flex/samples/crm/ConcurrencyException.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/crm/ConcurrencyException.java b/apps/samples/WEB-INF/src/flex/samples/crm/ConcurrencyException.java
new file mode 100755
index 0000000..cdfc2af
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/crm/ConcurrencyException.java
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+package flex.samples.crm;
+
+public class ConcurrencyException extends Exception
+{
+	private static final long serialVersionUID = -6405818907028247079L;
+
+	public ConcurrencyException(String message)
+	{
+		super(message);
+	}
+
+	public ConcurrencyException(Throwable cause)
+	{
+		super(cause);
+	}
+
+	public ConcurrencyException(String message, Throwable cause)
+	{
+		super(message, cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/src/flex/samples/crm/DAOException.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/crm/DAOException.java b/apps/samples/WEB-INF/src/flex/samples/crm/DAOException.java
new file mode 100755
index 0000000..a0a6f2d
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/crm/DAOException.java
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+package flex.samples.crm;
+
+public class DAOException extends RuntimeException
+{
+	private static final long serialVersionUID = -8852593974738250673L;
+
+	public DAOException(String message)
+	{
+		super(message);
+	}
+
+	public DAOException(Throwable cause)
+	{
+		super(cause);
+	}
+
+	public DAOException(String message, Throwable cause)
+	{
+		super(message, cause);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/src/flex/samples/crm/company/Company.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/crm/company/Company.java b/apps/samples/WEB-INF/src/flex/samples/crm/company/Company.java
new file mode 100755
index 0000000..5881851
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/crm/company/Company.java
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ */
+package flex.samples.crm.company;
+
+public class Company
+{
+	private int companyId;
+
+	private String name;
+
+	private String address;
+
+	private String city;
+
+	private String zip;
+
+	private String state;
+
+    private String industry;
+
+	public String getAddress()
+	{
+		return address;
+	}
+
+	public void setAddress(String address)
+	{
+		this.address = address;
+	}
+
+	public String getCity()
+	{
+		return city;
+	}
+
+	public void setCity(String city)
+	{
+		this.city = city;
+	}
+
+	public int getCompanyId()
+	{
+		return companyId;
+	}
+
+	public void setCompanyId(int companyId)
+	{
+		this.companyId = companyId;
+	}
+
+	public String getName()
+	{
+		return name;
+	}
+
+	public void setName(String name)
+	{
+		this.name = name;
+	}
+
+	public String getState()
+	{
+		return state;
+	}
+
+	public void setState(String state)
+	{
+		this.state = state;
+	}
+
+	public String getZip()
+	{
+		return zip;
+	}
+
+	public void setZip(String zip)
+	{
+		this.zip = zip;
+	}
+
+    public String getIndustry()
+    {
+        return this.industry;
+    }
+
+    public void setIndustry(String industry)
+    {
+        this.industry = industry;
+    }
+	
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/src/flex/samples/crm/company/CompanyDAO.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/crm/company/CompanyDAO.java b/apps/samples/WEB-INF/src/flex/samples/crm/company/CompanyDAO.java
new file mode 100755
index 0000000..3126504
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/crm/company/CompanyDAO.java
@@ -0,0 +1,228 @@
+/*
+ * 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.
+ */
+package flex.samples.crm.company;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.List;
+
+import flex.samples.ConnectionHelper;
+import flex.samples.crm.ConcurrencyException;
+import flex.samples.crm.DAOException;
+
+public class CompanyDAO
+{
+	public List findCompanies(String name, String industry) throws DAOException
+	{
+		List list = new ArrayList();
+		Connection c = null;
+		try
+		{
+            String sql = "SELECT * FROM company";
+            if (industry != null && industry != "All")
+                sql += " WHERE industry = ?";
+            if (name != null)
+            {
+               if (industry == null)
+                   sql += " WHERE company.name LIKE ?";
+               else
+                   sql += " AND company.name LIKE ?";
+            }
+            sql += " ORDER BY company.name";
+            
+			c = ConnectionHelper.getConnection();
+
+            PreparedStatement ps = c.prepareStatement(sql);
+            ps.setString(1, industry);
+            ps.setString(1, "%" + name + "%");
+            ResultSet rs = ps.executeQuery();
+			Company company;
+			while (rs.next())
+			{
+				company = new Company();
+				company.setCompanyId(rs.getInt("company_id"));
+				company.setName(rs.getString("name"));
+				company.setAddress(rs.getString("address"));
+				company.setCity(rs.getString("city"));
+				company.setZip(rs.getString("zip"));
+				company.setState(rs.getString("state"));
+				company.setIndustry(rs.getString("industry"));
+				list.add(company);
+			}
+            rs.close();
+            ps.close();
+		}
+		catch (SQLException e)
+		{
+			e.printStackTrace();
+			throw new DAOException(e);
+		}
+		finally
+		{
+			ConnectionHelper.close(c);
+		}
+		return list;
+	}
+
+	public Company getCompany(int companyId) throws DAOException
+	{
+		Company company = null;
+		Connection c = null;
+		try
+		{
+			c = ConnectionHelper.getConnection();
+            PreparedStatement ps = c.prepareStatement("SELECT * FROM company WHERE company_id= ?");
+            ps.setInt(1, companyId);
+			ResultSet rs = ps.executeQuery();
+			if (rs.next())
+			{
+				company = new Company();
+				company.setCompanyId(rs.getInt("company_id"));
+				company.setName(rs.getString("name"));
+				company.setAddress(rs.getString("address"));
+				company.setCity(rs.getString("city"));
+				company.setZip(rs.getString("zip"));
+				company.setState(rs.getString("state"));
+				company.setIndustry(rs.getString("industry"));
+			}
+			rs.close();
+			ps.close();
+		}
+		catch (SQLException e)
+		{
+			e.printStackTrace();
+			throw new DAOException(e);
+		}
+		finally
+		{
+			ConnectionHelper.close(c);
+		}
+		return company;
+	}
+
+	public Company create(Company company) throws DAOException
+	{
+		Connection c = null;
+        PreparedStatement ps = null;
+		try
+		{
+			c = ConnectionHelper.getConnection();
+			ps = c.prepareStatement("INSERT INTO company (name, address, city, zip, state, industry) VALUES (?, ?, ?, ?, ?, ?)");
+			ps.setString(1, company.getName());
+			ps.setString(2, company.getAddress());
+			ps.setString(3, company.getCity());
+			ps.setString(4, company.getZip());
+			ps.setString(5, company.getState());
+			ps.setString(6, company.getIndustry());
+			ps.execute();
+            ps.close();
+            ps = null;
+			Statement s = c.createStatement();
+			// HSQLDB Syntax to get the identity (company_id) of inserted row
+			ResultSet rs = s.executeQuery("CALL IDENTITY()");
+			rs.next();
+
+            // Update the id in the returned object.  This is important as this
+            // value must get returned to the client.
+			company.setCompanyId(rs.getInt(1));
+
+		}
+		catch (SQLException e)
+		{
+			e.printStackTrace();
+			throw new DAOException(e);
+		}
+		finally
+		{
+			ConnectionHelper.close(c);
+		}
+		return company;
+	}
+
+	public void update(Company newVersion, Company previousVersion, List changes) throws DAOException, ConcurrencyException
+	{
+		Connection c = null;
+        PreparedStatement ps = null;
+		try
+		{
+			c = ConnectionHelper.getConnection();
+            ps = c.prepareStatement("UPDATE company SET name=?, address=?, city=?, zip=?, state=?, industry=? WHERE company_id=? AND name=? AND address=? AND city=? AND zip=? AND state=?" );
+            ps.setString(1, newVersion.getName());
+            ps.setString(2, newVersion.getAddress());
+            ps.setString(3, newVersion.getCity());
+            ps.setString(4, newVersion.getZip());
+            ps.setString(5, newVersion.getState());
+            ps.setString(6, newVersion.getIndustry());
+            ps.setInt(7, newVersion.getCompanyId());
+			ps.setString(8, previousVersion.getName());
+			ps.setString(9, previousVersion.getAddress());
+			ps.setString(10, previousVersion.getCity());
+			ps.setString(11, previousVersion.getZip());
+			ps.setString(12, previousVersion.getState());
+			if (ps.executeUpdate() == 0)
+			{
+				throw new ConcurrencyException("Item not found");
+			}
+            ps.close();
+            ps = null;
+		}
+		catch (SQLException e)
+		{
+			e.printStackTrace();
+			throw new DAOException(e);
+		}
+		finally
+		{
+			ConnectionHelper.close(c);
+		}
+	}
+
+	public void delete(Company company) throws DAOException, ConcurrencyException
+	{
+		Connection c = null;
+        PreparedStatement ps = null;
+		try
+		{
+			c = ConnectionHelper.getConnection();
+
+			ps = c.prepareStatement("DELETE FROM company WHERE company_id=? AND name=? AND address=? AND city=? AND zip=? AND state=?");
+			ps.setInt(1, company.getCompanyId());
+			ps.setString(2, company.getName());
+			ps.setString(3, company.getAddress());
+			ps.setString(4, company.getCity());
+			ps.setString(5, company.getZip());
+			ps.setString(6, company.getState());
+			if (ps.executeUpdate() == 0)
+			{
+				throw new ConcurrencyException("Item not found");
+			}
+		}
+		catch (SQLException e)
+		{
+			e.printStackTrace();
+			throw new DAOException(e);
+		}
+		finally
+		{
+			ConnectionHelper.close(c);
+		}
+	}
+}
\ No newline at end of file


Mime
View raw message