http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/team/WEB-INF/src/features/runtimeconfig/RuntimeConfigurator.java ---------------------------------------------------------------------- diff --git a/attic/apps/team/WEB-INF/src/features/runtimeconfig/RuntimeConfigurator.java b/attic/apps/team/WEB-INF/src/features/runtimeconfig/RuntimeConfigurator.java index 0fc451c..ef4b3c3 100755 --- a/attic/apps/team/WEB-INF/src/features/runtimeconfig/RuntimeConfigurator.java +++ b/attic/apps/team/WEB-INF/src/features/runtimeconfig/RuntimeConfigurator.java @@ -1,110 +1,110 @@ -/* - * 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. - */ -/** - * A class that is meant to be used by a remoting destination to create destinations - * dynamically after server startup. The remoting destination is meant to be - * invoked by Flex clients to create dynamic destinations and use them. - */ -package features.runtimeconfig; - -import flex.messaging.MessageBroker; -import flex.messaging.MessageDestination; -import flex.messaging.services.MessageService; -import flex.messaging.services.messaging.adapters.JMSAdapter; -import flex.messaging.services.messaging.adapters.JMSSettings; - -public class RuntimeConfigurator -{ - MessageBroker msgBroker; - - public RuntimeConfigurator() - { - msgBroker = MessageBroker.getMessageBroker(null); - } - - /* - <destination id="messaging_AMF_Poll_Runtime" channels="my-amf-poll"/> - */ - public String createMessageDestination() - { - String serviceId = "message-service"; - String id = "messaging_AMF_Poll_Runtime"; - - MessageService msgService = (MessageService)msgBroker.getService(serviceId); - MessageDestination msgDestination = (MessageDestination)msgService.createDestination(id); - msgDestination.addChannel("my-amf-poll"); - - if (msgService.isStarted()) - msgDestination.start(); - - return "Destination: " + id + " created for Service: " + serviceId; - } - - /* - <destination id="messaging_AMF_Poll_Runtime" channels="my-amf-poll"/> - */ - public String removeMessageDestination() - { - String serviceId = "message-service"; - String id = "messaging_AMF_Poll_Runtime"; - - MessageService msgService = (MessageService)msgBroker.getService(serviceId); - msgService.removeDestination(id); - - return "Destination: " + id + " removed from Service: " + serviceId; - } - - /* - <destination id="messaging_AMF_Poll_JMS_Topic_Runtime" channels="my-amf-poll"> - <adapter ref="jms"/> - <properties> - <jms> - <connection-factory>java:comp/env/jms/flex/TopicConnectionFactory</connection-factory> - <destination-type>Topic</destination-type> - <destination-jndi-name>java:comp/env/jms/topic/flex/simpletopic</destination-jndi-name> - <message-type>javax.jms.TextMessage</message-type> - </jms> - </properties> - </destination> - */ - public String createMessageDestinationWithJMSAdapter() - { - String serviceId = "message-service"; - String id = "messaging_AMF_Poll_JMS_Topic_Runtime"; - - MessageService msgService = (MessageService)msgBroker.getService(serviceId); - MessageDestination msgDestination = (MessageDestination)msgService.createDestination(id); - msgDestination.addChannel("my-amf-poll"); - - // Use JMSSettings object for the <jms> properties above - JMSSettings js = new JMSSettings(); - js.setConnectionFactory("java:comp/env/jms/flex/TopicConnectionFactory"); - js.setDestinationType("Topic"); - js.setMessageType("javax.jms.TextMessage"); - js.setDestinationJNDIName("java:comp/env/jms/topic/flex/simpletopic"); - - JMSAdapter adapter = new JMSAdapter(); - adapter.setId("jms"); - adapter.setJMSSettings(js); - adapter.setDestination(msgDestination); - - if (msgService.isStarted()) - msgDestination.start(); - - return "Destination: " + id + " created for Service: " + serviceId; - } -} +/* + * 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. + */ +/** + * A class that is meant to be used by a remoting destination to create destinations + * dynamically after server startup. The remoting destination is meant to be + * invoked by Flex clients to create dynamic destinations and use them. + */ +package features.runtimeconfig; + +import flex.messaging.MessageBroker; +import flex.messaging.MessageDestination; +import flex.messaging.services.MessageService; +import flex.messaging.services.messaging.adapters.JMSAdapter; +import flex.messaging.services.messaging.adapters.JMSSettings; + +public class RuntimeConfigurator +{ + MessageBroker msgBroker; + + public RuntimeConfigurator() + { + msgBroker = MessageBroker.getMessageBroker(null); + } + + /* + <destination id="messaging_AMF_Poll_Runtime" channels="my-amf-poll"/> + */ + public String createMessageDestination() + { + String serviceId = "message-service"; + String id = "messaging_AMF_Poll_Runtime"; + + MessageService msgService = (MessageService)msgBroker.getService(serviceId); + MessageDestination msgDestination = (MessageDestination)msgService.createDestination(id); + msgDestination.addChannel("my-amf-poll"); + + if (msgService.isStarted()) + msgDestination.start(); + + return "Destination: " + id + " created for Service: " + serviceId; + } + + /* + <destination id="messaging_AMF_Poll_Runtime" channels="my-amf-poll"/> + */ + public String removeMessageDestination() + { + String serviceId = "message-service"; + String id = "messaging_AMF_Poll_Runtime"; + + MessageService msgService = (MessageService)msgBroker.getService(serviceId); + msgService.removeDestination(id); + + return "Destination: " + id + " removed from Service: " + serviceId; + } + + /* + <destination id="messaging_AMF_Poll_JMS_Topic_Runtime" channels="my-amf-poll"> + <adapter ref="jms"/> + <properties> + <jms> + <connection-factory>java:comp/env/jms/flex/TopicConnectionFactory</connection-factory> + <destination-type>Topic</destination-type> + <destination-jndi-name>java:comp/env/jms/topic/flex/simpletopic</destination-jndi-name> + <message-type>javax.jms.TextMessage</message-type> + </jms> + </properties> + </destination> + */ + public String createMessageDestinationWithJMSAdapter() + { + String serviceId = "message-service"; + String id = "messaging_AMF_Poll_JMS_Topic_Runtime"; + + MessageService msgService = (MessageService)msgBroker.getService(serviceId); + MessageDestination msgDestination = (MessageDestination)msgService.createDestination(id); + msgDestination.addChannel("my-amf-poll"); + + // Use JMSSettings object for the <jms> properties above + JMSSettings js = new JMSSettings(); + js.setConnectionFactory("java:comp/env/jms/flex/TopicConnectionFactory"); + js.setDestinationType("Topic"); + js.setMessageType("javax.jms.TextMessage"); + js.setDestinationJNDIName("java:comp/env/jms/topic/flex/simpletopic"); + + JMSAdapter adapter = new JMSAdapter(); + adapter.setId("jms"); + adapter.setJMSSettings(js); + adapter.setDestination(msgDestination); + + if (msgService.isStarted()) + msgDestination.start(); + + return "Destination: " + id + " created for Service: " + serviceId; + } +}
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/team/WEB-INF/src/features/validators/deserialization/ClassLoggingDeserializationValidator.java ---------------------------------------------------------------------- diff --git a/attic/apps/team/WEB-INF/src/features/validators/deserialization/ClassLoggingDeserializationValidator.java b/attic/apps/team/WEB-INF/src/features/validators/deserialization/ClassLoggingDeserializationValidator.java index 2e94fda..2dff3da 100755 --- a/attic/apps/team/WEB-INF/src/features/validators/deserialization/ClassLoggingDeserializationValidator.java +++ b/attic/apps/team/WEB-INF/src/features/validators/deserialization/ClassLoggingDeserializationValidator.java @@ -1,127 +1,127 @@ -/* - * 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 features.validators.deserialization; - -import java.util.HashSet; -import java.util.Set; - -import flex.messaging.config.ConfigMap; -import flex.messaging.log.Log; -import flex.messaging.validators.DeserializationValidator; - -/** - * This is a sample deserialization validator. It does not perform any real assignment - * and creation validations but instead, it keeps track of an internal set of class - * types, and when the class type is first encountered, it logs out the type of the class. - * One can use this validator to determine what class types are deserialized on the server. - */ -public class ClassLoggingDeserializationValidator implements DeserializationValidator -{ - //-------------------------------------------------------------------------- - // - // Public Static Constants - // - //-------------------------------------------------------------------------- - - public static String LOG_CATEGORY = "Endpoint.Deserialization.Creation"; - - //-------------------------------------------------------------------------- - // - // Variables - // - //-------------------------------------------------------------------------- - - /** - * Instance level lock for thread-safe state changes. - */ - protected final Object lock = new Object(); - - /** - * Keeps track of encountered class names. - */ - protected final Set<String> classNames = new HashSet<String>(); - - //-------------------------------------------------------------------------- - // - // Public Methods - // - //-------------------------------------------------------------------------- - - /** - * No assignment validation; simply returns true. - * - * @param instance The Array or List instance. - * @param index The index at which the value is being assigned. - * @param value The value that is assigned to the index. - * @return True if the assignment is valid. - */ - public boolean validateAssignment(Object instance, int index, Object value) - { - return true; - } - - /** - * No assignment validation; simply returns true. - * - * @param instance The instance with the property that is being assigned a new value. - * @param propertyName The name of the property that is being assigned. - * @param value The value that the property is being assigned to. - * @return True. - */ - public boolean validateAssignment(Object instance, String propertyName, Object value) - { - return true; - } - - /** - * No creation validation; simply returns true, but when a class is - * encountered the first time an Info level log message is printed - * to the Endpoint.Deserialization.Creation category listing the class name. - * Registering this validator in a development or test environment allows - * all required types used by the application to be captured in the server log, - * and this information may be used to configure a <tt>ClassDeserializationValidator</tt> - * in the production environment that disallows creation of all non-required types. - * - * @param c The class that is being created. - * @return True. - */ - public boolean validateCreation(Class<?> c) - { - String className = c == null? null : c.getName(); - if (className != null) - { - synchronized(lock) - { - if (!classNames.contains(className)) - { - if (Log.isInfo()) - Log.getLogger(LOG_CATEGORY).info(className); - classNames.add(className); - } - } - } - return true; - } - - /* (non-Javadoc) - * @see flex.messaging.FlexConfigurable#initialize(java.lang.String, flex.messaging.config.ConfigMap) - */ - public void initialize(String id, ConfigMap configMap) - { - // No-op. - } +/* + * 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 features.validators.deserialization; + +import java.util.HashSet; +import java.util.Set; + +import flex.messaging.config.ConfigMap; +import flex.messaging.log.Log; +import flex.messaging.validators.DeserializationValidator; + +/** + * This is a sample deserialization validator. It does not perform any real assignment + * and creation validations but instead, it keeps track of an internal set of class + * types, and when the class type is first encountered, it logs out the type of the class. + * One can use this validator to determine what class types are deserialized on the server. + */ +public class ClassLoggingDeserializationValidator implements DeserializationValidator +{ + //-------------------------------------------------------------------------- + // + // Public Static Constants + // + //-------------------------------------------------------------------------- + + public static String LOG_CATEGORY = "Endpoint.Deserialization.Creation"; + + //-------------------------------------------------------------------------- + // + // Variables + // + //-------------------------------------------------------------------------- + + /** + * Instance level lock for thread-safe state changes. + */ + protected final Object lock = new Object(); + + /** + * Keeps track of encountered class names. + */ + protected final Set<String> classNames = new HashSet<String>(); + + //-------------------------------------------------------------------------- + // + // Public Methods + // + //-------------------------------------------------------------------------- + + /** + * No assignment validation; simply returns true. + * + * @param instance The Array or List instance. + * @param index The index at which the value is being assigned. + * @param value The value that is assigned to the index. + * @return True if the assignment is valid. + */ + public boolean validateAssignment(Object instance, int index, Object value) + { + return true; + } + + /** + * No assignment validation; simply returns true. + * + * @param instance The instance with the property that is being assigned a new value. + * @param propertyName The name of the property that is being assigned. + * @param value The value that the property is being assigned to. + * @return True. + */ + public boolean validateAssignment(Object instance, String propertyName, Object value) + { + return true; + } + + /** + * No creation validation; simply returns true, but when a class is + * encountered the first time an Info level log message is printed + * to the Endpoint.Deserialization.Creation category listing the class name. + * Registering this validator in a development or test environment allows + * all required types used by the application to be captured in the server log, + * and this information may be used to configure a <tt>ClassDeserializationValidator</tt> + * in the production environment that disallows creation of all non-required types. + * + * @param c The class that is being created. + * @return True. + */ + public boolean validateCreation(Class<?> c) + { + String className = c == null? null : c.getName(); + if (className != null) + { + synchronized(lock) + { + if (!classNames.contains(className)) + { + if (Log.isInfo()) + Log.getLogger(LOG_CATEGORY).info(className); + classNames.add(className); + } + } + } + return true; + } + + /* (non-Javadoc) + * @see flex.messaging.FlexConfigurable#initialize(java.lang.String, flex.messaging.config.ConfigMap) + */ + public void initialize(String id, ConfigMap configMap) + { + // No-op. + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/team/WEB-INF/src/features/validators/deserialization/TestDeserializationValidator.java ---------------------------------------------------------------------- diff --git a/attic/apps/team/WEB-INF/src/features/validators/deserialization/TestDeserializationValidator.java b/attic/apps/team/WEB-INF/src/features/validators/deserialization/TestDeserializationValidator.java index 5d7585b..51c790e 100755 --- a/attic/apps/team/WEB-INF/src/features/validators/deserialization/TestDeserializationValidator.java +++ b/attic/apps/team/WEB-INF/src/features/validators/deserialization/TestDeserializationValidator.java @@ -1,58 +1,58 @@ -/* - * 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 features.validators.deserialization; - -import flex.messaging.config.ConfigMap; -import flex.messaging.validators.DeserializationValidator; - -public class TestDeserializationValidator implements DeserializationValidator -{ - /** - * Simply prints the assignment and always returns true. - */ - public boolean validateAssignment(Object instance, int index, Object value) - { - System.out.println("validateAssign1: [" + (instance == null? "null" : instance.getClass().getName()) + "," + index + "," + value + "]"); - return true; - } - - /** - * Simply prints the assignment and always returns true. - */ - public boolean validateAssignment(Object instance, String propertyName, Object value) - { - System.out.println("validateAssign2: [" + (instance == null? "null" : instance.getClass().getName()) + "," + propertyName + "," + value + "]"); - return true; - } - - /** - * Simply prints the creation and always returns true. - */ - public boolean validateCreation(Class<?> c) - { - System.out.println("validateCreate: " + (c == null? "null" : c.getName())); - return true; - } - - /* (non-Javadoc) - * @see flex.messaging.FlexConfigurable#initialize(java.lang.String, flex.messaging.config.ConfigMap) - */ - public void initialize(String id, ConfigMap configMap) - { - // No-op. - } +/* + * 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 features.validators.deserialization; + +import flex.messaging.config.ConfigMap; +import flex.messaging.validators.DeserializationValidator; + +public class TestDeserializationValidator implements DeserializationValidator +{ + /** + * Simply prints the assignment and always returns true. + */ + public boolean validateAssignment(Object instance, int index, Object value) + { + System.out.println("validateAssign1: [" + (instance == null? "null" : instance.getClass().getName()) + "," + index + "," + value + "]"); + return true; + } + + /** + * Simply prints the assignment and always returns true. + */ + public boolean validateAssignment(Object instance, String propertyName, Object value) + { + System.out.println("validateAssign2: [" + (instance == null? "null" : instance.getClass().getName()) + "," + propertyName + "," + value + "]"); + return true; + } + + /** + * Simply prints the creation and always returns true. + */ + public boolean validateCreation(Class<?> c) + { + System.out.println("validateCreate: " + (c == null? "null" : c.getName())); + return true; + } + + /* (non-Javadoc) + * @see flex.messaging.FlexConfigurable#initialize(java.lang.String, flex.messaging.config.ConfigMap) + */ + public void initialize(String id, ConfigMap configMap) + { + // No-op. + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/team/build.xml ---------------------------------------------------------------------- diff --git a/attic/apps/team/build.xml b/attic/apps/team/build.xml index b7331e0..f41ca33 100755 --- a/attic/apps/team/build.xml +++ b/attic/apps/team/build.xml @@ -1,194 +1,194 @@ -<?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="team.war/build.xml" default="main" basedir="../.."> - - <property file="${basedir}/build.properties" /> - <property name="team.war" value="${basedir}/apps/team" /> - <property name="dist.dir" value="${basedir}/dist" /> - <property name="src.dir" value="${team.war}/WEB-INF/src" /> - <property name="classes.dir" value="${team.war}/WEB-INF/classes" /> - <condition property="template.dir" value="client-side-detection-with-history"> - <equals arg1="${sdk.version}" arg2="3"/> - </condition> - <property name="template.dir" value=""/> - <condition property="war.filename" value="team-sdk3.war"> - <equals arg1="${sdk.version}" arg2="3"/> - </condition> - <property name="war.filename" value="team.war"/> - - <path id="classpath"> - <fileset dir="${team.war}/WEB-INF/lib" includes="**/*.jar" /> - <fileset dir="${team.war}/WEB-INF/flex/jars" includes="**/*.jar"/> - <pathelement location="${servlet.jar}" /> - <pathelement location="${jms.jar}"/> - </path> - - <target name="main" depends="clean,compile" /> - - <target name="prepare"> - <mkdir dir="${team.war}/WEB-INF/classes" /> - <mkdir dir="${team.war}/WEB-INF/lib" /> - <mkdir dir="${team.war}/WEB-INF/src" /> - </target> - - <target name="copy-resources"> - <fail unless="local.sdk.lib.dir" message="must specify local.sdk.lib.dir in server/build.properties"/> - <fail unless="local.sdk.frameworks.dir" message="must specify local.sdk.frameworks.dir in build.properties"/> - - <!-- copy sdk version sepecific web.xml. this is required for webtier --> - <copy todir="${team.war}/WEB-INF"> - <fileset dir="${qa.dir}/resources/webtier/flex_sdk_${sdk.version}/"> - <include name="web.xml"/> - </fileset> - </copy> - - <!-- copy sdk version specific flex-config.xml, air-config.xml and flex-webtier-config.xml --> - <copy todir="${team.war}/WEB-INF/flex"> - <fileset dir="${qa.dir}/resources/webtier/flex_sdk_${sdk.version}" includes="flex-config.xml,air-config.xml,flex-webtier-config.xml"/> - </copy> - - <!-- copy to the WEB-INF/flex directory --> - <copy todir="${team.war}/WEB-INF/flex"> - <fileset dir="${local.sdk.frameworks.dir}"> - <include name="*-manifest.xml" /> - <include name="flash-unicode-table.xml"/> - <include name="flex-sdk-description.xml" /> - <include name="*.ser"/> - <include name="locale/**/*"/> - <include name="themes/**/*"/> - </fileset> - </copy> - - <!-- copy swcs to the WEB-INF/flex/libs directory --> - <copy todir="${team.war}/WEB-INF/flex/libs"> - <fileset dir="${local.sdk.frameworks.dir}/libs" includes="**/*.swc"/> - </copy> - - <!-- copy to the lib directory --> - <copy todir="${team.war}/WEB-INF/lib"> - <fileset dir="${basedir}/lib" includes="${webapp.ce.lib},${webtier.lib},${jgroups.jars}" /> - <fileset dir="${qa.dir}/lib" includes="${axis.jars},${qa-services.jars}"/> - </copy> - - <!-- copy to the jars directory --> - <copy todir="${team.war}/WEB-INF/flex/jars"> - <fileset dir="${basedir}/lib" includes="${webtier.jars}"/> - </copy> - - <!-- copy to the classes directory --> - <copy todir="${team.war}/WEB-INF/classes"> - <fileset dir="${team.war}/WEB-INF/src"> - <include name="**/*.xml,**/*.properties" /> - </fileset> - <fileset dir="${basedir}/lib" includes="${webapp.classes}" /> - </copy> - - <!-- copy template file to the history directory --> - <copy todir="${team.war}/history" flatten="true"> - <fileset dir="${basedir}/templates/${template.dir}" includes="**/*.js,**/*.css,**/historyFrame.html"/> - </copy> - </target> - - <target name="run-depend" if="src.depend"> - <echo message="Removing class files that changed and dependent class files." /> - <depend cache="${classes.dir}" srcdir="${src.dir}" destdir="${classes.dir}" /> - </target> - - <target name="compile" depends="prepare,run-depend,copy-resources" description="compile"> - <javac source="1.5" debug="${src.debug}" destdir="${classes.dir}" srcdir="${src.dir}" classpathref="classpath" /> - </target> - - <target name="package" description=" Creates distribution war file"> - <mkdir dir="${dist.dir}" /> - <war file="${dist.dir}/${war.filename}" webxml="${team.war}/WEB-INF/web.xml"> - <manifest> - <attribute name="Sealed" value="${manifest.sealed}" /> - <attribute name="Implementation-Title" value="${manifest.Implementation-Title} - Team Application" /> - <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}" /> - <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}" /> - </manifest> - <fileset dir="${team.war}"> - <exclude name="build.xml" /> - <exclude name="WEB-INF/src/**/*.java" /> - <exclude name="WEB-INF/jsp/**/*" /> - <exclude name="WEB-INF/sessions/**/*" /> - <!-- This is included in the war task already --> - <exclude name="WEB-INF/web.xml" /> - </fileset> - </war> - </target> - - <target name="clean" description="--> Removes jars and classes"> - <delete quiet="true"> - <fileset dir="${team.war}/WEB-INF/lib" includes="${webapp.ce.lib},${webtier.lib},${jgroups.jars}" /> - <fileset dir="${team.war}/WEB-INF" includes="web.xml"/> - <fileset dir="${team.war}/WEB-INF/flex"> - <include name="*-manifest.xml" /> - <include name="air-config.xml"/> - <include name="flex-config.xml"/> - <include name="flex-webtier-config.xml"/> - <include name="flash-unicode-table.xml"/> - <include name="flex-sdk-description.xml" /> - <include name="*.ser"/> - <include name="locale/**/*"/> - <include name="themes/**/*"/> - </fileset> - </delete> - <delete quiet="true"> - <fileset dir="${team.war}/WEB-INF/flex/jars" includes="**/*"/> - </delete> - <delete quiet="true" includeEmptyDirs="true"> - <fileset dir="${team.war}/WEB-INF/flex/locale" includes="**/*"/> - </delete> - <delete quiet="true" includeEmptyDirs="true"> - <fileset dir="${team.war}/WEB-INF/flex/libs" includes="**/*"/> - </delete> - <delete quiet="true" includeEmptyDirs="true"> - <fileset dir="${team.war}/WEB-INF/flex" includes="*.ser,cache.dep,*-manifest.xml"/> - </delete> - <delete quiet="true"> - <fileset dir="${classes.dir}" includes="**/*.class" /> - </delete> - <delete quiet="true" file="${dist.dir}/${war.filename}" /> - <delete quiet="true" includeEmptyDirs="true"> - <fileset dir="${team.war}/history" includes="**/*"/> - </delete> - <delete quiet="true" dir="${team.war}/history" /> - <delete quiet="true" dir="${team.war}/WEB-INF/lib" /> - <delete quiet="true" dir="${team.war}/WEB-INF/classes" /> - <delete quiet="true" dir="${team.war}/WEB-INF/flex/jars" /> - <delete quiet="true" dir="${team.war}/WEB-INF/flex/libs" /> - <delete quiet="true" dir="${team.war}/WEB-INF/flex/locale" /> - <delete quiet="true" dir="${team.war}/WEB-INF/flex/themes" /> - </target> - - <target name="generated-clean"> - <delete includeEmptyDirs="true" quiet="true"> - <fileset dir="${team.war}" includes="**/generated/*" /> - </delete> - <delete includeEmptyDirs="true" quiet="true"> - <fileset dir="${team.war}" includes="**/generated" /> - </delete> - </target> - -</project> +<?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="team.war/build.xml" default="main" basedir="../.."> + + <property file="${basedir}/build.properties" /> + <property name="team.war" value="${basedir}/apps/team" /> + <property name="dist.dir" value="${basedir}/dist" /> + <property name="src.dir" value="${team.war}/WEB-INF/src" /> + <property name="classes.dir" value="${team.war}/WEB-INF/classes" /> + <condition property="template.dir" value="client-side-detection-with-history"> + <equals arg1="${sdk.version}" arg2="3"/> + </condition> + <property name="template.dir" value=""/> + <condition property="war.filename" value="team-sdk3.war"> + <equals arg1="${sdk.version}" arg2="3"/> + </condition> + <property name="war.filename" value="team.war"/> + + <path id="classpath"> + <fileset dir="${team.war}/WEB-INF/lib" includes="**/*.jar" /> + <fileset dir="${team.war}/WEB-INF/flex/jars" includes="**/*.jar"/> + <pathelement location="${servlet.jar}" /> + <pathelement location="${jms.jar}"/> + </path> + + <target name="main" depends="clean,compile" /> + + <target name="prepare"> + <mkdir dir="${team.war}/WEB-INF/classes" /> + <mkdir dir="${team.war}/WEB-INF/lib" /> + <mkdir dir="${team.war}/WEB-INF/src" /> + </target> + + <target name="copy-resources"> + <fail unless="local.sdk.lib.dir" message="must specify local.sdk.lib.dir in server/build.properties"/> + <fail unless="local.sdk.frameworks.dir" message="must specify local.sdk.frameworks.dir in build.properties"/> + + <!-- copy sdk version sepecific web.xml. this is required for webtier --> + <copy todir="${team.war}/WEB-INF"> + <fileset dir="${qa.dir}/resources/webtier/flex_sdk_${sdk.version}/"> + <include name="web.xml"/> + </fileset> + </copy> + + <!-- copy sdk version specific flex-config.xml, air-config.xml and flex-webtier-config.xml --> + <copy todir="${team.war}/WEB-INF/flex"> + <fileset dir="${qa.dir}/resources/webtier/flex_sdk_${sdk.version}" includes="flex-config.xml,air-config.xml,flex-webtier-config.xml"/> + </copy> + + <!-- copy to the WEB-INF/flex directory --> + <copy todir="${team.war}/WEB-INF/flex"> + <fileset dir="${local.sdk.frameworks.dir}"> + <include name="*-manifest.xml" /> + <include name="flash-unicode-table.xml"/> + <include name="flex-sdk-description.xml" /> + <include name="*.ser"/> + <include name="locale/**/*"/> + <include name="themes/**/*"/> + </fileset> + </copy> + + <!-- copy swcs to the WEB-INF/flex/libs directory --> + <copy todir="${team.war}/WEB-INF/flex/libs"> + <fileset dir="${local.sdk.frameworks.dir}/libs" includes="**/*.swc"/> + </copy> + + <!-- copy to the lib directory --> + <copy todir="${team.war}/WEB-INF/lib"> + <fileset dir="${basedir}/lib" includes="${webapp.ce.lib},${webtier.lib},${jgroups.jars}" /> + <fileset dir="${qa.dir}/lib" includes="${axis.jars},${qa-services.jars}"/> + </copy> + + <!-- copy to the jars directory --> + <copy todir="${team.war}/WEB-INF/flex/jars"> + <fileset dir="${basedir}/lib" includes="${webtier.jars}"/> + </copy> + + <!-- copy to the classes directory --> + <copy todir="${team.war}/WEB-INF/classes"> + <fileset dir="${team.war}/WEB-INF/src"> + <include name="**/*.xml,**/*.properties" /> + </fileset> + <fileset dir="${basedir}/lib" includes="${webapp.classes}" /> + </copy> + + <!-- copy template file to the history directory --> + <copy todir="${team.war}/history" flatten="true"> + <fileset dir="${basedir}/templates/${template.dir}" includes="**/*.js,**/*.css,**/historyFrame.html"/> + </copy> + </target> + + <target name="run-depend" if="src.depend"> + <echo message="Removing class files that changed and dependent class files." /> + <depend cache="${classes.dir}" srcdir="${src.dir}" destdir="${classes.dir}" /> + </target> + + <target name="compile" depends="prepare,run-depend,copy-resources" description="compile"> + <javac source="1.5" debug="${src.debug}" destdir="${classes.dir}" srcdir="${src.dir}" classpathref="classpath" /> + </target> + + <target name="package" description=" Creates distribution war file"> + <mkdir dir="${dist.dir}" /> + <war file="${dist.dir}/${war.filename}" webxml="${team.war}/WEB-INF/web.xml"> + <manifest> + <attribute name="Sealed" value="${manifest.sealed}" /> + <attribute name="Implementation-Title" value="${manifest.Implementation-Title} - Team Application" /> + <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}" /> + <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}" /> + </manifest> + <fileset dir="${team.war}"> + <exclude name="build.xml" /> + <exclude name="WEB-INF/src/**/*.java" /> + <exclude name="WEB-INF/jsp/**/*" /> + <exclude name="WEB-INF/sessions/**/*" /> + <!-- This is included in the war task already --> + <exclude name="WEB-INF/web.xml" /> + </fileset> + </war> + </target> + + <target name="clean" description="--> Removes jars and classes"> + <delete quiet="true"> + <fileset dir="${team.war}/WEB-INF/lib" includes="${webapp.ce.lib},${webtier.lib},${jgroups.jars}" /> + <fileset dir="${team.war}/WEB-INF" includes="web.xml"/> + <fileset dir="${team.war}/WEB-INF/flex"> + <include name="*-manifest.xml" /> + <include name="air-config.xml"/> + <include name="flex-config.xml"/> + <include name="flex-webtier-config.xml"/> + <include name="flash-unicode-table.xml"/> + <include name="flex-sdk-description.xml" /> + <include name="*.ser"/> + <include name="locale/**/*"/> + <include name="themes/**/*"/> + </fileset> + </delete> + <delete quiet="true"> + <fileset dir="${team.war}/WEB-INF/flex/jars" includes="**/*"/> + </delete> + <delete quiet="true" includeEmptyDirs="true"> + <fileset dir="${team.war}/WEB-INF/flex/locale" includes="**/*"/> + </delete> + <delete quiet="true" includeEmptyDirs="true"> + <fileset dir="${team.war}/WEB-INF/flex/libs" includes="**/*"/> + </delete> + <delete quiet="true" includeEmptyDirs="true"> + <fileset dir="${team.war}/WEB-INF/flex" includes="*.ser,cache.dep,*-manifest.xml"/> + </delete> + <delete quiet="true"> + <fileset dir="${classes.dir}" includes="**/*.class" /> + </delete> + <delete quiet="true" file="${dist.dir}/${war.filename}" /> + <delete quiet="true" includeEmptyDirs="true"> + <fileset dir="${team.war}/history" includes="**/*"/> + </delete> + <delete quiet="true" dir="${team.war}/history" /> + <delete quiet="true" dir="${team.war}/WEB-INF/lib" /> + <delete quiet="true" dir="${team.war}/WEB-INF/classes" /> + <delete quiet="true" dir="${team.war}/WEB-INF/flex/jars" /> + <delete quiet="true" dir="${team.war}/WEB-INF/flex/libs" /> + <delete quiet="true" dir="${team.war}/WEB-INF/flex/locale" /> + <delete quiet="true" dir="${team.war}/WEB-INF/flex/themes" /> + </target> + + <target name="generated-clean"> + <delete includeEmptyDirs="true" quiet="true"> + <fileset dir="${team.war}" includes="**/generated/*" /> + </delete> + <delete includeEmptyDirs="true" quiet="true"> + <fileset dir="${team.war}" includes="**/generated" /> + </delete> + </target> + +</project> http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/team/features/README.txt ---------------------------------------------------------------------- diff --git a/attic/apps/team/features/README.txt b/attic/apps/team/features/README.txt index 4f29f95..d5160ac 100755 --- a/attic/apps/team/features/README.txt +++ b/attic/apps/team/features/README.txt @@ -1,2 +1,2 @@ -This part of the team application is intended for "Hello World" type of applications +This part of the team application is intended for "Hello World" type of applications that showcase different features in the most basic way possible. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/team/features/ajax/README.txt ---------------------------------------------------------------------- diff --git a/attic/apps/team/features/ajax/README.txt b/attic/apps/team/features/ajax/README.txt index 504e58a..3d903db 100755 --- a/attic/apps/team/features/ajax/README.txt +++ b/attic/apps/team/features/ajax/README.txt @@ -1,3 +1,3 @@ -Place for sample AJAX apps that use FDMS-Bridge. Before running the apps, make sure you run "ant main" in /resources/fds-ajax-bridge to compile FDMS-bridge and get the latest js and swf files in here. - -Double-check that the channels specified in TextMessage.html and TextMessage.mxml exist. The destination should exist as well. +Place for sample AJAX apps that use FDMS-Bridge. Before running the apps, make sure you run "ant main" in /resources/fds-ajax-bridge to compile FDMS-bridge and get the latest js and swf files in here. + +Double-check that the channels specified in TextMessage.html and TextMessage.mxml exist. The destination should exist as well. http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/team/features/ajax/messaging/TextMessage.html ---------------------------------------------------------------------- diff --git a/attic/apps/team/features/ajax/messaging/TextMessage.html b/attic/apps/team/features/ajax/messaging/TextMessage.html index c813c00..ef529d3 100755 --- a/attic/apps/team/features/ajax/messaging/TextMessage.html +++ b/attic/apps/team/features/ajax/messaging/TextMessage.html @@ -1,88 +1,88 @@ -<!-- - 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. ---> -<html> -<head> -<title>Email Flex Bridge Example</title> -<style> -body { margin: 0px; - overflow:hidden } - -textarea { - font-size: 1em; -} -</style> - <script type="text/javascript" src="../includes/js/FABridge.js"></script> - <script type="text/javascript" src="../includes/js/FDMSLib.js"></script> -</head> -<body scroll='no' style="font-size:.9em;"> -<script language="javascript"> - var p; - var c; - - function fdmsLibraryReady() - { - // todo: when is this supposed to be called? - // are types available? - alert("Library Ready"); - - var cs = new ChannelSet(); - cs.addChannel(new AMFChannel("my-amf-poll", "http://localhost:8400/team/messagebroker/myamfpoll")); - //cs.addChannel(new AMFChannel("my-polling-amf", "http://localhost:8100/dev/messagebroker/amfpolling")); - //cs.addChannel(new AMFChannel("my-polling-amf", "/dev/messagebroker/amfpolling")); - - p = new Producer(); - p.setDestination("messaging_AMF_Poll"); - p.setChannelSet(cs); - - c = new Consumer(); - c.setDestination("messaging_AMF_Poll"); - c.addEventListener("message", messageHandler); - c.setChannelSet(cs); - c.subscribe(); - } - - function sendChat() - { - alert("Sending message..."); - - var m = new AsyncMessage(); - var body = "Hello!"; - m.setBody(body); - p.send(m); - } - - function messageHandler(event) - { - alert("messageHandler:" + (typeof(event.getMessage().getBody())) + "," + event.getMessage().getBody()); - } - -</script> - -<script> - FDMSLibrary.load("../includes/swf/FDMSBridge.swf", fdmsLibraryReady); -</script> - - <div style="width:1024px"> - <div style="margin-bottom: 20px;float:left;padding: 20px;"> - <!-- <button onClick="fesLib_send();return false;">execute</button> --> - <button onClick="sendChat();return false;">execute</button> -</div> -</div> -</body> - - -</html> +<!-- + 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. +--> +<html> +<head> +<title>Email Flex Bridge Example</title> +<style> +body { margin: 0px; + overflow:hidden } + +textarea { + font-size: 1em; +} +</style> + <script type="text/javascript" src="../includes/js/FABridge.js"></script> + <script type="text/javascript" src="../includes/js/FDMSLib.js"></script> +</head> +<body scroll='no' style="font-size:.9em;"> +<script language="javascript"> + var p; + var c; + + function fdmsLibraryReady() + { + // todo: when is this supposed to be called? + // are types available? + alert("Library Ready"); + + var cs = new ChannelSet(); + cs.addChannel(new AMFChannel("my-amf-poll", "http://localhost:8400/team/messagebroker/myamfpoll")); + //cs.addChannel(new AMFChannel("my-polling-amf", "http://localhost:8100/dev/messagebroker/amfpolling")); + //cs.addChannel(new AMFChannel("my-polling-amf", "/dev/messagebroker/amfpolling")); + + p = new Producer(); + p.setDestination("messaging_AMF_Poll"); + p.setChannelSet(cs); + + c = new Consumer(); + c.setDestination("messaging_AMF_Poll"); + c.addEventListener("message", messageHandler); + c.setChannelSet(cs); + c.subscribe(); + } + + function sendChat() + { + alert("Sending message..."); + + var m = new AsyncMessage(); + var body = "Hello!"; + m.setBody(body); + p.send(m); + } + + function messageHandler(event) + { + alert("messageHandler:" + (typeof(event.getMessage().getBody())) + "," + event.getMessage().getBody()); + } + +</script> + +<script> + FDMSLibrary.load("../includes/swf/FDMSBridge.swf", fdmsLibraryReady); +</script> + + <div style="width:1024px"> + <div style="margin-bottom: 20px;float:left;padding: 20px;"> + <!-- <button onClick="fesLib_send();return false;">execute</button> --> + <button onClick="sendChat();return false;">execute</button> +</div> +</div> +</body> + + +</html> http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/team/features/ajax/messaging/TextMessage.mxml ---------------------------------------------------------------------- diff --git a/attic/apps/team/features/ajax/messaging/TextMessage.mxml b/attic/apps/team/features/ajax/messaging/TextMessage.mxml index e57e81f..1e52de9 100755 --- a/attic/apps/team/features/ajax/messaging/TextMessage.mxml +++ b/attic/apps/team/features/ajax/messaging/TextMessage.mxml @@ -1,95 +1,95 @@ -<?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="initApp()"> - - <mx:Panel id="mainPanel" title="TextMessage" height="100%" width="100%" - paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> - <mx:Button label="Execute" click="sendChat()"/> - <mx:Button label="Clear" click='output.text = ""'/> - <mx:TextArea id="output" width="100%" height="100%"/> - </mx:Panel> - - <mx:Script> - <![CDATA[ - - import mx.messaging.ChannelSet; - import mx.messaging.Consumer; - import mx.messaging.Producer; - import mx.messaging.channels.AMFChannel; - import mx.messaging.events.MessageFaultEvent; - import mx.messaging.events.MessageEvent; - import mx.messaging.messages.AsyncMessage; - - public var producer:Producer; - public var consumer:Consumer; - - private function initApp():void - { - /* - var target:TraceTarget = new TraceTarget(); - target.includeLevel = true; - target.filters = ["mx.messaging.*", "mx.rpc.*"]; - Log.addTarget(target); - */ - - var cs:ChannelSet = new ChannelSet(); - cs.addChannel(new AMFChannel("my-amf-poll", "http://localhost:8400/team/messagebroker/myamfpoll")); - - producer = new Producer(); - // producer.destination = "MyTransientTopic"; - producer.destination = "messaging_AMF_Poll"; - producer.channelSet = cs; - - consumer = new Consumer(); - consumer.destination = "messaging_AMF_Poll"; - consumer.channelSet = cs; - consumer.addEventListener(MessageFaultEvent.FAULT, messageFaultHandler); - consumer.addEventListener(MessageEvent.MESSAGE, messageHandler); - consumer.subscribe(); - } - - public function sendChat():void - { - if (!consumer.subscribed) - { - output.text += "***Consumer resubscribed \n"; - consumer.subscribe(); - } - var m:AsyncMessage = new AsyncMessage(); - var mbody:String = "Hello!"; - m.body = mbody; - producer.send(m); - } - - private function messageHandler(event : MessageEvent) : void - { - output.text += "Consumer received message: "+ event.message.body + "\n"; - } - - private function messageFaultHandler(event : Object) : void - { - output.text += "Consumer 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="initApp()"> + + <mx:Panel id="mainPanel" title="TextMessage" height="100%" width="100%" + paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"> + <mx:Button label="Execute" click="sendChat()"/> + <mx:Button label="Clear" click='output.text = ""'/> + <mx:TextArea id="output" width="100%" height="100%"/> + </mx:Panel> + + <mx:Script> + <![CDATA[ + + import mx.messaging.ChannelSet; + import mx.messaging.Consumer; + import mx.messaging.Producer; + import mx.messaging.channels.AMFChannel; + import mx.messaging.events.MessageFaultEvent; + import mx.messaging.events.MessageEvent; + import mx.messaging.messages.AsyncMessage; + + public var producer:Producer; + public var consumer:Consumer; + + private function initApp():void + { + /* + var target:TraceTarget = new TraceTarget(); + target.includeLevel = true; + target.filters = ["mx.messaging.*", "mx.rpc.*"]; + Log.addTarget(target); + */ + + var cs:ChannelSet = new ChannelSet(); + cs.addChannel(new AMFChannel("my-amf-poll", "http://localhost:8400/team/messagebroker/myamfpoll")); + + producer = new Producer(); + // producer.destination = "MyTransientTopic"; + producer.destination = "messaging_AMF_Poll"; + producer.channelSet = cs; + + consumer = new Consumer(); + consumer.destination = "messaging_AMF_Poll"; + consumer.channelSet = cs; + consumer.addEventListener(MessageFaultEvent.FAULT, messageFaultHandler); + consumer.addEventListener(MessageEvent.MESSAGE, messageHandler); + consumer.subscribe(); + } + + public function sendChat():void + { + if (!consumer.subscribed) + { + output.text += "***Consumer resubscribed \n"; + consumer.subscribe(); + } + var m:AsyncMessage = new AsyncMessage(); + var mbody:String = "Hello!"; + m.body = mbody; + producer.send(m); + } + + private function messageHandler(event : MessageEvent) : void + { + output.text += "Consumer received message: "+ event.message.body + "\n"; + } + + private function messageFaultHandler(event : Object) : void + { + output.text += "Consumer received fault: " + event.faultString + "\n"; + } + + ]]> + </mx:Script> + </mx:Application> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/team/features/messaging/cluster/messaging_AMF_Poll_Cluster.mxml ---------------------------------------------------------------------- diff --git a/attic/apps/team/features/messaging/cluster/messaging_AMF_Poll_Cluster.mxml b/attic/apps/team/features/messaging/cluster/messaging_AMF_Poll_Cluster.mxml index adf85a6..4f60505 100755 --- a/attic/apps/team/features/messaging/cluster/messaging_AMF_Poll_Cluster.mxml +++ b/attic/apps/team/features/messaging/cluster/messaging_AMF_Poll_Cluster.mxml @@ -1,94 +1,94 @@ -<?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();"> - - <!-- Before running this test, make sure messaging_AMF_Poll_Cluster is - uncommented from messaging-config.xml. - --> - <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:CheckBox label="Connected?" selected="{consumer.connected}"/> - <mx:CheckBox label="Subscribed?" selected="{consumer.subscribed}"/> - </mx:HBox> - <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_Cluster" - fault="faultHandler(event)"/> - - <mx:Consumer id="consumer" - destination="messaging_AMF_Poll_Cluster" - 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); - } - - 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();"> + + <!-- Before running this test, make sure messaging_AMF_Poll_Cluster is + uncommented from messaging-config.xml. + --> + <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:CheckBox label="Connected?" selected="{consumer.connected}"/> + <mx:CheckBox label="Subscribed?" selected="{consumer.subscribed}"/> + </mx:HBox> + <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_Cluster" + fault="faultHandler(event)"/> + + <mx:Consumer id="consumer" + destination="messaging_AMF_Poll_Cluster" + 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); + } + + 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 http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/team/features/messaging/cluster/messaging_HTTP_Poll_Cluster.mxml ---------------------------------------------------------------------- diff --git a/attic/apps/team/features/messaging/cluster/messaging_HTTP_Poll_Cluster.mxml b/attic/apps/team/features/messaging/cluster/messaging_HTTP_Poll_Cluster.mxml index 24d137f..d157261 100755 --- a/attic/apps/team/features/messaging/cluster/messaging_HTTP_Poll_Cluster.mxml +++ b/attic/apps/team/features/messaging/cluster/messaging_HTTP_Poll_Cluster.mxml @@ -1,94 +1,94 @@ -<?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();"> - - <!-- Before running this test, make sure messaging_HTTP_Poll_Cluster is - uncommented from messaging-config.xml. - --> - <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:CheckBox label="Connected?" selected="{consumer.connected}"/> - <mx:CheckBox label="Subscribed?" selected="{consumer.subscribed}"/> - </mx:HBox> - <mx:Button label="Clear" click='ta.text = ""'/> - <mx:TextArea id="ta" width="100%" height="100%"/> - </mx:Panel> - - <mx:Producer id="producer" - destination="messaging_HTTP_Poll_Cluster" - fault="faultHandler(event)"/> - - <mx:Consumer id="consumer" - destination="messaging_HTTP_Poll_Cluster" - 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); - } - - 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();"> + + <!-- Before running this test, make sure messaging_HTTP_Poll_Cluster is + uncommented from messaging-config.xml. + --> + <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:CheckBox label="Connected?" selected="{consumer.connected}"/> + <mx:CheckBox label="Subscribed?" selected="{consumer.subscribed}"/> + </mx:HBox> + <mx:Button label="Clear" click='ta.text = ""'/> + <mx:TextArea id="ta" width="100%" height="100%"/> + </mx:Panel> + + <mx:Producer id="producer" + destination="messaging_HTTP_Poll_Cluster" + fault="faultHandler(event)"/> + + <mx:Consumer id="consumer" + destination="messaging_HTTP_Poll_Cluster" + 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); + } + + 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 http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/team/features/messaging/cluster/messaging_SecureAMF_Poll_Cluster.mxml ---------------------------------------------------------------------- diff --git a/attic/apps/team/features/messaging/cluster/messaging_SecureAMF_Poll_Cluster.mxml b/attic/apps/team/features/messaging/cluster/messaging_SecureAMF_Poll_Cluster.mxml index 86e8164..57367b6 100755 --- a/attic/apps/team/features/messaging/cluster/messaging_SecureAMF_Poll_Cluster.mxml +++ b/attic/apps/team/features/messaging/cluster/messaging_SecureAMF_Poll_Cluster.mxml @@ -1,95 +1,95 @@ -<?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();"> - - <!-- Before running this test, make sure messaging_SecureAMF_Poll_Cluster is - uncommented from messaging-config.xml and you request the sample with - secure protocol (https) and port. - --> - <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:CheckBox label="Connected?" selected="{consumer.connected}"/> - <mx:CheckBox label="Subscribed?" selected="{consumer.subscribed}"/> - </mx:HBox> - <mx:Button label="Clear" click='ta.text = ""'/> - <mx:TextArea id="ta" width="100%" height="100%"/> - </mx:Panel> - - <mx:Producer id="producer" - destination="messaging_SecureAMF_Poll_Cluster" - fault="faultHandler(event)"/> - - <mx:Consumer id="consumer" - destination="messaging_SecureAMF_Poll_Cluster" - 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); - } - - 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();"> + + <!-- Before running this test, make sure messaging_SecureAMF_Poll_Cluster is + uncommented from messaging-config.xml and you request the sample with + secure protocol (https) and port. + --> + <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:CheckBox label="Connected?" selected="{consumer.connected}"/> + <mx:CheckBox label="Subscribed?" selected="{consumer.subscribed}"/> + </mx:HBox> + <mx:Button label="Clear" click='ta.text = ""'/> + <mx:TextArea id="ta" width="100%" height="100%"/> + </mx:Panel> + + <mx:Producer id="producer" + destination="messaging_SecureAMF_Poll_Cluster" + fault="faultHandler(event)"/> + + <mx:Consumer id="consumer" + destination="messaging_SecureAMF_Poll_Cluster" + 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); + } + + 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
