You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/04/25 07:33:59 UTC

[01/51] [partial] BlazeDS Donation from Adobe Systems Inc

Repository: flex-blazeds
Updated Branches:
  refs/heads/master [created] 7a58369c4


http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/config/MessagingConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/config/MessagingConfiguration.java b/modules/core/src/flex/messaging/config/MessagingConfiguration.java
new file mode 100755
index 0000000..72237f9
--- /dev/null
+++ b/modules/core/src/flex/messaging/config/MessagingConfiguration.java
@@ -0,0 +1,1003 @@
+/*
+ * 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.messaging.config;
+
+import flex.management.ManageableComponent;
+import flex.management.runtime.messaging.endpoints.EndpointControl;
+import flex.messaging.Destination;
+import flex.messaging.FlexComponent;
+import flex.messaging.FlexContext;
+import flex.messaging.MessageBroker;
+import flex.messaging.Server;
+import flex.messaging.client.FlexClientManager;
+import flex.messaging.cluster.ClusterManager;
+import flex.messaging.endpoints.AbstractEndpoint;
+import flex.messaging.endpoints.Endpoint;
+import flex.messaging.endpoints.Endpoint2;
+import flex.messaging.log.Log;
+import flex.messaging.log.Target;
+import flex.messaging.security.LoginCommand;
+import flex.messaging.security.LoginManager;
+import flex.messaging.services.AuthenticationService;
+import flex.messaging.services.Service;
+import flex.messaging.services.ServiceAdapter;
+import flex.messaging.util.ClassUtil;
+import flex.messaging.util.RedeployManager;
+import flex.messaging.util.StringUtils;
+import flex.messaging.util.ToStringPrettyPrinter;
+import flex.messaging.util.UUIDGenerator;
+import flex.messaging.validators.DeserializationValidator;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * This object encapsulates settings for a MessageBroker instance.
+ * The MessageBroker itself has no knowledge of configuration specifics;
+ * instead, this object sets the relevant values on the broker using
+ * information which a ConfigurationParser has provided for it.
+ *
+ * @author Peter Farland
+ * @author neville
+ * @exclude
+ */
+public class MessagingConfiguration implements ServicesConfiguration
+{
+    private final String asyncMessageBrokerType = "flex.messaging.AsyncMessageBroker";
+    private final String asyncFlexClientManagerType = "flex.messaging.client.AsyncFlexClientManager";
+    
+    private final Map<String, ChannelSettings> channelSettings;
+    private final List<String> defaultChannels;
+    private final SecuritySettings securitySettings;
+    private final List<ServiceSettings> serviceSettings;
+    private final List<SharedServerSettings> sharedServerSettings;
+    private LoggingSettings loggingSettings;
+    private SystemSettings systemSettings;
+    private FlexClientSettings flexClientSettings;
+    private final Map<String, ClusterSettings> clusterSettings;
+    private final Map<String, FactorySettings> factorySettings;
+    private final List<MessageFilterSettings> messageFilterSettings;
+    private final Map<String, ValidatorSettings> validatorSettings;
+
+    /**
+     * Constructor.
+     * Construct a MessagingConfiguration object
+     * <p/>
+     */
+    public MessagingConfiguration()
+    {
+        channelSettings = new HashMap<String, ChannelSettings>();
+        defaultChannels = new ArrayList<String>(4);
+        clusterSettings = new HashMap<String, ClusterSettings>();
+        factorySettings = new HashMap<String, FactorySettings>();
+        serviceSettings = new ArrayList<ServiceSettings>();
+        sharedServerSettings = new ArrayList<SharedServerSettings>();
+        securitySettings = new SecuritySettings();
+        messageFilterSettings = new ArrayList<MessageFilterSettings>();
+        validatorSettings = new HashMap<String, ValidatorSettings>();
+    }
+
+    /**
+     * Configure the MessageBroker.
+     * <p/>
+     * @param broker current MessageBroker object
+     */
+    public void configureBroker(MessageBroker broker)
+    {
+        boolean async = (broker.getClass().getName().equals(asyncMessageBrokerType));
+        
+        broker.setChannelSettings(channelSettings);
+        broker.setSecuritySettings(securitySettings);
+        broker.setSystemSettings(systemSettings);
+        broker.setFlexClientSettings(flexClientSettings);
+
+        // validators need to come first so that the other code can use them
+        createValidators(broker);
+
+        createAuthorizationManager(broker);
+        createFlexClientManager(broker);
+        createRedeployManager(broker);
+        createFactories(broker);
+        
+        if (async)
+            createSharedServers(broker);
+        
+        createEndpoints(broker);
+        // Default channels have to be set after endpoints are created.
+        broker.setDefaultChannels(defaultChannels);
+        prepareClusters(broker);
+        createServices(broker);
+        
+        if (async)
+            createMessageFilters(broker);
+
+        createUUIDGenerator(broker);
+    }
+
+    /**
+     * Create a MessageBroker object with the Id.
+     * <p/>
+     * @param id String the MessageBroker Id
+     * @param loader the ClassLoader used to load the MessageBroker class
+     * @return the created MessageBroker object
+     */
+    public MessageBroker createBroker(String id, ClassLoader loader)
+    {
+        // Construct MessageBroker with manageable constructor to avoid loading
+        // any JMX classes in case manageable is set to false. 
+        MessageBroker broker;
+        try // Use the AsyncMessageBroker, if possible.
+        {
+            @SuppressWarnings("unchecked")
+            Class<? extends MessageBroker> messageBrokerClass = ClassUtil.createClass(asyncMessageBrokerType, loader);
+            Constructor constructor = messageBrokerClass.getConstructor(boolean.class);
+            broker = (MessageBroker)constructor.newInstance(systemSettings.isManageable());
+        }
+        catch (Throwable t) // Otherwise, use the default MessageBroker.
+        {
+            broker = new MessageBroker(systemSettings.isManageable());
+        }
+
+        // Initialize MessageBroker.
+        broker.setEnforceEndpointValidation(systemSettings.isEnforceEndpointValidation());
+        //broker.setManaged(systemSettings.isManageable());
+        broker.setId(id);
+        broker.setClassLoader(loader);
+
+        return broker;
+    }
+
+    private void createFactories(MessageBroker broker)
+    {
+        for (Iterator<Map.Entry<String,FactorySettings>> iter=factorySettings.entrySet().iterator(); iter.hasNext(); )
+        {
+            Map.Entry<String,FactorySettings> entry = iter.next();
+            String id = entry.getKey();
+            FactorySettings factorySetting = entry.getValue();
+            broker.addFactory(id, factorySetting.createFactory(broker.getClassLoader()));
+        }
+    }
+
+    private void createFlexClientManager(MessageBroker broker)
+    {
+        FlexClientManager flexClientManager = null;
+        try // Use the async version, if possible.
+        {            
+            @SuppressWarnings("unchecked")
+            Class<? extends FlexClientManager> flexClientManagerClass = ClassUtil.createClass(asyncFlexClientManagerType, broker.getClassLoader());
+            Constructor ctor = flexClientManagerClass.getConstructor(broker.getClass());
+            flexClientManager = (FlexClientManager)ctor.newInstance(broker);
+        }
+        catch (Throwable t) // Otherwise, use the default FlexClientManager.
+        {
+            flexClientManager = new FlexClientManager(broker.isManaged(), broker);
+        }        
+        broker.setFlexClientManager(flexClientManager);
+    }
+
+    private void createRedeployManager(MessageBroker broker)
+    {
+        RedeployManager redeployManager = new RedeployManager();
+        redeployManager.setEnabled(systemSettings.getRedeployEnabled());
+        redeployManager.setWatchInterval(systemSettings.getWatchInterval());
+        redeployManager.setTouchFiles(systemSettings.getTouchFiles());
+        redeployManager.setWatchFiles(systemSettings.getWatchFiles());
+        broker.setRedeployManager(redeployManager);
+    }
+
+    private void createAuthorizationManager(MessageBroker broker)
+    {
+        LoginManager loginManager = new LoginManager();
+
+        // Create a Login Command for the LoginManager.
+        LoginCommand loginCommand = null;
+
+        Map loginCommands = securitySettings.getLoginCommands();
+
+        // If default Login Command is enabled, use it.
+        LoginCommandSettings loginCommandSettings = (LoginCommandSettings)loginCommands.get(LoginCommandSettings.SERVER_MATCH_OVERRIDE);
+        if (loginCommandSettings != null)
+        {
+            loginCommand = initLoginCommand(loginCommandSettings);
+        }
+        // Otherwise, try a server specific Login Command.
+        else
+        {
+            String serverInfo = securitySettings.getServerInfo();
+            loginCommandSettings = (LoginCommandSettings)loginCommands.get(serverInfo);
+
+            if (loginCommandSettings != null)
+            {
+                loginCommand = initLoginCommand(loginCommandSettings);
+            }
+            else
+            {
+                // Try a partial match of serverInfo
+                serverInfo = serverInfo.toLowerCase();
+                for (Iterator iterator = loginCommands.keySet().iterator(); iterator.hasNext();)
+                {
+                    String serverMatch = (String)iterator.next();
+                    loginCommandSettings = (LoginCommandSettings)loginCommands.get(serverMatch);
+
+                    if (serverInfo.indexOf(serverMatch.toLowerCase()) != -1)
+                    {
+                        // add this match for easier lookup next time around
+                        loginCommands.put(serverInfo, loginCommandSettings);
+                        loginCommand = initLoginCommand(loginCommandSettings);
+                        break;
+                    }
+                }
+            }
+        }
+
+        if (loginCommand == null)
+        {
+            if (Log.isWarn())
+                Log.getLogger(ConfigurationManager.LOG_CATEGORY).warn
+                ("No login command was found for '" + securitySettings.getServerInfo()
+                        + "'. Please ensure that the login-command tag has the correct server attribute value"
+                        + ", or use 'all' to use the login command regardless of the server.");
+        }
+        else
+        {
+            loginManager.setLoginCommand(loginCommand);
+        }
+
+        if (loginCommandSettings != null)
+            loginManager.setPerClientAuthentication(loginCommandSettings.isPerClientAuthentication());
+
+        broker.setLoginManager(loginManager);
+    }
+
+    private LoginCommand initLoginCommand(LoginCommandSettings loginCommandSettings)
+    {
+        String loginClass = loginCommandSettings.getClassName();
+        Class c = ClassUtil.createClass(loginClass,
+                FlexContext.getMessageBroker() == null ? null :
+                FlexContext.getMessageBroker().getClassLoader());
+        LoginCommand loginCommand = (LoginCommand)ClassUtil.createDefaultInstance(c, LoginCommand.class);
+
+        return loginCommand;
+    }
+
+    private void createSharedServers(MessageBroker broker)
+    {
+        for (SharedServerSettings settings : sharedServerSettings)
+        {
+            String id = settings.getId();
+            String className = settings.getClassName();
+            Class serverClass = ClassUtil.createClass(className, broker.getClassLoader());
+            FlexComponent server = (FlexComponent)ClassUtil.createDefaultInstance(serverClass, serverClass);
+            server.initialize(id, settings.getProperties());
+            if (broker.isManaged() && (server instanceof ManageableComponent))
+            {
+                ManageableComponent manageableServer = (ManageableComponent)server;
+                manageableServer.setManaged(true);
+                manageableServer.setParent(broker);
+            }
+            
+            // TODO: move this to only AsyncMessageBroker.
+            broker.addServer((Server)server);
+            
+            if (Log.isInfo())
+            {
+                Log.getLogger(ConfigurationManager.LOG_CATEGORY).info
+                ("Server '" + id + "' of type '" + className + "' created.");
+            }
+        }
+    }
+
+    private void createEndpoints(MessageBroker broker)
+    {
+        for (Iterator<String> iter = channelSettings.keySet().iterator(); iter.hasNext();)
+        {
+            String id = iter.next();
+            ChannelSettings chanSettings = channelSettings.get(id);
+            String url = chanSettings.getUri();
+            String endpointClassName = chanSettings.getEndpointType();
+
+            // Create the Endpoint
+            Endpoint endpoint = broker.createEndpoint(id, url, endpointClassName);
+            
+            // Cast to AbstractEndpoint - these are newer properties that post-date the locked Endpoint interface.
+            if (endpoint instanceof AbstractEndpoint)
+            {   
+                AbstractEndpoint abstractEndpoint = (AbstractEndpoint)endpoint;
+                abstractEndpoint.setRemote(chanSettings.isRemote());
+                abstractEndpoint.setServerOnly(chanSettings.getServerOnly());
+            }
+                        
+            endpoint.setSecurityConstraint(chanSettings.getConstraint());
+            endpoint.setClientType(chanSettings.getClientType());
+
+            // Assign referenced server
+            String referencedServerId = chanSettings.getServerId();
+            if ((referencedServerId != null) && (endpoint instanceof Endpoint2))
+            {
+                Server server = broker.getServer(referencedServerId);
+                if (server == null)
+                {
+                    ConfigurationException ce = new ConfigurationException();
+                    ce.setMessage(11128, new Object[] {chanSettings.getId(), referencedServerId});
+                    throw ce;
+                }
+                ((Endpoint2)endpoint).setServer(broker.getServer(referencedServerId));
+            }
+
+            // Initialize with endpoint properties
+            endpoint.initialize(id, chanSettings.getProperties());
+
+            if (Log.isInfo())
+            {
+                String endpointURL = endpoint.getUrl();
+                String endpointSecurity = EndpointControl.getSecurityConstraintOf(endpoint);
+                if (StringUtils.isEmpty(endpointSecurity))
+                    endpointSecurity = "None";
+                Log.getLogger(ConfigurationManager.LOG_CATEGORY).info
+                ("Endpoint '" + id + "' created with security: " +
+                        endpointSecurity + StringUtils.NEWLINE +
+                        "at URL: " + endpointURL);
+            }
+        }
+    }
+
+    private void createServices(MessageBroker broker)
+    {
+        //the broker needs its AuthenticationService always
+        AuthenticationService authService = new AuthenticationService();
+        authService.setMessageBroker(broker);
+
+        for (Iterator<ServiceSettings> iter = serviceSettings.iterator(); iter.hasNext();)
+        {
+            ServiceSettings svcSettings = iter.next();
+            String svcId = svcSettings.getId();
+            String svcClassName = svcSettings.getClassName();
+
+            // Create the Service
+            Service service = broker.createService(svcId, svcClassName);
+
+            // Service Class Name - not needed in AbstractService
+
+            // Initialize with service properties
+            service.initialize(svcId, svcSettings.getProperties());
+
+            // Default Channels
+            for (Iterator chanIter = svcSettings.getDefaultChannels().iterator(); chanIter.hasNext();)
+            {
+                ChannelSettings chanSettings = (ChannelSettings)chanIter.next();
+                service.addDefaultChannel(chanSettings.getId());
+            }
+
+            // Adapter Definitions
+            Map svcAdapterSettings = svcSettings.getAllAdapterSettings();
+            for (Iterator asIter = svcAdapterSettings.values().iterator(); asIter.hasNext();)
+            {
+                AdapterSettings as = (AdapterSettings) asIter.next();
+                service.registerAdapter(as.getId(), as.getClassName());
+                if (as.isDefault())
+                {
+                    service.setDefaultAdapter(as.getId());
+                }
+            }
+
+            // Destinations
+            Map destinationSettings = svcSettings.getDestinationSettings();
+            for (Iterator destSettingsIter = destinationSettings.keySet().iterator(); destSettingsIter.hasNext();)
+            {
+                String destName = (String)destSettingsIter.next();
+                DestinationSettings destSettings = (DestinationSettings)destinationSettings.get(destName);
+
+                createDestination(destSettings, service, svcSettings);
+            }
+        }
+    }
+
+    private void createDestination(DestinationSettings destSettings, Service service, ServiceSettings svcSettings)
+    {
+        String destId = destSettings.getId();
+        Destination destination = service.createDestination(destId);
+
+        // Channels
+        List chanSettings = destSettings.getChannelSettings();
+        if (chanSettings.size() > 0)
+        {
+            List<String> channelIds = new ArrayList<String>(2);
+            for (Iterator iter = chanSettings.iterator(); iter.hasNext();) {
+                ChannelSettings cs = (ChannelSettings) iter.next();
+                channelIds.add(cs.getId());
+            }
+            destination.setChannels(channelIds);
+        }
+
+        // Security
+        SecurityConstraint constraint = destSettings.getConstraint();
+        destination.setSecurityConstraint(constraint);
+
+        // Initialize with service, adapter and destination properties
+        destination.initialize(destId, svcSettings.getProperties());
+        destination.initialize(destId, destSettings.getAdapterSettings().getProperties());
+        destination.initialize(destId, destSettings.getProperties());
+
+        // Service Adapter
+        createAdapter(destination, destSettings, svcSettings);
+    }
+
+    private void createAdapter(Destination destination, DestinationSettings destSettings, ServiceSettings svcSettings)
+    {
+        AdapterSettings adapterSettings = destSettings.getAdapterSettings();
+        String adapterId = adapterSettings.getId();
+
+        ServiceAdapter adapter = destination.createAdapter(adapterId);
+
+        // Initialize with service, adapter and then destination properties
+        adapter.initialize(adapterId, svcSettings.getProperties());
+        adapter.initialize(adapterId, adapterSettings.getProperties());
+        adapter.initialize(adapterId, destSettings.getProperties());
+
+    }
+
+    /**
+     * @exclude
+     * Used by the MessageBrokerServlet to set up the singleton Log instance
+     * and add any targets defined in the logging configuration.
+     * This needs to be invoked ahead of creating and bootstrapping a MessageBroker
+     * instance so we're sure to have the logging system running in case the bootstrap
+     * process needs to log anything out.
+     */
+    public void createLogAndTargets()
+    {
+        if (loggingSettings == null)
+        {
+            Log.setPrettyPrinterClass(ToStringPrettyPrinter.class.getName());
+            return;
+        }
+
+        Log.createLog();
+
+        ConfigMap properties = loggingSettings.getProperties();
+
+        // Override default pretty printer for FDS to traverse deep Object graphs
+        if (properties.getPropertyAsString("pretty-printer", null) == null)
+        {
+            Log.setPrettyPrinterClass(ToStringPrettyPrinter.class.getName());
+        }
+
+        Log.initialize(null, properties);
+
+        // Targets
+        List targets = loggingSettings.getTargets();
+        Iterator it = targets.iterator();
+        while (it.hasNext())
+        {
+            TargetSettings targetSettings = (TargetSettings)it.next();
+            String className = targetSettings.getClassName();
+
+            Class c = ClassUtil.createClass(className,
+                        FlexContext.getMessageBroker() == null ? null :
+                        FlexContext.getMessageBroker().getClassLoader());
+            try
+            {
+                Target target = (Target)c.newInstance();
+                target.setLevel(Log.readLevel(targetSettings.getLevel()));
+                target.setFilters(targetSettings.getFilters());
+                target.initialize(null, targetSettings.getProperties());
+                Log.addTarget(target);
+            }
+            catch (Throwable t)
+            {
+                // Unwrap to get to the interesting exception
+                if (t instanceof InvocationTargetException)
+                    t = ((InvocationTargetException ) t).getCause();
+
+                System.err.println("*** Error setting up logging system");
+                t.printStackTrace();
+
+                ConfigurationException cx = new ConfigurationException();
+                cx.setMessage(10126, new Object[] { className });
+                cx.setRootCause(t);
+                throw cx;
+            }
+        }
+    }
+
+    private void createMessageFilters(MessageBroker broker)
+    {
+        Class asyncFilterClass = ClassUtil.createClass("flex.messaging.filters.BaseAsyncMessageFilter");
+        Class syncFilterClass = ClassUtil.createClass("flex.messaging.filters.BaseSyncMessageFilter");
+        
+        for (MessageFilterSettings settings : messageFilterSettings)
+        {
+            String id = settings.getId();
+            String className = settings.getClassName();
+            Class filterClass = ClassUtil.createClass(className, broker.getClassLoader());
+            FlexComponent filter = (FlexComponent)ClassUtil.createDefaultInstance(filterClass, null);
+            MessageFilterSettings.FilterType filterType = settings.getFilterType();
+            boolean filterIsAsync = filterType == MessageFilterSettings.FilterType.ASYNC;
+            // Validate filter is assignable to proper base class.
+            if ((filterIsAsync && !asyncFilterClass.isAssignableFrom(filterClass)) ||
+                (!filterIsAsync && !syncFilterClass.isAssignableFrom(filterClass)))
+            {
+                // Filter class is not a valid subclass of either supported base filter type.
+                ConfigurationException cx = new ConfigurationException();
+                int errorCode = filterIsAsync ? 11144 : 11145;
+                cx.setMessage(errorCode, new Object[] {settings.getId()});
+                throw cx;
+            }
+                        
+            filter.initialize(id, settings.getProperties());
+            if (broker.isManaged() && (filter instanceof ManageableComponent))
+            {
+                ManageableComponent manageableFilter = (ManageableComponent)filter;
+                manageableFilter.setManaged(true);
+                manageableFilter.setParent(broker);
+            }
+            
+            try
+            {
+                String methodName = filterIsAsync ? "getAsyncMessageFilterChain" : "getSyncMessageFilterChain";
+                Method getMessageFilterChain = broker.getClass().getDeclaredMethod(methodName);
+                Object filterChain = getMessageFilterChain.invoke(broker, (Object[])null);
+                Class arg = filterIsAsync ? asyncFilterClass : syncFilterClass; 
+                Method addFilter = filterChain.getClass().getDeclaredMethod("add", arg);
+                addFilter.invoke(filterChain, new Object[] {filter});
+            }
+            catch (Exception e)
+            {
+                // Hit an unexpected problem adding the filter instance to the broker's async or sync chain.
+                ConfigurationException cx = new ConfigurationException();
+                int errorCode = filterType == MessageFilterSettings.FilterType.ASYNC ? 11138 : 11143;
+                cx.setMessage(errorCode, new Object[] {settings.getId()});
+                cx.setRootCause(e);
+                throw cx;
+            }
+
+            if (Log.isInfo())
+            {
+                Log.getLogger(ConfigurationManager.LOG_CATEGORY).info
+                ("MessageFilter '" + id + "' of type '" + className + "' created.");
+            }
+        }
+    }
+
+    private void createValidators(MessageBroker broker)
+    {
+        for (Iterator<ValidatorSettings> iter = validatorSettings.values().iterator(); iter.hasNext(); )
+        {
+            ValidatorSettings settings = iter.next();
+            String className = settings.getClassName();
+            String type = settings.getType();
+            Class<?> validatorClass = ClassUtil.createClass(className, broker.getClassLoader());
+            Class<?> expectedClass = ClassUtil.createClass(type, broker.getClassLoader());
+            Object validator = ClassUtil.createDefaultInstance(validatorClass, expectedClass);
+            // Only set the DeserializationValidator types for now.
+            if (validator instanceof DeserializationValidator)
+            {
+                // there can only be one deserialization validator, throw an error if there is more than one.
+                DeserializationValidator existingValidator = broker.getDeserializationValidator();
+                if (existingValidator != null)
+                {
+                    ConfigurationException cx = new ConfigurationException();
+                    cx.setMessage(11400, new Object[]{existingValidator.getClass().getCanonicalName(), className});                    
+                    throw cx;
+                }
+                DeserializationValidator deserializationValidator = (DeserializationValidator)validator;
+                deserializationValidator.initialize(null, settings.getProperties());
+                broker.setDeserializationValidator(deserializationValidator);
+                if (Log.isInfo())
+                {
+                    Log.getLogger(ConfigurationManager.LOG_CATEGORY).info
+                    ("DeserializationValidator of type '" + className + "' created.");
+                }
+            }
+        }
+    }
+
+    private void createUUIDGenerator(MessageBroker broker)
+    {
+        String className = systemSettings.getUUIDGeneratorClassName();
+        if (className == null || className.length() == 0)
+            return;
+
+        Class uuidGeneratorClass = ClassUtil.createClass(className, broker.getClassLoader());
+        if (!UUIDGenerator.class.isAssignableFrom(uuidGeneratorClass))
+        {
+            // UUID Generator class is not a valid subclass of ''{0}''
+            ConfigurationException cx = new ConfigurationException();
+            cx.setMessage(11148, new Object[] {UUIDGenerator.class.getName()});
+            throw cx;
+        }
+
+        Object uuidGenerator = ClassUtil.createDefaultInstance(uuidGeneratorClass, UUIDGenerator.class);
+        broker.setUUIDGenerator((UUIDGenerator)uuidGenerator);
+    }
+
+    private void prepareClusters(MessageBroker broker)
+    {
+        ClusterManager clusterManager = broker.getClusterManager();
+        for (Iterator<String> iter=clusterSettings.keySet().iterator(); iter.hasNext(); )
+        {
+            String clusterId = iter.next();
+            ClusterSettings cs = clusterSettings.get(clusterId);
+            clusterManager.prepareCluster(cs);
+        }
+    }
+
+    /**
+     * Add Shared Server configurations.
+     * <p/>
+     * @param settings the SharedServerSettings object
+     **/
+    public void addSharedServerSettings(SharedServerSettings settings)
+    {
+        sharedServerSettings.add(settings);
+    }
+
+    /**
+     * Add the Channel configurations.
+     * <p/>
+     * @param id the ChannelSetting Id
+     * @param settings the ChannelSettings
+     **/
+    public void addChannelSettings(String id, ChannelSettings settings)
+    {
+        channelSettings.put(id, settings);
+    }
+
+    /**
+     * Get the ChannelSettings by Id.
+     * <p/>
+     * @param id the ChannelSettings Id 
+     * @return ChannelSettings the Channel settings
+     **/
+    public ChannelSettings getChannelSettings(String id)
+    {
+        return channelSettings.get(id);
+    }
+
+    /**
+     * Get all the ChannelSettings.
+     * @return Map the Map of all the ChannelSettings, maped by Id
+     **/
+    public Map getAllChannelSettings()
+    {
+        return channelSettings;
+    }
+
+    /**
+     * Add the default Channel by Id.
+     * <p/>
+     * @param id the Channel Id
+     **/
+    public void addDefaultChannel(String id)
+    {
+        defaultChannels.add(id);
+    }
+
+    /**
+     * Get the default Channel List.
+     * <p/>
+     * @return List, the list of default Channels
+     **/
+    public List getDefaultChannels()
+    {
+        return defaultChannels;
+    }
+
+    /**
+     * Get the Security Configurations.
+     * <p/>
+     * @return SecuritySettings current SecuritySettings
+     **/
+    public SecuritySettings getSecuritySettings()
+    {
+        return securitySettings;
+    }
+
+    /**
+     * Add Service Configurations.
+     * <p/>
+     * @param settings the ServiceSettings object
+     **/
+    public void addServiceSettings(ServiceSettings settings)
+    {
+        serviceSettings.add(settings);
+    }
+
+    /**
+     * Get ServiceSettings by Id.
+     * <p/>
+     * @param id the ServiceSettings Id
+     * @return ServiceSettings the ServiceSettings object
+     **/
+    public ServiceSettings getServiceSettings(String id)
+    {
+        for (Iterator<ServiceSettings> iter = serviceSettings.iterator(); iter.hasNext();)
+        {
+            ServiceSettings serviceSettings = iter.next();
+            if (serviceSettings.getId().equals(id))
+                return serviceSettings;
+        }
+        return null;
+    }
+
+    /**
+     * Get all ServiceSettings.
+     * <p/>
+     * @return List all the service settings
+     **/
+    public List getAllServiceSettings()
+    {
+        return serviceSettings;
+    }
+
+    /**
+     * Get LoggingSettings.
+     * <p/>
+     * @return LoggingSettings the LoggingSettings object
+     **/
+    public LoggingSettings getLoggingSettings()
+    {
+        return loggingSettings;
+    }
+
+    /**
+     * Set LoggingSettings.
+     * <p/>
+     * @param loggingSettings the LoggingSettings object
+     **/
+    public void setLoggingSettings(LoggingSettings loggingSettings)
+    {
+        this.loggingSettings = loggingSettings;
+    }
+
+    /**
+     * Set SystemSettings.
+     * <p/>
+     * @param ss the SystemSettings object
+     **/
+    public void setSystemSettings(SystemSettings ss)
+    {
+        systemSettings = ss;
+    }
+
+    /**
+     * Get SystemSettings.
+     * <p/>
+     * @return SystemSettings the LoggingSettings object
+     **/
+    public SystemSettings getSystemSettings()
+    {
+        return systemSettings;
+    }
+
+    /**
+     * Set FlexClientSettings.
+     * <p/>
+     * @param value the FlexClientSettings object
+     **/
+    public void setFlexClientSettings(FlexClientSettings value)
+    {
+        flexClientSettings = value;
+    }
+
+    /**
+     * Get FlexClientSettings.
+     * <p/>
+     * @return FlexClientSettings the FlexClientSettings object
+     **/
+    public FlexClientSettings getFlexClientSettings()
+    {
+        return flexClientSettings;
+    }
+
+    /**
+     * Add the ClusterSettings.
+     * <p/>   
+     * @param settings the ClusterSettings object
+     **/
+    public void addClusterSettings(ClusterSettings settings)
+    {
+        if (settings.isDefault())
+        {
+            for (Iterator<ClusterSettings> it = clusterSettings.values().iterator(); it.hasNext(); )
+            {
+                ClusterSettings cs = it.next();
+
+                if (cs.isDefault())
+                {
+                    ConfigurationException cx = new ConfigurationException();
+                    cx.setMessage(10214, new Object[] { settings.getClusterName(), cs.getClusterName() });
+                    throw cx;
+                }
+            }
+        }
+        if (clusterSettings.containsKey(settings.getClusterName()))
+        {
+            ConfigurationException cx = new ConfigurationException();
+            cx.setMessage(10206, new Object[] { settings.getClusterName() });
+            throw cx;
+        }
+        clusterSettings.put(settings.getClusterName(), settings);
+    }
+
+    /**
+     * Get the ClusterSettings object by Id.
+     * <p/>
+     * @param clusterId the ClusterSettings Id
+     * @return ClusterSettings the ClusterSettings object
+     **/
+    public ClusterSettings getClusterSettings(String clusterId)
+    {
+        for (Iterator<ClusterSettings> it = clusterSettings.values().iterator(); it.hasNext(); )
+        {
+            ClusterSettings cs = it.next();
+            if (cs.getClusterName() == clusterId)
+                return cs; // handle null case
+            if (cs.getClusterName() != null && cs.getClusterName().equals(clusterId))
+                return cs;
+        }
+        return null;
+    }
+
+    /**
+     * Get the default ClusterSettings.
+     * <p/>
+     * @return ClusterSettings the default ClusterSetting object
+     **/
+    public ClusterSettings getDefaultCluster()
+    {
+        for (Iterator<ClusterSettings> it = clusterSettings.values().iterator(); it.hasNext(); )
+        {
+            ClusterSettings cs = it.next();
+            if (cs.isDefault())
+                return cs;
+        }
+        return null;
+    }
+
+    /**
+     * Add FactorySettings by Id.
+     * <p/>
+     * @param id the FactorySettings Id
+     * @param settings the FactorySettings object
+     **/
+    public void addFactorySettings(String id, FactorySettings settings)
+    {
+        factorySettings.put(id, settings);
+    }
+
+    /**
+     * Add MessageFilterSettings.
+     * <p/>
+     * @param settings the MessageFilterSettings object
+     **/
+    public void addMessageFilterSettings(MessageFilterSettings settings)
+    {
+        messageFilterSettings.add(settings);
+    }
+
+    /**
+     * Add ValidatorSettings.
+     * <p/>
+     * @param settings the ValidatorSettings object
+     **/
+    public void addValidatorSettings(ValidatorSettings settings)
+    {
+        String type = settings.getType();
+        if (validatorSettings.containsKey(type))
+        {
+            // Cannot add multiple validators with the same type ''{0}''
+            ConfigurationException ce = new ConfigurationException();
+            ce.setMessage(11136, new Object[] {type});
+            throw ce;
+        }
+        validatorSettings.put(type, settings);
+    }
+
+    /**
+     * Report unused properties.
+     * <p/>
+     **/
+    public void reportUnusedProperties()
+    {
+        ArrayList<Object[]> findings = new ArrayList<Object[]>();
+
+        Iterator<ServiceSettings> serviceItr = serviceSettings.iterator();
+        while (serviceItr.hasNext())
+        {
+            ServiceSettings serviceSettings = serviceItr.next();
+            gatherUnusedProperties(serviceSettings.getId(), serviceSettings.getSourceFile(),
+                    ConfigurationConstants.SERVICE_ELEMENT, serviceSettings, findings);
+            Iterator destinationItr = serviceSettings.getDestinationSettings().values().iterator();
+            while (destinationItr.hasNext())
+            {
+                DestinationSettings destinationSettings = (DestinationSettings) destinationItr.next();
+                gatherUnusedProperties(destinationSettings.getId(), destinationSettings.getSourceFile(),
+                     ConfigurationConstants.DESTINATION_ELEMENT,
+                     destinationSettings, findings);
+
+                AdapterSettings adapterSettings = destinationSettings.getAdapterSettings();
+                if (adapterSettings != null)
+                {
+                    gatherUnusedProperties(adapterSettings.getId(), adapterSettings.getSourceFile(),
+                         ConfigurationConstants.ADAPTER_ELEMENT,
+                         adapterSettings, findings);
+                }
+            }
+        }
+
+        Iterator<ChannelSettings> channelItr = channelSettings.values().iterator();
+        while (channelItr.hasNext())
+        {
+            ChannelSettings channelSettings = channelItr.next();
+            // Skip property validation for remote channel-definitions
+            if (channelSettings.isRemote())
+                continue;
+
+            gatherUnusedProperties(channelSettings.getId(), channelSettings.getSourceFile(),
+            ConfigurationConstants.CHANNEL_ELEMENT, channelSettings, findings);
+        }
+
+        Iterator<SharedServerSettings> serverItr = sharedServerSettings.iterator();
+        while (serverItr.hasNext())
+        {
+            SharedServerSettings serverSettings = serverItr.next();
+            gatherUnusedProperties(serverSettings.getId(), serverSettings.getSourceFile(),
+                    ConfigurationConstants.SERVER_ELEMENT, serverSettings, findings);
+        }
+
+        if (!findings.isEmpty())
+        {
+            int errorNumber = 10149;
+            ConfigurationException exception = new ConfigurationException();
+            StringBuffer allDetails = new StringBuffer();
+            for (int i = 0; i < findings.size(); i++)
+            {
+                allDetails.append(StringUtils.NEWLINE);
+                allDetails.append("  ");
+                exception.setDetails(errorNumber, "pattern", findings.get(i));
+                allDetails.append(exception.getDetails());
+                exception.setDetails(null);
+            }
+            exception.setMessage(errorNumber, new Object[] {allDetails});
+            throw exception;
+        }
+    }
+
+    private void gatherUnusedProperties
+        (String settingsId, String settingsSource, String settingsType,
+         PropertiesSettings settings, Collection<Object[]> result)
+    {
+        List unusedProperties = settings.getProperties().findAllUnusedProperties();
+        int size = unusedProperties.size();
+        if (size > 0)
+        {
+            for (int i = 0; i < size; i++)
+            {
+                String path = (String) unusedProperties.get(i);
+                result.add(new Object[] {path, settingsType, settingsId, settingsSource});
+            }
+        }
+    }
+}


[38/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/history/history.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/history/history.js b/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/history/history.js
new file mode 100755
index 0000000..0f82450
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/history/history.js
@@ -0,0 +1,722 @@
+/*
+ * 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.
+ */
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        ie8: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+        if (browser.version == 8)
+        {
+            browser.ie = false;
+            browser.ie8 = true;
+        }
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    function hashChangeHandler()
+    {
+        currentHref = document.location.href;
+        var flexAppUrl = getHash();
+        //ADR: to fix multiple
+        if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+            var pl = getPlayers();
+            for (var i = 0; i < pl.length; i++) {
+                pl[i].browserURLChange(flexAppUrl);
+            }
+        } else {
+            getPlayer().browserURLChange(flexAppUrl);
+        }
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+        var i;
+
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+                for (i = 0; i < o.length; i++) {
+                    if (typeof o[i].browserURLChange != "undefined")
+                        return o[i];
+                }
+                for (i = 0; i < e.length; i++) {
+                    if (typeof e[i].browserURLChange != "undefined")
+                        return e[i];
+                }
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+            for (i = 0; i < e.length; i++) {
+                if (typeof e[i].browserURLChange != "undefined")
+                {
+                    return e[i];
+                }
+            }
+            for (i = 0; i < o.length; i++) {
+                if (typeof o[i].browserURLChange != "undefined")
+                {
+                    return o[i];
+                }
+            }
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var i;
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+                        currentHref = document.location.href;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                var flexAppUrl = getHash();
+                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
+                {    
+                    // If it did change and we're running Safari 3.x or earlier, 
+                    // then we have to look the old state up in our hand-maintained 
+                    // array since document.location.hash won't have changed, 
+                    // then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                    flexAppUrl = historyHash[currentHistoryLength];
+                }
+
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            iframe.src = 'javascript:false;'; 
+
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox || browser.ie8)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+
+        if (browser.ie8)        
+            document.body.onhashchange = hashChangeHandler;
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        },
+        getUserAgent: function() {
+            return navigator.userAgent;
+        },
+        getPlatform: function() {
+            return navigator.platform;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/history/historyFrame.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/history/historyFrame.html b/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/history/historyFrame.html
new file mode 100755
index 0000000..63bdd3e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/history/historyFrame.html
@@ -0,0 +1,45 @@
+<!--
+  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>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/index.template.html b/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/index.template.html
new file mode 100755
index 0000000..e3e9c81
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/swfobject.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/swfobject.js b/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/swfobject.js
new file mode 100755
index 0000000..07730fa
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/swfobject.js
@@ -0,0 +1,793 @@
+/*
+ * 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.
+ */
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+	
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+		ON_READY_STATE_CHANGE = "onreadystatechange",
+		
+		win = window,
+		doc = document,
+		nav = navigator,
+		
+		plugin = false,
+		domLoadFnArr = [main],
+		regObjArr = [],
+		objIdArr = [],
+		listenersArr = [],
+		storedAltContent,
+		storedAltContentId,
+		storedCallbackFn,
+		storedCallbackObj,
+		isDomLoaded = false,
+		isExpressInstallActive = false,
+		dynamicStylesheet,
+		dynamicStylesheetMedia,
+		autoHideShow = true,
+	
+	/* Centralized function for browser feature detection
+		- User agent string detection is only used when no good alternative is possible
+		- Is executed directly for optimal performance
+	*/	
+	ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+			u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+				plugin = true;
+				ie = false; // cascaded feature detection for Internet Explorer
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			try {
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+				if (a) { // a will return null when ActiveX is disabled
+					d = a.GetVariable("$version");
+					if (d) {
+						ie = true; // cascaded feature detection for Internet Explorer
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+			}
+			catch(e) {}
+		}
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+	}(),
+	
+	/* Cross-browser onDomLoad
+		- Will fire an event as soon as the DOM of a web page is loaded
+		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+		- Regular onload serves as fallback
+	*/ 
+	onDomLoad = function() {
+		if (!ua.w3) { return; }
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+			callDomLoadFunctions();
+		}
+		if (!isDomLoaded) {
+			if (typeof doc.addEventListener != UNDEF) {
+				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+			}		
+			if (ua.ie && ua.win) {
+				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+					if (doc.readyState == "complete") {
+						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+						callDomLoadFunctions();
+					}
+				});
+				if (win == top) { // if not inside an iframe
+					(function(){
+						if (isDomLoaded) { return; }
+						try {
+							doc.documentElement.doScroll("left");
+						}
+						catch(e) {
+							setTimeout(arguments.callee, 0);
+							return;
+						}
+						callDomLoadFunctions();
+					})();
+				}
+			}
+			if (ua.wk) {
+				(function(){
+					if (isDomLoaded) { return; }
+					if (!/loaded|complete/.test(doc.readyState)) {
+						setTimeout(arguments.callee, 0);
+						return;
+					}
+					callDomLoadFunctions();
+				})();
+			}
+			addLoadEvent(callDomLoadFunctions);
+		}
+	}();
+	
+	function callDomLoadFunctions() {
+		if (isDomLoaded) { return; }
+		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+			t.parentNode.removeChild(t);
+		}
+		catch (e) { return; }
+		isDomLoaded = true;
+		var dl = domLoadFnArr.length;
+		for (var i = 0; i < dl; i++) {
+			domLoadFnArr[i]();
+		}
+	}
+	
+	function addDomLoadEvent(fn) {
+		if (isDomLoaded) {
+			fn();
+		}
+		else { 
+			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+		}
+	}
+	
+	/* Cross-browser onload
+		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+		- Will fire an event as soon as a web page including all of its assets are loaded 
+	 */
+	function addLoadEvent(fn) {
+		if (typeof win.addEventListener != UNDEF) {
+			win.addEventListener("load", fn, false);
+		}
+		else if (typeof doc.addEventListener != UNDEF) {
+			doc.addEventListener("load", fn, false);
+		}
+		else if (typeof win.attachEvent != UNDEF) {
+			addListener(win, "onload", fn);
+		}
+		else if (typeof win.onload == "function") {
+			var fnOld = win.onload;
+			win.onload = function() {
+				fnOld();
+				fn();
+			};
+		}
+		else {
+			win.onload = fn;
+		}
+	}
+	
+	/* Main function
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
+	*/
+	function main() { 
+		if (plugin) {
+			testPlayerVersion();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Detect the Flash Player version for non-Internet Explorer browsers
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+		  a. Both release and build numbers can be detected
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+	*/
+	function testPlayerVersion() {
+		var b = doc.getElementsByTagName("body")[0];
+		var o = createElement(OBJECT);
+		o.setAttribute("type", FLASH_MIME_TYPE);
+		var t = b.appendChild(o);
+		if (t) {
+			var counter = 0;
+			(function(){
+				if (typeof t.GetVariable != UNDEF) {
+					var d = t.GetVariable("$version");
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				else if (counter < 10) {
+					counter++;
+					setTimeout(arguments.callee, 10);
+					return;
+				}
+				b.removeChild(o);
+				t = null;
+				matchVersions();
+			})();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Perform Flash Player and SWF version matching; static publishing only
+	*/
+	function matchVersions() {
+		var rl = regObjArr.length;
+		if (rl > 0) {
+			for (var i = 0; i < rl; i++) { // for each registered object element
+				var id = regObjArr[i].id;
+				var cb = regObjArr[i].callbackFn;
+				var cbObj = {success:false, id:id};
+				if (ua.pv[0] > 0) {
+					var obj = getElementById(id);
+					if (obj) {
+						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+							setVisibility(id, true);
+							if (cb) {
+								cbObj.success = true;
+								cbObj.ref = getObjectById(id);
+								cb(cbObj);
+							}
+						}
+						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+							var att = {};
+							att.data = regObjArr[i].expressInstall;
+							att.width = obj.getAttribute("width") || "0";
+							att.height = obj.getAttribute("height") || "0";
+							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+							// parse HTML object param element's name-value pairs
+							var par = {};
+							var p = obj.getElementsByTagName("param");
+							var pl = p.length;
+							for (var j = 0; j < pl; j++) {
+								if (p[j].getAttribute("name").toLowerCase() != "movie") {
+									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+								}
+							}
+							showExpressInstall(att, par, id, cb);
+						}
+						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+							displayAltContent(obj);
+							if (cb) { cb(cbObj); }
+						}
+					}
+				}
+				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+					setVisibility(id, true);
+					if (cb) {
+						var o = getObjectById(id); // test whether there is an HTML object element or not
+						if (o && typeof o.SetVariable != UNDEF) { 
+							cbObj.success = true;
+							cbObj.ref = o;
+						}
+						cb(cbObj);
+					}
+				}
+			}
+		}
+	}
+	
+	function getObjectById(objectIdStr) {
+		var r = null;
+		var o = getElementById(objectIdStr);
+		if (o && o.nodeName == "OBJECT") {
+			if (typeof o.SetVariable != UNDEF) {
+				r = o;
+			}
+			else {
+				var n = o.getElementsByTagName(OBJECT)[0];
+				if (n) {
+					r = n;
+				}
+			}
+		}
+		return r;
+	}
+	
+	/* Requirements for Adobe Express Install
+		- only one instance can be active at a time
+		- fp 6.0.65 or higher
+		- Win/Mac OS only
+		- no Webkit engines older than version 312
+	*/
+	function canExpressInstall() {
+		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+	}
+	
+	/* Show the Adobe Express Install dialog
+		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+	*/
+	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+		isExpressInstallActive = true;
+		storedCallbackFn = callbackFn || null;
+		storedCallbackObj = {success:false, id:replaceElemIdStr};
+		var obj = getElementById(replaceElemIdStr);
+		if (obj) {
+			if (obj.nodeName == "OBJECT") { // static publishing
+				storedAltContent = abstractAltContent(obj);
+				storedAltContentId = null;
+			}
+			else { // dynamic publishing
+				storedAltContent = obj;
+				storedAltContentId = replaceElemIdStr;
+			}
+			att.id = EXPRESS_INSTALL_ID;
+			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+				fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+			if (typeof par.flashvars != UNDEF) {
+				par.flashvars += "&" + fv;
+			}
+			else {
+				par.flashvars = fv;
+			}
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			if (ua.ie && ua.win && obj.readyState != 4) {
+				var newObj = createElement("div");
+				replaceElemIdStr += "SWFObjectNew";
+				newObj.setAttribute("id", replaceElemIdStr);
+				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						obj.parentNode.removeChild(obj);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			createSWF(att, par, replaceElemIdStr);
+		}
+	}
+	
+	/* Functions to abstract and display alternative content
+	*/
+	function displayAltContent(obj) {
+		if (ua.ie && ua.win && obj.readyState != 4) {
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			var el = createElement("div");
+			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+			el.parentNode.replaceChild(abstractAltContent(obj), el);
+			obj.style.display = "none";
+			(function(){
+				if (obj.readyState == 4) {
+					obj.parentNode.removeChild(obj);
+				}
+				else {
+					setTimeout(arguments.callee, 10);
+				}
+			})();
+		}
+		else {
+			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+		}
+	} 
+
+	function abstractAltContent(obj) {
+		var ac = createElement("div");
+		if (ua.win && ua.ie) {
+			ac.innerHTML = obj.innerHTML;
+		}
+		else {
+			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+			if (nestedObj) {
+				var c = nestedObj.childNodes;
+				if (c) {
+					var cl = c.length;
+					for (var i = 0; i < cl; i++) {
+						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+							ac.appendChild(c[i].cloneNode(true));
+						}
+					}
+				}
+			}
+		}
+		return ac;
+	}
+	
+	/* Cross-browser dynamic SWF creation
+	*/
+	function createSWF(attObj, parObj, id) {
+		var r, el = getElementById(id);
+		if (ua.wk && ua.wk < 312) { return r; }
+		if (el) {
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+				attObj.id = id;
+			}
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+				var att = "";
+				for (var i in attObj) {
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+						if (i.toLowerCase() == "data") {
+							parObj.movie = attObj[i];
+						}
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							att += ' class="' + attObj[i] + '"';
+						}
+						else if (i.toLowerCase() != "classid") {
+							att += ' ' + i + '="' + attObj[i] + '"';
+						}
+					}
+				}
+				var par = "";
+				for (var j in parObj) {
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+					}
+				}
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+				r = getElementById(attObj.id);	
+			}
+			else { // well-behaving browsers
+				var o = createElement(OBJECT);
+				o.setAttribute("type", FLASH_MIME_TYPE);
+				for (var m in attObj) {
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							o.setAttribute("class", attObj[m]);
+						}
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+							o.setAttribute(m, attObj[m]);
+						}
+					}
+				}
+				for (var n in parObj) {
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+						createObjParam(o, n, parObj[n]);
+					}
+				}
+				el.parentNode.replaceChild(o, el);
+				r = o;
+			}
+		}
+		return r;
+	}
+	
+	function createObjParam(el, pName, pValue) {
+		var p = createElement("param");
+		p.setAttribute("name", pName);	
+		p.setAttribute("value", pValue);
+		el.appendChild(p);
+	}
+	
+	/* Cross-browser SWF removal
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
+	*/
+	function removeSWF(id) {
+		var obj = getElementById(id);
+		if (obj && obj.nodeName == "OBJECT") {
+			if (ua.ie && ua.win) {
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						removeObjectInIE(id);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			else {
+				obj.parentNode.removeChild(obj);
+			}
+		}
+	}
+	
+	function removeObjectInIE(id) {
+		var obj = getElementById(id);
+		if (obj) {
+			for (var i in obj) {
+				if (typeof obj[i] == "function") {
+					obj[i] = null;
+				}
+			}
+			obj.parentNode.removeChild(obj);
+		}
+	}
+	
+	/* Functions to optimize JavaScript compression
+	*/
+	function getElementById(id) {
+		var el = null;
+		try {
+			el = doc.getElementById(id);
+		}
+		catch (e) {}
+		return el;
+	}
+	
+	function createElement(el) {
+		return doc.createElement(el);
+	}
+	
+	/* Updated attachEvent function for Internet Explorer
+		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+	*/	
+	function addListener(target, eventType, fn) {
+		target.attachEvent(eventType, fn);
+		listenersArr[listenersArr.length] = [target, eventType, fn];
+	}
+	
+	/* Flash Player and SWF content version matching
+	*/
+	function hasPlayerVersion(rv) {
+		var pv = ua.pv, v = rv.split(".");
+		v[0] = parseInt(v[0], 10);
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+		v[2] = parseInt(v[2], 10) || 0;
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+	}
+	
+	/* Cross-browser dynamic CSS creation
+		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+	*/	
+	function createCSS(sel, decl, media, newStyle) {
+		if (ua.ie && ua.mac) { return; }
+		var h = doc.getElementsByTagName("head")[0];
+		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+		var m = (media && typeof media == "string") ? media : "screen";
+		if (newStyle) {
+			dynamicStylesheet = null;
+			dynamicStylesheetMedia = null;
+		}
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+			// create dynamic stylesheet + get a global reference to it
+			var s = createElement("style");
+			s.setAttribute("type", "text/css");
+			s.setAttribute("media", m);
+			dynamicStylesheet = h.appendChild(s);
+			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+			}
+			dynamicStylesheetMedia = m;
+		}
+		// add style rule
+		if (ua.ie && ua.win) {
+			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+				dynamicStylesheet.addRule(sel, decl);
+			}
+		}
+		else {
+			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+			}
+		}
+	}
+	
+	function setVisibility(id, isVisible) {
+		if (!autoHideShow) { return; }
+		var v = isVisible ? "visible" : "hidden";
+		if (isDomLoaded && getElementById(id)) {
+			getElementById(id).style.visibility = v;
+		}
+		else {
+			createCSS("#" + id, "visibility:" + v);
+		}
+	}
+
+	/* Filter to avoid XSS attacks
+	*/
+	function urlEncodeIfNecessary(s) {
+		var regex = /[\\\"<>\.;]/;
+		var hasBadChars = regex.exec(s) != null;
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+	}
+	
+	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+	*/
+	var cleanup = function() {
+		if (ua.ie && ua.win) {
+			window.attachEvent("onunload", function() {
+				// remove listeners to avoid memory leaks
+				var ll = listenersArr.length;
+				for (var i = 0; i < ll; i++) {
+					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+				}
+				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+				var il = objIdArr.length;
+				for (var j = 0; j < il; j++) {
+					removeSWF(objIdArr[j]);
+				}
+				// cleanup library's main closures to avoid memory leaks
+				for (var k in ua) {
+					ua[k] = null;
+				}
+				ua = null;
+				for (var l in swfobject) {
+					swfobject[l] = null;
+				}
+				swfobject = null;
+			});
+		}
+	}();
+	
+	return {
+		/* Public API
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
+		*/ 
+		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+			if (ua.w3 && objectIdStr && swfVersionStr) {
+				var regObj = {};
+				regObj.id = objectIdStr;
+				regObj.swfVersion = swfVersionStr;
+				regObj.expressInstall = xiSwfUrlStr;
+				regObj.callbackFn = callbackFn;
+				regObjArr[regObjArr.length] = regObj;
+				setVisibility(objectIdStr, false);
+			}
+			else if (callbackFn) {
+				callbackFn({success:false, id:objectIdStr});
+			}
+		},
+		
+		getObjectById: function(objectIdStr) {
+			if (ua.w3) {
+				return getObjectById(objectIdStr);
+			}
+		},
+		
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+			var callbackObj = {success:false, id:replaceElemIdStr};
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+				setVisibility(replaceElemIdStr, false);
+				addDomLoadEvent(function() {
+					widthStr += ""; // auto-convert to string
+					heightStr += "";
+					var att = {};
+					if (attObj && typeof attObj === OBJECT) {
+						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+							att[i] = attObj[i];
+						}
+					}
+					att.data = swfUrlStr;
+					att.width = widthStr;
+					att.height = heightStr;
+					var par = {}; 
+					if (parObj && typeof parObj === OBJECT) {
+						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+							par[j] = parObj[j];
+						}
+					}
+					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+							if (typeof par.flashvars != UNDEF) {
+								par.flashvars += "&" + k + "=" + flashvarsObj[k];
+							}
+							else {
+								par.flashvars = k + "=" + flashvarsObj[k];
+							}
+						}
+					}
+					if (hasPlayerVersion(swfVersionStr)) { // create SWF
+						var obj = createSWF(att, par, replaceElemIdStr);
+						if (att.id == replaceElemIdStr) {
+							setVisibility(replaceElemIdStr, true);
+						}
+						callbackObj.success = true;
+						callbackObj.ref = obj;
+					}
+					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+						att.data = xiSwfUrlStr;
+						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+						return;
+					}
+					else { // show alternative content
+						setVisibility(replaceElemIdStr, true);
+					}
+					if (callbackFn) { callbackFn(callbackObj); }
+				});
+			}
+			else if (callbackFn) { callbackFn(callbackObj);	}
+		},
+		
+		switchOffAutoHideShow: function() {
+			autoHideShow = false;
+		},
+		
+		ua: ua,
+		
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		},
+		
+		hasFlashPlayerVersion: hasPlayerVersion,
+		
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
+			if (ua.w3) {
+				return createSWF(attObj, parObj, replaceElemIdStr);
+			}
+			else {
+				return undefined;
+			}
+		},
+		
+		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+			if (ua.w3 && canExpressInstall()) {
+				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+			}
+		},
+		
+		removeSWF: function(objElemIdStr) {
+			if (ua.w3) {
+				removeSWF(objElemIdStr);
+			}
+		},
+		
+		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+			if (ua.w3) {
+				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+			}
+		},
+		
+		addDomLoadEvent: addDomLoadEvent,
+		
+		addLoadEvent: addLoadEvent,
+		
+		getQueryParamValue: function(param) {
+			var q = doc.location.search || doc.location.hash;
+			if (q) {
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+				if (param == null) {
+					return urlEncodeIfNecessary(q);
+				}
+				var pairs = q.split("&");
+				for (var i = 0; i < pairs.length; i++) {
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+					}
+				}
+			}
+			return "";
+		},
+		
+		// For internal usage only
+		expressInstallCallback: function() {
+			if (isExpressInstallActive) {
+				var obj = getElementById(EXPRESS_INSTALL_ID);
+				if (obj && storedAltContent) {
+					obj.parentNode.replaceChild(storedAltContent, obj);
+					if (storedAltContentId) {
+						setVisibility(storedAltContentId, true);
+						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+					}
+					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+				}
+				isExpressInstallActive = false;
+			} 
+		}
+	};
+}();

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync06/src/Contact.as
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync06/src/Contact.as b/apps/samples-spring/WEB-INF/flex-src/insync06/src/Contact.as
new file mode 100755
index 0000000..ffa1f02
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync06/src/Contact.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
+{
+	[Bindable]
+	[RemoteClass(alias="org.springframework.flex.samples.contact.Contact")]
+	public class Contact
+	{
+		public var id:int = -1;
+		public var firstName:String;
+		public var lastName:String;
+		public var email:String;
+		public var phone:String;
+		public var address:String;
+		public var city:String;
+		public var state:String;
+		public var zip:String;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync06/src/ContactEvent.as
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync06/src/ContactEvent.as b/apps/samples-spring/WEB-INF/flex-src/insync06/src/ContactEvent.as
new file mode 100755
index 0000000..864bf62
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync06/src/ContactEvent.as
@@ -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
+{
+	import flash.events.Event;
+
+	public class ContactEvent extends Event
+	{
+		public static const CREATED:String = "contactCreated";
+		public static const UPDATED:String = "contactUpdated";
+		public static const DELETED:String = "contactDeleted";
+	
+		public var contact:Contact;
+		
+		public function ContactEvent(type:String, contact:Contact, bubbles:Boolean = true, cancelable:Boolean = false)
+   		{
+   			this.contact = contact;
+			super(type, bubbles, cancelable);
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync06/src/ContactForm.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync06/src/ContactForm.mxml b/apps/samples-spring/WEB-INF/flex-src/insync06/src/ContactForm.mxml
new file mode 100755
index 0000000..c3b4482
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync06/src/ContactForm.mxml
@@ -0,0 +1,138 @@
+<?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:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		   xmlns:s="library://ns.adobe.com/flex/spark" 
+		   xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
+		   label="{contact.id>-1?contact.firstName+' '+contact.lastName:'New Contact'}">
+
+	<fx:Metadata>
+		[Event(name="contactCreated", type="ContactEvent")]
+		[Event(name="contactUpdated", type="ContactEvent")]
+		[Event(name="contactDeleted", type="ContactEvent")]
+	</fx:Metadata>
+	
+	<fx:Script>
+		<![CDATA[
+
+			import mx.rpc.events.FaultEvent;
+			import mx.rpc.events.ResultEvent;
+			import mx.controls.Alert;
+			
+			[Bindable] public var contact:Contact;
+			
+			private function save():void
+			{
+				contact.firstName = firstName.text;
+				contact.lastName = lastName.text;
+				contact.email = email.text;
+				contact.phone = phone.text;
+				contact.address = address.text;
+				contact.city = city.text;
+				contact.state = state.text;
+				contact.zip = zip.text;
+				if (contact.id == -1)
+				{
+					ro.create(contact);	
+				}
+				else
+				{
+					ro.update(contact);
+				}
+			}			
+			
+			private function deleteItem():void
+			{
+				ro.remove(contact);		
+			}
+			
+			private function closeItem():void
+			{
+				parent.removeChild(this);
+			}
+			
+			private function create_resultHandler(event:ResultEvent):void
+			{
+				contact.id = event.result.id;
+				dispatchEvent(new ContactEvent(ContactEvent.CREATED, contact));			
+			}
+			
+			private function update_resultHandler(event:ResultEvent):void
+			{
+				dispatchEvent(new ContactEvent(ContactEvent.UPDATED, contact));			
+			}
+			
+			private function remove_resultHandler(event:ResultEvent):void
+			{
+				dispatchEvent(new ContactEvent(ContactEvent.DELETED, contact));			
+			}
+			
+			private function faultHandler(event:FaultEvent):void
+			{
+				Alert.show(event.fault.faultDetail);
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<mx:RemoteObject id="ro" destination="contactService" fault="faultHandler(event)" endpoint="{&apos;http://{server.name}:{server.port}/samples-spring/messagebroker/amf&apos;}">
+			<mx:method name="create" result="create_resultHandler(event)"/>
+			<mx:method name="update" result="update_resultHandler(event)"/>
+			<mx:method name="remove" result="remove_resultHandler(event)"/>
+		</mx:RemoteObject>
+	</fx:Declarations>
+
+	<mx:Form>
+		<mx:FormItem label="Id">
+			<mx:TextInput text="{contact.id}" enabled="false"/>
+		</mx:FormItem>
+		<mx:FormItem label="First Name">
+			<mx:TextInput id="firstName" text="{contact.firstName}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Last Name">
+			<mx:TextInput id="lastName" text="{contact.lastName}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Email">
+			<mx:TextInput id="email" text="{contact.email}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Phone">
+			<mx:TextInput id="phone" text="{contact.phone}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Address">
+			<mx:TextInput id="address" text="{contact.address}"/>
+		</mx:FormItem>
+		<mx:FormItem label="City">
+			<mx:TextInput id="city" text="{contact.city}"/>
+		</mx:FormItem>
+		<mx:FormItem label="State">
+			<mx:TextInput id="state" text="{contact.state}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Zip">
+			<mx:TextInput id="zip" text="{contact.zip}"/>
+		</mx:FormItem>
+	</mx:Form>
+	
+	<s:HGroup left="8" bottom="8">
+		<s:Button label="Close" click="closeItem()"/>
+		<s:Button label="Save" click="save()"/>
+		<s:Button label="Delete" click="deleteItem()"/>
+	</s:HGroup>
+
+</mx:Canvas>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync06/src/insync06.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync06/src/insync06.mxml b/apps/samples-spring/WEB-INF/flex-src/insync06/src/insync06.mxml
new file mode 100755
index 0000000..f7e1a95
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync06/src/insync06.mxml
@@ -0,0 +1,114 @@
+<?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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:local="*">
+	
+	<fx:Script>
+		<![CDATA[
+			
+			import mx.collections.ArrayCollection;
+			import mx.controls.Alert;
+			import mx.rpc.events.FaultEvent;
+			import mx.rpc.events.ResultEvent;
+			
+			[Bindable] private var contacts:ArrayCollection;
+			
+			private function resultHandler(event:ResultEvent):void
+			{
+				contacts = event.result as ArrayCollection
+			}
+			
+			private function faultHandler(event:FaultEvent):void
+			{
+				Alert.show(event.fault.faultDetail);
+			}
+			
+			public function openContact(contact:Contact):void
+			{
+				var children:Array = tn.getChildren();
+				for (var i:int = 0; i<children.length; i++)
+				{
+					if (ContactForm(children[i]).contact.id == contact.id)
+					{
+						tn.selectedChild = children[i];
+						return;
+					}
+				}
+				
+				var form:ContactForm = new ContactForm();
+				form.addEventListener(ContactEvent.CREATED, contactCreatedHandler);
+				form.addEventListener(ContactEvent.UPDATED, contactUpdatedHandler);
+				form.addEventListener(ContactEvent.DELETED, contactDeletedHandler);
+				tn.addChild(form);
+				form.contact = contact;
+				tn.selectedChild = form;
+			}
+
+			private function search():void
+			{
+				ro.findByName(searchStr.text);
+			}
+			
+			private function contactCreatedHandler(event:ContactEvent):void
+			{
+				search();				
+			}
+			
+			private function contactUpdatedHandler(event:ContactEvent):void
+			{
+				search();				
+			}
+			
+			private function contactDeletedHandler(event:ContactEvent):void
+			{
+				tn.removeChild(event.target as ContactForm);
+				search();				
+			}
+			
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<s:RemoteObject id="ro" destination="contactService" fault="faultHandler(event)" endpoint="{&apos;http://{server.name}:{server.port}/samples-spring/messagebroker/amf&apos;}">
+			<s:method name="findByName" result="resultHandler(event)"/>
+		</s:RemoteObject>
+	</fx:Declarations>
+	
+	<s:controlBarContent>
+		<s:TextInput id="searchStr"/>
+		<s:Button label="Search" click="search()"/>
+		<mx:Button label="New Contact" click="openContact(new Contact())"/>
+	</s:controlBarContent>
+	
+	<mx:HDividedBox  top="8" left="8" right="8" bottom="8">
+		<mx:DataGrid id="dg" dataProvider="{contacts}" width="30%" height="100%"
+					 doubleClickEnabled="{dg.selectedItem != null}"
+					 doubleClick="openContact(dg.selectedItem as Contact)">
+			<mx:columns>
+				<mx:DataGridColumn dataField="firstName" headerText="First Name"/>
+				<mx:DataGridColumn dataField="lastName" headerText="Last Name"/>
+			</mx:columns>
+		</mx:DataGrid>
+		<mx:TabNavigator id="tn" width="70%" height="100%"/>
+	</mx:HDividedBox>
+	
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/simplepush/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/simplepush/.actionScriptProperties b/apps/samples-spring/WEB-INF/flex-src/simplepush/.actionScriptProperties
new file mode 100755
index 0000000..d2d2c37
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/simplepush/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="simplepush.mxml" projectUUID="8054d1ac-d0ae-40e5-b6a0-30b8baec27da" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="simplepush.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/simplepush/.flexProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/simplepush/.flexProperties b/apps/samples-spring/WEB-INF/flex-src/simplepush/.flexProperties
new file mode 100755
index 0000000..1d99468
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/simplepush/.flexProperties
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/simplepush/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/simplepush/.project b/apps/samples-spring/WEB-INF/flex-src/simplepush/.project
new file mode 100755
index 0000000..1dbd388
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/simplepush/.project
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>simplepush</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/simplepush/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/simplepush/build.xml b/apps/samples-spring/WEB-INF/flex-src/simplepush/build.xml
new file mode 100755
index 0000000..b4e5dc4
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/simplepush/build.xml
@@ -0,0 +1,76 @@
+<?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-spring.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="context.root" value="samples-spring" />
+    <property name="application.name" value="simplepush" />
+    <property name="application.file" value="simplepush" />
+    <property name="application.bin.dir" value="${samples-spring.war}/simplepush" />
+    <property name="application.src.dir" value="${samples-spring.war}/WEB-INF/flex-src/simplepush/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-spring.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"
+            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>


[04/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/FlexClient.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/FlexClient.java b/modules/core/src/flex/messaging/client/FlexClient.java
new file mode 100755
index 0000000..3e0c7d2
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/FlexClient.java
@@ -0,0 +1,2240 @@
+/*
+ * 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.messaging.client;
+
+import flex.messaging.ConnectionAwareSession;
+import flex.messaging.FlexContext;
+import flex.messaging.FlexSession;
+import flex.messaging.FlexSessionListener;
+import flex.messaging.HttpFlexSession;
+import flex.messaging.MessageClient;
+import flex.messaging.MessageClientListener;
+import flex.messaging.MessageException;
+import flex.messaging.endpoints.Endpoint;
+import flex.messaging.log.Log;
+import flex.messaging.log.LogCategories;
+import flex.messaging.messages.CommandMessage;
+import flex.messaging.messages.Message;
+import flex.messaging.services.MessageService;
+import flex.messaging.util.StringUtils;
+import flex.messaging.util.TimeoutAbstractObject;
+
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * Represents a Flex client application instance on the server.
+ */
+public class FlexClient extends TimeoutAbstractObject implements FlexSessionListener, MessageClientListener
+{
+    //--------------------------------------------------------------------------
+    //
+    // Public Static Constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Log category for FlexClient related messages.
+     */
+    public static final String FLEX_CLIENT_LOG_CATEGORY = LogCategories.CLIENT_FLEXCLIENT;
+
+    /**
+     * This value is passed to the server in an initial client connect to
+     * indicate that the client needs a server-assigned FlexClient Id.
+     * @exclude
+     */
+    public static final String NULL_FLEXCLIENT_ID = "nil";
+
+    //--------------------------------------------------------------------------
+    //
+    // Private Static Constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Error string constants.
+     */
+    private static final int FLEX_CLIENT_INVALIDATED = 10027;
+    private static final int ENDPOINT_PUSH_HANDLER_ALREADY_REGISTERED = 10033;
+
+    private static final String POLL_WAIT_THREAD_NAME_EXTENSION = "-in-poll-wait";
+
+    //--------------------------------------------------------------------------
+    //
+    // Private Static Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * List of registered FlexClient created listeners.
+     */
+    private static final CopyOnWriteArrayList<FlexClientListener> createdListeners = new CopyOnWriteArrayList<FlexClientListener>();
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Static Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Adds a create listener that will be notified when new FlexClients
+     * are created.
+     *
+     * @see flex.messaging.client.FlexClientListener
+     *
+     * @param listener The listener to add.
+     */
+    public static void addClientCreatedListener(FlexClientListener listener)
+    {
+        if (listener != null)
+            createdListeners.addIfAbsent(listener);
+    }
+
+    /**
+     * Removes a FlexClient created listener.
+     *
+     * @see flex.messaging.client.FlexClientListener
+     *
+     * @param listener The listener to remove.
+     */
+    public static void removeClientCreatedListener(FlexClientListener listener)
+    {
+        if (listener != null)
+            createdListeners.remove(listener);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @exclude
+     * Constructs a new FlexClient instance.
+     *
+     * @param manager The FlexClientManager managing this instance.
+     */
+    public FlexClient(FlexClientManager manager)
+    {
+        this(manager, FlexContext.getMessageBroker().createUUID());
+    }
+
+    /**
+     * @exclude
+     * Constructs a new FlexClient instance having the specified Id.
+     *
+     * @param manager The FlexClientManager managing this instance.
+     * @param id The Id for this instance.
+     */
+    public FlexClient(FlexClientManager manager, String id)
+    {
+        this.id = id;
+        flexClientManager = manager;
+        updateLastUse();
+        valid = true;
+
+        if (Log.isDebug())
+            Log.getLogger(FLEX_CLIENT_LOG_CATEGORY).debug("FlexClient created with id '" + this.id + "'.");
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Storage for custom attributes.
+     */
+    private volatile Map<String, Object> attributes;
+
+    /**
+     * List of registered FlexClient attribute listeners.
+     */
+    private volatile CopyOnWriteArrayList<FlexClientAttributeListener> attributeListeners;
+
+    /**
+     * List of registered FlexClient destroyed listeners.
+     */
+    private volatile CopyOnWriteArrayList<FlexClientListener> destroyedListeners;
+
+    /**
+     * The manager for the FlexClient.
+     */
+    final FlexClientManager flexClientManager;
+
+    /**
+     * The unique Id for the instance.
+     */
+    private final String id;
+
+    /**
+     * Flag used to break cycles during invalidation.
+     */
+    /* package visibility for FlexClientManager */ volatile boolean invalidating;
+
+    /**
+     * Instance level lock to sync for state changes.
+     */
+    final Object lock = new Object();
+
+    /**
+     * MessageClient subscriptions for this MessageClient.
+     */
+    private volatile CopyOnWriteArrayList<MessageClient> messageClients;
+
+    /**
+     * Queues of outbound messages to push to the client keyed by endpoint id.
+     * Map(String endpointId, EndpointQueue queue).
+     */
+    private final Map<String, EndpointQueue> outboundQueues = new ConcurrentHashMap<String, EndpointQueue>(1);
+
+    /**
+     * EndpointPushHandlers keyed by endpointId that the FlexClient
+     * can use to push messages to remote clients.
+     * NOTE: these can't be added to the EndpointQueue data type because the existence of queues depends
+     * upon client subscription state whereas endpoints that support push will generally set up their push
+     * handling before any subscriptions have been created.
+     */
+    private Map<String, EndpointPushHandler> endpointPushHandlers;
+
+    /**
+     * Associated FlexSessions that represent the connections the FlexClient makes to the server.
+     */
+    private final CopyOnWriteArrayList<FlexSession> sessions = new CopyOnWriteArrayList<FlexSession>(); // We always have at least one session.
+
+    /**
+     * Flag indicating whether the instance is valid; once invalidated this flag is
+     * set to false.
+     */
+    boolean valid;
+
+    /**
+     * The principal associated with this client.  Only used when perClientAuthentication
+     * is being used.
+     */
+    private Principal userPrincipal;
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Adds a FlexClient attribute listener that will be notified when an
+     * attribute is added, removed or changed. If the attribute implements
+     * FlexClientBindingListener, it will be notified before any
+     * FlexClientAttributeListeners are notified.
+     *
+     * @param listener The listener to add.
+     */
+    public void addClientAttributeListener(FlexClientAttributeListener listener)
+    {
+        if (listener != null)
+        {
+            checkValid();
+
+            synchronized (lock)
+            {
+                if (attributeListeners == null)
+                    attributeListeners = new CopyOnWriteArrayList<FlexClientAttributeListener>();
+            }
+
+            attributeListeners.addIfAbsent(listener);
+        }
+    }
+
+    /**
+     * Adds a destroy listener that will be notified when the FlexClient
+     * is destroyed. Listeners are notified after all attributes
+     * have been unbound from the FlexClient and any FlexClientBindingListeners
+     * and FlexClientAttributeListeners have been notified.
+     *
+     * @see flex.messaging.client.FlexClientListener
+     *
+     * @param listener The listener to add.
+     */
+    public void addClientDestroyedListener(FlexClientListener listener)
+    {
+        if (listener != null)
+        {
+            checkValid();
+
+            synchronized (lock)
+            {
+                if (destroyedListeners == null)
+                    destroyedListeners = new CopyOnWriteArrayList<FlexClientListener>();
+            }
+
+            destroyedListeners.addIfAbsent(listener);
+        }
+    }
+
+    /**
+     * Returns the attribute bound to the specified name for the FlexClient, or null
+     * if no attribute is bound under the name.
+     *
+     * @param name The name the attribute is bound to.
+     * @return The attribute bound to the specified name.
+     */
+    public Object getAttribute(String name)
+    {
+        synchronized (lock)
+        {
+            checkValid();
+
+            updateLastUse();
+
+            return (attributes == null) ? null : attributes.get(name);
+        }
+    }
+
+    /**
+     * Returns a snapshot of the names of all attributes bound to the FlexClient.
+     *
+     * @return A snapshot of the names of all attributes bound to the FlexClient.
+     */
+    public Enumeration<String> getAttributeNames()
+    {
+        synchronized (lock)
+        {
+            checkValid();
+
+            updateLastUse();
+
+            if (attributes == null)
+                return Collections.enumeration(Collections.<String>emptyList());
+
+            // Return a copy so we do not run into concurrent modification problems if
+            // someone adds to the attributes while iterating through the returned enumeration.
+            return Collections.enumeration(new ArrayList<String>(attributes.keySet()));
+        }
+    }
+
+    /**
+     * @exclude
+     * Returns the push handler registered with the FlexClient with the supplied
+     * endpoint id, or null if no push handler was registered with the FlexClient
+     * for that endpoint.
+     *
+     * @return The push handler registered with the FlexClient with the supplied
+     * endpoint id, or null if no push handler was registered with the FlexClient
+     * for that endpoint.
+     */
+    public EndpointPushHandler getEndpointPushHandler(String endpointId)
+    {
+        synchronized (lock)
+        {
+            if (endpointPushHandlers != null && endpointPushHandlers.containsKey(endpointId))
+                return endpointPushHandlers.get(endpointId);
+            return null;
+        }
+    }
+
+    /**
+     * @exclude
+     * Returns the queue processor registered with the FlexClient with the supplied
+     * endpoint id, or null if no queue processor was registered with the FlexClient
+     * for that endpoint.
+     *
+     * @param endpointId The endpoint id.
+     * @return The queue processor registered with the FlexClient.
+     */
+    public FlexClientOutboundQueueProcessor getOutboundQueueProcessor(String endpointId)
+    {
+        EndpointQueue queue = outboundQueues.get(endpointId);
+        return (queue != null)? queue.processor : null;
+    }
+    
+    /**
+     * @exclude
+     * Returns the endpoint queue registered with the FlexClient with the supplied
+     * endpoint id, or null if no endpoint queue was registered with the FlexClient
+     * for that endpoint.
+     *
+     * @param endpointId The endpoint id.
+     * @return The endpoint queue registered with the FlexClient.
+     */
+    public EndpointQueue getEndpointQueue(String endpointId)
+    {
+        return outboundQueues.get(endpointId);
+    }
+
+    /**
+     * Override {@link flex.messaging.util.TimeoutAbstractObject#getLastUse()} to make timeout
+     * dependent upon FlexClient inactivity but also upon the presence of an active push-enabled session,
+     * async or waited poll, or registered endpoint push handler (all of which indicate that a client has
+     * an active, open connection to the server).
+     *
+     * @return The 'last use' timestamp for the FlexClient, which may be the current system time if the FlexClient
+     *         has been idle but an open connection from the client to the server exists.
+     */
+    @Override
+    public long getLastUse()
+    {
+        synchronized (lock)
+        {
+            long currentLastUse = super.getLastUse();
+            long idleTime = System.currentTimeMillis() - currentLastUse;
+            if (idleTime < flexClientManager.getFlexClientTimeoutMillis())
+                return currentLastUse; // Not timed out; this will trigger the timeout to be rescheduled.
+
+            // Check for async long-polls or endpoint streaming connections, if found, keep alive.
+            if (!outboundQueues.isEmpty())
+            {
+                for (EndpointQueue queue : outboundQueues.values())
+                {
+                    if (queue.asyncPoll != null)
+                        return System.currentTimeMillis();
+
+                    if (endpointPushHandlers != null && endpointPushHandlers.containsKey(queue.endpointId))
+                        return System.currentTimeMillis();
+                }
+            }
+
+            // Check for connected sessions, or a session holding a (non-async) long poll and if found, keep alive.
+            for (FlexSession session : sessions)
+            {
+                if (session instanceof ConnectionAwareSession)
+                {
+                    if (((ConnectionAwareSession)session).isConnected())
+                        return System.currentTimeMillis();
+                }
+                // Otherwise, check for a long-poll.
+                if (session.waitMonitor != null)
+                {
+                    for (EndpointQueue queue : session.waitMonitor.values())
+                    {
+                        if (queue.flexClient.equals(this))
+                            return System.currentTimeMillis();
+                    }
+                }
+            }
+            return currentLastUse; // Allow the FlexClient to timeout.
+        }
+    }
+
+    /**
+     * Returns the attribute bound to the specified name for the current FlexSession
+     * associated with the FlexClient. If the attribute does not exist in the current
+     * FlexSession, this method iterates through all the other FlexSessions associated with 
+     * the FlexClient and either returns the attribute bound, or null if no attribute is bound 
+     * under the name.
+     *
+     * @param name The name the attribute is bound to.
+     * @return The attribute bound to the specified name.
+     */
+    public Object getSessionAttribute(String name)
+    {
+        Object attributeValue = getSessionAttributeInCurrentSession(name);
+        if (attributeValue != null)
+            return attributeValue;
+
+        return getSessionAttributeInOtherSessions(name);
+    }
+
+    /**
+     * Returns a snapshot of the names of all attributes bound to all the FlexSessions
+     * associated with the FlexClient.
+     *
+     * @return A snapshot of the names of all attributes bound to all the FlexSessions
+     * associated with the FlexClient.
+     */
+    public Enumeration<String> getSessionAttributeNames()
+    {
+        Set<String> attributeNames = new HashSet<String>();
+        for (FlexSession session : sessions)
+            attributeNames.addAll(getSessionAttributeNames(session));
+        return Collections.enumeration(attributeNames);
+    }
+
+    /**
+     * @exclude
+     *
+     * Returns the principal associated with this client.  If the client has not
+     * authenticated the principal will be null.  Should only be called from FlexContext
+     * and only if perClientAuthentication is used.  Not available to users.
+     *
+     * @return The principal associated with the session.
+     */
+    public Principal getUserPrincipal()
+    {
+        synchronized (lock)
+        {
+            checkValid();
+            return userPrincipal;
+        }
+    }
+
+    /**
+     * @exclude
+     *
+     * Should only be called from FlexContext and only if perClientAuthentication is used.
+     * Not available to users.
+     *
+     * @param userPrincipal The principal to associate with the session.
+     */
+    public void setUserPrincipal(Principal userPrincipal)
+    {
+        synchronized (lock)
+        {
+            checkValid();
+            this.userPrincipal = userPrincipal;
+        }
+    }
+
+    /**
+     * Invalidates the FlexClient.
+     */
+    public void invalidate()
+    {
+        synchronized (lock)
+        {
+            if (!valid || invalidating)
+                return; // Already shutting down.
+
+            invalidating = true; // This thread gets to shut the FlexClient down.
+            flexClientManager.removeFlexClient(this);
+            cancelTimeout();
+        }
+
+        // Unregister from all FlexSessions.
+        if (!sessions.isEmpty())
+        {
+            for (FlexSession session : sessions)
+                unregisterFlexSession(session);
+        }
+
+        // Invalidate associated MessageClient subscriptions.
+        if (messageClients != null && !messageClients.isEmpty())
+        {
+            for (MessageClient messageClient : messageClients)
+            {
+                messageClient.removeMessageClientDestroyedListener(this);
+                messageClient.invalidate();
+            }
+            messageClients.clear();
+        }
+
+        // Notify destroy listeners that we're shutting the FlexClient down.
+        if (destroyedListeners != null && !destroyedListeners.isEmpty())
+        {
+            for (FlexClientListener destroyListener : destroyedListeners)
+            {
+                destroyListener.clientDestroyed(this);
+            }
+            destroyedListeners.clear();
+        }
+
+        // Unbind all attributes.
+        if (attributes != null && !attributes.isEmpty())
+        {
+            Set<String> keySet = attributes.keySet();
+            String[] keys = keySet.toArray(new String[keySet.size()]);
+            for (String key : keys)
+                removeAttribute(key);
+        }
+
+        // Close any registered push handlers.
+        if (endpointPushHandlers != null && !endpointPushHandlers.isEmpty())
+        {
+            for (EndpointPushHandler handler : endpointPushHandlers.values())
+            {
+                handler.close(true /* notify Channel of disconnect */);
+            }
+            endpointPushHandlers = null;
+        }
+
+        synchronized (lock)
+        {
+            valid = false;
+            invalidating = false;
+        }
+
+        if (Log.isDebug())
+            Log.getLogger(FLEX_CLIENT_LOG_CATEGORY).debug("FlexClient with id '" + this.id + "' has been invalidated.");
+    }
+
+    /**
+     * Returns true if the FlexClient is valid; false if it has been invalidated.
+     *
+     * @return true if the FlexClient is valid; otherwise false.
+     */
+    public boolean isValid()
+    {
+        synchronized (lock)
+        {
+            return valid;
+        }
+    }
+
+    /**
+     * Returns a snapshot of the FlexSessions associated with the FlexClient
+     * when this method is invoked.
+     * This list is not guaranteed to remain consistent with the actual list
+     * of active FlexSessions associated with the FlexClient over time.
+     *
+     * @return A snapshot of the current list of FlexSessions associated with the FlexClient.
+     */
+    public List<FlexSession> getFlexSessions()
+    {
+        List<FlexSession> currentSessions;
+        synchronized (lock)
+        {
+            checkValid();
+
+            updateLastUse();
+
+            currentSessions = new ArrayList<FlexSession>(sessions); // Make a copy of the current list to return.
+        }
+        return currentSessions;
+    }
+
+    /**
+     * Return the session count.
+     *
+     * @return The number of sessions associated with this FlexClient.
+     */
+    public int getSessionCount()
+    {
+        int sessionCount;
+        synchronized (lock)
+        {
+            sessionCount = (sessions != null) ? sessions.size() : 0; // Make a copy of the current list to return.
+        }
+        return sessionCount;
+    }
+
+    /**
+     * Return the subscription count.
+     *
+     * @return The number of subscriptions associated with this FlexClient.
+     */
+    public int getSubscriptionCount()
+    {
+        int count = 0;
+        synchronized (lock)
+        {
+
+            if (messageClients != null && !messageClients.isEmpty())
+            {
+                for (MessageClient messageClient : messageClients)
+                    count += messageClient.getSubscriptionCount();
+            }
+
+        }
+        return count;
+    }
+
+    /**
+     * Returns the message client registered with the FlexClient with the supplied
+     * client id, or null if no message client was registered with the FlexClient
+     * with that client id.
+     *
+     * @param clientId The client id.
+     * @return The message client registered with the FlexClient.
+     */
+    public MessageClient getMessageClient(String clientId)
+    {
+        synchronized (lock)
+        {
+            if (messageClients != null && !messageClients.isEmpty())
+            {
+                for (MessageClient messageClient : messageClients)
+                {
+                    if (messageClient.getClientId().equals(clientId))
+                        return messageClient;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Returns a snapshot of the MessageClients (subscriptions) associated with the FlexClient
+     * when this method is invoked.
+     * This list is not guaranteed to remain consistent with the actual list
+     * of active MessageClients associated with the FlexClient over time.
+     *
+     * @return A snapshot of the current list of MessageClients associated with the FlexClient.
+     */
+    public List<MessageClient> getMessageClients()
+    {
+        List<MessageClient> currentMessageClients;
+        synchronized (lock)
+        {
+            checkValid();
+
+            updateLastUse();
+
+            currentMessageClients = (messageClients != null) ? new ArrayList<MessageClient>(messageClients) // Make a copy of the current list to return.
+                                                             : Collections.<MessageClient>emptyList(); // Return an empty list.
+        }
+        return currentMessageClients;
+    }
+
+    /**
+     * Returns the unique Id for the FlexClient.
+     *
+     * @return The unique Id for the FlexClient.
+     */
+    public String getId()
+    {
+        return id;
+    }
+
+    /**
+     * @exclude
+     * Implements TimeoutCapable.
+     * Determine the time, in milliseconds, that this object is allowed to idle
+     * before having its timeout method invoked.
+     */
+    @Override
+    public long getTimeoutPeriod()
+    {
+        return flexClientManager.getFlexClientTimeoutMillis();
+    }
+
+    /**
+     * @exclude
+     * Implements MessageClientListener.
+     * Handling created events is a no-op.
+     *
+     * @param messageClient The new MessageClient.
+     */
+    public void messageClientCreated(MessageClient messageClient) {}
+
+    /**
+     * @exclude
+     * Implements MessageClientListener.
+     * Notification that an associated FlexSession was destroyed.
+     *
+     * @param messageClient The MessageClient that was destroyed.
+     */
+    public void messageClientDestroyed(MessageClient messageClient)
+    {
+        unregisterMessageClient(messageClient);
+    }
+
+    /**
+     * @exclude
+     * Poll for outbound messages for the FlexClient.
+     * This method is only invoked by internal code while processing a client poll request; it
+     * is not intended for general public use.
+     * Poll requests that trigger this method come from client-side polling channels and the request
+     * is not specific to a single Consumer/MessageClient instance so process any queued messages for
+     * the specified endpoint across all subscriptions.
+     *
+     * @param endpointId The Id of the endpoint that received the poll request.
+     * @return The flush result including messages to return in the poll response and
+     *         an optional wait time for the next poll/flush.
+     */
+    public FlushResult poll(String endpointId)
+    {
+        EndpointQueue queue = null;
+        synchronized (lock)
+        {
+            checkValid();
+
+            queue = outboundQueues.get(endpointId);
+
+            if (queue != null)
+                return internalPoll(queue);
+        }
+
+        if (queue == null)
+        {
+            // Otherwise, the client is not subscribed.
+            throwNotSubscribedException(endpointId);
+        }
+        
+        return null;
+    }
+
+    /**
+     * @exclude
+     * Poll for outbound messages for the FlexClient and if no messages are available
+     * immediately, store a reference to the passed async handler and call back when messages arrive.
+     *
+     * @param endpointId The Id of the endpoint that received the poll request.
+     * @param handler The handler to callback when messages arrive.
+     * @param waitIntervalMillis The wait interval in milliseconds for the poll to wait for data to arrive
+     *        before returning an empty poll response.
+     *
+     * @return A <tt>TimeoutAbstractObject</tt> representing the asynchronous poll, or <code>null</code>
+     *         if the poll request was handled immediately because data was available to return.
+     */
+    public TimeoutAbstractObject pollAsync(String endpointId, AsyncPollHandler handler, long waitIntervalMillis)
+    {
+        EndpointQueue queue;
+        TimeoutAbstractObject asyncPollTask = null;
+        
+        synchronized (lock)
+        {
+            checkValid();
+
+            queue = outboundQueues.get(endpointId);
+
+            // If the queue exists and is not empty, flush immediately.
+            if (queue != null)
+            {
+                if (!queue.messages.isEmpty())
+                {
+                    handler.asyncPollComplete(internalFlush(queue));
+                }
+                else // Set up an async long-poll.
+                {
+                    // Avoid monopolizing user agent connections.
+                    FlexSession session = FlexContext.getFlexSession();
+                    synchronized (session)
+                    {
+                        if (session.asyncPollMap != null)
+                        {
+                            AsyncPollWithTimeout parkedPoll = session.asyncPollMap.get(endpointId);
+                            if (parkedPoll != null)
+                            {
+                                // If the poll is from the same client for this endpoint, treat it as a no-op.
+                                if (parkedPoll.getFlexClient().equals(this))
+                                {
+                                    PollFlushResult result = new PollFlushResult();
+                                    result.setClientProcessingSuppressed(true);
+                                    handler.asyncPollComplete(result);
+                                }
+                                else // If the poll is for a different client on the same session, swap their waits.
+                                {
+                                    PollFlushResult result = new PollFlushResult();
+                                    result.setAvoidBusyPolling(true);
+                                    completeAsyncPoll(parkedPoll, result);
+                                }
+                            }
+                        }
+                        AsyncPollWithTimeout asyncPoll = new AsyncPollWithTimeout(this, session, queue, handler, waitIntervalMillis, endpointId);
+                        synchronized (session)
+                        {
+                            if (session.asyncPollMap == null)
+                                session.asyncPollMap = new HashMap<String, AsyncPollWithTimeout>();
+                            session.asyncPollMap.put(endpointId, asyncPoll);
+                        }
+                        queue.asyncPoll = asyncPoll;
+                        asyncPollTask = asyncPoll;
+                    }
+                }
+            }
+        }
+        if (queue == null)
+        {
+            // The queue was null; let the client know that there are no active subscriptions.
+            throwNotSubscribedException(endpointId);
+        }
+        return asyncPollTask;
+    }
+
+    /**
+     * @exclude
+     * Poll for outbound messages for the FlexClient and if no messages are available
+     * immediately, put processing into a wait state until messages arrive.
+     * This method is only invoked by internal code while processing a client poll request; it
+     * is not intended for general public use.
+     * Poll requests that trigger this method come from client-side polling channels and the request
+     * is not specific to a single Consumer/MessageClient instance so process any queued messages for
+     * the specified endpoint across all subscriptions.
+     *
+     * @param endpointId The Id of the endpoint that received the poll request.
+     * @param session The FlexSession associated with this waitable poll request.
+     * @param listener The listener to notify before a wait begins and as soon as one completes.
+     * @param waitIntervalMillis The maximum amount of time to wait for messages in milliseconds.
+     * @return The flush result including messages to return in the poll response and
+     *         an optional wait time for the next poll/flush.
+     */
+    public FlushResult pollWithWait(String endpointId, FlexSession session, PollWaitListener listener, long waitIntervalMillis)
+    {
+        EndpointQueue queue;
+        synchronized (lock)
+        {
+            checkValid();
+
+            queue = outboundQueues.get(endpointId);
+
+            // If the queue exists and is not empty there's no reason to wait; flush immediately.
+            if (queue != null)
+            {
+                FlushResult flushResult = internalPoll(queue);
+                if (flushResult != null)
+                    return flushResult;
+            }
+        }
+
+        // The queue exists but it was empty; we can try to wait for messages.
+        if (queue != null)
+        {
+            synchronized (session)
+            {
+                // Set up the waitMonitor on the session; this is a reference to the queue that the
+                // current poll request targets and we use it as a wait/notify monitor.
+                // This also lets us prevent busy polling cycles from a single client. If we already have a waited
+                // poll request a subsequent poll request is treated as a no-op.
+                if (session.waitMonitor != null)
+                {
+                    final EndpointQueue waitingQueue = session.waitMonitor.get(endpointId);
+                    // If the poll is from the same client swf, and the same endpoint, treat it as a no-op poll.
+                    if (waitingQueue != null && waitingQueue.flexClient.equals(this))
+                    {
+                        PollFlushResult result = new PollFlushResult();
+                        result.setClientProcessingSuppressed(true);
+                        return result;
+                    }
+                }
+                else
+                {
+                    session.waitMonitor = new HashMap<String, EndpointQueue>();
+                }
+
+                // Set the waitMonitor for the session to the queue
+                // for this poll request before releasing the lock.
+                session.waitMonitor.put(endpointId, queue);
+            }
+
+            // Now that the session references the wait monitor this thread will use to wait we can enter
+            // the wait state.
+            // -1 wait-interval actually means wait until notified.
+            waitIntervalMillis = (waitIntervalMillis == -1) ? 0 : waitIntervalMillis;
+            String threadName = Thread.currentThread().getName();
+            try
+            {
+                boolean didWait = false;
+                boolean avoidBusyPolling = false;
+                synchronized (queue)
+                {
+                    // If the message queue is still empty, wait for a message to be added before invoking flush.
+                    if (queue.messages.isEmpty())
+                    {
+                        reportStatusIfDebug("waiting for new messages to arrive");
+
+                        didWait = true;
+
+                        // Tag thread name during the wait.
+                        Thread currentThread = Thread.currentThread();
+                        currentThread.setName(threadName + POLL_WAIT_THREAD_NAME_EXTENSION);
+
+                        if (listener != null)
+                            listener.waitStart(queue);
+ 
+                        queue.waitPoll = true; // Mark the queue as waiting.
+
+                        queue.wait(waitIntervalMillis);
+                        
+                        queue.waitPoll = false; // Unmark the queue as waiting.
+
+                        // Reset thread name now that the wait is over.
+                        currentThread.setName(threadName);
+
+                        if (listener != null)
+                            listener.waitEnd(queue);
+
+                        if (queue.avoidBusyPolling)
+                        {
+                            avoidBusyPolling = true;
+                            queue.avoidBusyPolling = false;
+                        }
+                    }
+                }
+
+                synchronized (session)
+                {
+                    if (session.waitMonitor != null)
+                    {
+                        session.waitMonitor.remove(endpointId);
+                    }
+                }
+
+                if (Log.isDebug())
+                {
+                    if (didWait)
+                        reportStatusIfDebug("done waiting for new messages to arrive and is flushing the outbound queue");
+                    else
+                        reportStatusIfDebug("didn't need to wait and is flushing the outbound queue");
+                }
+
+                // We need to hold the FlexClient lock to invoke flush.
+                FlushResult result;
+                synchronized (lock)
+                {
+                    result = internalFlush(queue);
+                }
+                if (avoidBusyPolling)
+                {
+                    PollFlushResult swappedPollResult = new PollFlushResult();
+                    if (result != null)
+                    {
+                        swappedPollResult.setMessages(result.getMessages());
+                        swappedPollResult.setNextFlushWaitTimeMillis(result.getNextFlushWaitTimeMillis());
+                    }
+                    swappedPollResult.setAvoidBusyPolling(true);
+                    result = swappedPollResult;
+                }
+                return result;
+            }
+            catch (InterruptedException e)
+            {
+                if (Log.isWarn())
+                    Log.getLogger(FLEX_CLIENT_LOG_CATEGORY).warn("Poll wait thread '" + threadName + "' for FlexClient with id '" + this.id +
+                            "' could not finish waiting for new messages to arrive " +
+                            "because it was interrupted: " + e.toString());
+            }
+        }
+        else
+        {
+            // The queue was null; let the client know that there are no active subscriptions.
+            throwNotSubscribedException(endpointId);
+        }
+        return null;
+    }
+
+    private void reportStatusIfDebug(String message)
+    {
+        String threadName = Thread.currentThread().getName();
+        if (Log.isDebug())
+            Log.getLogger(FLEX_CLIENT_LOG_CATEGORY).debug("Poll wait thread '" + threadName + "' for FlexClient with id '" + this.id + "' is " + message);
+    }
+
+    /**
+     * @exclude
+     * Poll for outbound messages for a specific MessageClient/Consumer.
+     * This overload of poll() is only invoked when handling a Consumer.receive() request.
+     *
+     * @param client The specific MessageClient instance to poll for messages for.
+     * @return The flush result including messages to return in the poll response.
+     *         The nextFlushWaitTimeMillis value is always forced to a value of 0 because
+     *         Consumer.receive() calls are driven by client code and this setting has no meaning.
+     */
+    public FlushResult poll(MessageClient client)
+    {
+        FlushResult flushResult = null;
+        String endpointId = client.getEndpointId();
+        EndpointQueue queue = null;
+        synchronized (lock)
+        {
+            checkValid();
+
+            queue = outboundQueues.get(endpointId);
+            if (queue != null)
+            {
+                try
+                {
+                    flushResult = internalFlush(queue, client);
+                }
+                catch (RuntimeException e)
+                {
+                    if (Log.isError())
+                        Log.getLogger(FLEX_CLIENT_LOG_CATEGORY).error("Failed to flush an outbound queue for MessageClient '" + client.getClientId() + "' for FlexClient '" + getId() + "'.", e);
+                    throw e;
+                }
+                if (flushResult != null)
+                    flushResult.setNextFlushWaitTimeMillis(0); // Force to 0.
+            }
+        }
+        if (queue == null)
+        {
+            throwNotSubscribedException(endpointId);
+        }
+        return flushResult;
+    }
+
+    /**
+     * @exclude
+     * Push a message to the FlexClient.
+     * The message is added to the outbound queue of messages for the client and
+     * will be pushed if possible or retrieved via a client poll request.
+     *
+     * @param message The Message to push.
+     * @param messageClient The MessageClient subscription that this message targets.
+     */
+    public void push(Message message, MessageClient messageClient)
+    {
+        // We should check the message client is valid or not
+        if (!isValid())
+            return;
+
+        // Route this message to the proper per-endpoint outbound queue.
+        EndpointQueue queue = outboundQueues.get(messageClient.getEndpointId());
+
+        // This queue may be null if all corresponding subscriptions have been invalidated.
+        if (queue == null)
+            return;
+
+        boolean empty;
+        
+        // We need to obtain the lock here
+        // Maintain the pattern of using the FlexClient.lock and ensure that order of locks should always start with the FlexClient.lock
+        // This is critical to prevent deadlock cases, see Watson bug 2724938 
+        synchronized (lock)
+        {
+            synchronized (queue) // To protect the list during the add and allow for notification.
+            {
+                // Let the processor add the message to the queue.
+                try
+                {
+                    queue.processor.add(queue.messages, message);
+                    empty = queue.messages.isEmpty();
+
+                    if (Log.isDebug())
+                        Log.getLogger(LogCategories.MESSAGE_GENERAL).debug(
+                                "Queuing message: " + message.getMessageId() +
+                                StringUtils.NEWLINE +
+                                "  to send to MessageClient: " + messageClient.getClientId() +
+                                StringUtils.NEWLINE +
+                                "  for FlexClient: " + messageClient.getFlexClient().getId() +
+                                StringUtils.NEWLINE +
+                                "  via endpoint: " + queue.endpointId +
+                                StringUtils.NEWLINE +
+                                "  client outbound queue size: " + queue.messages.size());
+                }
+                catch (RuntimeException e)
+                {
+                    if (Log.isError())
+                        Log.getLogger(FLEX_CLIENT_LOG_CATEGORY).error("Failed to add a message to an outbound queue for FlexClient '" + getId() + "'.", e);
+                    throw e;
+                }
+                // And notify any threads that may be in a poll wait state.
+                if (!empty && queue.waitPoll)
+                {
+                    // TODO This updateLastUse call is added here because there used to be a call 
+                    // at the beginning of the push method but not convinced that it is needed. 
+                    updateLastUse();
+                    queue.notifyAll();
+                }
+            }
+
+            if (!empty)
+            {
+                if (queue.asyncPoll != null)
+                {
+                    completeAsyncPoll(queue.asyncPoll, internalFlush(queue));
+                }
+                else if (!empty && queue.flushTask == null &&
+                        (queue.pushSession != null || (endpointPushHandlers != null && endpointPushHandlers.containsKey(queue.endpointId))))
+                {
+                    // If a delayed flush is not scheduled and we have a push-enabled session associated with the queue
+                    // or a push-enabled endpoint, try a direct push to the client.
+                    // Once again we should acquire the lock for queue, otherwise a potential dead lock could happen, see Watson bug 2724936
+                    // By acquiring the queue lock again, we break the cycle by acquiring the queue before holding FlexClient.lock object 
+                    synchronized (queue) 
+                    {
+                        directFlush(queue);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * @exclude
+     * Registers an <tt>EndpointPushHandler</tt> for the specified endpoint to handle pushing messages
+     * to remote clients.
+     *
+     * @param handler The <tt>EndpointPushHandler</tt> to register.
+     * @param endpointId The endpoint to register for.
+     */
+    public void registerEndpointPushHandler(EndpointPushHandler handler, String endpointId)
+    {
+        synchronized (lock)
+        {
+            if (endpointPushHandlers == null)
+                endpointPushHandlers = new HashMap<String, EndpointPushHandler>(1);
+
+            if (endpointPushHandlers.containsKey(endpointId))
+            {
+                MessageException me = new MessageException();
+                me.setMessage(ENDPOINT_PUSH_HANDLER_ALREADY_REGISTERED, new Object[] {getId(), endpointId});
+                throw me;
+            }
+
+            endpointPushHandlers.put(endpointId, handler);
+        }
+    }
+
+    /**
+     * @exclude
+     * Used internally to associate a FlexSession with this FlexClient.
+     *
+     * @param session The FlexSession to associate with this FlexClient.
+     */
+    public void registerFlexSession(FlexSession session)
+    {
+        if (sessions.addIfAbsent(session))
+        {
+            session.addSessionDestroyedListener(this);
+            session.registerFlexClient(this);
+        }
+    }
+
+    /**
+     * @exclude
+     * Used internally to associate a MessageClient with this FlexClient.
+     *
+     * @param messageClient The MessageClient to associate with this FlexClient.
+     */
+    public void registerMessageClient(MessageClient messageClient)
+    {
+        synchronized (lock)
+        {
+            if (messageClients == null)
+                messageClients = new CopyOnWriteArrayList<MessageClient>();
+        }
+
+        if (messageClients.addIfAbsent(messageClient))
+        {
+            messageClient.addMessageClientDestroyedListener(this);
+            String endpointId = messageClient.getEndpointId();
+            // Manage the outbound queue this MessageClient's subscription(s) will use
+            // and associate the MessageClient with an EndpointPushHandler if one exists for the
+            // endpoint the subscription was made over; this allows the shut-down of a
+            // push connection to invalidate any subscriptions that are using it.
+            synchronized (lock)
+            {
+                getOrCreateEndpointQueueAndRegisterSubscription(messageClient, endpointId);
+                if (endpointPushHandlers != null)
+                {
+                    EndpointPushHandler handler = endpointPushHandlers.get(endpointId);
+                    if (handler != null)
+                        handler.registerMessageClient(messageClient);
+                }
+            }
+        }
+    }
+
+    /**
+     * Removes the attribute bound to the specified name for the FlexClient.
+     *
+     * @param name The name of the attribute to remove.
+     */
+    public void removeAttribute(String name)
+    {
+        Object value; // Used for event dispatch after the attribute is removed.
+
+        synchronized (lock)
+        {
+            checkValid();
+
+            updateLastUse();
+
+            value = (attributes != null) ? attributes.remove(name) : null;
+        }
+
+        // If no value was bound under this name it's a no-op.
+        if (value == null)
+            return;
+
+        notifyAttributeUnbound(name, value);
+        notifyAttributeRemoved(name, value);
+    }
+
+    /**
+     * Removes a FlexClient attribute listener.
+     *
+     * @param listener The listener to remove.
+     */
+    public void removeClientAttributeListener(FlexClientAttributeListener listener)
+    {
+        // No need to check validity; removing a listener is always ok.
+        if (listener != null && attributeListeners != null)
+            attributeListeners.remove(listener);
+    }
+
+    /**
+     * Removes a FlexClient destroyed listener.
+     *
+     * @see flex.messaging.client.FlexClientListener
+     *
+     * @param listener The listener to remove.
+     */
+    public void removeClientDestroyedListener(FlexClientListener listener)
+    {
+        // No need to check validity; removing a listener is always ok.
+        if (listener != null && destroyedListeners != null)
+            destroyedListeners.remove(listener);
+    }
+
+    /**
+     * Removes the attribute bound to the specified name for all the FlexSessions
+     * associated with the FlexClient. 
+     *
+     * @param name The name of the attribute to remove.
+     */
+    public void removeSessionAttribute(String name)
+    {
+        for (FlexSession session : sessions)
+            session.removeAttribute(name);
+    }
+
+    /**
+     * @exclude
+     * Implements FlexSessionListener interface.
+     * Notification that a FlexSession was created.
+     * This is a no-op because the FlexClient is never added as a static FlexSession created listener
+     * but this method is required by the interface. We only listen for the destroyed event from
+     * associated FlexSessions.
+     *
+     * @param session The FlexSession that was created.
+     */
+    public void sessionCreated(FlexSession session) {}
+
+    /**
+     * @exclude
+     * Implements FlexSessionListener interface.
+     * Notification that an associated FlexSession was destroyed.
+     *
+     * @param session The FlexSession that was destroyed.
+     */
+    public void sessionDestroyed(FlexSession session)
+    {
+        unregisterFlexSession(session);
+    }
+
+    /**
+     * Binds an attribute value for the FlexClient under the specified name.
+     *
+     * @param name The name to bind the attribute under.
+     * @param value The value of the attribute.
+     */
+    public void setAttribute(String name, Object value)
+    {
+        // Null value set is the same as removeAttribute().
+        if (value == null)
+        {
+            removeAttribute(name);
+            return;
+        }
+
+        Object oldValue; // Used to determine which events to dispatch after the set is performed.
+
+        // Only synchronize for the attribute mutation; event dispatch doesn't require it.
+        synchronized (lock)
+        {
+            checkValid();
+
+            updateLastUse();
+
+            if (attributes == null)
+                attributes = new HashMap<String, Object>();
+
+            oldValue = attributes.put(name, value);
+        }
+
+        if (oldValue == null)
+        {
+            notifyAttributeBound(name, value);
+            notifyAttributeAdded(name, value);
+        }
+        else
+        {
+            notifyAttributeUnbound(name, oldValue);
+            notifyAttributeReplaced(name, oldValue);
+            notifyAttributeBound(name, value);
+        }
+    }
+
+    /**
+     * Binds an attribute value for the current FlexSession associated with the 
+     * FlexClient under the specified name. If the current FlexSession is NIO-based
+     * (NIOHTTPFlexSession or RTMPFlexSession), and if the FlexClient is associated 
+     * with a Servlet-based session (HttpFlexSession) as well, the attribute is bound 
+     * on the Servlet-based session too to make it available to the underlying J2EE HttpSession.
+     * 
+     * @param name The name to bind the attribute under.
+     * @param value The value of the attribute.
+     */
+    public void setSessionAttribute(String name, Object value)
+    {
+        setSessionAttributeInCurrentSession(name, value);
+        if (!isCurrentSessionServletBased())
+            setSessionAttributeInServletBasedSession(name, value);
+    }
+
+    /**
+     * @exclude
+     * Implements TimeoutCapable.
+     * Inform the object that it has timed out.
+     */
+    public void timeout()
+    {
+        invalidate();
+    }
+
+    /**
+     * @exclude
+     * Unregisters an <tt>EndpointPushHandler</tt> from the specified endpoint.
+     *
+     * @param handler The <tt>EndpointPushHandler</tt> to unregister.
+     * @param endpointId The endpoint to unregister from.
+     */
+    public void unregisterEndpointPushHandler(EndpointPushHandler handler, String endpointId)
+    {
+        synchronized (lock)
+        {
+            if (endpointPushHandlers == null)
+                return; // No-op.
+
+            if (endpointPushHandlers.get(endpointId).equals(handler))
+                endpointPushHandlers.remove(endpointId);
+        }
+    }
+
+    /**
+     * @exclude
+     * Used internally to disassociate a FlexSession from this FlexClient.
+     *
+     * @param session The FlexSession to disassociate from this FlexClient.
+     */
+    public void unregisterFlexSession(FlexSession session)
+    {
+        if (sessions.remove(session))
+        {
+            session.removeSessionDestroyedListener(this);
+            session.unregisterFlexClient(this);
+            // Once all client sessions/connections terminate; shut down.
+            if (sessions.isEmpty())
+                invalidate();
+        }
+    }
+
+    /**
+     * @exclude
+     * Used internally to disassociate a MessageClient (subscription) from a FlexClient.
+     *
+     * @param messageClient The MessageClient to disassociate from the FlexClient.
+     */
+    public void unregisterMessageClient(MessageClient messageClient)
+    {
+        if (messageClients != null && messageClients.remove(messageClient))
+        {
+            messageClient.removeMessageClientDestroyedListener(this);
+            String endpointId = messageClient.getEndpointId();
+            // Manage the outbound queue that this subscription uses.
+            synchronized (lock)
+            {
+                EndpointQueue queue = outboundQueues.get(endpointId);
+                if (queue != null)
+                {
+                    // Decrement the ref count of MessageClients using this queue.
+                    queue.messageClientRefCount--;
+
+                    // Unregister the message client from the outbound throttle
+                    // manager (if one exists).
+                    OutboundQueueThrottleManager tm = queue.processor.getOutboundQueueThrottleManager();
+                    if (tm != null)
+                        tm.unregisterAllSubscriptions(messageClient.getDestinationId());
+
+                    // If we're not attempting to notify the remote client that this MessageClient has
+                    // been invalidated, remove any associated messages from the queue.
+                    if (!messageClient.isAttemptingInvalidationClientNotification())
+                    {
+                        Object messageClientId = messageClient.getClientId();
+                        for (Iterator<Message> iter = queue.messages.iterator(); iter.hasNext(); )
+                        {
+                            Message message = iter.next();
+                            if (message.getClientId().equals(messageClientId))
+                                iter.remove();
+                        }
+                    }
+
+                    // If no active subscriptions require the queue, clean it up if possible.
+                    if (queue.messageClientRefCount == 0)
+                    {
+                        if (queue.messages.isEmpty() || messageClient.isClientChannelDisconnected())
+                        {
+                            if (queue.asyncPoll != null) // Close out async long-poll if one is registered.
+                            {
+                                FlushResult flushResult = internalFlush(queue);
+                                // If the MessageClient isn't attempting client notification, override
+                                // and do so in this case to suppress the next poll request from the remote client
+                                // which will fail triggering an unnecessary channel disconnect on the client.
+                                if (!messageClient.isAttemptingInvalidationClientNotification())
+                                {
+                                    CommandMessage msg = new CommandMessage();
+                                    msg.setClientId(messageClient.getClientId());
+                                    msg.setOperation(CommandMessage.SUBSCRIPTION_INVALIDATE_OPERATION);
+                                    List<Message> messages = flushResult.getMessages();
+                                    if (messages == null)
+                                        messages = new ArrayList<Message>(1);
+                                    messages.add(msg);
+                                }
+                                completeAsyncPoll(queue.asyncPoll, flushResult);
+                            }
+
+                            // Remove the empty, unused queue.
+                            outboundQueues.remove(endpointId);
+                        }
+                        // Otherwise, the queue is being used by a polling client or contains messages
+                        // that will be written by a delayed flush.
+                        // Leave it in place. Once the next poll request or delayed flush occurs the
+                        // queue will be cleaned up at that point. See internalFlush() and shutdownQueue().
+                    }
+
+                    // Make sure to notify any threads waiting on this queue that may be associated
+                    // with the subscription that's gone away.
+                    synchronized (queue)
+                    {
+                        queue.notifyAll();
+                    }
+                }
+                // And if this subscription was associated with an endpoint push handler, unregister it.
+                if (endpointPushHandlers != null)
+                {
+                    EndpointPushHandler handler = endpointPushHandlers.get(endpointId);
+                    if (handler != null)
+                        handler.unregisterMessageClient(messageClient);
+                }
+            }
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Protected Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Utility method that tests validity and throws an exception if the instance
+     * has been invalidated.
+     */
+    protected void checkValid()
+    {
+        synchronized (lock)
+        {
+            if (!valid)
+            {
+                MessageException e = new MessageException();
+                e.setMessage(FLEX_CLIENT_INVALIDATED);
+                throw e;
+            }
+        }
+    }
+    
+    /**
+     * Invoked to clean up a timed out or closed async poll.
+     *
+     * @param asyncPoll The async poll to complete.
+     * @param result The FlushResult for the poll response.
+     */
+    protected void completeAsyncPoll(AsyncPollWithTimeout asyncPoll, FlushResult result)
+    {
+        synchronized (lock)
+        {
+            asyncPoll.cancelTimeout();
+            EndpointQueue queue = asyncPoll.getEndpointQueue();
+            if (queue.asyncPoll.equals(asyncPoll))
+                queue.asyncPoll = null;
+            FlexSession session = asyncPoll.getFlexSession();
+            synchronized (session)
+            {
+                if (session.asyncPollMap != null)
+                    session.asyncPollMap.remove(asyncPoll.getEndpointId());
+            }
+            asyncPoll.getHandler().asyncPollComplete(result);
+        }
+    }
+
+    /**
+     * Invoked to flush queued outbound messages to a client directly using a session
+     * that supports real-time push.
+     * Called by push() or delayed flush tasks for push-enabled sessions/connections.
+     */
+    protected void directFlush(EndpointQueue queue)
+    {
+        synchronized (lock)
+        {
+            // No need to invoke flush if the FlexClient has been invalidated.
+            if (!valid)
+                return;
+
+            // If this invocation is a callback from a flush task, null out the task ref on
+            // the queue to allow a subsequent delayed flush to be scheduled.
+            if (queue.flushTask != null)
+                queue.flushTask = null;
+
+            FlushResult flushResult = internalFlush(queue, null, false /* updateLastUse */);
+            if (flushResult == null) // If there's no flush result, return.
+                return;
+
+            // Pass any messages that are ready to flush off to the network layer.
+            List<Message> messages = flushResult.getMessages();
+            if (messages != null && !messages.isEmpty())
+            {
+                if (queue.pushSession != null)
+                {
+                    if (queue.pushSession instanceof ConnectionAwareSession)
+                    {
+                        // Update last use only if we're actually writing back to the client.
+                        if ( ((ConnectionAwareSession)queue.pushSession).isConnected() )
+                            updateLastUse();
+                    }
+                    for (Message msg : messages)
+                        queue.pushSession.push(msg);
+                }
+                else if (endpointPushHandlers != null)
+                {
+                    updateLastUse();
+                    EndpointPushHandler handler = endpointPushHandlers.get(queue.endpointId);
+                    handler.pushMessages(messages);
+                }
+            }
+
+            // Schedule a delayed flush if necessary.
+            int flushWaitTime = flushResult.getNextFlushWaitTimeMillis();
+            if (flushWaitTime > 0) // Set up and schedule the delayed flush task.
+                queue.flushTask = new FlexClientScheduledFlushForPush(queue, flushWaitTime);
+        }
+    }
+    
+    /**
+     * Utility method to initialize an EndpointQueue (if necessary) and associate a subscription (MessageClient) with it.
+     */
+    protected EndpointQueue getOrCreateEndpointQueueAndRegisterSubscription(MessageClient messageClient, String endpointId)
+    {
+        EndpointQueue newQueue;
+        if (!outboundQueues.containsKey(endpointId))
+        {
+            newQueue = new EndpointQueue();
+            newQueue.flexClient = this;
+            newQueue.endpointId = endpointId;
+            newQueue.endpoint = flexClientManager.getMessageBroker().getEndpoint(endpointId);
+            newQueue.messages = new ArrayList<Message>(); /* Default size of 10 is fine */
+            FlexSession session = messageClient.getFlexSession();
+            if (session.isPushSupported())
+                newQueue.pushSession = session;
+            newQueue.processor = flexClientManager.createOutboundQueueProcessor(this, endpointId);
+            newQueue.messageClientRefCount = 1;
+
+            outboundQueues.put(endpointId, newQueue);
+        }
+        else
+        {
+            newQueue = outboundQueues.get(endpointId);
+            newQueue.messageClientRefCount++;
+            // Resubscribes as a result of network connectivity issues may arrive over the same
+            // endpoint but use a new session.
+            FlexSession session = messageClient.getFlexSession();
+            if (session.isPushSupported())
+                newQueue.pushSession = session;
+        }
+        return newQueue;
+    }    
+
+    /**
+     * Utility method to flush the outbound queue and log any problems.
+     * Any exceptions are logged and then rethrown.
+     * 
+     * @param queue The outbound queue to flush.
+     */
+    protected FlushResult internalFlush(EndpointQueue queue)
+    {
+        return internalFlush(queue, null);
+    }
+    
+    /**
+     * Utility method to flush the outbound queue and log any problems.
+     * If a specific client is passed, we need to invoke a client-specific flush.
+     * If the passed client is null, we do a general flush of the queue.
+     * Any exceptions are logged and then rethrown.
+     * 
+     * @param queue The outbound queue to flush.
+     * @param client The client to flush for.
+     */
+    protected FlushResult internalFlush(EndpointQueue queue, MessageClient client)
+    {
+        return internalFlush(queue, null, true);
+    }
+
+    /**
+     * Utility method to flush the outbound queue and log any problems.
+     * If a specific client is passed, we need to invoke a client-specific flush.
+     * If the passed client is null, we do a general flush of the queue.
+     * Any exceptions are logged and then rethrown.
+     * 
+     * @param queue The outbound queue to flush.
+     * @param client The client to flush for.
+     * @param updateLastUse Whether the last-use timestamp of the FlexClient should
+     * be updated.
+     */
+    protected FlushResult internalFlush(EndpointQueue queue, MessageClient client, 
+            boolean updateLastUse)
+    {
+        FlushResult flushResult;
+        try
+        {
+            synchronized (queue)
+            {
+                flushResult = queue.processor.flush(client, queue.messages);
+                shutdownQueue(queue);
+            }
+
+            if (updateLastUse)
+                updateLastUseIfNecessary(flushResult);
+        }
+        catch (RuntimeException e)
+        {
+            if (Log.isError())
+                Log.getLogger(FLEX_CLIENT_LOG_CATEGORY).error("Failed to flush an outbound queue for FlexClient '" + getId() + "'.", e);
+            throw e;
+        }
+        return flushResult;
+    }    
+
+    /**
+     * Utility method to flush messages in response to a poll request with 
+     * regular and wait poll.
+     * 
+     * @param queue The endpoint queue to flush messages for.
+     * @return The flush result with messages, or null if there are no messages.
+     */
+    protected FlushResult internalPoll(EndpointQueue queue)
+    {
+        List<Message> allMessages = new ArrayList<Message>();
+
+        // First, add the previously flushed messages.
+        if (queue.flushedMessagesBetweenPolls != null && queue.flushedMessagesBetweenPolls.size() > 0)
+        {
+            allMessages.addAll(queue.flushedMessagesBetweenPolls);
+            queue.flushedMessagesBetweenPolls.clear();
+        }
+
+        // Then, check for regularly queued messages. We call internalFlush
+        // even if the queue is empty so the queue processor could know
+        // about the incoming poll request regardless.
+        FlushResult internalFlushResult = internalFlush(queue);
+        List<Message> flushedMessages = internalFlushResult.getMessages();
+        if (flushedMessages != null && !flushedMessages.isEmpty())
+            allMessages.addAll(flushedMessages);
+
+        // Schedule a delayed flush, if necessary.
+        int flushWaitTime = internalFlushResult.getNextFlushWaitTimeMillis();
+        if (flushWaitTime > 0)
+            queue.flushTask = new FlexClientScheduledFlushForPoll(queue, flushWaitTime);
+
+        if (allMessages.size() > 0) // Flush, if there are messages.
+        {
+            FlushResult flushResult = new FlushResult();
+            flushResult.setMessages(allMessages);
+            return flushResult;
+        }
+        return null;
+    }
+
+    /**
+     * Notify attribute listeners that an attribute has been added.
+     *
+     * @param name The name of the attribute.
+     *
+     * @param value The new value of the attribute.
+     */
+    protected void notifyAttributeAdded(String name, Object value)
+    {
+        if (attributeListeners != null && !attributeListeners.isEmpty())
+        {
+            FlexClientBindingEvent event = new FlexClientBindingEvent(this, name, value);
+            // CopyOnWriteArrayList is iteration-safe from ConcurrentModificationExceptions.
+            for (FlexClientAttributeListener attribListener : attributeListeners)
+                attribListener.attributeAdded(event);
+        }
+    }
+
+    /**
+     * Notify binding listener that it has been bound to the FlexClient.
+     *
+     * @param name The attribute name.
+     *
+     * @param value The attribute that has been bound.
+     */
+    protected void notifyAttributeBound(String name, Object value)
+    {
+        if ((value != null) && (value instanceof FlexClientBindingListener))
+        {
+            FlexClientBindingEvent bindingEvent = new FlexClientBindingEvent(this, name);
+            ((FlexClientBindingListener)value).valueBound(bindingEvent);
+        }
+    }
+
+    /**
+     * Notify attribute listeners that an attribute has been removed.
+     *
+     * @param name The name of the attribute.
+     *
+     * @param value The previous value of the attribute.
+     */
+    protected void notifyAttributeRemoved(String name, Object value)
+    {
+        if (attributeListeners != null && !attributeListeners.isEmpty())
+        {
+            FlexClientBindingEvent event = new FlexClientBindingEvent(this, name, value);
+            // CopyOnWriteArrayList is iteration-safe from ConcurrentModificationExceptions.
+            for (FlexClientAttributeListener attribListener : attributeListeners)
+                attribListener.attributeRemoved(event);
+        }
+    }
+
+    /**
+     * Notify attribute listeners that an attribute has been replaced.
+     *
+     * @param name The name of the attribute.
+     *
+     * @param value The previous value of the attribute.
+     */
+    protected void notifyAttributeReplaced(String name, Object value)
+    {
+        if (attributeListeners != null && !attributeListeners.isEmpty())
+        {
+            FlexClientBindingEvent event = new FlexClientBindingEvent(this, name, value);
+            // CopyOnWriteArrayList is iteration-safe from ConcurrentModificationExceptions.
+            for (FlexClientAttributeListener attribListener : attributeListeners)
+                attribListener.attributeReplaced(event);
+        }
+    }
+
+    /**
+     * Notify binding listener that it has been unbound from the FlexClient.
+     *
+     * @param name The attribute name.
+     *
+     * @param value The attribute that has been unbound.
+     */
+    protected void notifyAttributeUnbound(String name, Object value)
+    {
+        if ((value != null) && (value instanceof FlexClientBindingListener))
+        {
+            FlexClientBindingEvent bindingEvent = new FlexClientBindingEvent(this, name);
+            ((FlexClientBindingListener)value).valueUnbound(bindingEvent);
+        }
+    }    
+    
+    /**
+     * Invoked by FlexClientManager after this new FlexClient has been constructed and
+     * is fully configured.
+     */
+    protected void notifyCreated()
+    {
+        if (!createdListeners.isEmpty())
+        {
+            // CopyOnWriteArrayList is iteration-safe from ConcurrentModificationExceptions.
+            for (FlexClientListener createListener : createdListeners)
+                createListener.clientCreated(this);
+        }
+    }
+    
+    /**
+     * Utility method used to shutdown endpoint queues accessed via polling channels
+     * that have no more active subscriptions and no more pending outbound messages.
+     *
+     * @param queue The queue to potentially shutdown.
+     * @return true if the queue was cleaned up/removed; otherwise false.
+     */
+    protected boolean shutdownQueue(EndpointQueue queue)
+    {
+        // If no more subscriptions are using the queue and it is empty, shut it down.
+        if (queue.messageClientRefCount == 0 && queue.messages.isEmpty())
+        {
+            outboundQueues.remove(queue.endpointId);
+            // Notify any threads waiting on this queue.
+            synchronized (queue)
+            {
+                queue.notifyAll();
+            }
+            return true;
+        }
+        return false;
+    }
+    
+    /**
+     * Utility method to throw a not subscribed exception back to the client
+     * if they issue a poll request to an endpoint that they haven't subscribed over.
+     * <p/>
+     * This method should not be called when you hold an internal thread lock. It iterates
+     * over all the FlexClients in the current session and will not work if two or more 
+     * FlexClients in the same session call it simultaneously.
+     *
+     * @param endpointId The endpoint Id.
+     */
+    protected void throwNotSubscribedException(String endpointId)
+    {
+        // Pre-3.1 versions of the client library did not handle URL session tokens properly
+        // and may incorrectly issue a poll, after subscribing, that does not contain the proper
+        // FlexClient id.
+        // This scenario looks like a poll from a client that is not subscribed, but it is not,
+        // and deserves a more useful error message.
+        // We determine this by checking for an (orphaned) FlexClient instance associated with the
+        // current session that has a subscription established through the target endpoint.
+        List<FlexClient> flexClients = FlexContext.getFlexSession().getFlexClients();
+        for (FlexClient otherClient : flexClients)
+        {
+            if (!otherClient.equals(this))
+            {
+                List<MessageClient> otherSubs = otherClient.getMessageClients();
+                for (MessageClient otherSub : otherSubs)
+                {
+                    if (otherSub.getEndpointId().equals(endpointId))
+                    {
+                        // Throw not-subscribed exception with extra guidance.
+                        FlexClientNotSubscribedException e = new FlexClientNotSubscribedException();
+                        e.setMessage(10036, new Object[]{endpointId});
+                        e.setCode(MessageService.NOT_SUBSCRIBED_CODE);
+                        throw e;
+                    }
+                }
+            }
+        }
+
+        // Throw general not-subscribed exception.
+        FlexClientNotSubscribedException e = new FlexClientNotSubscribedException();
+        e.setMessage(10028, new Object[]{endpointId});
+        e.setCode(MessageService.NOT_SUBSCRIBED_CODE);
+        throw e;
+    }
+
+    /**
+     * Updates the last-use timestamp if there are messages in the flush result.
+     * 
+     * @param flushResult The flush result.
+     */
+    protected void updateLastUseIfNecessary(FlushResult flushResult)
+    {
+        List<Message> messages = flushResult != null ? flushResult.getMessages() : null;
+        if (messages != null && !messages.isEmpty())
+            updateLastUse();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+    private Set<String> getSessionAttributeNames(FlexSession session)
+    {
+        Set<String> attributeNames = new HashSet<String>();
+        Enumeration<String> currentAttributeNames = session.getAttributeNames();
+        while (currentAttributeNames.hasMoreElements())
+            attributeNames.add(currentAttributeNames.nextElement());
+        return attributeNames;
+    }
+
+    private Object getSessionAttributeInCurrentSession(String name)
+    {
+        return FlexContext.getFlexSession().getAttribute(name);
+    }
+
+    private Object getSessionAttributeInOtherSessions(String name)
+    {
+        FlexSession currentSession = FlexContext.getFlexSession();
+        for (FlexSession session : sessions)
+        {
+            if (session == currentSession)
+                continue;
+
+            Object attributeValue = session.getAttribute(name);
+            if (attributeValue != null)
+                return attributeValue;
+        }
+        return null;
+    }
+
+    private void setSessionAttributeInCurrentSession(String name, Object value)
+    {
+        FlexContext.getFlexSession().setAttribute(name, value);
+    }
+
+    private void setSessionAttributeInServletBasedSession(String name, Object value)
+    {
+        for (FlexSession session : sessions)
+        {
+            if (isServletBasedSession(session))
+            {
+                session.setAttribute(name, value);
+                return;
+            }
+        }
+    }
+
+    private boolean isCurrentSessionServletBased()
+    {
+        return isServletBasedSession(FlexContext.getFlexSession());
+    }
+
+    private boolean isServletBasedSession(FlexSession session)
+    {
+        return session instanceof HttpFlexSession;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Inner Classes
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Helper class for handling async poll requests. This class allows the response for an async poll
+     * to be delayed until data arrives to return to the client or the specified wait interval elapses.
+     * Wait timeouts are monitored by the <tt>FlexClientManager</tt> which contains a <tt>TimeoutManager</tt>
+     * instance that is started and stopped during application bootstrap and shutdown. Managing timeouts
+     * locally or statically isn't a good option because they lack a useful shutdown hook that's necessary
+     * in order to close down the timeout manager cleanly.
+     */
+    public class AsyncPollWithTimeout extends TimeoutAbstractObject
+    {
+        /**
+         * Constructor.
+         *
+         * @param flexClient flex client
+         * @param session flex session
+         * @param queue endpoint queue
+         * @param handler poll handler
+         * @param waitIntervalMillis wait interval
+         * @param endpointId endpoint
+         */
+        public AsyncPollWithTimeout(FlexClient flexClient, FlexSession session, EndpointQueue queue, AsyncPollHandler handler, long waitIntervalMillis, String endpointId)
+        {
+            this.flexClient = flexClient;
+            this.session = session;
+            this.queue = queue;
+            this.handler = handler;
+            setTimeoutPeriod(waitIntervalMillis);
+            flexClientManager.monitorAsyncPollTimeout(this);
+            this.endpointId = endpointId;
+        }
+
+        private final FlexClient flexClient;
+
+        /**
+         * Return client.
+         *
+         * @return flex client
+         */
+        public FlexClient getFlexClient()
+        {
+            return flexClient;
+        }
+
+        private final FlexSession session;
+
+        /**
+         * Return session.
+         * @return flex session
+         */
+        public FlexSession getFlexSession()
+        {
+            return session;
+        }
+
+        private final EndpointQueue queue;
+
+        /**
+         * Return endpoint queue.
+         * @return the queue
+         */
+        public EndpointQueue getEndpointQueue()
+        {
+            return queue;
+        }
+
+        private final AsyncPollHandler handler;
+
+        /**
+         * Return handler.
+         * @return the handler
+         */
+        public AsyncPollHandler getHandler()
+        {
+            return handler;
+        }
+
+        private final String endpointId;
+
+        /**
+         * Return endpoint ID.
+         * @return the id
+         */
+        public String getEndpointId()
+        {
+            return endpointId;
+        }
+
+        /**
+         * Trigger a timeout.
+         */
+        public void timeout()
+        {
+            completeAsyncPoll(this, null /* nothing to return */);
+        }
+    }
+
+    /**
+     * Helper class to flush a FlexClient's outbound queue after a specified delay.
+     * Delayed flushes are handled by the <tt>FlexClientManager</tt>
+     * using <tt>TimeoutManager</tt>.
+     */
+    abstract class FlexClientScheduledFlush extends TimeoutAbstractObject
+    {
+        final EndpointQueue queue;
+
+        public FlexClientScheduledFlush(EndpointQueue queue, long waitIntervalMillis)
+        {
+            this.queue = queue;
+            setTimeoutPeriod(waitIntervalMillis);
+            flexClientManager.monitorScheduledFlush(this);
+        }
+
+        abstract void performFlushTask();
+
+        public void timeout()
+        {
+            FlexContext.setThreadLocalFlexClient(FlexClient.this);
+            performFlushTask();
+            FlexContext.setThreadLocalFlexClient(null);
+        }
+    }
+
+    /**
+     * Helper class for push channels to directly flush a FlexClient's outbound
+     * queue after a specified delay.
+     */
+    class FlexClientScheduledFlushForPush extends FlexClientScheduledFlush
+    {
+        public FlexClientScheduledFlushForPush(EndpointQueue queue, long waitIntervalMillis)
+        {
+            super(queue, waitIntervalMillis);
+        }
+
+        @Override
+        void performFlushTask()
+        {
+            synchronized (lock)
+            {   
+                synchronized (queue)
+                {
+                    directFlush(queue);
+                }
+            }
+        }
+
+    }
+
+    /**
+     * Helper class for polling channels to flush a FlexClient's outbound
+     * queue to flushedMessagesBetweenPolls queue after a specified delay.
+     * When the next poll happens, the flushedMessagesBetweenPolls will be
+     * drained first.
+     */
+    class FlexClientScheduledFlushForPoll extends FlexClientScheduledFlush
+    {
+        public FlexClientScheduledFlushForPoll(EndpointQueue queue, long waitIntervalMillis)
+        {
+            super(queue, waitIntervalMillis);
+        }
+
+        @Override
+        void performFlushTask()
+        {
+            synchronized (lock)
+            {
+                // No need to invoke flush if the FlexClient has been invalidated.
+                if (!valid)
+                    return;
+
+                // If this invocation is a callback from a flush task, null out the task ref on
+                // the queue to allow a subsequent delayed flush to be scheduled.
+                if (queue.flushTask != null)
+                    queue.flushTask = null;
+
+                FlushResult flushResult = internalFlush(queue);
+                if (flushResult == null)
+                    return;
+
+                List<Message> messages = flushResult.getMessages();
+                if (messages != null && messages.size() > 0)
+                {
+                    if (queue.asyncPoll != null)
+                    {
+                        completeAsyncPoll(queue.asyncPoll, flushResult);
+                    }
+                    else
+                    {
+                        if (queue.flushedMessagesBetweenPolls == null)
+                            queue.flushedMessagesBetweenPolls = new ArrayList<Message>();
+                        queue.flushedMessagesBetweenPolls.addAll(messages);
+                    }
+                }
+
+                // Schedule a delayed flush, if necessary.
+                int flushWaitTime = flushResult.getNextFlushWaitTimeMillis();
+                if (flushWaitTime > 0)
+                    queue.flushTask = new FlexClientScheduledFlushForPoll(queue, flushWaitTime);
+            }
+        }
+    }
+
+    /**
+     * @exclude
+     * Helper class that stores per-endpoint outbound queue state including:
+     * <ul>
+     *   <li>flexClient - The <tt>FlexClient</tt> the queue is used by.</li>
+     *   <li>messages - The outbound queue of messages for the endpoint.</li>
+     *   <li>flushedMessagesBetweenPolls - Keeps track of flushed (more precisely
+     *       drained buffered) messages between polls. A seperate list is needed
+     *       from messages list to avoid regular flush handling.</li>
+     *   <li>flushedMessagesBetweenPolls - Keeps track of flushed messages between polls.</li>
+     *   <li>processor - The processor that handles adding messages to the queue as well as flushing
+     *       them to the network.</li>
+     *   <li>asyncPoll - The async poll to timeout or callback when messages arrive
+     *       (null if the endpoint or session supports direct push).</li>
+     *   <li>pushSession - A reference to a pushSession to use for direct writes to the
+     *       client (null if the endpoint uses polling or handles push directly).</li>
+     *  
+     *   <li>flushTask - A reference to a pending flush task that will perform a delayed flush of the queue;
+     *       null if no delayed flush has been scheduled.</li>
+     *   <li>messageClientRefCount - A reference count of MessageClients subcribed over this endpoint.
+     *       Once all MessageClients unsubscribe this queue can be shut down.</li>
+     *   <li>avoidBusyPolling - Used to signal poll result generation for the queue to avoid busy polling.</li>
+     * </ul>
+     */
+    public static class EndpointQueue
+    {
+        public FlexClient flexClient;
+        public String endpointId;
+        public Endpoint endpoint;
+        public List<Message> messages;
+        public List<Message> flushedMessagesBetweenPolls;
+        public FlexClientOutboundQueueProcessor processor;
+        public AsyncPollWithTimeout asyncPoll;
+        public boolean waitPoll;
+        public FlexSession pushSession;
+        public TimeoutAbstractObject flushTask;
+        public int messageClientRefCount;
+        public boolean avoidBusyPolling;
+    }
+}


[15/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/log/Logger.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/log/Logger.java b/modules/common/src/flex/messaging/log/Logger.java
new file mode 100755
index 0000000..e8f622f
--- /dev/null
+++ b/modules/common/src/flex/messaging/log/Logger.java
@@ -0,0 +1,402 @@
+/*
+ * 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.messaging.log;
+
+import flex.messaging.util.PrettyPrinter;
+import flex.messaging.util.StringUtils;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * The <code>Logger</code> class is used to log out information. It provides named
+ * methods to log information out at the desired level. Each <code>Logger</code>
+ * will log information out for a log category that is settable.
+ *
+ * @exclude
+ */
+public class Logger
+{
+    /**
+     * The category this logger send messages for.
+     */
+    private volatile String category;
+
+    /**
+     * The list of targets that this logger will dispatch log events to.
+     */
+    private final ArrayList targets;
+
+    /**
+     * Constructs a <code>Logger</code> instance that will log
+     * information out to the specified category.
+     *
+     * @param category The category to log information for.
+     */
+    public Logger(String category)
+    {
+        this.category = category;
+        targets = new ArrayList();
+    }
+
+    /**
+     * Returns the category this <code>Logger</code> logs information for.
+     *
+     * @return The category this <code>Logger</code> logs information for.
+     */
+    public String getCategory()
+    {
+        return category;
+    }
+
+    /**
+     * Determines whether the <code>Logger</code> has at least one target.
+     * 
+     * @return True if the <code>Logger</code> has one or more targets.
+     */
+    public boolean hasTarget()
+    {
+        synchronized (targets)
+        {
+            return !targets.isEmpty();
+        }
+    }
+    /**
+     * Adds a <code>Target</code> that will format and output log events
+     * generated by this <code>Logger</code>.
+     *
+     * @param target The <code>Target</code> to add.
+     */
+    void addTarget(Target target)
+    {
+        synchronized (targets)
+        {
+            if (!targets.contains(target))
+                targets.add(target);
+        }
+    }
+
+    /**
+     * Removes a <code>Target</code> from this <code>Logger</code>.
+     *
+     * @param target The <code>Target</code> to remove.
+     */
+    void removeTarget(Target target)
+    {
+        synchronized (targets)
+        {
+            targets.remove(target);
+        }
+    }
+
+    /*
+     *  DEBUG
+     */
+    /**
+     * Logs out a debug message.
+     *
+     * @param message The message to log.
+     */
+    public void debug(String message)
+    {
+        log(LogEvent.DEBUG, message, null, null);
+    }
+
+    /**
+     * Logs out a debug message associated with a <code>Throwable</code>.
+     *
+     * @param message The message to log.
+     * @param t The associated <code>Throwable</code>.
+     */
+    public void debug(String message, Throwable t)
+    {
+        log(LogEvent.DEBUG, message, null, t);
+    }
+
+    /**
+     * Logs out a debug message supporting positional parameter substitutions.
+     *
+     * @param message The message to log.
+     * @param parameters Parameters to substitute into the message.
+     */
+    public void debug(String message, Object[] parameters)
+    {
+        log(LogEvent.DEBUG, message, parameters, null);
+    }
+
+    /**
+     * Logs out a debug message supporting positional parameter substitutions and an
+     * associated <code>Throwable</code>.
+     *
+     * @param message The message to log.
+     * @param parameters Parameters to substitute into the message.
+     * @param t The associated <code>Throwable</code>.
+     */
+    public void debug(String message, Object[] parameters, Throwable t)
+    {
+        log(LogEvent.DEBUG, message, parameters, t);
+    }
+
+    /*
+     *  INFO
+     */
+    /**
+     * Logs out an info message.
+     *
+     * @param message The message to log.
+     */
+    public void info(String message)
+    {
+        log(LogEvent.INFO, message, null, null);
+    }
+
+    /**
+     * Logs out an info message associated with a <code>Throwable</code>.
+     *
+     * @param message The message to log.
+     * @param t The associated <code>Throwable</code>.
+     */
+    public void info(String message, Throwable t)
+    {
+        log(LogEvent.INFO, message, null, t);
+    }
+
+    /**
+     * Logs out an info message supporting positional parameter substitutions.
+     *
+     * @param message The message to log.
+     * @param parameters Parameters to substitute into the message.
+     */
+    public void info(String message, Object[] parameters)
+    {
+        log(LogEvent.INFO, message, parameters, null);
+    }
+
+    /**
+     * Logs out an info message supporting positional parameter substitutions and an
+     * associated <code>Throwable</code>.
+     *
+     * @param message The message to log.
+     * @param parameters Parameters to substitute into the message.
+     * @param t The associated <code>Throwable</code>.
+     */
+    public void info(String message, Object[] parameters, Throwable t)
+    {
+        log(LogEvent.INFO, message, parameters, t);
+    }
+
+    /*
+     *  WARN
+     */
+    /**
+     * Logs out a warn message.
+     *
+     * @param message The message to log.
+     */
+    public void warn(String message)
+    {
+        log(LogEvent.WARN, message, null, null);
+    }
+
+    /**
+     * Logs out a warn message associated with a <code>Throwable</code>.
+     *
+     * @param message The message to log.
+     * @param t The associated <code>Throwable</code>.
+     */
+    public void warn(String message, Throwable t)
+    {
+        log(LogEvent.WARN, message, null, t);
+    }
+
+    /**
+     * Logs out a warn message supporting positional parameter substitutions.
+     *
+     * @param message The message to log.
+     * @param parameters Parameters to substitute into the message.
+     */
+    public void warn(String message, Object[] parameters)
+    {
+        log(LogEvent.WARN, message, parameters, null);
+    }
+
+    /**
+     * Logs out a warn message supporting positional parameter substitutions and an
+     * associated <code>Throwable</code>.
+     *
+     * @param message The message to log.
+     * @param parameters Parameters to substitute into the message.
+     * @param t The associated <code>Throwable</code>.
+     */
+    public void warn(String message, Object[] parameters, Throwable t)
+    {
+        log(LogEvent.WARN, message, parameters, t);
+    }
+
+    /*
+     *  ERROR
+     */
+    /**
+     * Logs out an error message.
+     *
+     * @param message The message to log.
+     */
+    public void error(String message)
+    {
+        log(LogEvent.ERROR, message, null, null);
+    }
+
+    /**
+     * Logs out an error message associated with a <code>Throwable</code>.
+     *
+     * @param message The message to log.
+     * @param t The associated <code>Throwable</code>.
+     */
+    public void error(String message, Throwable t)
+    {
+        log(LogEvent.ERROR, message, null, t);
+    }
+
+    /**
+     * Logs out an error message supporting positional parameter substitutions.
+     *
+     * @param message The message to log.
+     * @param parameters Parameters to substitute into the message.
+     */
+    public void error(String message, Object[] parameters)
+    {
+        log(LogEvent.ERROR, message, parameters, null);
+    }
+
+    /**
+     * Logs out an error message supporting positional parameter substitutions and an
+     * associated <code>Throwable</code>.
+     *
+     * @param message The message to log.
+     * @param parameters Parameters to substitute into the message.
+     * @param t The associated <code>Throwable</code>.
+     */
+    public void error(String message, Object[] parameters, Throwable t)
+    {
+        log(LogEvent.ERROR, message, parameters, t);
+    }
+
+    /*
+    *  FATAL
+    */
+    /**
+     * Logs out a fatal message.
+     *
+     * @param message The message to log.
+     */
+    public void fatal(String message)
+    {
+        log(LogEvent.FATAL, message, null, null);
+    }
+
+    /**
+     * Logs out a fatal message associated with a <code>Throwable</code>.
+     *
+     * @param message The message to log.
+     * @param t The associated <code>Throwable</code>.
+     */
+    public void fatal(String message, Throwable t)
+    {
+        log(LogEvent.FATAL, message, null, t);
+    }
+
+    /**
+     * Logs out a fatal message supporting positional parameter substitutions.
+     *
+     * @param message The message to log.
+     * @param parameters Parameters to substitute into the message.
+     */
+    public void fatal(String message, Object[] parameters)
+    {
+        log(LogEvent.FATAL, message, parameters, null);
+    }
+
+    /**
+     * Logs out a fatal message supporting positional parameter substitutions and an
+     * associated <code>Throwable</code>.
+     *
+     * @param message The message to log.
+     * @param parameters Parameters to substitute into the message.
+     * @param t The associated <code>Throwable</code>.
+     */
+    public void fatal(String message, Object[] parameters, Throwable t)
+    {
+        log(LogEvent.FATAL, message, parameters, t);
+    }
+
+    /**
+     * @exclude
+     * The methods named according to log level delegate to this method to log.
+     *
+     * @param level The log level.
+     * @param message The message to log.
+     * @param parameters Substitution parameters (may be null).
+     * @param t The associated <code>Throwable</code> (may be null).
+     */
+    public void log(short level, String message, Object[] parameters, Throwable t)
+    {
+        log(level, message, parameters, t, true);
+    }
+
+    /**
+     * @exclude
+     * Logs a passed message if its level verifies as high enough.
+     *
+     * @param level The log level.
+     * @param message The message to log.
+     * @param parameters Substitution parameters (may be null).
+     * @param t The associated <code>Throwable</code>.
+     * @param verifyLevel <code>true</code> to verify the log level; otherwise log without verifying the level.
+     */
+    public void log(short level, String message, Object[] parameters, Throwable t, boolean verifyLevel)
+    {
+        if (targets.size() > 0 && (!verifyLevel || (level >= Log.getTargetLevel())))
+        {
+            if (parameters != null)
+            {
+                PrettyPrinter prettyPrinter = Log.getPrettyPrinter();
+
+                // replace all of the parameters in the msg string
+                for(int i = 0; i < parameters.length; i++)
+                {
+                    String replacement = parameters[i] != null ? prettyPrinter.prettify(parameters[i]) : "null";
+
+                    //this guy runs into problems if the replacement has a \ or $ in it
+                    //message = message.replaceAll("\\{" + i + "\\}", replacement);
+                    message = StringUtils.substitute(message, "{" + i + "}", replacement);
+                }
+            }
+            LogEvent event = new LogEvent(this, message, level, t);
+            Target tgt;
+            synchronized (targets)
+            {
+                for (Iterator iter = targets.iterator(); iter.hasNext();)
+                {
+                    tgt = (Target) iter.next();
+                    if (!verifyLevel || (level >= tgt.getLevel()))
+                        tgt.logEvent(event);
+                }
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/log/Target.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/log/Target.java b/modules/common/src/flex/messaging/log/Target.java
new file mode 100755
index 0000000..c5c8224
--- /dev/null
+++ b/modules/common/src/flex/messaging/log/Target.java
@@ -0,0 +1,112 @@
+/*
+ * 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.messaging.log;
+
+import java.util.List;
+
+import flex.messaging.config.ConfigMap;
+
+/**
+ * All logger target implementations within the logging framework must
+ * implement this interface. <code>Target</code> implementations receive log events
+ * and output information from these events to the appropriate output
+ * destination which may be a console, log file or some other custom
+ * destination.
+ */
+public interface Target
+{
+    /**
+     * Initializes the target with id and properties.
+     *
+     * @param id id for the target.
+     * @param properties ConfigMap of properties for the target.
+     */
+    void initialize(String id, ConfigMap properties);
+
+    /**
+     * Returns the category filters defined for the <code>Target</code>.
+     *
+     * @return The category filters defined for the <code>Target</code>.
+     */
+    List getFilters();
+
+    /**
+     * Sets the category filters that the <code>Target</code> will process
+     * log events for.
+     *
+     * @param value The category filters that the <code>Target</code> will process
+     */
+    void setFilters(List value);
+
+    /**
+     * Adds the category filteer that the <code>Target</code> will process
+     * log events for.
+     *
+     * @param value The new category filter to add to the <code>Target</code>'s list of filters.
+     */
+    void addFilter(String value);
+
+    /**
+     * Removes a category filter from the list of filters the <code>Target</code> will
+     * process log events for.
+     *
+     * @param value The category filter to remove from the <code>Target</code>'s list of filters.
+     */
+    void removeFilter(String value);
+
+    /**
+     * Returns the log level that the <code>Target</code> will process log
+     * events for. Log events at this level, or at a higher priority level
+     * will be processed.
+     *
+     * @return The log level that the <code>Target</code> will process log events for.
+     */
+    short getLevel();
+
+    /**
+     * Sets the log level that the <code>Target</code> will process log events
+     * for. Log events at this level, or at a higher priority level will be
+     * processed.
+     *
+     * @param value The log level that the <code>Target</code> will process log events for.
+     */
+    void setLevel(short value);
+
+    /**
+     * Adds a <code>Logger</code> whose category matches the filters list for
+     * the <code>Target</code>. The <code>Logger</code> will dispatch log events
+     * to this <code>Target</code> to be output.
+     *
+     * @param logger The <code>Logger</code> to add.
+     */
+    void addLogger(Logger logger);
+
+    /**
+     * Removes a <code>Logger</code> from the <code>Target</code>.
+     *
+     * @param logger The <code>Logger</code> to remove.
+     */
+    void removeLogger(Logger logger);
+
+    /**
+     * Logs a log event out to the <code>Target</code>s output destination,
+     * which may be the console or a log file.
+     *
+     * @param event The <code>LogEvent</code> containing the information to output.
+     */
+    void logEvent(LogEvent event);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/util/BasicPrettyPrinter.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/util/BasicPrettyPrinter.java b/modules/common/src/flex/messaging/util/BasicPrettyPrinter.java
new file mode 100755
index 0000000..6abc550
--- /dev/null
+++ b/modules/common/src/flex/messaging/util/BasicPrettyPrinter.java
@@ -0,0 +1,164 @@
+/*
+ * 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.messaging.util;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.Method;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Map;
+
+/**
+ * Prettifies the representation of an Object as a String. Complex
+ * types are not traversed.
+ *
+ * @exclude
+ */
+public class BasicPrettyPrinter implements PrettyPrinter
+{
+    protected ObjectTrace trace;
+
+    public BasicPrettyPrinter()
+    {
+    }
+
+    /**
+     * Prettifies the representation of an Object as a String.
+     * <ul>
+     *   <li>Simple types are simply toString'ed.</li>
+     *   <li>XML strings are formatted with line feeds and indentations.</li>
+     *   <li>Complex types report their class names.</li>
+     *   <li>Collections, Maps and native Arrays also report their size/length.</li>
+     * </ul>
+     * @return A prettified version of an Object as a String.
+     */
+    public String prettify(Object o)
+    {
+        try
+        {
+            trace = new ObjectTrace();
+            internalPrettify(o);
+            return trace.toString();
+        }
+        catch (Throwable t)
+        {
+            return trace.toString();
+        }
+        finally
+        {
+            trace = null;
+        }
+    }
+
+    protected void internalPrettify(Object o)
+    {
+        if (o == null)
+        {
+            trace.writeNull();
+        }
+        else if (o instanceof String)
+        {
+            String string = (String)o;
+            if (string.startsWith("<?xml"))
+            {
+                trace.write(StringUtils.prettifyXML(string));
+            }
+            else
+            {
+                trace.write(string);
+            }
+        }
+        else if (o instanceof Number || o instanceof Boolean || o instanceof Date
+                || o instanceof Calendar || o instanceof Character)
+        {
+            trace.write(o);
+        }
+        else
+        {
+            prettifyComplexType(o);
+        }
+    }
+
+    protected void prettifyComplexType(Object o)
+    {
+        StringBuffer header = new StringBuffer();
+
+        if (o instanceof PrettyPrintable)
+        {
+            PrettyPrintable pp = (PrettyPrintable)o;
+            header.append(pp.toStringHeader());
+        }
+
+        Class c = o.getClass();
+        String className = c.getName();
+
+        if (o instanceof Collection)
+        {
+            header.append(className).append(" (Collection size:").append(((Collection)o).size()).append(")");
+        }
+        else if (o instanceof Map)
+        {
+            header.append(className).append(" (Map size:").append(((Map)o).size()).append(")");
+        }
+        else if (c.isArray() && c.getComponentType() != null)
+        {
+            Class componentType = c.getComponentType();
+            className = componentType.getName();
+            header.append(className).append("[] (Array length:").append(Array.getLength(o)).append(")");
+        }
+        else
+        {
+            header.append(className);
+        }
+
+        trace.startObject(header.toString());
+        trace.endObject();
+    }
+
+    /**
+     * If the definition of toString is not from java.lang.Object or any class in the
+     * java.util.* package then we consider it a custom implementation in which case
+     * we'll use it instead of introspecting the class.
+     *
+     * @param c The class to check for a custom toString definition.
+     * @return Whether this class declares a custom toString() method.
+     */
+    protected boolean hasCustomToStringMethod(Class c)
+    {
+        try
+        {
+            Method toStringMethod = c.getMethod("toString", (Class[])null);
+            Class declaringClass = toStringMethod.getDeclaringClass();
+            if (declaringClass != Object.class
+                    && !declaringClass.getName().startsWith("java.util"))
+            {
+                return true;
+            }
+        }
+        catch (Throwable t)
+        {
+        }
+
+        return false;
+    }
+
+    public Object copy()
+    {
+        return new BasicPrettyPrinter();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/util/ExceptionUtil.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/util/ExceptionUtil.java b/modules/common/src/flex/messaging/util/ExceptionUtil.java
new file mode 100755
index 0000000..f787859
--- /dev/null
+++ b/modules/common/src/flex/messaging/util/ExceptionUtil.java
@@ -0,0 +1,246 @@
+/*
+ * 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.messaging.util;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.NoSuchElementException;
+import java.util.StringTokenizer;
+
+/**
+ * @exclude
+ */
+public class ExceptionUtil
+{
+    /**
+     * List of no-arg methods that are known to return a wrapped throwable.
+     **/
+    public static String[] unwrapMethods = { "getRootCause", "getTargetException",
+                                             "getTargetError", "getException",
+                                             "getCausedByException", "getLinkedException" };
+
+    /**
+     * Get the wrapped Exception object from the Throwable object.
+     * @param t the Throwable object
+     * @return Throwable the wrapped exception object if any
+     */
+    public static Throwable wrappedException(Throwable t)
+    {
+        // Handle these statically since they are core to Java
+        return (t instanceof InvocationTargetException)? 
+                ((InvocationTargetException)t).getTargetException() : getRootCauseWithReflection(t);
+    }
+
+    /**
+     * Get to the base exception (if any).
+     * @param t the Throwable object
+     * @return the base Exception object
+     */
+    public static Throwable baseException(Throwable t) 
+    {
+        Throwable wrapped = wrappedException(t);
+        return wrapped != null? baseException(wrapped) : t;
+    }
+
+    /**
+     * Return the stack trace in a String.
+     * @param t the Throwable object
+     * @return String the String presentation of the Throwable object
+     */
+    public static String toString(Throwable t) 
+    {
+        StringWriter strWrt = new StringWriter();
+        t.printStackTrace(new PrintWriter(strWrt));
+
+        return strWrt.toString();
+    }
+
+    /**
+     * Return the stack trace up to the first line that starts with prefix.
+     *
+     * <p>Example: ExceptionUtil.getStackTraceUpTo(exception, "jrunx.");</p>
+     * @param t the Throwable object
+     * @param prefix the prefix message that we are looking for
+     * @return String the String of stack trace lines till the prefix message is located
+     */
+    public static String getStackTraceUpTo(Throwable t, String prefix) 
+    {
+        StringTokenizer tokens = new StringTokenizer(toString(t), "\n\r");
+        StringBuffer trace = new StringBuffer();
+        boolean done = false;
+
+        String lookingFor = "at " + prefix;
+        while (!done && tokens.hasMoreElements())
+        {
+            String token = tokens.nextToken();
+            if (token.indexOf(lookingFor) == -1)
+                trace.append(token);
+            else
+                done = true;
+            trace.append(StringUtils.NEWLINE);
+        }
+
+        return trace.toString();
+    }
+
+    /**
+     * return the top n lines of this stack trace.
+     *
+     * <p>Example: ExceptionUtil.getStackTraceLines(exception, 10);</p>
+     * @param t the Throwable object
+     * @param numLines number of lines we should trace down
+     * @return String the String of stack trace lines
+     */
+    public static String getStackTraceLines(Throwable t, int numLines) 
+    {
+        StringTokenizer tokens = new StringTokenizer(toString(t), "\n\r");
+
+        StringBuffer trace = new StringBuffer();
+
+        for (int i=0; i<numLines; i++)
+        {
+            String token = tokens.nextToken();
+            trace.append(token);
+            trace.append(StringUtils.NEWLINE);
+        }
+
+        return trace.toString();
+    }
+
+    /**
+     * Return the "nth" method call from the stack trace of "t", where 0 is
+     * the top.
+     * @param t the Throwable object
+     * @param nth the line number of the message should we skip
+     * @return String the callAt String
+     */
+    public static String getCallAt(Throwable t, int nth) 
+    {
+        StringTokenizer tokens = new StringTokenizer(toString(t), "\n\r");
+        try 
+        {
+            // Skip the first line - the exception message
+            for(int i = 0; i <= nth; ++i)
+                tokens.nextToken();
+
+            // get the method name from the next token
+            String token = tokens.nextToken();
+            int index1 = token.indexOf(' ');
+            int index2 = token.indexOf('(');
+            StringBuffer call = new StringBuffer();
+            call.append(token.substring(index1 < 0 ? 0 : index1 + 1, index2 < 0 ? call.length() : index2));
+
+            int index3 = token.indexOf(':', index2 < 0 ? 0 : index2);
+            if(index3 >= 0) 
+            {
+                int index4 = token.indexOf(')', index3);
+                call.append(token.substring(index3, index4 < 0 ? token.length() : index4));
+            }
+            return call.toString();
+        }
+        catch(NoSuchElementException e) {}
+
+        return "unknown";
+    }
+
+
+    /**
+     * Utility method for converting an exception into a string. This
+     * method unwinds all wrapped exceptions
+     * @param t The throwable exception
+     * @return The printable exception
+     */
+    public static String exceptionToString(Throwable t)
+    {
+        StringWriter sw = new StringWriter();
+        PrintWriter out = new PrintWriter(sw);
+
+        //print out the exception stack.
+        printExceptionStack(t, out, 0);
+        return sw.toString();
+    }
+    
+    /**
+     * Utility method for converting an exception and all chained root causes into a
+     * string. Unlike <code>exceptionToString(Throwable)</code> which prints the chain
+     * from most nested root cause down to the top-level exception, this method prints 
+     * from the top-level exception down to the most nested root cause.
+     * 
+     * @param t The throwable exception.
+     * @return The printable exception.
+     */
+    public static String exceptionFollowedByRootCausesToString(Throwable t)
+    {
+        StringBuffer output = new StringBuffer();
+        Throwable root = t;
+        while (root != null)
+        {
+            output.append((root == t) ? ((root instanceof Exception) ? "  Exception: " : "  Error: ") : "  Root cause: ");
+            output.append(ExceptionUtil.toString(root));
+            // Do not recurse if the root cause has already been printed; this will have happened if the root cause has
+            // been assigned to the current Throwable via initCause() or as a constructor argument.
+            Throwable cause = root.getCause();
+            root = ExceptionUtil.wrappedException(root);
+            if (cause == root)
+                break;
+        }
+        return output.toString();
+    }
+
+    /**
+     * Recursively prints out a stack of wrapped exceptions.
+     */
+    protected static void printExceptionStack(Throwable th, PrintWriter out, int depth){
+        //only print the stack depth if the depth is greater than 0
+        boolean printStackDepth = depth>0;
+
+        Throwable wrappedException = ExceptionUtil.wrappedException(th);
+        if (wrappedException != null)
+        {
+            printStackDepth = true;
+            printExceptionStack(wrappedException, out, depth + 1);
+        }
+
+        if(printStackDepth){
+            out.write("[" + depth + "]");
+        }
+
+        th.printStackTrace(out);
+    }
+
+    private static Throwable getRootCauseWithReflection(Throwable t)
+    {
+        for(int i = 0; i < unwrapMethods.length; i++)
+        {
+            Method m = null;
+
+            try
+            {
+                m = t.getClass().getMethod(unwrapMethods[i], (Class[])null);
+                return (Throwable) m.invoke(t, (Object[])null);
+            }
+            catch(Exception nsme)
+            {
+                // ignore
+            }
+        }
+
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/util/FileUtils.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/util/FileUtils.java b/modules/common/src/flex/messaging/util/FileUtils.java
new file mode 100755
index 0000000..8f7146a
--- /dev/null
+++ b/modules/common/src/flex/messaging/util/FileUtils.java
@@ -0,0 +1,96 @@
+/*
+ * 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.messaging.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * @exclude
+ */
+public class FileUtils
+{
+    public static final String UTF_8 = "UTF-8";
+    public static final String UTF_16 = "UTF-16";
+
+    /**
+     * Sets a mark in the InputStream for 3 bytes to check for a BOM. If the BOM
+     * stands for UTF-8 encoded content then the stream will not be reset, otherwise
+     * for UTF-16 with a BOM or any other encoding situation the stream is reset to the
+     * mark (as for UTF-16 the parser will handle the BOM).
+     *
+     * @param in InputStream containing BOM and must support mark().
+     * @param default_encoding The default character set encoding. null or "" => system default
+     * @return The file character set encoding.
+     * @throws IOException
+     */
+    public static final String consumeBOM(InputStream in, String default_encoding) throws IOException
+    {
+        in.mark(3);
+
+        // Determine file encoding...
+        // ASCII - no header (use the supplied encoding)
+        // UTF8  - EF BB BF
+        // UTF16 - FF FE or FE FF (decoder chooses endian-ness)
+        if (in.read() == 0xef && in.read() == 0xbb && in.read() == 0xbf)
+        {
+            // UTF-8 reader does not consume BOM, so do not reset
+            if (System.getProperty("flex.platform.CLR") != null)
+            {
+                return "UTF8";
+            }
+            else
+            {
+                return UTF_8;
+            }
+        }
+        else
+        {
+            in.reset();
+            int b0 = in.read();
+            int b1 = in.read();
+            if (b0 == 0xff && b1 == 0xfe || b0 == 0xfe && b1 == 0xff)
+            {
+                in.reset();
+                // UTF-16 reader will consume BOM
+                if (System.getProperty("flex.platform.CLR") != null)
+                {
+                    return "UTF16";
+                }
+                else
+                {
+                    return UTF_16;
+                }
+            }
+            else
+            {
+                // no BOM found
+                in.reset();
+                if (default_encoding != null && default_encoding.length() != 0)
+                {
+                    return default_encoding;
+                }
+                else
+                {
+                    return System.getProperty("file.encoding");
+                }
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/util/LocaleUtils.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/util/LocaleUtils.java b/modules/common/src/flex/messaging/util/LocaleUtils.java
new file mode 100755
index 0000000..e398971
--- /dev/null
+++ b/modules/common/src/flex/messaging/util/LocaleUtils.java
@@ -0,0 +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 flex.messaging.util;
+
+import java.util.Locale;
+
+/**
+ * @exclude
+ */
+public class LocaleUtils
+{
+    /**
+     * Builds a <code>Locale</code> instance from the passed string. If the string
+     * is <code>null</code> this method will return the default locale for the JVM.
+     *
+     * @param locale The locale as a string.
+     * @return The Locale instance built from the passed string.
+     */
+    public static Locale buildLocale(String locale)
+    {
+        if (locale == null)
+        {
+            return Locale.getDefault();
+        }
+        else
+        {
+            int index = locale.indexOf('_');
+            if (index == -1)
+            {
+                return new Locale(locale);
+            }
+            String language = locale.substring(0, index);
+            String rest = locale.substring(index + 1);
+            index = rest.indexOf('_');
+            if (index == -1)
+            {
+                return new Locale(language, rest);
+            }
+            String country = rest.substring(0, index);
+            rest = rest.substring(index + 1);
+            return new Locale(language, country, rest);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/util/ObjectTrace.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/util/ObjectTrace.java b/modules/common/src/flex/messaging/util/ObjectTrace.java
new file mode 100755
index 0000000..6477086
--- /dev/null
+++ b/modules/common/src/flex/messaging/util/ObjectTrace.java
@@ -0,0 +1,173 @@
+/*
+ * 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.messaging.util;
+
+import flex.messaging.log.Log;
+
+/**
+ * Simple utility to trace an Object graph out to a StringBuffer.
+ *
+ * Note that new lines are NOT added after the individual values
+ * in complex type properties.
+ *
+ * @exclude
+ */
+public class ObjectTrace
+{
+
+
+    /* This boolean is used for suppressing debug output for selected properties.
+     * The logger will check this before printing a property.
+     */
+    public boolean nextElementExclude;
+
+    public ObjectTrace()
+    {
+        buffer = new StringBuffer(4096);
+    }
+
+    public ObjectTrace(int bufferSize)
+    {
+        buffer = new StringBuffer(bufferSize);
+    }
+
+    public String toString()
+    {
+        return buffer.toString();
+    }
+
+    public void write(Object o)
+    {
+        if (m_nested <= 0)
+            buffer.append(indentString());
+
+        buffer.append(String.valueOf(o));
+    }
+
+    public void writeNull()
+    {
+        if (m_nested <= 0)
+            buffer.append(indentString());
+
+        buffer.append("null");
+    }
+
+    public void writeRef(int ref)
+    {
+        if (m_nested <= 0)
+            buffer.append(indentString());
+
+        buffer.append("(Ref #").append(ref).append(")");
+    }
+
+    public void writeString(String s)
+    {
+        if (m_nested <= 0)
+            buffer.append(indentString());
+
+        buffer.append("\"").append(s).append("\"");
+    }
+
+    public void startArray(String header)
+    {
+        if (header != null && header.length() > 0)
+        {
+            if (m_nested <= 0)
+                buffer.append(indentString());
+
+            buffer.append(header).append(newLine);
+        }
+
+        m_indent++;
+        m_nested++;
+    }
+
+    public void arrayElement(int index)
+    {
+        buffer.append(indentString()).append("[").append(index).append("] = ");
+    }
+
+    public void endArray()
+    {
+        m_indent--;
+        m_nested--;
+    }
+
+    public void startObject(String header)
+    {
+        if (header != null && header.length() > 0)
+        {
+            if (m_nested <= 0)
+                buffer.append(indentString());
+
+            buffer.append(header).append(newLine);
+        }
+
+        m_indent++;
+        m_nested++;
+    }
+
+    public void namedElement(String name)
+    {
+        if (Log.isExcludedProperty(name))
+        {
+            nextElementExclude = true;
+        }
+
+        buffer.append(indentString()).append(name).append(" = ");
+    }
+
+    public void endObject()
+    {
+        m_indent--;
+        m_nested--;
+    }
+
+    public void newLine()
+    {
+        boolean alreadyPadded = false;
+        int length = buffer.length();
+
+        if (length > 3)
+        {
+            String tail = buffer.substring(length - 3, length - 1); //Get last two chars in buffer
+            alreadyPadded = tail.equals(newLine);
+        }
+
+        if (!alreadyPadded)
+            buffer.append(newLine);
+    }
+
+    /**
+     * Uses the static member, m_indent to create a string of spaces of
+     * the appropriate indentation.
+     */
+    protected String indentString()
+    {
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < m_indent; ++i)
+        {
+            sb.append("  ");
+        }
+        return sb.toString();
+    }
+
+    protected StringBuffer buffer;
+    protected int m_indent;
+    protected int m_nested;
+    public static String newLine = StringUtils.NEWLINE;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/util/PrettyPrintable.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/util/PrettyPrintable.java b/modules/common/src/flex/messaging/util/PrettyPrintable.java
new file mode 100755
index 0000000..3c2933b
--- /dev/null
+++ b/modules/common/src/flex/messaging/util/PrettyPrintable.java
@@ -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.
+ */
+package flex.messaging.util;
+
+/**
+ * Allows an Object to customize how it is pretty printed in
+ * logging/debugging output.
+ *
+ * @exclude
+ */
+public interface PrettyPrintable
+{
+    String toStringHeader();
+
+    String toStringCustomProperty(String name);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/util/PrettyPrinter.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/util/PrettyPrinter.java b/modules/common/src/flex/messaging/util/PrettyPrinter.java
new file mode 100755
index 0000000..c4e86c0
--- /dev/null
+++ b/modules/common/src/flex/messaging/util/PrettyPrinter.java
@@ -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.
+ */
+package flex.messaging.util;
+
+/**
+ * Implementations convert Object graphs to Strings for
+ * logging and debugging.
+ *
+ * @exclude
+ */
+public interface PrettyPrinter
+{
+    String prettify(Object o);
+
+    Object copy();
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/util/PropertyStringResourceLoader.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/util/PropertyStringResourceLoader.java b/modules/common/src/flex/messaging/util/PropertyStringResourceLoader.java
new file mode 100755
index 0000000..39f571d
--- /dev/null
+++ b/modules/common/src/flex/messaging/util/PropertyStringResourceLoader.java
@@ -0,0 +1,379 @@
+/*
+ * 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.messaging.util;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
+
+import flex.messaging.log.Log;
+import flex.messaging.log.Logger;
+import flex.messaging.log.LogCategories;
+
+/**
+ * Implementation of <code>ResourceLoader</code> that loads string resources
+ * from property files.
+ * <p>
+ * This class uses <code>MessageFormat</code> to perform substitutions
+ * within parameterized strings.
+ * </p>
+ *
+ * @author Seth Hodgson
+ * @see MessageFormat
+ * @exclude
+ */
+public class PropertyStringResourceLoader implements ResourceLoader
+{
+    // The property file bundle that contains localized error strings for BlazeDS.
+    public static final String PROPERTY_BUNDLE = "flex/messaging/errors";
+
+    // The property file bundle that contains localized error strings for BlazeDS 
+    // code specific to vendors (eg. LoginCommands for specific application serves)
+    public static final String VENDORS_BUNDLE = "flex/messaging/vendors";
+    
+    // The property file bundle that contains localized error strings for LCDS.
+    public static final String LCDS_PROPERTY_BUNDLE = "flex/data/errors";
+
+    // The category to write log entries under.
+    private static final String LOG_CATEGORY = LogCategories.RESOURCE;
+
+    // The property bundle names to use in string lookups.
+    private String[] propertyBundles;
+
+    // The default FDS locale.
+    private Locale defaultLocale;
+
+    // The set of locales that have strings loaded.
+    private Set loadedLocales = new TreeSet();
+
+    // A map of all loaded strings.
+    private Map strings = new HashMap();
+
+    // The logger for this instance.
+    private Logger logger;
+
+    /**
+     * Constructs a <code>PropertyStringResourceLoader</code> using the default
+     * property bundles specified by the <code>PROPERTY_BUNDLE</code> and
+     * <code>LCDS_PROPERTY_BUNDLE</code> fields.
+     */
+    public PropertyStringResourceLoader()
+    {
+        this(new String[] {PROPERTY_BUNDLE, LCDS_PROPERTY_BUNDLE});
+    }
+
+    /**
+     * Constructs a <code>PropertyStringResourceLoader</code> that will use the
+     * specified property bundle to use for string lookups.
+     *
+     * @param propertyBundle The property bundles to use for lookups.
+     */
+    public PropertyStringResourceLoader(String propertyBundle)
+    {
+        this(new String[] {propertyBundle});
+    }
+
+    /**
+     * Constructs a <code>PropertyStringResourceLoader</code> that will use the
+     * specified property bundles to use for string lookups.
+     *
+     * @param propertyBundles The list of the property bundles to use for lookups.
+     */
+    public PropertyStringResourceLoader(String[] propertyBundles)
+    {
+        this.propertyBundles = propertyBundles;
+        logger = Log.getLogger(LOG_CATEGORY);
+    }
+
+    // Implements flex.messaging.util.ResourceLoader.init; inherits javadoc specification.
+    public void init(Map properties)
+    {}
+
+    // Implements flex.messaging.util.ResourceLoader.getString; inherits javadoc specification.
+    public String getString(String key)
+    {
+        return getString(key, null, null);
+    }
+
+    // Implements flex.messaging.util.ResourceLoader.getString; inherits javadoc specification.
+    public String getString(String key, Object[] arguments)
+    {
+        return getString(key, null, arguments);
+    }
+
+    // Implements flex.messaging.util.ResourceLoader.getString; inherits javadoc specification.
+    public String getString(String key, Locale locale)
+    {
+        return getString(key, locale, null);
+    }
+
+    // Implements flex.messaging.util.ResourceLoader.getString; inherits javadoc specification.
+    public String getString(String key, Locale locale, Object[] arguments)
+    {
+        synchronized(strings)
+        {
+            if (defaultLocale == null)
+            {
+                defaultLocale = getDefaultLocale();
+            }
+        }
+        String value = null;
+        String stringKey = null;
+        String localeKey = (locale != null) ?
+                           generateLocaleKey(locale) :
+                           generateLocaleKey(defaultLocale);
+        String originalStringKey = generateStringKey(key, localeKey);
+        int trimIndex = 0;
+
+        /*
+         * Attempt to get a string for the target locale - fail back to less specific
+         * versions of the locale.
+         */
+        while (true)
+        {
+            loadStrings(localeKey);
+            stringKey = generateStringKey(key, localeKey);
+            synchronized(strings)
+            {
+                value = (String) strings.get(stringKey);
+                if (value != null)
+                {
+                    if (!stringKey.equals(originalStringKey))
+                    {
+                        strings.put(originalStringKey, value);
+                    }
+                    return substituteArguments(value, arguments);
+                }
+            }
+            trimIndex = localeKey.lastIndexOf('_');
+            if (trimIndex != -1)
+            {
+                localeKey = localeKey.substring(0, trimIndex);
+            }
+            else
+            {
+                break;
+            }
+        }
+
+        /*
+         * Attempt to get the string in our default locale if it is
+         * different than the requested locale.
+         */
+        if ((locale != null) && (!locale.equals(defaultLocale)))
+        {
+            localeKey = generateLocaleKey(defaultLocale);
+            stringKey = generateStringKey(key, localeKey);
+            synchronized(strings)
+            {
+                value = (String) strings.get(stringKey);
+                if (value != null)
+                {
+                    strings.put(originalStringKey, value);
+                    return substituteArguments(value, arguments);
+                }
+            }
+        }
+
+        // As a last resort, try to get a non-locale-specific string.
+        loadStrings("");
+        stringKey = generateStringKey(key, "");
+        synchronized(strings)
+        {
+            value = (String) strings.get(stringKey);
+            if (value != null)
+            {
+                strings.put(originalStringKey, value);
+                return substituteArguments(value, arguments);
+            }
+        }
+
+        // No string is available. Return a formatted missing string value.
+        return ("???" + key + "???");
+    }
+
+    /**
+     * Sets the default locale to be used when locating resources. The
+     * string will be converted into a Locale.
+     *
+     * @param locale The default locale to be used.
+     */
+    public void setDefaultLocale(String locale)
+    {
+        defaultLocale = LocaleUtils.buildLocale(locale);
+    }
+
+    /**
+     * Sets the default locale to be used when locating resources.
+     *
+     * @param locale The default locale to be used.
+     */
+    public void setDefaultLocale(Locale locale)
+    {
+        defaultLocale = locale;
+    }
+
+    /**
+     * The default locale to be used when locating resources.
+     * @return Locale the default Locale object
+     */
+    public Locale getDefaultLocale()
+    {
+        if (defaultLocale == null)
+            defaultLocale = Locale.getDefault();
+
+        return defaultLocale;
+    }
+
+    /**
+     * Loads localized strings for the specified locale from a property file.
+     *
+     * @param localeKey The locale to load strings for.
+     */
+    protected synchronized void loadStrings(String localeKey)
+    {
+        if (loadedLocales.contains(localeKey))
+        {
+            return;
+        }
+
+        if (propertyBundles != null)
+        {
+            for (int i = 0; i < propertyBundles.length; i++)
+            {
+                String propertyBundle = propertyBundles[i];
+                loadProperties(localeKey, propertyBundle);
+            }
+        }
+    }
+
+    protected InputStream loadFile(String filename)
+    {
+        ClassLoader loader = Thread.currentThread().getContextClassLoader();
+        InputStream stream = loader.getResourceAsStream(filename);
+        
+        // Try the properties file in our classloader too - just in case
+        if (stream == null)
+        {
+            stream = PropertyStringResourceLoader.class.getClassLoader().getResourceAsStream(filename);
+        }
+        
+        return stream;
+    }
+    
+    // Helper method for loadStrings.
+    protected void loadProperties(String localeKey, String propertyBundle)
+    {
+        // Build the path to the target property file.
+        String filename = propertyBundle;
+        if (localeKey.length() > 0)
+        {
+            filename += "_" + localeKey;
+        }
+        filename += ".properties";
+        // Load the property file.
+        InputStream stream = loadFile(filename); 
+            
+        Properties props = new Properties();
+        if (stream != null)
+        {
+            try
+            {
+                props.load(stream);
+            }
+            catch (IOException ioe)
+            {
+                logger.warn("There was a problem reading the string resource property file '" + filename + "' stream.", ioe);
+            }
+            catch (IllegalArgumentException iae)
+            {
+                logger.warn("The string resource property file '" + filename + "' contains a malformed Unicode escape sequence.", iae);
+            }
+            finally
+            {
+                try
+                {
+                    stream.close();
+                }
+                catch (IOException ioe)
+                {
+                    logger.warn("The string resource property file '" + filename + "' stream failed to close.", ioe);
+                }
+            }
+        }
+        else
+        {
+            logger.warn("The class loader could not locate the string resource property file '" + filename + "'. This may not be an issue if a property file is available for a less specific locale or the default locale.");
+        }
+        // Move strings into string cache.
+        if (props.size() > 0)
+        {
+            synchronized(strings)
+            {
+                Iterator iter = props.keySet().iterator();
+                while (iter.hasNext())
+                {
+                    String key = (String) iter.next();
+                    strings.put(generateStringKey(key, localeKey), props.getProperty(key));
+                }
+            }
+        }
+    }
+
+    /**
+     * Generates a locale cache key.
+     *
+     * @param locale The locale to generate a cache key for.
+     * @return The generated cache key.
+     */
+    private String generateLocaleKey(Locale locale)
+    {
+        return (locale == null) ? "" : locale.toString();
+    }
+
+    /**
+     * Generates a cache key for a string resource.
+     *
+     * @param key The string to generate a cache key for.
+     * @param locale The locale to retrieve the string for.
+     * @return The generated cache key for the string resource.
+     */
+    private String generateStringKey(String key, String locale)
+    {
+        return (key + "-" + locale);
+    }
+
+    /**
+     * Substitutes the specified arguments into a parameterized string.
+     *
+     * @param parameterized The string containing parameter tokens for substitution.
+     * @param arguments The arguments to substitute into the parameterized string.
+     * @return The resulting substituted string.
+     */
+    private String substituteArguments(String parameterized, Object[] arguments)
+    {
+        return MessageFormat.format(parameterized, arguments).trim();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/util/ResourceLoader.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/util/ResourceLoader.java b/modules/common/src/flex/messaging/util/ResourceLoader.java
new file mode 100755
index 0000000..0ea39b0
--- /dev/null
+++ b/modules/common/src/flex/messaging/util/ResourceLoader.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.messaging.util;
+
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * The root interface for classes that provide access to localized resources.
+ *
+ * @author Seth Hodgson
+ * @exclude
+ */
+public interface ResourceLoader
+{
+    /**
+     * Initializes the <code>ResourceLoader</code> using the specified properties.
+     *
+     * @param properties The initialization properties.
+     */
+    void init(Map properties);
+
+    /**
+     * Sets the default locale to be used when locating resources. The
+     * string will be converted into a Locale.
+     *
+     * @param locale The default locale to be used.
+     */
+    void setDefaultLocale(String locale);
+
+    /**
+     * Sets the default locale to be used when locating resources.
+     *
+     * @param locale The default locale to be used.
+     */
+    void setDefaultLocale(Locale locale);
+
+    /**
+     * The default locale to be used when locating resources.
+     *
+     * @return The default locale.
+     */
+    Locale getDefaultLocale();
+
+    /**
+     * Gets a string for the given key.
+     *
+     * @param key The key for the target string.
+     * @return The string for the given key.
+     */
+    String getString(String key);
+
+    /**
+     * Gets a parameterized string for the given key and substitutes
+     * the parameters using the passed array of arguments.
+     *
+     * @param key The key for the target string.
+     * @param arguments The arguments to substitute into the parameterized string.
+     * @return The substituted string for the given key.
+     * @exception IllegalArgumentException If the parameterized string is invalid,
+     *            or if an argument in the <code>arguments</code> array
+     *            is not of the type expected by the format element(s)
+     *            that use it.
+     */
+    String getString(String key, Object[] arguments);
+
+    /**
+     * Gets a string for the given key and locale.
+     *
+     * @param key The key for the target string.
+     * @param locale The target locale for the string.
+     * @return The localized string for the given key.
+     */
+    String getString(String key, Locale locale);
+
+    /**
+     * Gets a parameterized string for the given key and locale and substitutes the
+     * parameters using the passed array of arguments.
+     *
+     * @param key The key for the target string.
+     * @param locale The target locale for the string.
+     * @param arguments The arguments to substitute into the parameterized string.
+     * @return The substituted localized string for the given key.
+     * @exception IllegalArgumentException If the parameterized string is invalid,
+     *            or if an argument in the <code>arguments</code> array
+     *            is not of the type expected by the format element(s)
+     *            that use it.
+     */
+    String getString(String key, Locale locale, Object[] arguments);
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/util/StringUtils.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/util/StringUtils.java b/modules/common/src/flex/messaging/util/StringUtils.java
new file mode 100755
index 0000000..7eca7e6
--- /dev/null
+++ b/modules/common/src/flex/messaging/util/StringUtils.java
@@ -0,0 +1,214 @@
+/*
+ * 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.messaging.util;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+/**
+ * @exclude
+ */
+public class StringUtils
+{
+    /**
+     * The String to use for an OS specific line separator.
+     */
+    public static final String NEWLINE = System.getProperty("line.separator");
+
+    public static String substitute(String str, String from, String to)
+    {
+        if (from == null || from.equals("") || to == null)
+            return str;
+
+        int index = str.indexOf(from);
+
+        if (index == -1)
+            return str;
+
+        StringBuffer buf = new StringBuffer(str.length());
+        int lastIndex = 0;
+
+        while (index != -1)
+        {
+            buf.append(str.substring(lastIndex, index));
+            buf.append(to);
+            lastIndex = index + from.length();
+            index = str.indexOf(from, lastIndex);
+        }
+
+        // add in last chunk
+        buf.append(str.substring(lastIndex));
+
+        return buf.toString();
+    }
+
+    public static boolean findMatchWithWildcard(char[] src, char[] pat)
+    {
+        if (src == null || pat == null)
+            return false;
+
+        // we consider an empty pattern to be a don't-match-anything pattern
+        if (pat.length == 0)
+            return false;
+
+        if (src.length == 0)
+            return (pat.length == 0 || (pat.length == 1 && (pat[0] == '*' || pat[0] == '?')));
+
+        boolean star = false;
+
+        int srcLen = src.length;
+        int patLen = pat.length;
+        int srcIdx = 0;
+        int patIdx = 0;
+
+        for (; srcIdx < srcLen; srcIdx++)
+        {
+            if (patIdx == patLen)
+            {
+                if (patLen < (srcLen - srcIdx))
+                    patIdx = 0; //Start the search again
+                else
+                    return false;
+            }
+
+            char s = src[srcIdx];
+            char m = pat[patIdx];
+
+            switch (m)
+            {
+                case '*':
+                    // star on the end
+                    if (patIdx == pat.length - 1)
+                        return true;
+                    star = true;
+                    ++patIdx;
+                    break;
+
+                case '?':
+                    ++patIdx;
+                    break;
+
+                default:
+                    if (s != m)
+                    {
+                        if (!star)
+                        {
+                            if (patLen < (srcLen - srcIdx))
+                                patIdx = 0; //Start the search again
+                            else
+                                return false;
+                        }
+                    }
+                    else
+                    {
+                        star = false;
+                        ++patIdx;
+                    }
+                    break;
+            }
+        }
+
+        if (patIdx < patLen)
+        {
+            //read off the rest of the pattern and make sure it's all wildcard
+            for (; patIdx < patLen; patLen++)
+            {
+                if (pat[patIdx] != '*')
+                {
+                    return false;
+                }
+            }
+            return true;
+        }
+
+
+        return !star;
+    }
+
+    /**
+     * Returns a prettified version of the XML, with indentations and
+     * linefeeds.  Returns the original string if there was an error.
+     * @param xml the xml string
+     * @return String the prettified xml string
+     */
+    public static String prettifyXML(String xml)
+    {
+        String result = xml;
+        try
+        {
+            StringReader reader = new StringReader(xml);
+            StringWriter writer = new StringWriter();
+            Transformer transformer =
+                TransformerFactory.newInstance().newTransformer();
+            transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+            transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+            transformer.transform
+                (new StreamSource(reader), new StreamResult(writer));
+            writer.close();
+
+            result = writer.toString();
+        }
+        catch (TransformerFactoryConfigurationError error)
+        {
+            // Ignore.
+        }
+        catch (TransformerException error)
+        {
+            // Ignore.
+        }
+        catch (IOException error)
+        {
+            // Ignore.
+        }
+        return result;
+    }
+
+    /**
+     * Returns a prettified version of the string, or the original
+     * string if the operation is not possible.
+     * @param string the string to check
+     * @return String the prettified string
+     */
+    public static String prettifyString(String string)
+    {
+        String result = string;
+        if (string.startsWith("<?xml"))
+        {
+            result = prettifyXML(string);
+        }
+        return result;
+    }
+
+    /**
+     * Returns true if a string is null or empty.
+     * @param string the String to check
+     * @return boolean true if the string is an empty string
+     */
+    public static boolean isEmpty(String string)
+    {
+        return string == null || string.length() == 0;
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/util/UUIDUtils.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/util/UUIDUtils.java b/modules/common/src/flex/messaging/util/UUIDUtils.java
new file mode 100755
index 0000000..8df82e3
--- /dev/null
+++ b/modules/common/src/flex/messaging/util/UUIDUtils.java
@@ -0,0 +1,330 @@
+/*
+ * 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.messaging.util;
+
+import java.util.Random;
+import java.util.UUID;
+
+public class UUIDUtils
+{
+    private static Random _weakRand = new Random();
+	
+    /**
+     * The spec indicates that our time value should be based on 100 nano
+     * second increments but our time granularity is in milliseconds.
+     * The spec also says we can approximate the time by doing an increment
+     * when we dole out new ids in the same millisecond.  We can fit 10,000
+     * 100 nanos into a single millisecond.
+     */
+    private static final int MAX_IDS_PER_MILLI = 10000;
+	
+    /**
+     *  Any given time-of-day value can only be used once; remember the last used
+     *  value so we don't reuse them.
+     *  <p>NOTE: this algorithm assumes the clock will not be turned back.
+     */
+    private static long lastUsedTOD = 0;
+    /** Counter to use when we need more than one id in the same millisecond. */
+    private static int numIdsThisMilli = 0;
+	
+    /**  Hex digits, used for padding UUID strings with random characters. */
+    private static final String alphaNum = "0123456789ABCDEF";
+	
+    /** 4 bits per hex character. */
+    private static final int BITS_PER_DIGIT = 4;
+	
+    private static final int BITS_PER_INT = 32;
+    private static final int BITS_PER_LONG = 64;
+    private static final int DIGITS_PER_INT = BITS_PER_INT / BITS_PER_DIGIT;
+    private static final int DIGITS_PER_LONG = BITS_PER_LONG / BITS_PER_DIGIT;
+	
+    /**
+     *  @private
+     */
+    private static char[] UPPER_DIGITS = new char[] {
+	'0', '1', '2', '3', '4', '5', '6', '7',
+	'8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
+    };
+	
+    /**
+     * Private constructor to prevent instances from being created.
+     */
+    private UUIDUtils()
+    {
+    }
+	
+    /**
+     *
+     * Use the createUUID function when you need a unique string that you will
+     * use as a persistent identifier in a distributed environment. To a very
+     * high degree of certainty, this function returns a unique value; no other
+     * invocation on the same or any other system should return the same value.
+     *
+     * @return a Universally Unique Identifier (UUID)
+     * Proper Format: `XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
+     * where `X' stands for a hexadecimal digit (0-9 or A-F).
+     */
+    public static String createUUID()
+    {
+		return createUUID(false);
+	}
+	
+    public static String createUUID(boolean secure) throws Error
+    {
+        Random rand = _weakRand;
+		if (secure)
+			throw new Error("Secure UUIDs not implemented");
+		
+        StringBuffer s = new StringBuffer(36);
+		
+        appendHexString(uniqueTOD(), false, 11, s);
+		
+        //  Just use random padding characters, but ensure that the high bit
+        //  is set to eliminate chances of collision with an IEEE 802 address.
+        s.append(  alphaNum.charAt( rand.nextInt(16) | 8 ) );
+		
+        //  Add random padding characters.
+        appendRandomHexChars(32 - s.length(), rand, s);
+		
+        //insert dashes in proper position. so the format matches CF
+        s.insert(8,"-");
+        s.insert(13,"-");
+        s.insert(18,"-");
+        s.insert(23,"-");
+		
+        return s.toString();
+    }
+
+    /**
+     * Converts a 128-bit UID encoded as a byte[] to a String representation.
+     * The format matches that generated by createUID. If a suitable byte[]
+     * is not provided, null is returned.
+     *
+     * @param ba byte[] 16 bytes in length representing a 128-bit UID.
+     *
+     * @return String representation of the UID, or null if an invalid
+     * byte[] is provided.
+     */
+    public static String fromByteArray(byte[] ba)
+    {
+        if (ba == null || ba.length != 16)
+            return null;
+
+        StringBuffer result = new StringBuffer(36);
+        for (int i = 0; i < 16; i++)
+        {
+            if (i == 4 || i == 6 || i == 8 || i == 10)
+                result.append('-');
+
+            result.append(UPPER_DIGITS[(ba[i] & 0xF0) >>> 4]);
+            result.append(UPPER_DIGITS[(ba[i] & 0x0F)]);
+        }
+        return result.toString();
+    }
+
+	
+    /**
+     * A utility method to check whether a String value represents a
+     * correctly formatted UID value. UID values are expected to be
+     * in the format generated by createUID(), implying that only
+     * capitalized A-F characters in addition to 0-9 digits are
+     * supported.
+     *
+     * @param uid The value to test whether it is formatted as a UID.
+     *
+     * @return Returns true if the value is formatted as a UID.
+     */
+    public static boolean isUID(String uid)
+    {
+        if (uid == null || uid.length() != 36)
+            return false;
+
+        char[] chars = uid.toCharArray();
+        for (int i = 0; i < 36; i++)
+        {
+            char c = chars[i];
+
+            // Check for correctly placed hyphens
+            if (i == 8 || i == 13 || i == 18 || i == 23)
+            {
+                if (c != '-')
+                    return false;
+            }
+            // We allow capital alpha-numeric hex digits only
+            else if (c < 48 || c > 70 || (c > 57 && c < 65))
+            {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     * Converts a UID formatted String to a byte[]. The UID must be in the
+     * format generated by createUID, otherwise null is returned.
+     *
+     * @param uid String representing a 128-bit UID.
+     *
+     * @return byte[] 16 bytes in length representing the 128-bits of the
+     * UID or null if the uid could not be converted.
+     */
+    public static byte[] toByteArray(String uid)
+    {
+        if (!isUID(uid))
+            return null;
+
+        byte[] result = new byte[16];
+        char[] chars = uid.toCharArray();
+        int r = 0;
+
+        for (int i = 0; i < chars.length; i++)
+        {
+            if (chars[i] == '-')
+                continue;
+            int h1 = Character.digit(chars[i], 16);
+            i++;
+            int h2 = Character.digit(chars[i], 16);
+            result[r++] = (byte)(((h1 << 4) | h2) & 0xFF);
+        }
+        return result;
+    }
+
+    private static void appendRandomHexChars(int n, Random rand, StringBuffer result)
+    {
+        int digitsPerInt = DIGITS_PER_INT;
+        while (n > 0)
+        {
+            int digitsToUse = Math.min(n, digitsPerInt);
+            n -= digitsToUse;
+            appendHexString(rand.nextInt(), true, digitsToUse, result);
+        }
+    }
+
+    private static void appendHexString
+        (long value, boolean prependZeroes, int nLeastSignificantDigits,
+         StringBuffer result)
+    {
+        int bitsPerDigit = BITS_PER_DIGIT;
+
+        long mask = (1L << bitsPerDigit) - 1;
+
+        if (nLeastSignificantDigits < DIGITS_PER_LONG)
+        {
+            // Clear the bits that we don't care about.
+            value &= (1L << (bitsPerDigit * nLeastSignificantDigits)) - 1;
+        }
+
+        // Reorder the sequence so that the first set of bits will become the
+        // last set of bits.
+        int i = 0;
+        long reorderedValue = 0;
+        if (value == 0)
+        {
+            // One zero is dumped.
+            i++;
+        }
+        else
+        {
+            do
+            {
+                reorderedValue = (reorderedValue << bitsPerDigit) | (value & mask);
+                value >>>= bitsPerDigit;
+                i++;
+            } while (value != 0);
+        }
+
+        if (prependZeroes)
+        {
+            for (int j = nLeastSignificantDigits - i; j > 0; j--)
+            {
+                result.append('0');
+            }
+        }
+
+
+        // Dump the reordered sequence, with the most significant character
+        // first.
+        for (; i > 0; i--)
+        {
+            result.append(alphaNum.charAt((int) (reorderedValue & mask)));
+            reorderedValue >>>= bitsPerDigit;
+        }
+    }
+
+    private static String createInsecureUUID()
+    {
+        StringBuffer s = new StringBuffer(36);
+
+        appendHexString(uniqueTOD(), false, 11, s);
+
+        //  Just use random padding characters, but ensure that the high bit
+        //  is set to eliminate chances of collision with an IEEE 802 address.
+        s.append(  alphaNum.charAt( _weakRand.nextInt(16) | 8 ) );
+
+        //  Add random padding characters.
+        appendRandomHexChars(32 - s.length(), _weakRand, s);
+
+        //insert dashes in proper position. so the format matches CF
+        s.insert(8,"-");
+        s.insert(13,"-");
+        s.insert(18,"-");
+        s.insert(23,"-");
+
+        return s.toString();
+    }
+
+    /**
+     *  @return a time value, unique for calls to this method loaded by the same classloader.
+     */
+    private static synchronized long uniqueTOD()
+    {
+        long currentTOD = System.currentTimeMillis();
+
+        // Clock was set back... do not hang in this case waiting to catch up.
+        // Instead, rely on the random number part to differentiate the ids.
+        if (currentTOD < lastUsedTOD)
+            lastUsedTOD = currentTOD;
+
+        if (currentTOD == lastUsedTOD)
+        {
+            numIdsThisMilli++;
+            /*
+             * Fall back to the old technique of sleeping if we allocate
+             * too many ids in one time interval.
+             */
+            if (numIdsThisMilli >= MAX_IDS_PER_MILLI)
+            {
+                while ( currentTOD == lastUsedTOD )
+                {
+                    try { Thread.sleep(1); } catch ( Exception interrupt ) { /* swallow, wake up */ }
+                    currentTOD = System.currentTimeMillis();
+                }
+                lastUsedTOD = currentTOD;
+                numIdsThisMilli = 0;
+            }
+        }
+        else
+        {
+            //  We have a new TOD, reset the counter
+            lastUsedTOD = currentTOD;
+            numIdsThisMilli = 0;
+        }
+
+        return lastUsedTOD * MAX_IDS_PER_MILLI + (long)numIdsThisMilli;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/AdobeInfo.xml
----------------------------------------------------------------------
diff --git a/modules/core/AdobeInfo.xml b/modules/core/AdobeInfo.xml
new file mode 100755
index 0000000..3504592
--- /dev/null
+++ b/modules/core/AdobeInfo.xml
@@ -0,0 +1,24 @@
+<?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.
+
+-->
+    <manifest version="1.0">
+    <versioninfo> 
+        <build AdobeIPNumber="0000494"/>
+    </versioninfo>
+</manifest>
\ No newline at end of file


[03/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/FlexClientAttributeListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/FlexClientAttributeListener.java b/modules/core/src/flex/messaging/client/FlexClientAttributeListener.java
new file mode 100755
index 0000000..9481bc2
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/FlexClientAttributeListener.java
@@ -0,0 +1,47 @@
+/*
+ * 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.messaging.client;
+
+/**
+ * Interface for FlexClient attribute listeners.
+ */
+public interface FlexClientAttributeListener 
+{
+    /**
+     * Callback invoked after an attribute is added to the FlexClient.
+     * 
+     * @param event The event containing the associated FlexClient and attribute
+     *              information.
+     */
+    void attributeAdded(FlexClientBindingEvent event);
+    
+    /**
+     * Callback invoked after an attribute is removed from the FlexClient.
+     * 
+     * @param event The event containing the associated FlexClient and attribute
+     *              information.
+     */
+    void attributeReplaced(FlexClientBindingEvent event);
+    
+    /**
+     * Callback invoked after an attribute has been replaced with a new value.
+     * 
+     * @param event The event containing the associated FlexClient and attribute
+     *              information.
+     */
+    void attributeRemoved(FlexClientBindingEvent event);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/FlexClientBindingEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/FlexClientBindingEvent.java b/modules/core/src/flex/messaging/client/FlexClientBindingEvent.java
new file mode 100755
index 0000000..236f70a
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/FlexClientBindingEvent.java
@@ -0,0 +1,115 @@
+/*
+ * 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.messaging.client;
+
+/**
+ * Event used to notify FlexClientAttributeListeners of changes to FlexClient
+ * attributes.
+ */
+public class FlexClientBindingEvent 
+{
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Constructs an event for an attribute that is bound or unbound from a FlexClient.
+     * 
+     * @param client The FlexClient.
+     * @param name The attribute name.
+     */
+    public FlexClientBindingEvent(FlexClient client, String name)
+    {
+        this.client = client;
+        this.name = name;
+    }    
+
+    
+    /**
+     * Constructs an event for an attribute that is added to a FlexClient or 
+     * replaced by a new value.
+     * 
+     * @param client The FlexClient.
+     * @param name The attribute name.
+     * @param value The attribute value.
+     */
+    public FlexClientBindingEvent(FlexClient client, String name, Object value)
+    {
+        this.client = client;
+        this.name = name;
+        this.value = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * The FlexClient that generated the event.
+     */
+    private FlexClient client;
+    
+    /**
+     * The name of the attribute associated with the event.
+     */
+    private String name;
+    
+    /**
+     * The value of the attribute associated with the event.
+     */
+    private Object value;
+    
+    //--------------------------------------------------------------------------
+    //
+    // Methods
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     * Returns the FlexClient that generated the event.
+     * 
+     * @return The FlexClient that generated the event.
+     */
+    public FlexClient getClient()
+    {
+        return client;
+    }
+    
+    /**
+     * Returns the name of the attribute associated with the event.
+     * 
+     * @return The name of the attribute associated with the event.
+     */
+    public String getName()
+    {
+        return name;
+    }
+    
+    /**
+     * Returns the value of the attribute associated with the event.
+     * 
+     * @return The value of the attribute associated with the event.
+     */
+    public Object getValue()
+    {
+        return value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/FlexClientBindingListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/FlexClientBindingListener.java b/modules/core/src/flex/messaging/client/FlexClientBindingListener.java
new file mode 100755
index 0000000..d1fb36b
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/FlexClientBindingListener.java
@@ -0,0 +1,39 @@
+/*
+ * 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.messaging.client;
+
+/**
+ * Interface to be notified when the implementing object is bound or unbound from the FlexClient.
+ */
+public interface FlexClientBindingListener 
+{
+    /**
+     * Callback invoked when the object is bound to a FlexClient.
+     * 
+     * @param event The event containing the FlexClient and attribute
+     *              information.
+     */
+    void valueBound(FlexClientBindingEvent event);
+    
+    /**
+     * Callback invoked when the object is unbound from a FlexClient.
+     * 
+     * @param event The event containing the FlexClient and attribute
+     *              information.
+     */
+    void valueUnbound(FlexClientBindingEvent event);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/FlexClientListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/FlexClientListener.java b/modules/core/src/flex/messaging/client/FlexClientListener.java
new file mode 100755
index 0000000..49dc24a
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/FlexClientListener.java
@@ -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 flex.messaging.client;
+
+/**
+ * Interface to be notified when a FlexClient is created or destroyed. Implementations of this interface
+ * may add themselves as created listeners statically via <code>FlexClient.addClientCreatedListener()</code>.
+ * To listen for FlexClient destruction, the implementation instance must add itself as a listener to
+ * a specific FlexClient instance via the <code>addClientDestroyedListener()</code> method.
+ */
+public interface FlexClientListener 
+{
+    /**
+     * Notification that a FlexClient was created.
+     * 
+     * @param client The FlexClient that was created.
+     */
+    void clientCreated(FlexClient client);
+    
+    /**
+     * Notification that a FlexClient is about to be destroyed.
+     * 
+     * @param client The FlexClient that will be destroyed.
+     */
+    void clientDestroyed(FlexClient client);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/FlexClientManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/FlexClientManager.java b/modules/core/src/flex/messaging/client/FlexClientManager.java
new file mode 100755
index 0000000..d1e7a1e
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/FlexClientManager.java
@@ -0,0 +1,519 @@
+/*
+ * 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.messaging.client;
+
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ThreadFactory;
+
+import flex.management.ManageableComponent;
+import flex.management.runtime.messaging.client.FlexClientManagerControl;
+import flex.messaging.FlexContext;
+import flex.messaging.MessageBroker;
+import flex.messaging.MessageException;
+import flex.messaging.config.FlexClientSettings;
+import flex.messaging.endpoints.AbstractEndpoint;
+import flex.messaging.endpoints.Endpoint;
+import flex.messaging.log.Log;
+import flex.messaging.log.LogCategories;
+import flex.messaging.util.ClassUtil;
+import flex.messaging.util.TimeoutAbstractObject;
+import flex.messaging.util.TimeoutManager;
+
+/**
+ * @exclude
+ * Manages FlexClient instances for a MessageBroker.
+ */
+public class FlexClientManager extends ManageableComponent
+{
+    public static final String TYPE = "FlexClientManager";
+
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @exclude
+     */
+    public FlexClientManager()
+    {
+        this(MessageBroker.getMessageBroker(null));
+    }
+    /**
+     * Constructs a FlexClientManager for the passed MessageBroker.
+     *
+     * @param broker The MessageBroker that the Flex client manager is associated with.
+     */
+    public FlexClientManager(MessageBroker broker)
+    {
+        this(broker.isManaged(), broker);
+    }
+
+    /**
+     * @exclude
+     */
+    public FlexClientManager(boolean enableManagement, MessageBroker mbroker)
+    {
+        super(enableManagement);
+
+        super.setId(TYPE);
+
+        // Ensure that we have a message broker:
+        broker = (mbroker != null) ? mbroker : MessageBroker.getMessageBroker(null);
+
+        FlexClientSettings flexClientSettings = broker.getFlexClientSettings();
+        if (flexClientSettings != null && flexClientSettings.getTimeoutMinutes() != -1)
+        {
+            // Convert from minutes to millis.
+            setFlexClientTimeoutMillis(flexClientSettings.getTimeoutMinutes()*60*1000);
+        }
+
+        this.setParent(broker);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * The MessageBroker that owns this manager.
+     */
+    private final MessageBroker broker;
+
+    /**
+     * The Mbean controller for this manager.
+     */
+    private FlexClientManagerControl controller;
+
+    /**
+     * Table to store FlexClients by id.
+     */
+    private final Map<String,FlexClient> flexClients = new ConcurrentHashMap<String,FlexClient>();
+
+
+    /**
+     * Manages time outs for FlexClients.
+     * This currently includes timeout of FlexClient instances, timeouts for async
+     * long-poll handling, and scheduling delayed flushes of outbound messages.
+     */
+    private volatile TimeoutManager flexClientTimeoutManager;
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  clientIds
+    //----------------------------------
+
+    /**
+     * Returns a string array of the client IDs.
+     *
+     * @return A string array of the client IDs.
+     */
+    public String[] getClientIds()
+    {
+        String[] ids = new String[flexClients.size()];
+        ArrayList<String> idList = new ArrayList<String>(flexClients.keySet());
+
+        for (int i = 0; i < flexClients.size(); i++)
+            ids[i] = idList.get(i);
+
+        return ids;
+    }
+
+    //----------------------------------
+    //  flexClientCount
+    //----------------------------------
+
+    /**
+     * Returns the number of FlexClients in use.
+     *
+     * @return The number of FlexClients in use.
+     */
+    public int getFlexClientCount()
+    {
+        return flexClients.size();
+    }
+
+    //----------------------------------
+    //  flexClientTimeoutMillis
+    //----------------------------------
+
+    private volatile long flexClientTimeoutMillis;
+
+    /**
+     * Returns the idle timeout in milliseconds to apply to new FlexClient instances.
+     *
+     * @return The idle timeout in milliseconds to apply to new FlexClient instances.
+     */
+    public long getFlexClientTimeoutMillis()
+    {
+        return flexClientTimeoutMillis;
+    }
+
+    /**
+     * Sets the idle timeout in milliseconds to apply to new FlexClient instances.
+     *
+     * @param value The idle timeout in milliseconds to apply to new FlexClient instances.
+     */
+    public void setFlexClientTimeoutMillis(long value)
+    {
+        if (value < 1)
+            value = 0;
+
+        synchronized (this)
+        {
+            flexClientTimeoutMillis = value;
+        }
+    }
+
+    //----------------------------------
+    //  messageBroker
+    //----------------------------------
+
+    /**
+     * Returns the MessageBroker instance that owns this FlexClientManager.
+     *
+     * @return The parent MessageBroker instance.
+     */
+    public MessageBroker getMessageBroker()
+    {
+        return broker;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Get FlexClient with the specified id or a new one will be created.
+     * This method will return a valid existing FlexClient for the specific Id, 
+     * or a new FlexClient will created  
+     * @param id The id of the Flex client.
+     * @return FlexClient the FlexClient with the specified id
+     */
+    public FlexClient getFlexClient(String id)
+    {
+        return getFlexClient(id, true);
+    }
+    
+    /**
+     * Get the FlexClient with the specified id.
+     *
+     * @param id The id of the Flex client.
+     * @param createNewIfNotExist if true, a new FlexClient will be created if not exist
+     * @return FlexClient the FlexClient with the specified id
+     */
+    public FlexClient getFlexClient(String id, boolean createNewIfNotExist)
+    {
+        FlexClient flexClient = null;
+        // Try to lookup an existing instance if we receive an id.
+        if (id != null)
+        {
+            flexClient = flexClients.get(id);
+            if (flexClient != null)
+            {
+                if (flexClient.isValid() && !flexClient.invalidating)
+                {
+                    flexClient.updateLastUse();
+                    return flexClient;
+                }
+                // Invalid, remove it - it will be replaced below.
+                flexClients.remove(id);
+            }
+        }
+        // Use a manager-level lock (this) when creating/recreating a new FlexClient.
+        synchronized (this)
+        {
+            if (id != null)
+            {
+                flexClient = flexClients.get(id);
+                if (flexClient != null)
+                {
+                    flexClient.updateLastUse();
+                    return flexClient;
+                }
+                else
+                {
+                    if (!createNewIfNotExist)
+                    {
+                        return null;
+                    }
+                }
+            }
+            
+            flexClient = createFlexClient(id);
+            checkForNullAndDuplicateId(flexClient.getId());
+            flexClients.put(flexClient.getId(), flexClient);
+            if (flexClientTimeoutMillis > 0)
+                flexClientTimeoutManager.scheduleTimeout(flexClient);
+            flexClient.notifyCreated();
+            return flexClient;
+        }
+    }
+
+    /**
+     * Creates a FlexClientOutboundQueueProcessor instance and hooks it up to the passed
+     * FlexClient.
+     *
+     * @param flexClient The FlexClient to equip with a queue processor.
+     * @param endpointId The Id of the endpoint the queue processor is used for.
+     * @return The FlexClient with a configured queue processor.
+     */
+    public FlexClientOutboundQueueProcessor createOutboundQueueProcessor(FlexClient flexClient, String endpointId)
+    {
+        // First, try to create a custom outbound queue processor, if one exists.
+        FlexClientOutboundQueueProcessor processor = createCustomOutboundQueueProcessor(flexClient, endpointId);
+
+        // If no custom processor, then try to create default queue processor.
+        if (processor == null)
+            processor = createDefaultOutboundQueueProcessor(flexClient, endpointId);
+
+        // If MessageBroker's default queue processor fails, use the default processor.
+        if (processor == null)
+        {
+            processor = new FlexClientOutboundQueueProcessor();
+            processor.setFlexClient(flexClient);
+            processor.setEndpointId(endpointId);
+        }
+
+        return processor;
+    }
+
+    /**
+     * @exclude
+     * Monitors an async poll for a FlexClient for timeout.
+     *
+     * @param asyncPollTimeout The async poll task to monitor for timeout.
+     */
+    public void monitorAsyncPollTimeout(TimeoutAbstractObject asyncPollTimeout)
+    {
+        flexClientTimeoutManager.scheduleTimeout(asyncPollTimeout);
+    }
+
+    /**
+     * @exclude
+     * Monitors a scheduled flush for a FlexClient for timeout.
+     *
+     * @param scheduledFlushTimeout The schedule flush task to monitor for timeout.
+     */
+    public void monitorScheduledFlush(TimeoutAbstractObject scheduledFlushTimeout)
+    {
+        flexClientTimeoutManager.scheduleTimeout(scheduledFlushTimeout);
+    }
+
+    /**
+     * Starts the Flex client manager.
+     *
+     * @see flex.management.ManageableComponent#start()
+     */
+    @Override
+    public void start()
+    {
+        if (isManaged())
+        {
+            controller = new FlexClientManagerControl(getParent().getControl(), this);
+            setControl(controller);
+            controller.register();
+        }
+
+        final String baseId = getId();
+        flexClientTimeoutManager = new TimeoutManager(new ThreadFactory()
+                                                        {
+                                                            int counter = 1;
+                                                            public synchronized Thread newThread(Runnable runnable)
+                                                            {
+                                                                Thread t = new Thread(runnable);
+                                                                t.setName(baseId + "-FlexClientTimeoutThread-" + counter++);
+                                                                return t;
+                                                            }
+                                                        });
+    }
+
+    /**
+     * @see flex.management.ManageableComponent#stop()
+     */
+    public void stop()
+    {
+        if (controller != null)
+        {
+            controller.unregister();
+        }
+
+        if (flexClientTimeoutManager != null)
+            flexClientTimeoutManager.shutdown();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Protected Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Hook method invoked when a new <tt>FlexClient</tt> instance is created.
+     * 
+     * @param id The id the client provided, which was previously assigned by this server, 
+     *           or another server in a cluster. New clients will pass a <code>null</code>
+     *           value in which case this server must generate a unique id.
+     */
+    protected FlexClient createFlexClient(String id)
+    {
+        return (id == null) ? new FlexClient(this) : new FlexClient(this, id);
+    }
+    
+    /* (non-Javadoc)
+     * @see flex.management.ManageableComponent#getLogCategory()
+     */
+    protected String getLogCategory()
+    {
+        return LogCategories.CLIENT_FLEXCLIENT;
+    }
+
+    /**
+     * @exclude
+     * Removes a FlexClient from being managed by this manager.
+     * This method is invoked by FlexClients when they are invalidated.
+     *
+     * @param flexClient The id of the FlexClient being invalidated.
+     */
+    protected void removeFlexClient(FlexClient flexClient)
+    {
+        if (flexClient != null)
+        {
+            String id = flexClient.getId();
+            synchronized (id)
+            {
+                FlexClient storedClient = flexClients.get(id);
+                // If the stored instance is the same as the invalidating instance based upon identity,
+                // remove it.
+                if (storedClient == flexClient)
+                    flexClients.remove(id);
+            }
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+    private void checkForNullAndDuplicateId(String id)
+    {
+        if (id == null)
+        {
+            // Cannot create ''{0}'' with null id.
+            MessageException me = new MessageException();
+            me.setMessage(10039, new Object[]{"FlexClient"});
+            me.setCode("Server.Processing.NullId");
+            throw me;
+        }
+
+        if (flexClients.containsKey(id))
+        {
+            // Cannot create ''{0}'' with id ''{1}''; another ''{0}'' is already registered with the same id.
+            MessageException me = new MessageException();
+            me.setMessage(10040, new Object[]{"FlexClient", id});
+            me.setCode("Server.Processing.DuplicateId");
+            throw me;
+        }
+    }
+
+    private FlexClientOutboundQueueProcessor createDefaultOutboundQueueProcessor(
+            FlexClient flexClient, String endpointId)
+    {
+        FlexClientSettings flexClientSettings = broker.getFlexClientSettings();
+        if (flexClientSettings == null)
+            return null;
+
+        String queueProcessorClassName = flexClientSettings.getFlexClientOutboundQueueProcessorClassName();
+        if (queueProcessorClassName == null)
+            return null;
+
+        FlexClientOutboundQueueProcessor processor = null;
+        try
+        {
+            Class queueProcessorClass = createClass(queueProcessorClassName);
+            Object instance = ClassUtil.createDefaultInstance(queueProcessorClass, null);
+            processor = (FlexClientOutboundQueueProcessor)instance;
+            processor.setFlexClient(flexClient);
+            processor.setEndpointId(endpointId);
+            processor.initialize(flexClientSettings.getFlexClientOutboundQueueProcessorProperties());
+        }
+        catch (Throwable t)
+        {
+            String message = "Failed to create MessageBroker's outbound queue processor for FlexClient with id '" + flexClient.getId() + "'.";
+            if (Log.isWarn())
+                Log.getLogger(FlexClient.FLEX_CLIENT_LOG_CATEGORY).warn(message, t);
+
+            MessageException me = new MessageException(message, t);
+            throw me;
+        }
+
+        return processor;
+    }
+
+    private FlexClientOutboundQueueProcessor createCustomOutboundQueueProcessor(
+            FlexClient flexClient, String endpointId)
+    {
+        FlexClientOutboundQueueProcessor processor = null;
+        Endpoint endpoint = broker.getEndpoint(endpointId);
+        if (endpoint instanceof AbstractEndpoint)
+        {
+            Class processorClass = ((AbstractEndpoint)endpoint).getFlexClientOutboundQueueProcessorClass();
+            if (processorClass != null)
+            {
+                try
+                {
+                    Object instance = ClassUtil.createDefaultInstance(processorClass, null);
+                    if (instance instanceof FlexClientOutboundQueueProcessor)
+                    {
+                        processor = (FlexClientOutboundQueueProcessor)instance;
+                        processor.setFlexClient(flexClient);
+                        processor.setEndpointId(endpointId);
+                        processor.initialize(((AbstractEndpoint)endpoint).getFlexClientOutboundQueueProcessorConfig());
+                    }
+                }
+                catch (Throwable t)
+                {
+                    if (Log.isWarn())
+                        Log.getLogger(FlexClient.FLEX_CLIENT_LOG_CATEGORY).warn("Failed to create custom outbound queue processor for FlexClient with id '" + flexClient.getId() + "'. Using MessageBroker's default queue processor.", t);
+                }
+            }
+        }
+        return processor;
+    }
+
+    private Class createClass(String className)
+    {
+        Class c = ClassUtil.createClass(className, FlexContext.getMessageBroker() == null ? null :
+                    FlexContext.getMessageBroker().getClassLoader());
+
+        return c;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/FlexClientNotSubscribedException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/FlexClientNotSubscribedException.java b/modules/core/src/flex/messaging/client/FlexClientNotSubscribedException.java
new file mode 100755
index 0000000..629405d
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/FlexClientNotSubscribedException.java
@@ -0,0 +1,73 @@
+/*
+ * 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.messaging.client;
+
+import flex.messaging.MessageException;
+import flex.messaging.log.LogEvent;
+
+/**
+ * @exclude
+ */
+public class FlexClientNotSubscribedException extends MessageException
+{
+    /**
+     * @exclude
+     */
+    private static final long serialVersionUID = 773524927178340950L;
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------        
+    
+    //----------------------------------
+    //  defaultLogMessageIntro
+    //----------------------------------            
+
+    /**
+     * Overrides the intro text for the log message. 
+     */
+    public String getDefaultLogMessageIntro()
+    {
+        return "FlexClient not subscribed: ";        
+    }
+    
+    //----------------------------------
+    //  logStackTraceEnabled
+    //----------------------------------            
+    
+    /**
+     * Override to disable stack trace logging.
+     */
+    public boolean isLogStackTraceEnabled()
+    {
+        return false;        
+    }    
+    
+    //----------------------------------
+    //  peferredLogLevel
+    //----------------------------------            
+    
+    /**
+     * Override to lower the preferred log level to debug. 
+     */
+    public short getPreferredLogLevel()
+    {
+        return LogEvent.DEBUG;        
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/FlexClientOutboundQueueProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/FlexClientOutboundQueueProcessor.java b/modules/core/src/flex/messaging/client/FlexClientOutboundQueueProcessor.java
new file mode 100755
index 0000000..059c3ef
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/FlexClientOutboundQueueProcessor.java
@@ -0,0 +1,347 @@
+/*
+ * 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.messaging.client;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import flex.messaging.Destination;
+import flex.messaging.MessageClient;
+import flex.messaging.MessageDestination;
+import flex.messaging.config.ConfigMap;
+import flex.messaging.messages.Message;
+import flex.messaging.services.messaging.ThrottleManager;
+import flex.messaging.services.messaging.ThrottleManager.ThrottleResult;
+import flex.messaging.services.messaging.ThrottleManager.ThrottleResult.Result;
+
+/**
+ * The base FlexClientOutboundQueueProcessor implementation used if a custom implementation is not
+ * specified. Its behavior is very simple. It adds all new messages in order to the tail
+ * of the outbound queue and flushes all queued messages to the network as quickly as possible.
+ * It also handles the outbound client-level throttling specified at the destination level.
+ *
+ * @author shodgson
+ */
+public class FlexClientOutboundQueueProcessor
+{
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * The associated FlexClient.
+     */
+    private FlexClient client;
+
+    /**
+     * The last MessageClient messages were flushed to. This is mainly for faster
+     * lookup.
+     */
+    private MessageClient lastMessageClient;
+
+    /**
+     * The associated endpoint's Id.
+     */
+    private String endpointId;
+
+    /**
+     * Manages throttling of outbound client level messages.
+     */
+    protected OutboundQueueThrottleManager outboundQueueThrottleManager;
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @exclude
+     * Stores the Id for the outbound queue's endpoint.
+     *
+     * @param value The Id for the outbound queue's endpoint.
+     */
+    public void setEndpointId(String value)
+    {
+        endpointId = value;
+    }
+
+    /**
+     * Returns the Id for the outbound queue's endpoint.
+     *
+     * @return The Id for the outbound queue's endpoint.
+     */
+    public String getEndpointId()
+    {
+        return endpointId;
+    }
+
+    /**
+     * @exclude
+     * Sets the associated FlexClient.
+     *
+     * @param value The associated FlexClient.
+     */
+    public void setFlexClient(FlexClient value)
+    {
+        client = value;
+    }
+
+    /**
+     * Returns the associated FlexClient.
+     *
+     * @return The associated FlexClient.
+     */
+    public FlexClient getFlexClient()
+    {
+        return client;
+    }
+
+    /**
+     * Returns the outbound queue throttle manager, or null if one does not exist.
+     *
+     * @return The outbound queue throttle manager.
+     */
+    public OutboundQueueThrottleManager getOutboundQueueThrottleManager()
+    {
+       return outboundQueueThrottleManager;
+    }
+
+    /**
+     * Utility method to initialize (if necessary) and return an outbound queue
+     * throttle manager.
+     *
+     * @return The outbound queue throttle manager.
+     */
+    public OutboundQueueThrottleManager getOrCreateOutboundQueueThrottleManager()
+    {
+        if (outboundQueueThrottleManager == null)
+            outboundQueueThrottleManager = new OutboundQueueThrottleManager(this);
+        return outboundQueueThrottleManager;
+    }
+
+    /**
+     * No-op; this default implementation doesn't require custom initialization.
+     * Subclasses may override to process any custom initialization properties that have been
+     * defined in the server configuration.
+     *
+     * @param properties A ConfigMap containing any custom initialization properties.
+     */
+    public void initialize(ConfigMap properties) {}
+
+    /**
+     * Always adds a new message to the tail of the queue.
+     *
+     * @param outboundQueue The queue of outbound messages.
+     * @param message The new message to add to the queue.
+     */
+    public void add(List<Message> outboundQueue, Message message)
+    {
+        outboundQueue.add(message);
+    }
+
+    /**
+     * Always empties the queue and returns all messages to be sent to the client.
+     *
+     * @param outboundQueue The queue of outbound messages.
+     * @return A FlushResult containing the messages that have been removed from the outbound queue
+     *         to be written to the network and a wait time for the next flush of the outbound queue
+     *         that is the default for the underlying Channel/Endpoint.
+     */
+    public FlushResult flush(List<Message> outboundQueue)
+    {
+        return flush(null /* no client distinction */, outboundQueue);
+    }
+
+    /**
+     * Removes all messages in the queue targeted to this specific MessageClient subscription(s) and
+     * returns them to be sent to the client.
+     * Overrides should be careful to only return messages for the specified MessageClient.
+     *
+     * @param messageClient The specific MessageClient to return messages for.
+     * @param outboundQueue The queue of outbound messages.
+     * @return A FlushResult containing the messages that have been removed from the outbound queue
+     *         to be written to the network for this MessageClient.
+     */
+    public FlushResult flush(MessageClient messageClient, List<Message> outboundQueue)
+    {
+        FlushResult flushResult = new FlushResult();
+        List<Message> messagesToFlush = null;
+
+        for (Iterator<Message> iter = outboundQueue.iterator(); iter.hasNext();)
+        {
+            Message message = iter.next();
+            if (messageClient == null || (message.getClientId().equals(messageClient.getClientId())))
+            {
+                if (isMessageExpired(message)) // Don't flush expired messages.
+                {
+                    iter.remove();
+                    continue;
+                }
+
+                messageClient = messageClient == null? getMessageClient(message) : messageClient;
+
+                // First, apply the destination level outbound throttling.
+                ThrottleResult throttleResult = throttleOutgoingDestinationLevel(messageClient, message, false);
+                Result result = throttleResult.getResult();
+
+                // No destination level throttling; check destination-client level throttling.
+                if (Result.OK == result)
+                {
+                    throttleResult = throttleOutgoingClientLevel(messageClient, message, false);
+                    result = throttleResult.getResult();
+                    // If no throttling, simply add the message to the list.
+                    if (Result.OK == result)
+                    {
+                        updateMessageFrequencyOutgoing(messageClient, message);
+                        if (messagesToFlush == null)
+                            messagesToFlush = new ArrayList<Message>();
+                        messagesToFlush.add(message);
+                    }
+                    // In rest of the policies (which is NONE), simply don't
+                    // add the message to the list.
+                }
+                iter.remove();
+            }
+        }
+
+        flushResult.setMessages(messagesToFlush);
+        return flushResult;
+    }
+
+    /**
+     * Utility method to test whether a message has expired or not.
+     * Messages with a timeToLive value that is shorter than the timespan from the message's
+     * timestamp up to the current system time will cause this method to return true.
+     * If there are expired messages in the outbound queue, flush implementations
+     * should use this helper method to only process and return messages that have
+     * not yet expired.
+     *
+     * @param message The message to test for expiration.
+     *
+     * @return true if the message has a timeToLive value that has expired; otherwise false.
+     */
+    public boolean isMessageExpired(Message message)
+    {
+        return (message.getTimeToLive() > 0 && (System.currentTimeMillis() - message.getTimestamp()) >= message.getTimeToLive());
+    }
+
+    /**
+     * Attempts to throttle the outgoing message at the destination level.
+     *
+     * @param msgClient The client the message is intended for.
+     * @param message The message to consider to throttle.
+     * @param buffered Whether the message has already been buffered. In that case,
+     * parts of regular throttling code is skipped.
+     * @return The result of throttling attempt.
+     */
+    protected ThrottleResult throttleOutgoingDestinationLevel(MessageClient msgClient, Message message, boolean buffered)
+    {
+        ThrottleManager throttleManager = getThrottleManager(msgClient);
+        if (throttleManager != null)
+        {
+            // In already buffered messages, don't use ThrottleManager#throttleOutgoingMessage
+            // to avoid regular throttling handling as the message has already been buffered.
+            if (buffered)
+                return throttleManager.throttleDestinationLevel(message, false /*incoming*/);
+
+            // Otherwise, regular throttling.
+            return throttleManager.throttleOutgoingMessage(message);
+        }
+        return new ThrottleResult(); // Otherwise, return OK result.
+    }
+
+    /**
+     * Attempts to throttle the outgoing message at the destination-client level.
+     *
+     * @param msgClient The client the message is intended for.
+     * @param message The message to consider to throttle.
+     * @param buffered Whether the message has already been buffered. In that case,
+     * parts of regular throttling code is skipped.
+     * @return The result of throttling attempt.
+     */
+    protected ThrottleResult throttleOutgoingClientLevel(MessageClient msgClient, Message message, boolean buffered)
+    {
+        if (outboundQueueThrottleManager != null) // Means client level throttling enabled.
+        {
+            ThrottleResult throttleResult = outboundQueueThrottleManager.throttleOutgoingClientLevel(message);
+            if (!buffered)
+            {
+                ThrottleManager throttleManager = getThrottleManager(msgClient);
+                if (throttleManager != null)
+                    throttleManager.handleOutgoingThrottleResult(message, throttleResult, true /*isClientLevel*/);
+            }
+            return throttleResult;
+        }
+        return new ThrottleResult(); // Otherwise, return OK result.
+    }
+
+    /**
+     * Returns the message client that the message is intended to.
+     *
+     * @param message The message.
+     * @return The message client that the message is intended to.
+     */
+    protected MessageClient getMessageClient(Message message)
+    {
+        // First try using the cached message client.
+        if (lastMessageClient != null && message.getClientId().equals(lastMessageClient.getClientId()))
+        {
+            return lastMessageClient;
+        }
+        else // Go ahead with the lookup.
+        {
+            lastMessageClient = client.getMessageClient((String)message.getClientId());
+            return lastMessageClient;
+        } 
+    }
+
+    /**
+     * Returns the throttle manager associated with the destination the message
+     * is intended to.
+     *
+     * @param msgClient The message client; it can be null.
+     * @return The throttle manager.
+     */
+    protected ThrottleManager getThrottleManager(MessageClient msgClient)
+    {
+        Destination destination = msgClient != null? msgClient.getDestination() : null;
+        return (destination != null && destination instanceof MessageDestination)? 
+                ((MessageDestination)destination).getThrottleManager() : null;
+    }
+
+    /**
+     * Updates the outgoing message's message frequency.
+     *
+     * @param msgClient The MessageClient that might have been passed to the flush; it can be null.
+     * @param message The message.
+     */
+    protected void updateMessageFrequencyOutgoing(MessageClient msgClient, Message message)
+    {
+        // Update the destination level message frequency.
+        ThrottleManager throttleManager = getThrottleManager(msgClient);
+        if (throttleManager != null)
+            throttleManager.updateMessageFrequencyDestinationLevel(false /*incoming*/);
+
+        // Update the client level message frequency.
+        if (outboundQueueThrottleManager != null)
+            outboundQueueThrottleManager.updateMessageFrequencyOutgoingClientLevel(message);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/FlushResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/FlushResult.java b/modules/core/src/flex/messaging/client/FlushResult.java
new file mode 100755
index 0000000..6dd8cad
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/FlushResult.java
@@ -0,0 +1,117 @@
+/*
+ * 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.messaging.client;
+
+import java.util.List;
+
+import flex.messaging.messages.Message;
+
+/**
+ * Stores the messages that should be written to the network as a result of a flush
+ * invocation on a FlexClient's outbound queue.
+ */
+public class FlushResult
+{
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Constructs a <tt>FlushResult</tt> instance to return from a
+     * flush invocation on a FlexClient's outbound queue.
+     * This instance stores the list of messages to write over the network to
+     * the client as well as an optional wait time in milliseconds for when the
+     * next flush should be invoked.
+     */
+    public FlushResult() {}
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  messages
+    //----------------------------------
+
+    private List<Message> messages;
+
+    /**
+     * Returns the messages to write to the network for this flush invocation.
+     * This list may be null, in which case no messages are written.
+     *
+     * @return The messages to write to the network for this flush invocation.
+     */
+    public List<Message> getMessages()
+    {
+        return messages;
+    }
+
+    /**
+     * Sets the messages to write to the network for this flush invocation.
+     *
+     * @param value The messages to write to the network for this flush invocation.
+     */
+    public void setMessages(List<Message> value)
+    {
+        messages = value;
+    }
+
+    //----------------------------------
+    //  nextFlushWaitTimeMillis
+    //----------------------------------
+
+    private int nextFlushWaitTimeMillis = 0;
+
+    /**
+     * Returns the wait time in milliseconds for when the next flush invocation should occur.
+     * If this value is 0, the default, a delayed flush is not scheduled and the next flush will
+     * depend upon the underlying Channel/Endpoint.
+     * For client-side polling Channels the next flush invocation will happen when the client sends
+     * its next poll request at its regular interval.
+     * For client-side Channels that support direct writes to the client a flush invocation is triggered
+     * when the next message is added to the outbound queue.
+     *
+     * @return The wait time in milliseconds before flush is next invoked. A value of 0, the default,
+     *         indicates that the default flush behavior for the underlying Channel/Endpoint should be
+     *         used.
+     */
+    public int getNextFlushWaitTimeMillis()
+    {
+        return nextFlushWaitTimeMillis;
+    }
+
+    /**
+     * Sets the wait time in milliseconds for when the next flush invocation should occur.
+     * If this value is 0, the default, a delayed flush is not scheduled and the next flush will
+     * depend upon the underlying Channel/Endpoint.
+     * For client-side polling Channels the next flush invocation will happen when the client sends
+     * its next poll request at its regular interval.
+     * For client-side Channels that support direct writes to the client a flush invocation is triggered
+     * when the next message is added to the outbound queue.
+     * Negative value assignments are treated as 0.
+     *
+     * @param value The wait time in milliseconds before flush will be invoked.
+     */
+    public void setNextFlushWaitTimeMillis(int value)
+    {
+        nextFlushWaitTimeMillis = (value < 1) ? 0 : value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/OutboundQueueThrottleManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/OutboundQueueThrottleManager.java b/modules/core/src/flex/messaging/client/OutboundQueueThrottleManager.java
new file mode 100755
index 0000000..e81a249
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/OutboundQueueThrottleManager.java
@@ -0,0 +1,269 @@
+/*
+ * 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.messaging.client;
+
+import java.util.concurrent.ConcurrentHashMap;
+
+import flex.messaging.MessageClient.SubscriptionInfo;
+import flex.messaging.config.ThrottleSettings.Policy;
+import flex.messaging.log.Log;
+import flex.messaging.messages.Message;
+import flex.messaging.services.messaging.MessageFrequency;
+import flex.messaging.services.messaging.ThrottleManager;
+import flex.messaging.services.messaging.ThrottleManager.ThrottleResult;
+import flex.messaging.util.StringUtils;
+
+
+/**
+ * Used to keep track of and limit outbound message rates of a single FlexClient queue.
+ * An outbound FlexClient queue can contain messages from multiple MessageClients
+ * across multiple destinations. It can also contain messages for multiple
+ * subscriptions (for each subtopic/selector) across the same destination for
+ * the same MessageClient.
+ */
+public class OutboundQueueThrottleManager
+{
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Constructs a default outbound queue throttle manager.
+     *
+     * @param processor The outbound queue processor that is using this throttle manager.
+     */
+    public OutboundQueueThrottleManager(FlexClientOutboundQueueProcessor processor)
+    {
+        destinationFrequencies = new ConcurrentHashMap<String, DestinationFrequency>();
+        this.processor = processor;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Map of destination id and destination message frequencies.
+     */
+    protected final ConcurrentHashMap<String, DestinationFrequency> destinationFrequencies;
+
+    /**
+     * The parent queue processor of the throttle manager.
+     */
+    protected final FlexClientOutboundQueueProcessor processor;
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Registers the destination with the outbound throttle manager.
+     *
+     * @param destinationId The id of the destination.
+     * @param outboundMaxClientFrequency The outbound max-client-frequency specified
+     * at the destination.
+     * @param outboundPolicy The outbound throttle policy specified at the destination.
+     */
+    public void registerDestination(String destinationId, int outboundMaxClientFrequency, Policy outboundPolicy)
+    {
+        DestinationFrequency frequency = destinationFrequencies.get(destinationId);
+        if (frequency == null)
+        {
+            frequency = new DestinationFrequency(outboundMaxClientFrequency, outboundPolicy);
+            destinationFrequencies.putIfAbsent(destinationId, frequency);
+        }
+    }
+
+    /**
+     * Registers the subscription of a client talking to a destination with the
+     * specified subscription info.
+     *
+     * @param destinationId The destination id.
+     * @param si The subscription information.
+     */
+    public void registerSubscription(String destinationId, SubscriptionInfo si)
+    {
+        DestinationFrequency frequency = destinationFrequencies.get(destinationId);
+        frequency.logMaxFrequencyDuringRegistration(frequency.outboundMaxClientFrequency, si);
+    }
+
+    /**
+     * Unregisters the subscription.
+     *
+     * @param destinationId The destination id.
+     * @param si The subscription information.
+     */
+    public void unregisterSubscription(String destinationId, SubscriptionInfo si)
+    {
+        unregisterDestination(destinationId);
+    }
+
+    /**
+     * Unregisters all subscriptions of the client under the specified destination.
+     *
+     * @param destinationId The destination id.
+     */
+    public void unregisterAllSubscriptions(String destinationId)
+    {
+        unregisterDestination(destinationId);
+    }
+
+    /**
+     * Attempts to throttle the outgoing message.
+     *
+     * @param message The message to consider to throttle.
+     * @return True if the message was throttled; otherwise false.
+     */
+    public ThrottleResult throttleOutgoingClientLevel(Message message)
+    {
+        String destinationId = message.getDestination();
+        if (isDestinationRegistered(destinationId))
+        {
+            DestinationFrequency frequency = destinationFrequencies.get(message.getDestination());
+            int maxFrequency = frequency.getMaxFrequency(message); // Limit to check against.
+            MessageFrequency messageFrequency = frequency.getMessageFrequency(message); // Message rate of the client.
+            if (messageFrequency != null)
+            {
+                ThrottleResult result = messageFrequency.checkLimit(maxFrequency, frequency.outboundPolicy);
+                return result;
+            }
+        }
+        return new ThrottleResult(); // Otherwise, return OK result.
+    }
+
+    /**
+     * Updates the outgoing client level message frequency of the message.
+     *
+     * @param message The message.
+     */
+    public void updateMessageFrequencyOutgoingClientLevel(Message message)
+    {
+        String destinationId = message.getDestination();
+        if (isDestinationRegistered(destinationId))
+        {
+            DestinationFrequency frequency = destinationFrequencies.get(message.getDestination());
+            MessageFrequency messageFrequency = frequency.getMessageFrequency(message);
+            if (messageFrequency != null)
+                messageFrequency.updateMessageFrequency();
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Protected Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Determines whether the destination has been registered or not.
+     *
+     * @param destinationId The destination id.
+     * @return True if the destination with the specified id has been registered.
+     */
+    protected boolean isDestinationRegistered(String destinationId)
+    {
+        return destinationFrequencies.containsKey(destinationId);
+    }
+
+    /**
+     * Unregisters the destination from the outbound throttle manager.
+     *
+     * @param destinationId The id of the destination.
+     */
+    protected void unregisterDestination(String destinationId)
+    {
+        if (isDestinationRegistered(destinationId))
+            destinationFrequencies.remove(destinationId);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Inner Classes
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Used to keep track of max-client-frequency and outgoing throttle policy
+     * specified at the destination. It also keeps track of outbound message
+     * rates of all MessageClient subscriptions across the destination.
+     */
+    class DestinationFrequency
+    {
+        protected final int outboundMaxClientFrequency; // destination specified client limit.
+        protected final MessageFrequency outboundClientFrequency;
+        protected final Policy outboundPolicy; // destination specified policy.
+
+        /**
+         * Default constructor.
+         *
+         * @param outboundMaxClientFrequency The outbound throttling max-client-frequency of the destination.
+         * @param outboundPolicy The outbound throttling policy of the destination.
+         */
+        DestinationFrequency(int outboundMaxClientFrequency, Policy outboundPolicy)
+        {
+            this.outboundMaxClientFrequency = outboundMaxClientFrequency;
+            this.outboundPolicy = outboundPolicy;
+            outboundClientFrequency = new MessageFrequency(outboundMaxClientFrequency);
+        }
+
+        /**
+         * Returns the max-client-frequency for the subscription the message is
+         * intended for (which is simply the max-client-frequency specified at 
+         * the destination).
+         *
+         * @param message The message.
+         *
+         * @return The max-frequency for the subscription.
+         */
+        int getMaxFrequency(Message message)
+        {
+            return outboundMaxClientFrequency;
+        }
+
+        /**
+         * Given a subscription the message is intended to, returns the message
+         * rate frequency for that subscription.
+         *
+         * @param message The message.
+         * @return The message frequency for the subscription, if it exists; otherwise null.
+         */
+        MessageFrequency getMessageFrequency(Message message)
+        {
+            return outboundClientFrequency;
+        }
+
+        /**
+         * Utility function to log the maxFrequency being used during subscription.
+         *
+         * @param maxFrequency The maxFrequency to log.
+         */
+        void logMaxFrequencyDuringRegistration(int maxFrequency, SubscriptionInfo si)
+        {
+            if (Log.isDebug())
+                Log.getLogger(ThrottleManager.LOG_CATEGORY).debug("Outbound queue throttle manager for FlexClient '"
+                        + processor.getFlexClient().getId() + "' is using '" + maxFrequency
+                        + "' as the throttling limit for its subscription: "
+                        +  StringUtils.NEWLINE + si);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/PollFlushResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/PollFlushResult.java b/modules/core/src/flex/messaging/client/PollFlushResult.java
new file mode 100755
index 0000000..fe4a76d
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/PollFlushResult.java
@@ -0,0 +1,97 @@
+/*
+ * 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.messaging.client;
+
+/**
+ * Extends <tt>FlushResult</tt> and adds additional properties for controlling 
+ * client polling behavior.
+ */
+public class PollFlushResult extends FlushResult
+{
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  avoidBusyPolling
+    //----------------------------------
+
+    private boolean avoidBusyPolling;
+    
+    /**
+     * Indicates whether the handling of this result should attempt to avoid
+     * potential busy-polling cycles.
+     * This will be set to <code>true</code> in the case of two clients that are both
+     * long-polling the server over the same session.
+     * 
+     * @return <code>true</code> if the handling of this result should attempt to avoid potential
+     *         busy-polling cycles.
+     */
+    public boolean isAvoidBusyPolling()
+    {
+        return avoidBusyPolling;
+    }
+    
+    /**
+     * Set to <code>true</code> to signal that handling for this result should attempt to avoid
+     * potential busy-polling cycles.
+     * 
+     * @param value <code>true</code> to signal that handling for this result should attempt to 
+     *        avoid potential busy-polling cycles.
+     */
+    public void setAvoidBusyPolling(boolean value)
+    {
+        avoidBusyPolling = value;
+    }
+    
+    //----------------------------------
+    //  clientProcessingSuppressed
+    //----------------------------------
+
+    private boolean clientProcessingSuppressed;
+    
+    /**
+     * Indicates whether client processing of this result should be
+     * suppressed.
+     * This should be <code>true</code> for results generated for poll requests
+     * that arrive while a long-poll request from the same client is being serviced
+     * to avoid a busy polling cycle.
+     * 
+     * @return <code>true</code> if client processing of this result should be suppressed;
+     *         otherwise <code>false</code>.
+     */
+    public boolean isClientProcessingSuppressed()
+    {
+        return clientProcessingSuppressed;
+    }
+    
+    /**
+     * Set to <code>true</code> to suppress client processing of this result.
+     * Default is <code>false</code>.
+     * This should be set to <code>true</code> for results generated for poll requests
+     * that arrive while a long-poll request from the same client is being serviced
+     * to avoid a busy polling cycle.
+     * 
+     * @param value <code>true</code> to suppress client processing of the result.
+     */
+    public void setClientProcessingSuppressed(boolean value)
+    {
+        clientProcessingSuppressed = value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/PollWaitListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/PollWaitListener.java b/modules/core/src/flex/messaging/client/PollWaitListener.java
new file mode 100755
index 0000000..ae4b820
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/PollWaitListener.java
@@ -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 flex.messaging.client;
+
+/**
+ * Used alongside invocations of <code>FlexClient.pollWithWait()</code> to allow calling code to
+ * maintain a record of the Objects being used to place waited poll requests into a wait
+ * state. This can be used to break the threads out of their wait state separately from the
+ * internal waited poll handling within <code>FlexClient</code>.
+ */
+public interface PollWaitListener
+{
+    /**
+     * Hook method invoked directly before a wait begins.
+     * 
+     * @param notifier The <tt>Object</tt> being used to <code>wait()/notify()</code>.
+     */
+    void waitStart(Object notifier);
+    
+    /**
+     * Hook method invoked directly after a wait completes.
+     * 
+     * @param notifier The <tt>Object</tt> being used to <code>wait()/notify()</code>.
+     */
+    void waitEnd(Object notifier);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/UserAgentSettings.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/UserAgentSettings.java b/modules/core/src/flex/messaging/client/UserAgentSettings.java
new file mode 100755
index 0000000..e04ef88
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/UserAgentSettings.java
@@ -0,0 +1,258 @@
+/*
+ * 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.messaging.client;
+
+/**
+ * A class to hold user agent specific properties. For example, in streaming
+ * endpoints, a certain number of bytes need to be written before the
+ * streaming connection can be used and this value is specific to user agents.
+ * Similarly, the number of simultaneous connections a session can have is user
+ * agent specific.
+ */
+public class UserAgentSettings
+{
+    /**
+     * The prefixes of the version token used by various browsers.
+     */
+    public static final String USER_AGENT_ANDROID = "Android";
+    public static final String USER_AGENT_CHROME = "Chrome";
+    public static final String USER_AGENT_FIREFOX = "Firefox";
+    public static final String USER_AGENT_FIREFOX_1 = "Firefox/1";
+    public static final String USER_AGENT_FIREFOX_2 = "Firefox/2";
+    public static final String USER_AGENT_MSIE = "MSIE";
+    public static final String USER_AGENT_MSIE_5 = "MSIE 5";
+    public static final String USER_AGENT_MSIE_6 = "MSIE 6";
+    public static final String USER_AGENT_MSIE_7 = "MSIE 7";
+    public static final String USER_AGENT_OPERA = "Opera";
+    public static final String USER_AGENT_OPERA_8 = "Opera 8";
+    // Opera 10,11 ship as User Agent Opera/9.8.
+    public static final String USER_AGENT_OPERA_10 = "Opera/9.8"; 
+    public static final String USER_AGENT_SAFARI = "Safari";
+
+    /**
+     * Bytes needed to kickstart the streaming connections for IE.
+     */
+    public static final int KICKSTART_BYTES_MSIE = 2048;
+    /**
+     * Bytes needed to kickstart the streaming connections for SAFARI.
+     */
+    public static final int KICKSTART_BYTES_SAFARI = 512;
+    /**
+     * Bytes needs to kicksart the streaming connections for Android.
+     */
+    public static final int KICKSTART_BYTES_ANDROID = 4010;
+
+    /**
+     * The default number of persistent connections per session for various browsers.
+     */
+    private static final int MAX_PERSISTENT_CONNECTIONS_LEGACY =  1;
+    public static final int MAX_PERSISTENT_CONNECTIONS_DEFAULT = 5;
+    private static final int MAX_PERSISTENT_CONNECTIONS_OPERA_LEGACY = 3;
+    private static final int MAX_PERSISTENT_CONNECTIONS_CHROME = MAX_PERSISTENT_CONNECTIONS_DEFAULT;
+    private static final int MAX_PERSISTENT_CONNECTIONS_FIREFOX = MAX_PERSISTENT_CONNECTIONS_DEFAULT;
+    private static final int MAX_PERSISTENT_CONNECTIONS_MSIE = MAX_PERSISTENT_CONNECTIONS_DEFAULT;
+    private static final int MAX_PERSISTENT_CONNECTIONS_OPERA = 7;
+    private static final int MAX_PERSISTENT_CONNECTIONS_SAFARI = 3;
+
+    private String matchOn;
+    private int kickstartBytes;
+    private int maxPersistentConnectionsPerSession = MAX_PERSISTENT_CONNECTIONS_DEFAULT;
+
+    /**
+     *  Static method to retrieve pre-initialized user agents which are as follows:
+     *
+     *  In Chrome 0, 1, 2, the limit is 6:
+     *      match-on="Chrome" max-persistent-connections-per-session="5"
+     *
+     *  In Firefox 1, 2, the limit is 2:
+     *      match-on="Firefox" max-persistent-connections-per-session="1"
+     *
+     *  In Firefox 3, the limit is 6:
+     *      match-on="Firefox/3" max-persistent-connections-per-session="5"
+     *
+     *  In MSIE 5, 6, 7, the limit is 2 with kickstart bytes of 2K:
+     *      match-on="MSIE" max-persistent-connections-per-session="1" kickstart-bytes="2048"
+     *
+     *  In MSIE 8, the limit is 6 with kickstart bytes of 2K:
+     *      match-on="MSIE 8" max-persistent-connections-per-session="5" kickstart-bytes="2048"
+     *
+     *  In Opera 7, 9, the limit is 4:
+     *      match-on="Opera" max-persistent-connections-per-session="3"
+     *
+     *  In Opera 8, the limit is 8:
+     *      match-on="Opera 8" max-persistent-connections-per-session="7"
+     *
+     *  In Opera 10, the limit is 8.
+     *      match-on="Opera 10" max-persistent-connections-per-session="7"
+     *
+     *  In Safari 3, 4, the limit is 4.
+     *      match-on="Safari" max-persistent-connections-per-session="3"
+     *
+     * @param matchOn String to use match the agent.
+     */
+    public static UserAgentSettings getAgent(String matchOn)
+    {
+        UserAgentSettings userAgent = new UserAgentSettings();
+        userAgent.setMatchOn(matchOn);
+
+        if (USER_AGENT_ANDROID.equals(matchOn))
+        {
+            userAgent.setKickstartBytes(KICKSTART_BYTES_ANDROID);
+            userAgent.setMaxPersistentConnectionsPerSession(MAX_PERSISTENT_CONNECTIONS_SAFARI);
+        }
+        if (USER_AGENT_CHROME.equals(matchOn))
+        {
+            userAgent.setMaxPersistentConnectionsPerSession(MAX_PERSISTENT_CONNECTIONS_CHROME);
+        }
+        else if (USER_AGENT_FIREFOX.equals(matchOn))
+        {
+            userAgent.setMaxPersistentConnectionsPerSession(MAX_PERSISTENT_CONNECTIONS_FIREFOX);
+        }
+        else if (USER_AGENT_FIREFOX_1.equals(matchOn))
+        {
+            userAgent.setMaxPersistentConnectionsPerSession(MAX_PERSISTENT_CONNECTIONS_LEGACY);
+        }
+        else if (USER_AGENT_FIREFOX_2.equals(matchOn))
+        {
+            userAgent.setMaxPersistentConnectionsPerSession(MAX_PERSISTENT_CONNECTIONS_LEGACY);
+        }
+        else if (USER_AGENT_MSIE.equals(matchOn))
+        {
+            userAgent.setKickstartBytes(KICKSTART_BYTES_MSIE);
+            userAgent.setMaxPersistentConnectionsPerSession(MAX_PERSISTENT_CONNECTIONS_MSIE);
+        }
+        else if (USER_AGENT_MSIE_5.equals(matchOn))
+        {
+            userAgent.setKickstartBytes(KICKSTART_BYTES_MSIE);
+            userAgent.setMaxPersistentConnectionsPerSession(MAX_PERSISTENT_CONNECTIONS_LEGACY);
+        }
+        else if (USER_AGENT_MSIE_6.equals(matchOn))
+        {
+            userAgent.setKickstartBytes(KICKSTART_BYTES_MSIE);
+            userAgent.setMaxPersistentConnectionsPerSession(MAX_PERSISTENT_CONNECTIONS_LEGACY);
+        }
+        else if (USER_AGENT_MSIE_7.equals(matchOn))
+        {
+            userAgent.setKickstartBytes(KICKSTART_BYTES_MSIE);
+            userAgent.setMaxPersistentConnectionsPerSession(MAX_PERSISTENT_CONNECTIONS_LEGACY);
+        }
+        else if (USER_AGENT_OPERA.equals(matchOn))
+        {
+            userAgent.setMaxPersistentConnectionsPerSession(MAX_PERSISTENT_CONNECTIONS_OPERA_LEGACY);
+        }
+        else if (USER_AGENT_OPERA_8.equals(matchOn))
+        {
+            userAgent.setMaxPersistentConnectionsPerSession(MAX_PERSISTENT_CONNECTIONS_OPERA);
+        }
+        else if (USER_AGENT_OPERA_10.equals(matchOn))
+        {
+            userAgent.setMaxPersistentConnectionsPerSession(MAX_PERSISTENT_CONNECTIONS_OPERA);
+        }
+        else if (USER_AGENT_SAFARI.equals(matchOn))
+        {
+            userAgent.setKickstartBytes(KICKSTART_BYTES_SAFARI);
+            userAgent.setMaxPersistentConnectionsPerSession(MAX_PERSISTENT_CONNECTIONS_SAFARI);
+        }
+        return userAgent;
+    }
+
+    /**
+     * Returns the String to use to match the agent.
+     *
+     * @return The String to use to match the agent.
+     */
+    public String getMatchOn()
+    {
+        return matchOn;
+    }
+
+    /**
+     * Sets the String to use to match the agent.
+     *
+     * @param matchOn The String to use to match the agent.
+     */
+    public void setMatchOn(String matchOn)
+    {
+        this.matchOn = matchOn;
+    }
+
+    /**
+     * Returns the number of bytes needed to kickstart the streaming connections
+     * for the user agent.
+     *
+     * @return The number of bytes needed to kickstart the streaming connections
+     * for the user agent.
+     */
+    public int getKickstartBytes()
+    {
+        return kickstartBytes;
+    }
+
+    /**
+     * Sets the number of bytes needed to kickstart the streaming connections
+     * for the user agent.
+     *
+     * @param kickstartBytes The number of bytes needed to kickstart the streaming
+     * connections for the user agent.
+     */
+    public void setKickstartBytes(int kickstartBytes)
+    {
+        if (kickstartBytes < 0)
+            kickstartBytes = 0;
+        this.kickstartBytes = kickstartBytes;
+    }
+
+    /**
+     * @deprecated Use {@link UserAgentSettings#getMaxPersistentConnectionsPerSession()} instead.
+     */
+    public int getMaxStreamingConnectionsPerSession()
+    {
+        return getMaxPersistentConnectionsPerSession();
+    }
+
+    /**
+     * @deprecated Use {@link UserAgentSettings#setMaxPersistentConnectionsPerSession(int)} instead.
+     */
+    public void setMaxStreamingConnectionsPerSession(int maxStreamingConnectionsPerSession)
+    {
+        setMaxPersistentConnectionsPerSession(maxStreamingConnectionsPerSession);
+    }
+
+    /**
+     * Returns the number of simultaneous streaming connections per session
+     * the user agent supports.
+     *
+     * @return The number of streaming connections per session the user agent supports.
+     */
+    public int getMaxPersistentConnectionsPerSession()
+    {
+        return maxPersistentConnectionsPerSession;
+    }
+
+    /**
+     * Sets the number of simultaneous streaming connections per session
+     * the user agent supports.
+     *
+     * @param maxStreamingConnectionsPerSession The number of simultaneous
+     * streaming connections per session the user agent supports.
+     */
+    public void setMaxPersistentConnectionsPerSession(int maxStreamingConnectionsPerSession)
+    {
+        this.maxPersistentConnectionsPerSession = maxStreamingConnectionsPerSession;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/package-info.java b/modules/core/src/flex/messaging/client/package-info.java
new file mode 100755
index 0000000..e9a5b98
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/package-info.java
@@ -0,0 +1,18 @@
+/*
+ * 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.messaging.client;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/cluster/BroadcastHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/cluster/BroadcastHandler.java b/modules/core/src/flex/messaging/cluster/BroadcastHandler.java
new file mode 100755
index 0000000..7d6f365
--- /dev/null
+++ b/modules/core/src/flex/messaging/cluster/BroadcastHandler.java
@@ -0,0 +1,45 @@
+/*
+ * 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.messaging.cluster;
+
+import java.util.List;
+
+/**
+ * @exclude
+ * This interface represents a handler for a message broadcast by a Cluster.
+ * Clusters broadcast messages across their physical nodes, and when they
+ * receive those messages they locate a BroadcastHandler capable of handling
+ * the broadcast.
+ */
+public interface BroadcastHandler
+{
+    /**
+     * Handle the broadcast message.
+     *
+     * @param sender sender of the original message
+     * @param params any parameters need to handle the message
+     */
+    void handleBroadcast(Object sender, List<Object> params);
+
+    /**
+     * Determine whether this Handler supports a particular operation by name.
+     *
+     * @return whether or not this handler supports the named operation
+     * @param name name of the operation
+     */
+    boolean isSupportedOperation(String name);
+}


[37/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/history/history.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/history/history.css b/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/history/history.css
new file mode 100755
index 0000000..4a7f791
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/history/history.css
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/history/history.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/history/history.js b/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/history/history.js
new file mode 100755
index 0000000..0f82450
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/history/history.js
@@ -0,0 +1,722 @@
+/*
+ * 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.
+ */
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        ie8: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+        if (browser.version == 8)
+        {
+            browser.ie = false;
+            browser.ie8 = true;
+        }
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    function hashChangeHandler()
+    {
+        currentHref = document.location.href;
+        var flexAppUrl = getHash();
+        //ADR: to fix multiple
+        if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+            var pl = getPlayers();
+            for (var i = 0; i < pl.length; i++) {
+                pl[i].browserURLChange(flexAppUrl);
+            }
+        } else {
+            getPlayer().browserURLChange(flexAppUrl);
+        }
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+        var i;
+
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+                for (i = 0; i < o.length; i++) {
+                    if (typeof o[i].browserURLChange != "undefined")
+                        return o[i];
+                }
+                for (i = 0; i < e.length; i++) {
+                    if (typeof e[i].browserURLChange != "undefined")
+                        return e[i];
+                }
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+            for (i = 0; i < e.length; i++) {
+                if (typeof e[i].browserURLChange != "undefined")
+                {
+                    return e[i];
+                }
+            }
+            for (i = 0; i < o.length; i++) {
+                if (typeof o[i].browserURLChange != "undefined")
+                {
+                    return o[i];
+                }
+            }
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var i;
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+                        currentHref = document.location.href;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                var flexAppUrl = getHash();
+                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
+                {    
+                    // If it did change and we're running Safari 3.x or earlier, 
+                    // then we have to look the old state up in our hand-maintained 
+                    // array since document.location.hash won't have changed, 
+                    // then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                    flexAppUrl = historyHash[currentHistoryLength];
+                }
+
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            iframe.src = 'javascript:false;'; 
+
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox || browser.ie8)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+
+        if (browser.ie8)        
+            document.body.onhashchange = hashChangeHandler;
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        },
+        getUserAgent: function() {
+            return navigator.userAgent;
+        },
+        getPlatform: function() {
+            return navigator.platform;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/history/historyFrame.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/history/historyFrame.html b/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/history/historyFrame.html
new file mode 100755
index 0000000..63bdd3e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/history/historyFrame.html
@@ -0,0 +1,45 @@
+<!--
+  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>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/index.template.html b/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/index.template.html
new file mode 100755
index 0000000..e3e9c81
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/swfobject.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/swfobject.js b/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/swfobject.js
new file mode 100755
index 0000000..07730fa
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/simplepush/html-template/swfobject.js
@@ -0,0 +1,793 @@
+/*
+ * 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.
+ */
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+	
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+		ON_READY_STATE_CHANGE = "onreadystatechange",
+		
+		win = window,
+		doc = document,
+		nav = navigator,
+		
+		plugin = false,
+		domLoadFnArr = [main],
+		regObjArr = [],
+		objIdArr = [],
+		listenersArr = [],
+		storedAltContent,
+		storedAltContentId,
+		storedCallbackFn,
+		storedCallbackObj,
+		isDomLoaded = false,
+		isExpressInstallActive = false,
+		dynamicStylesheet,
+		dynamicStylesheetMedia,
+		autoHideShow = true,
+	
+	/* Centralized function for browser feature detection
+		- User agent string detection is only used when no good alternative is possible
+		- Is executed directly for optimal performance
+	*/	
+	ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+			u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+				plugin = true;
+				ie = false; // cascaded feature detection for Internet Explorer
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			try {
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+				if (a) { // a will return null when ActiveX is disabled
+					d = a.GetVariable("$version");
+					if (d) {
+						ie = true; // cascaded feature detection for Internet Explorer
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+			}
+			catch(e) {}
+		}
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+	}(),
+	
+	/* Cross-browser onDomLoad
+		- Will fire an event as soon as the DOM of a web page is loaded
+		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+		- Regular onload serves as fallback
+	*/ 
+	onDomLoad = function() {
+		if (!ua.w3) { return; }
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+			callDomLoadFunctions();
+		}
+		if (!isDomLoaded) {
+			if (typeof doc.addEventListener != UNDEF) {
+				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+			}		
+			if (ua.ie && ua.win) {
+				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+					if (doc.readyState == "complete") {
+						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+						callDomLoadFunctions();
+					}
+				});
+				if (win == top) { // if not inside an iframe
+					(function(){
+						if (isDomLoaded) { return; }
+						try {
+							doc.documentElement.doScroll("left");
+						}
+						catch(e) {
+							setTimeout(arguments.callee, 0);
+							return;
+						}
+						callDomLoadFunctions();
+					})();
+				}
+			}
+			if (ua.wk) {
+				(function(){
+					if (isDomLoaded) { return; }
+					if (!/loaded|complete/.test(doc.readyState)) {
+						setTimeout(arguments.callee, 0);
+						return;
+					}
+					callDomLoadFunctions();
+				})();
+			}
+			addLoadEvent(callDomLoadFunctions);
+		}
+	}();
+	
+	function callDomLoadFunctions() {
+		if (isDomLoaded) { return; }
+		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+			t.parentNode.removeChild(t);
+		}
+		catch (e) { return; }
+		isDomLoaded = true;
+		var dl = domLoadFnArr.length;
+		for (var i = 0; i < dl; i++) {
+			domLoadFnArr[i]();
+		}
+	}
+	
+	function addDomLoadEvent(fn) {
+		if (isDomLoaded) {
+			fn();
+		}
+		else { 
+			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+		}
+	}
+	
+	/* Cross-browser onload
+		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+		- Will fire an event as soon as a web page including all of its assets are loaded 
+	 */
+	function addLoadEvent(fn) {
+		if (typeof win.addEventListener != UNDEF) {
+			win.addEventListener("load", fn, false);
+		}
+		else if (typeof doc.addEventListener != UNDEF) {
+			doc.addEventListener("load", fn, false);
+		}
+		else if (typeof win.attachEvent != UNDEF) {
+			addListener(win, "onload", fn);
+		}
+		else if (typeof win.onload == "function") {
+			var fnOld = win.onload;
+			win.onload = function() {
+				fnOld();
+				fn();
+			};
+		}
+		else {
+			win.onload = fn;
+		}
+	}
+	
+	/* Main function
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
+	*/
+	function main() { 
+		if (plugin) {
+			testPlayerVersion();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Detect the Flash Player version for non-Internet Explorer browsers
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+		  a. Both release and build numbers can be detected
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+	*/
+	function testPlayerVersion() {
+		var b = doc.getElementsByTagName("body")[0];
+		var o = createElement(OBJECT);
+		o.setAttribute("type", FLASH_MIME_TYPE);
+		var t = b.appendChild(o);
+		if (t) {
+			var counter = 0;
+			(function(){
+				if (typeof t.GetVariable != UNDEF) {
+					var d = t.GetVariable("$version");
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				else if (counter < 10) {
+					counter++;
+					setTimeout(arguments.callee, 10);
+					return;
+				}
+				b.removeChild(o);
+				t = null;
+				matchVersions();
+			})();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Perform Flash Player and SWF version matching; static publishing only
+	*/
+	function matchVersions() {
+		var rl = regObjArr.length;
+		if (rl > 0) {
+			for (var i = 0; i < rl; i++) { // for each registered object element
+				var id = regObjArr[i].id;
+				var cb = regObjArr[i].callbackFn;
+				var cbObj = {success:false, id:id};
+				if (ua.pv[0] > 0) {
+					var obj = getElementById(id);
+					if (obj) {
+						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+							setVisibility(id, true);
+							if (cb) {
+								cbObj.success = true;
+								cbObj.ref = getObjectById(id);
+								cb(cbObj);
+							}
+						}
+						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+							var att = {};
+							att.data = regObjArr[i].expressInstall;
+							att.width = obj.getAttribute("width") || "0";
+							att.height = obj.getAttribute("height") || "0";
+							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+							// parse HTML object param element's name-value pairs
+							var par = {};
+							var p = obj.getElementsByTagName("param");
+							var pl = p.length;
+							for (var j = 0; j < pl; j++) {
+								if (p[j].getAttribute("name").toLowerCase() != "movie") {
+									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+								}
+							}
+							showExpressInstall(att, par, id, cb);
+						}
+						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+							displayAltContent(obj);
+							if (cb) { cb(cbObj); }
+						}
+					}
+				}
+				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+					setVisibility(id, true);
+					if (cb) {
+						var o = getObjectById(id); // test whether there is an HTML object element or not
+						if (o && typeof o.SetVariable != UNDEF) { 
+							cbObj.success = true;
+							cbObj.ref = o;
+						}
+						cb(cbObj);
+					}
+				}
+			}
+		}
+	}
+	
+	function getObjectById(objectIdStr) {
+		var r = null;
+		var o = getElementById(objectIdStr);
+		if (o && o.nodeName == "OBJECT") {
+			if (typeof o.SetVariable != UNDEF) {
+				r = o;
+			}
+			else {
+				var n = o.getElementsByTagName(OBJECT)[0];
+				if (n) {
+					r = n;
+				}
+			}
+		}
+		return r;
+	}
+	
+	/* Requirements for Adobe Express Install
+		- only one instance can be active at a time
+		- fp 6.0.65 or higher
+		- Win/Mac OS only
+		- no Webkit engines older than version 312
+	*/
+	function canExpressInstall() {
+		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+	}
+	
+	/* Show the Adobe Express Install dialog
+		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+	*/
+	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+		isExpressInstallActive = true;
+		storedCallbackFn = callbackFn || null;
+		storedCallbackObj = {success:false, id:replaceElemIdStr};
+		var obj = getElementById(replaceElemIdStr);
+		if (obj) {
+			if (obj.nodeName == "OBJECT") { // static publishing
+				storedAltContent = abstractAltContent(obj);
+				storedAltContentId = null;
+			}
+			else { // dynamic publishing
+				storedAltContent = obj;
+				storedAltContentId = replaceElemIdStr;
+			}
+			att.id = EXPRESS_INSTALL_ID;
+			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+				fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+			if (typeof par.flashvars != UNDEF) {
+				par.flashvars += "&" + fv;
+			}
+			else {
+				par.flashvars = fv;
+			}
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			if (ua.ie && ua.win && obj.readyState != 4) {
+				var newObj = createElement("div");
+				replaceElemIdStr += "SWFObjectNew";
+				newObj.setAttribute("id", replaceElemIdStr);
+				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						obj.parentNode.removeChild(obj);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			createSWF(att, par, replaceElemIdStr);
+		}
+	}
+	
+	/* Functions to abstract and display alternative content
+	*/
+	function displayAltContent(obj) {
+		if (ua.ie && ua.win && obj.readyState != 4) {
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			var el = createElement("div");
+			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+			el.parentNode.replaceChild(abstractAltContent(obj), el);
+			obj.style.display = "none";
+			(function(){
+				if (obj.readyState == 4) {
+					obj.parentNode.removeChild(obj);
+				}
+				else {
+					setTimeout(arguments.callee, 10);
+				}
+			})();
+		}
+		else {
+			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+		}
+	} 
+
+	function abstractAltContent(obj) {
+		var ac = createElement("div");
+		if (ua.win && ua.ie) {
+			ac.innerHTML = obj.innerHTML;
+		}
+		else {
+			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+			if (nestedObj) {
+				var c = nestedObj.childNodes;
+				if (c) {
+					var cl = c.length;
+					for (var i = 0; i < cl; i++) {
+						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+							ac.appendChild(c[i].cloneNode(true));
+						}
+					}
+				}
+			}
+		}
+		return ac;
+	}
+	
+	/* Cross-browser dynamic SWF creation
+	*/
+	function createSWF(attObj, parObj, id) {
+		var r, el = getElementById(id);
+		if (ua.wk && ua.wk < 312) { return r; }
+		if (el) {
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+				attObj.id = id;
+			}
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+				var att = "";
+				for (var i in attObj) {
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+						if (i.toLowerCase() == "data") {
+							parObj.movie = attObj[i];
+						}
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							att += ' class="' + attObj[i] + '"';
+						}
+						else if (i.toLowerCase() != "classid") {
+							att += ' ' + i + '="' + attObj[i] + '"';
+						}
+					}
+				}
+				var par = "";
+				for (var j in parObj) {
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+					}
+				}
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+				r = getElementById(attObj.id);	
+			}
+			else { // well-behaving browsers
+				var o = createElement(OBJECT);
+				o.setAttribute("type", FLASH_MIME_TYPE);
+				for (var m in attObj) {
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							o.setAttribute("class", attObj[m]);
+						}
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+							o.setAttribute(m, attObj[m]);
+						}
+					}
+				}
+				for (var n in parObj) {
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+						createObjParam(o, n, parObj[n]);
+					}
+				}
+				el.parentNode.replaceChild(o, el);
+				r = o;
+			}
+		}
+		return r;
+	}
+	
+	function createObjParam(el, pName, pValue) {
+		var p = createElement("param");
+		p.setAttribute("name", pName);	
+		p.setAttribute("value", pValue);
+		el.appendChild(p);
+	}
+	
+	/* Cross-browser SWF removal
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
+	*/
+	function removeSWF(id) {
+		var obj = getElementById(id);
+		if (obj && obj.nodeName == "OBJECT") {
+			if (ua.ie && ua.win) {
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						removeObjectInIE(id);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			else {
+				obj.parentNode.removeChild(obj);
+			}
+		}
+	}
+	
+	function removeObjectInIE(id) {
+		var obj = getElementById(id);
+		if (obj) {
+			for (var i in obj) {
+				if (typeof obj[i] == "function") {
+					obj[i] = null;
+				}
+			}
+			obj.parentNode.removeChild(obj);
+		}
+	}
+	
+	/* Functions to optimize JavaScript compression
+	*/
+	function getElementById(id) {
+		var el = null;
+		try {
+			el = doc.getElementById(id);
+		}
+		catch (e) {}
+		return el;
+	}
+	
+	function createElement(el) {
+		return doc.createElement(el);
+	}
+	
+	/* Updated attachEvent function for Internet Explorer
+		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+	*/	
+	function addListener(target, eventType, fn) {
+		target.attachEvent(eventType, fn);
+		listenersArr[listenersArr.length] = [target, eventType, fn];
+	}
+	
+	/* Flash Player and SWF content version matching
+	*/
+	function hasPlayerVersion(rv) {
+		var pv = ua.pv, v = rv.split(".");
+		v[0] = parseInt(v[0], 10);
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+		v[2] = parseInt(v[2], 10) || 0;
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+	}
+	
+	/* Cross-browser dynamic CSS creation
+		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+	*/	
+	function createCSS(sel, decl, media, newStyle) {
+		if (ua.ie && ua.mac) { return; }
+		var h = doc.getElementsByTagName("head")[0];
+		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+		var m = (media && typeof media == "string") ? media : "screen";
+		if (newStyle) {
+			dynamicStylesheet = null;
+			dynamicStylesheetMedia = null;
+		}
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+			// create dynamic stylesheet + get a global reference to it
+			var s = createElement("style");
+			s.setAttribute("type", "text/css");
+			s.setAttribute("media", m);
+			dynamicStylesheet = h.appendChild(s);
+			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+			}
+			dynamicStylesheetMedia = m;
+		}
+		// add style rule
+		if (ua.ie && ua.win) {
+			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+				dynamicStylesheet.addRule(sel, decl);
+			}
+		}
+		else {
+			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+			}
+		}
+	}
+	
+	function setVisibility(id, isVisible) {
+		if (!autoHideShow) { return; }
+		var v = isVisible ? "visible" : "hidden";
+		if (isDomLoaded && getElementById(id)) {
+			getElementById(id).style.visibility = v;
+		}
+		else {
+			createCSS("#" + id, "visibility:" + v);
+		}
+	}
+
+	/* Filter to avoid XSS attacks
+	*/
+	function urlEncodeIfNecessary(s) {
+		var regex = /[\\\"<>\.;]/;
+		var hasBadChars = regex.exec(s) != null;
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+	}
+	
+	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+	*/
+	var cleanup = function() {
+		if (ua.ie && ua.win) {
+			window.attachEvent("onunload", function() {
+				// remove listeners to avoid memory leaks
+				var ll = listenersArr.length;
+				for (var i = 0; i < ll; i++) {
+					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+				}
+				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+				var il = objIdArr.length;
+				for (var j = 0; j < il; j++) {
+					removeSWF(objIdArr[j]);
+				}
+				// cleanup library's main closures to avoid memory leaks
+				for (var k in ua) {
+					ua[k] = null;
+				}
+				ua = null;
+				for (var l in swfobject) {
+					swfobject[l] = null;
+				}
+				swfobject = null;
+			});
+		}
+	}();
+	
+	return {
+		/* Public API
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
+		*/ 
+		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+			if (ua.w3 && objectIdStr && swfVersionStr) {
+				var regObj = {};
+				regObj.id = objectIdStr;
+				regObj.swfVersion = swfVersionStr;
+				regObj.expressInstall = xiSwfUrlStr;
+				regObj.callbackFn = callbackFn;
+				regObjArr[regObjArr.length] = regObj;
+				setVisibility(objectIdStr, false);
+			}
+			else if (callbackFn) {
+				callbackFn({success:false, id:objectIdStr});
+			}
+		},
+		
+		getObjectById: function(objectIdStr) {
+			if (ua.w3) {
+				return getObjectById(objectIdStr);
+			}
+		},
+		
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+			var callbackObj = {success:false, id:replaceElemIdStr};
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+				setVisibility(replaceElemIdStr, false);
+				addDomLoadEvent(function() {
+					widthStr += ""; // auto-convert to string
+					heightStr += "";
+					var att = {};
+					if (attObj && typeof attObj === OBJECT) {
+						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+							att[i] = attObj[i];
+						}
+					}
+					att.data = swfUrlStr;
+					att.width = widthStr;
+					att.height = heightStr;
+					var par = {}; 
+					if (parObj && typeof parObj === OBJECT) {
+						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+							par[j] = parObj[j];
+						}
+					}
+					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+							if (typeof par.flashvars != UNDEF) {
+								par.flashvars += "&" + k + "=" + flashvarsObj[k];
+							}
+							else {
+								par.flashvars = k + "=" + flashvarsObj[k];
+							}
+						}
+					}
+					if (hasPlayerVersion(swfVersionStr)) { // create SWF
+						var obj = createSWF(att, par, replaceElemIdStr);
+						if (att.id == replaceElemIdStr) {
+							setVisibility(replaceElemIdStr, true);
+						}
+						callbackObj.success = true;
+						callbackObj.ref = obj;
+					}
+					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+						att.data = xiSwfUrlStr;
+						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+						return;
+					}
+					else { // show alternative content
+						setVisibility(replaceElemIdStr, true);
+					}
+					if (callbackFn) { callbackFn(callbackObj); }
+				});
+			}
+			else if (callbackFn) { callbackFn(callbackObj);	}
+		},
+		
+		switchOffAutoHideShow: function() {
+			autoHideShow = false;
+		},
+		
+		ua: ua,
+		
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		},
+		
+		hasFlashPlayerVersion: hasPlayerVersion,
+		
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
+			if (ua.w3) {
+				return createSWF(attObj, parObj, replaceElemIdStr);
+			}
+			else {
+				return undefined;
+			}
+		},
+		
+		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+			if (ua.w3 && canExpressInstall()) {
+				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+			}
+		},
+		
+		removeSWF: function(objElemIdStr) {
+			if (ua.w3) {
+				removeSWF(objElemIdStr);
+			}
+		},
+		
+		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+			if (ua.w3) {
+				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+			}
+		},
+		
+		addDomLoadEvent: addDomLoadEvent,
+		
+		addLoadEvent: addLoadEvent,
+		
+		getQueryParamValue: function(param) {
+			var q = doc.location.search || doc.location.hash;
+			if (q) {
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+				if (param == null) {
+					return urlEncodeIfNecessary(q);
+				}
+				var pairs = q.split("&");
+				for (var i = 0; i < pairs.length; i++) {
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+					}
+				}
+			}
+			return "";
+		},
+		
+		// For internal usage only
+		expressInstallCallback: function() {
+			if (isExpressInstallActive) {
+				var obj = getElementById(EXPRESS_INSTALL_ID);
+				if (obj && storedAltContent) {
+					obj.parentNode.replaceChild(storedAltContent, obj);
+					if (storedAltContentId) {
+						setVisibility(storedAltContentId, true);
+						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+					}
+					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+				}
+				isExpressInstallActive = false;
+			} 
+		}
+	};
+}();

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/simplepush/src/simplepush.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/simplepush/src/simplepush.mxml b/apps/samples-spring/WEB-INF/flex-src/simplepush/src/simplepush.mxml
new file mode 100755
index 0000000..612c623
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/simplepush/src/simplepush.mxml
@@ -0,0 +1,53 @@
+<?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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx">
+
+	<fx:Script>
+		<![CDATA[
+			
+			import mx.messaging.messages.IMessage;
+			
+			private function messageHandler(message:IMessage):void
+			{
+				pushedValue.text = ""+ message.body;	
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<mx:ChannelSet id="cs">
+			<mx:StreamingAMFChannel uri="/samples-spring/messagebroker/streamingamf"/>
+			<mx:AMFChannel uri="/samples-spring/messagebroker/amflongpolling"/>
+			<mx:AMFChannel uri="/samples-spring/messagebroker/amfpolling"/>
+		</mx:ChannelSet>
+		
+		<mx:Consumer id="consumer" destination="simple-feed" channelSet="{cs}" 
+					 message="messageHandler(event.message)"/>
+	</fx:Declarations>
+
+	<s:TextInput id="pushedValue" width="250" verticalCenter="0" horizontalCenter="0"/>
+	
+	<s:Button label="Subscribe" click="consumer.subscribe()" enabled="{!consumer.subscribed}" verticalCenter="30" horizontalCenter="-50"/>
+	<s:Button label="Unsubscribe" click="consumer.unsubscribe()" enabled="{consumer.subscribed}" verticalCenter="30" horizontalCenter="50"/>
+
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/.actionScriptProperties b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/.actionScriptProperties
new file mode 100755
index 0000000..58c6481
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="Main.mxml" projectUUID="f21aa2f0-00b4-41cf-8fec-e942e9473bf9" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="Main.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/.flexProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/.flexProperties b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/.flexProperties
new file mode 100755
index 0000000..1d99468
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/.flexProperties
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/.project b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/.project
new file mode 100755
index 0000000..4372b24
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/.project
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>spring-blazeds-101</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/build.xml b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/build.xml
new file mode 100755
index 0000000..bbcbc16
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/build.xml
@@ -0,0 +1,76 @@
+<?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-spring.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="context.root" value="samples-spring" />
+    <property name="application.name" value="spring-blazeds-101" />
+    <property name="application.file" value="Main" />
+    <property name="application.bin.dir" value="${samples-spring.war}/spring-blazeds-101" />
+    <property name="application.src.dir" value="${samples-spring.war}/WEB-INF/flex-src/spring-blazeds-101/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-spring.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"
+            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-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/history/history.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/history/history.css b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/history/history.css
new file mode 100755
index 0000000..4a7f791
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/history/history.css
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }


[22/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/collateral/blazeds-src-readme.htm
----------------------------------------------------------------------
diff --git a/collateral/blazeds-src-readme.htm b/collateral/blazeds-src-readme.htm
new file mode 100755
index 0000000..5b25237
--- /dev/null
+++ b/collateral/blazeds-src-readme.htm
@@ -0,0 +1,558 @@
+<!--
+  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>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<title>BlazeDS Source Readme</title>
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+	{font-family:"Cambria Math";
+	panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+	{font-family:Verdana;
+	panose-1:2 11 6 4 3 5 4 4 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+	{margin:0in;
+	margin-bottom:.0001pt;
+	font-size:12.0pt;
+	font-family:"Times New Roman","serif";
+	color:windowtext;}
+h3
+	{mso-style-link:"Heading 3 Char";
+	margin-right:0in;
+	margin-left:0in;
+	font-size:13.5pt;
+	font-family:"Times New Roman","serif";
+	color:black;
+	font-weight:bold;}
+a:link, span.MsoHyperlink
+	{color:blue;
+	text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+	{color:purple;
+	text-decoration:underline;}
+p
+	{margin-right:2.6pt;
+	margin-left:2.6pt;
+	font-size:12.0pt;
+	font-family:"Verdana","sans-serif";
+	color:black;}
+pre
+	{mso-style-link:"HTML Preformatted Char";
+	margin:0in;
+	margin-bottom:.0001pt;
+	font-size:10.0pt;
+	font-family:"Courier New";
+	color:windowtext;}
+span.Heading3Char
+	{mso-style-name:"Heading 3 Char";
+	mso-style-link:"Heading 3";
+	font-family:"Cambria","serif";
+	color:#4F81BD;
+	font-weight:bold;}
+span.HTMLPreformattedChar
+	{mso-style-name:"HTML Preformatted Char";
+	mso-style-link:"HTML Preformatted";
+	font-family:"Courier New";}
+.MsoChpDefault
+	{font-size:10.0pt;}
+@page Section1
+	{size:8.5in 11.0in;
+	margin:1.0in 1.25in 1.0in 1.25in;}
+div.Section1
+	{page:Section1;}
+ /* List Definitions */
+ ol
+	{margin-bottom:0in;}
+ul
+	{margin-bottom:0in;}
+-->
+</style>
+
+</head>
+
+<body lang=EN-US link=blue vlink=purple>
+
+<div class=Section1>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>BlazeDS Source Distribution</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>This BlazeDS Source Distribution includes
+the Adobe BlazeDS and Adobe Flex SDK, which are each licensed under separate
+licenses as described below:</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal><u><span style='font-size:14.0pt'>Adobe BlazeDS License
+Information</span></u><span style='font-size:14.0pt'>:</span></p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>�
+2004-2008 Adobe Systems Incorporated. All rights reserved.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+program is free software: you can redistribute it and/or modify it under the
+terms of the GNU Lesser General Public License, Version 3, as published by the
+Free Software Foundation.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE.� See the GNU Lesser General Public License for more
+details.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>You
+should have received a copy of the GNU Lesser General Public License along with
+this program.� If not, see http://www.gnu.org/licenses/.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>You
+shall not disclaim warranty or limit liability differently from the terms of
+Sections 15 and 16 of the GNU General Public License, Version 3, which is
+incorporated into the GNU Lesser General Public License.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>You
+shall preserve all legal notices or author attributions in the program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>You
+shall not misrepresent the original version of the program, and you shall mark
+all modified versions of the program in reasonable ways to show the differences
+from the original version of the program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>�</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>In
+accordance with Section 7(f) of the GNU General Public License, Version 3,
+which is incorporated into the GNU Lesser General Public License, certain
+portions of this program are licensed under Apache 2.0 which requires the
+indemnification of the author or licensors of the software licensed under
+Apache 2.0 license by those who convey the program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>If
+you have any questions regarding this agreement or if you wish to request any
+information from Adobe please use the address and contact information included
+with this program to contact the Adobe office serving your jurisdiction.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>By
+downloading, using, modifying, distributing and/or accessing the program, you
+agree to the GNU Lesser General Public License, Version 3.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>The name &ldquo;BlazeDS&rdquo; and the BlazeDS logo must not be  used to endorse or promote products derived from this software without prior  written permission from Adobe. &nbsp;Similarly, products derived from this open  source software may not be called &quot;BlazeDS&quot;, nor may  &quot;BlazeDS&quot; appear in their name or the BlazeDS logo appear with such  products, without prior written permission of Adobe.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>&nbsp;</span></b></p>
+
+<p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>NOTICES
+RELATED TO CERTAIN THIRD PARTY MATERIALS:</span></b></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Apache
+1.1 Licensed Products</span></u><span style='font-size:10.0pt'>:� </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+product includes software listed below that were developed by the Apache
+Software Foundation (http://www.apache.org/).� Such software is licensed under
+the Apache Software License, Version 1.1; you may obtain a copy of such license
+at� http://apache.org/licenses/LICENSE-1.1.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>-
+Apache Commons</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- commons-codec-1.3.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- commons-fileupload-1.1.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- commons-httpclient-3.0.1.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- commons-io-1.1.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>- Apache
+Velocity</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- mm-velocity-1.4.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>-
+Apache XML</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- xalan.jar (version 2.5.2)</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Apache
+2.0 Licensed Products</span></u><span style='font-size:10.0pt'>:� </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+product includes software listed below that were licensed under the Apache
+License, Version 2.0 (the &quot;License&quot;); 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 &quot;AS IS&quot; 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.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>-
+Apache Tomcat</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- Apache Tomcat 6.0.29</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Creative
+Commons Licensed Products</span></u><span style='font-size:10.0pt'>: </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+software uses the java.util.concurrent (concurrent.jar version 1.3.3) API and
+the backport of java.util.concurrent API. Both packages are public-domain
+sources from the JSR 166 CVS repository, the dl.util.concurrent package, and
+the Doug Lea's collections package.backport-util-concurrent.jar (version 2.2)
+The license terms of these packages can be found here
+(http://creativecommons.org:81/licenses/publicdomain/). </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>GNU
+LGPLv.2.1 Licensed Products</span></u><span style='font-size:10.0pt'>: </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+software uses the JGroups toolkit library for reliable multicast communication
+(jgroups.jar).� Such JGroups library is licensed under� the GNU Lesser General
+Public License, Version 2.1, a copy of which is included with such library.�
+You may also obtain a copy of such license at <a
+href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.�� </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Hypersonic
+Licensed Products</span></u><span style='font-size:10.0pt'>:� </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+software uses the Hypersonic Java SQL database engine (hsqldb.jar version
+1.8.0) which is licensed under the Hypersonic license (<a
+href="http://hsqldb.org/web/hsqlLicense.html">http://hsqldb.org/web/hsqlLicense.html</a>),
+the text of which is provided below:</span></p>
+
+<p style='margin-left:1.0in'><b><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>For
+content, code, and products originally developed by Thomas Mueller and the
+Hypersonic SQL Group:</span></b><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'><br>
+<br>
+Copyright (c) 1995-2000 by the Hypersonic SQL Group.<br>
+All rights reserved. </span></p>
+
+<p style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>Redistribution
+and use in source and binary forms, with or without<br>
+modification, are permitted provided that the following conditions are met:<br>
+<br>
+Redistributions of source code must retain the above copyright notice, this<br>
+list of conditions and the following disclaimer.<br>
+<br>
+Redistributions in binary form must reproduce the above copyright notice,<br>
+this list of conditions and the following disclaimer in the documentation<br>
+and/or other materials provided with the distribution.<br>
+<br>
+Neither the name of the Hypersonic SQL Group nor the names of its<br>
+contributors may be used to endorse or promote products derived from this<br>
+software without specific prior written permission.<br>
+<br>
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS
+IS&quot;AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE HYPERSONIC SQL GROUP,� OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></p>
+
+<p style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>This
+software consists of voluntary contributions made by many individuals on behalf
+of the<br>
+Hypersonic SQL Group.</span></p>
+
+<h3 style='margin-left:69.4pt'><span style='font-size:10.0pt'>For work added by
+the HSQL Development Group (a.k.a. hsqldb_lic.txt):</span></h3>
+
+<p style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>Copyright
+(c) 2001-2005, The HSQL Development Group<br>
+All rights reserved.<br>
+<br>
+Redistribution and use in source and binary forms, with or without<br>
+modification, are permitted provided that the following conditions are met:<br>
+<br>
+Redistributions of source code must retain the above copyright notice, this<br>
+list of conditions and the following disclaimer.<br>
+<br>
+Redistributions in binary form must reproduce the above copyright notice,<br>
+this list of conditions and the following disclaimer in the documentation<br>
+and/or other materials provided with the distribution.<br>
+<br>
+Neither the name of the HSQL Development Group nor the names of its<br>
+contributors may be used to endorse or promote products derived from this<br>
+software without specific prior written permission.<br>
+<br>
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS
+IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,� OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>�</span></p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal><u><span style='font-size:14.0pt'>Adobe Flex SDK License
+Information</span></u><span style='font-size:14.0pt'>:</span></p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Adobe
+Flex SDK License Agreement:</span></u><span style='font-size:10.0pt'>� </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>All
+files contained in the Adobe Flex SDK are subject to and governed by the Adobe
+Flex SDK License Agreement specified here: <a href="licenses\license-adobesdk.htm">Adobe
+Flex SDK License Agreement</a>, <u>EXCEPT</u> those files specifically
+identified below as �Mozilla Public License Files�.� </span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>By downloading,
+modifying, distributing, using and/or accessing any files in this directory,
+you agree to the terms and conditions of the applicable end user license
+agreement. </span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>In
+addition to the Adobe license terms, you also agree to be bound by the third-party
+terms specified here: <a href="http://www.adobe.com/go/thirdparty">Third Party
+Software Notices</a>. Adobe recommends that you review these third-party terms.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'><span
+ style='text-decoration:none'>&nbsp;</span></span></u></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Mozilla
+Public License Files:</span></u><span style='font-size:10.0pt'>� </span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>The
+files located in the following directory locations of the Adobe Flex SDK are
+governed by the �Mozilla Public License Version 1.1� found below.� </span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>ant<br>
+asdoc<br>
+frameworks/javascript<br>
+frameworks/locale<br>
+frameworks/projects<br>
+frameworks/themes</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>The
+contents of such above files are subject to the Mozilla Public License Version
+1.1 (the &quot;License&quot;); you may not use these files except in compliance
+with the License. You may obtain a copy of the License here: <a
+href="licenses\license-mpl.htm">Mozilla Public License Version 1.1</a> or <a
+href="http://www.mozilla.org/MPL/">http://www.mozilla.org/MPL/</a>.</span></p>
+
+<pre style='margin-left:1.0in'><span style='font-family:"Times New Roman","serif"'>Software distributed under the License is distributed on an &quot;AS IS&quot; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.</span></pre><pre
+style='margin-left:1.0in'><span style='font-family:"Times New Roman","serif"'>&nbsp;</span></pre><pre
+style='margin-left:1.0in'><span style='font-family:"Times New Roman","serif"'>The Original Code consists of the files listed above.</span></pre><pre
+style='margin-left:1.0in'><span style='font-family:"Times New Roman","serif"'>&nbsp;</span></pre>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>The
+Initial Developer of the Original Code is Adobe Systems Incorporated.</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>By
+downloading, modifying, distributing, using and/or accessing any files in this
+directory, you agree to the terms and conditions of the applicable end user
+license agreement.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>NOTICES
+RELATED TO CERTAIN THIRD PARTY MATERIALS:</span></b></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Apache
+1.1 Licensed Products</span></u><span style='font-size:10.0pt'>:� </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>This
+product includes software listed below that were developed by the Apache
+Software Foundation (<a href="http://www.apache.org/">http://www.apache.org</a>/).�
+Such software is licensed under the Apache Software License, Version 1.1; you
+may obtain a copy of such license at <a
+href="http://apache.org/licenses/LICENSE-1.1">http://apache.org/licenses/LICENSE-1.1</a>.</span></p>
+
+<p class=MsoNormal style='margin-left:1.5in'><span style='font-size:10.0pt'>Apache
+Commons Collections 2.1<br>
+Apache Commons Discovery 0.2<br>
+Apache Xerces 2.4</span></p>
+
+<p style='margin-left:38.6pt'><u><span style='font-size:10.0pt;font-family:
+"Times New Roman","serif"'>Apache 2.0 Licensed Products</span></u><span
+style='font-size:10.0pt;font-family:"Times New Roman","serif"'>:� </span></p>
+
+<p style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>This
+product includes software listed below that were licensed under the Apache
+License, Version 2.0 (the &quot;License&quot;); you may not use this file
+except in compliance with the License. You may obtain a copy of the License at <a
+href="http://www.apache.org/licenses/LICENSE-2.0"
+title="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>.
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an &quot;AS IS&quot; BASIS,&nbsp;&nbsp;
+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.</span></p>
+
+<p style='margin-left:1.5in'><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>Apache
+Axis 1.1, � 2001-2004, Apache Software Foundation<br>
+Apache Batik SVG Toolkit 1.6, � 2005, Apache Software Foundation<br>
+Apache Commons Logging 1.0.4, � 2004, Apache Software Foundation<br>
+Apache Velocity 1.4, � 2004, Apache Software Foundation<br>
+Apache Xalan 2.6.0, � 2004, Apache Software Foundation</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>BSD
+Licensed Products</span></u><span style='font-size:10.0pt'>:</span></p>
+
+<p style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>Easing
+Equations Copyright (c) 2001-2003, Robert Penner</span></p>
+
+<p style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>All
+rights reserved.</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>Redistribution
+and use in source and binary forms, with or without modification, are permitted
+provided that the following conditions are met:</span></p>
+
+<p class=MsoNormal style='margin-left:1.5in;text-indent:-.25in'><span
+style='font-size:10.0pt;font-family:Symbol'>�<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><span style='font-size:10.0pt'>Redistributions of source code
+must retain the above copyright notice, this list of conditions and the
+following disclaimer. </span></p>
+
+<p class=MsoNormal style='margin-left:1.5in;text-indent:-.25in'><span
+style='font-size:10.0pt;font-family:Symbol'>�<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><span style='font-size:10.0pt'>Redistributions in binary form
+must reproduce the above copyright notice, this list of conditions and the
+following disclaimer in the documentation and/or other materials provided with
+the distribution. </span></p>
+
+<p class=MsoNormal style='margin-left:1.5in;text-indent:-.25in'><span
+style='font-size:10.0pt;font-family:Symbol'>�<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><span style='font-size:10.0pt'>Neither the name of the
+&lt;ORGANIZATION&gt; nor the names of its contributors may be used to endorse
+or promote products derived from this software without specific prior written
+permission. </span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>THIS
+SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS
+IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE<span
+style='color:blue'>.</span></span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt;
+color:blue'>&nbsp;</span></p>
+
+</div>
+
+</body>
+
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/collateral/blazeds-turnkey-readme.htm
----------------------------------------------------------------------
diff --git a/collateral/blazeds-turnkey-readme.htm b/collateral/blazeds-turnkey-readme.htm
new file mode 100755
index 0000000..638b85f
--- /dev/null
+++ b/collateral/blazeds-turnkey-readme.htm
@@ -0,0 +1,557 @@
+<!--
+  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>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<title>BlazeDS Turnkey Readme</title>
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+	{font-family:"Cambria Math";
+	panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+	{font-family:Verdana;
+	panose-1:2 11 6 4 3 5 4 4 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+	{margin:0in;
+	margin-bottom:.0001pt;
+	font-size:12.0pt;
+	font-family:"Times New Roman","serif";
+	color:windowtext;}
+h3
+	{mso-style-link:"Heading 3 Char";
+	margin-right:0in;
+	margin-left:0in;
+	font-size:13.5pt;
+	font-family:"Times New Roman","serif";
+	color:black;
+	font-weight:bold;}
+a:link, span.MsoHyperlink
+	{color:blue;
+	text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+	{color:purple;
+	text-decoration:underline;}
+p
+	{margin-right:2.6pt;
+	margin-left:2.6pt;
+	font-size:12.0pt;
+	font-family:"Verdana","sans-serif";
+	color:black;}
+pre
+	{mso-style-link:"HTML Preformatted Char";
+	margin:0in;
+	margin-bottom:.0001pt;
+	font-size:10.0pt;
+	font-family:"Courier New";
+	color:windowtext;}
+span.Heading3Char
+	{mso-style-name:"Heading 3 Char";
+	mso-style-link:"Heading 3";
+	font-family:"Cambria","serif";
+	color:#4F81BD;
+	font-weight:bold;}
+span.HTMLPreformattedChar
+	{mso-style-name:"HTML Preformatted Char";
+	mso-style-link:"HTML Preformatted";
+	font-family:"Courier New";}
+.MsoChpDefault
+	{font-size:10.0pt;}
+@page Section1
+	{size:8.5in 11.0in;
+	margin:1.0in 1.25in 1.0in 1.25in;}
+div.Section1
+	{page:Section1;}
+ /* List Definitions */
+ ol
+	{margin-bottom:0in;}
+ul
+	{margin-bottom:0in;}
+-->
+</style>
+
+</head>
+
+<body lang=EN-US link=blue vlink=purple>
+
+<div class=Section1>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>BlazeDS Turnkey</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>This BlazeDS Turnkey<span style='font-size:10.0pt'> </span>includes
+the Adobe BlazeDS and Adobe Flex SDK, which are each licensed under separate
+licenses as described below:</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal><u><span style='font-size:14.0pt'>Adobe BlazeDS License
+Information</span></u><span style='font-size:14.0pt'>:</span></p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>�
+2004-2008 Adobe Systems Incorporated. All rights reserved.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+program is free software: you can redistribute it and/or modify it under the
+terms of the GNU Lesser General Public License, Version 3, as published by the
+Free Software Foundation.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE.� See the GNU Lesser General Public License for more
+details.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>You
+should have received a copy of the GNU Lesser General Public License along with
+this program.� If not, see http://www.gnu.org/licenses/.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>You
+shall not disclaim warranty or limit liability differently from the terms of
+Sections 15 and 16 of the GNU General Public License, Version 3, which is
+incorporated into the GNU Lesser General Public License.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>You
+shall preserve all legal notices or author attributions in the program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>You
+shall not misrepresent the original version of the program, and you shall mark
+all modified versions of the program in reasonable ways to show the differences
+from the original version of the program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>�</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>In
+accordance with Section 7(f) of the GNU General Public License, Version 3,
+which is incorporated into the GNU Lesser General Public License, certain
+portions of this program are licensed under Apache 2.0 which requires the
+indemnification of the author or licensors of the software licensed under
+Apache 2.0 license by those who convey the program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>If
+you have any questions regarding this agreement or if you wish to request any
+information from Adobe please use the address and contact information included
+with this program to contact the Adobe office serving your jurisdiction.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>By
+downloading, using, modifying, distributing and/or accessing the program, you
+agree to the GNU Lesser General Public License, Version 3.</span></p>
+<p class=MsoNormal style='margin-left:.5in'>&nbsp;</p>
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>The name &ldquo;BlazeDS&rdquo; and the BlazeDS logo must not be  used to endorse or promote products derived from this software without prior  written permission from Adobe. &nbsp;Similarly, products derived from this open  source software may not be called &quot;BlazeDS&quot;, nor may  &quot;BlazeDS&quot; appear in their name or the BlazeDS logo appear with such  products, without prior written permission of Adobe.</span></p>
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>&nbsp;</span></b></p>
+
+<p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>NOTICES
+RELATED TO CERTAIN THIRD PARTY MATERIALS:</span></b></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Apache
+1.1 Licensed Products</span></u><span style='font-size:10.0pt'>:� </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+product includes software listed below that were developed by the Apache
+Software Foundation (http://www.apache.org/).� Such software is licensed under
+the Apache Software License, Version 1.1; you may obtain a copy of such license
+at� http://apache.org/licenses/LICENSE-1.1.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>-
+Apache Commons</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- commons-codec-1.3.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- commons-fileupload-1.1.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- commons-httpclient-3.0.1.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- commons-io-1.1.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>- Apache
+Velocity</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- mm-velocity-1.4.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>-
+Apache XML</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- xalan.jar (version 2.5.2)</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Apache
+2.0 Licensed Products</span></u><span style='font-size:10.0pt'>:� </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+product includes software listed below that were licensed under the Apache
+License, Version 2.0 (the &quot;License&quot;); 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 &quot;AS IS&quot; 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.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>-
+Apache Tomcat</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- Apache Tomcat 6.0.29</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Creative
+Commons Licensed Products</span></u><span style='font-size:10.0pt'>: </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+software uses the java.util.concurrent (concurrent.jar version 1.3.3) API and
+the backport of java.util.concurrent API. Both packages are public-domain
+sources from the JSR 166 CVS repository, the dl.util.concurrent package, and
+the Doug Lea's collections package.backport-util-concurrent.jar (version 2.2)
+The license terms of these packages can be found here
+(http://creativecommons.org:81/licenses/publicdomain/). </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>GNU
+LGPLv.2.1 Licensed Products</span></u><span style='font-size:10.0pt'>: </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+software uses the JGroups toolkit library for reliable multicast communication
+(jgroups.jar).� Such JGroups library is licensed under� the GNU Lesser General
+Public License, Version 2.1, a copy of which is included with such library.�
+You may also obtain a copy of such license at <a
+href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.�� </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Hypersonic
+Licensed Products</span></u><span style='font-size:10.0pt'>:� </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+software uses the Hypersonic Java SQL database engine (hsqldb.jar version
+1.8.0) which is licensed under the Hypersonic license (<a
+href="http://hsqldb.org/web/hsqlLicense.html">http://hsqldb.org/web/hsqlLicense.html</a>),
+the text of which is provided below:</span></p>
+
+<p style='margin-left:1.0in'><b><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>For
+content, code, and products originally developed by Thomas Mueller and the
+Hypersonic SQL Group:</span></b><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'><br>
+<br>
+Copyright (c) 1995-2000 by the Hypersonic SQL Group.<br>
+All rights reserved. </span></p>
+
+<p style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>Redistribution
+and use in source and binary forms, with or without<br>
+modification, are permitted provided that the following conditions are met:<br>
+<br>
+Redistributions of source code must retain the above copyright notice, this<br>
+list of conditions and the following disclaimer.<br>
+<br>
+Redistributions in binary form must reproduce the above copyright notice,<br>
+this list of conditions and the following disclaimer in the documentation<br>
+and/or other materials provided with the distribution.<br>
+<br>
+Neither the name of the Hypersonic SQL Group nor the names of its<br>
+contributors may be used to endorse or promote products derived from this<br>
+software without specific prior written permission.<br>
+<br>
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS
+IS&quot;AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE HYPERSONIC SQL GROUP,� OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></p>
+
+<p style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>This
+software consists of voluntary contributions made by many individuals on behalf
+of the<br>
+Hypersonic SQL Group.</span></p>
+
+<h3 style='margin-left:69.4pt'><span style='font-size:10.0pt'>For work added by
+the HSQL Development Group (a.k.a. hsqldb_lic.txt):</span></h3>
+
+<p style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>Copyright
+(c) 2001-2005, The HSQL Development Group<br>
+All rights reserved.<br>
+<br>
+Redistribution and use in source and binary forms, with or without<br>
+modification, are permitted provided that the following conditions are met:<br>
+<br>
+Redistributions of source code must retain the above copyright notice, this<br>
+list of conditions and the following disclaimer.<br>
+<br>
+Redistributions in binary form must reproduce the above copyright notice,<br>
+this list of conditions and the following disclaimer in the documentation<br>
+and/or other materials provided with the distribution.<br>
+<br>
+Neither the name of the HSQL Development Group nor the names of its<br>
+contributors may be used to endorse or promote products derived from this<br>
+software without specific prior written permission.<br>
+<br>
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS
+IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,� OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>�</span></p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal><u><span style='font-size:14.0pt'>Adobe Flex SDK License
+Information</span></u><span style='font-size:14.0pt'>:</span></p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Adobe
+Flex SDK License Agreement:</span></u><span style='font-size:10.0pt'>� </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>All
+files contained in the Adobe Flex SDK are subject to and governed by the Adobe
+Flex SDK License Agreement specified here: <a href="licenses\license-adobesdk.htm">Adobe
+Flex SDK License Agreement</a>, <u>EXCEPT</u> those files specifically
+identified below as �Mozilla Public License Files�.� </span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>By downloading,
+modifying, distributing, using and/or accessing any files in this directory,
+you agree to the terms and conditions of the applicable end user license
+agreement. </span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>In
+addition to the Adobe license terms, you also agree to be bound by the third-party
+terms specified here: <a href="http://www.adobe.com/go/thirdparty">Third Party
+Software Notices</a>. Adobe recommends that you review these third-party terms.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'><span
+ style='text-decoration:none'>&nbsp;</span></span></u></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Mozilla
+Public License Files:</span></u><span style='font-size:10.0pt'>� </span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>The
+files located in the following directory locations of the Adobe Flex SDK are
+governed by the �Mozilla Public License Version 1.1� found below.� </span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>ant<br>
+asdoc<br>
+frameworks/javascript<br>
+frameworks/locale<br>
+frameworks/projects<br>
+frameworks/themes</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>The
+contents of such above files are subject to the Mozilla Public License Version
+1.1 (the &quot;License&quot;); you may not use these files except in compliance
+with the License. You may obtain a copy of the License here: <a
+href="licenses\license-mpl.htm">Mozilla Public License Version 1.1</a> or <a
+href="http://www.mozilla.org/MPL/">http://www.mozilla.org/MPL/</a>.</span></p>
+
+<pre style='margin-left:1.0in'><span style='font-family:"Times New Roman","serif"'>Software distributed under the License is distributed on an &quot;AS IS&quot; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.</span></pre><pre
+style='margin-left:1.0in'><span style='font-family:"Times New Roman","serif"'>&nbsp;</span></pre><pre
+style='margin-left:1.0in'><span style='font-family:"Times New Roman","serif"'>The Original Code consists of the files listed above.</span></pre><pre
+style='margin-left:1.0in'><span style='font-family:"Times New Roman","serif"'>&nbsp;</span></pre>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>The
+Initial Developer of the Original Code is Adobe Systems Incorporated.</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>By
+downloading, modifying, distributing, using and/or accessing any files in this
+directory, you agree to the terms and conditions of the applicable end user
+license agreement.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>NOTICES
+RELATED TO CERTAIN THIRD PARTY MATERIALS:</span></b></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Apache
+1.1 Licensed Products</span></u><span style='font-size:10.0pt'>:� </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>This
+product includes software listed below that were developed by the Apache
+Software Foundation (<a href="http://www.apache.org/">http://www.apache.org</a>/).�
+Such software is licensed under the Apache Software License, Version 1.1; you
+may obtain a copy of such license at <a
+href="http://apache.org/licenses/LICENSE-1.1">http://apache.org/licenses/LICENSE-1.1</a>.</span></p>
+
+<p class=MsoNormal style='margin-left:1.5in'><span style='font-size:10.0pt'>Apache
+Commons Collections 2.1<br>
+Apache Commons Discovery 0.2<br>
+Apache Xerces 2.4</span></p>
+
+<p style='margin-left:38.6pt'><u><span style='font-size:10.0pt;font-family:
+"Times New Roman","serif"'>Apache 2.0 Licensed Products</span></u><span
+style='font-size:10.0pt;font-family:"Times New Roman","serif"'>:� </span></p>
+
+<p style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>This
+product includes software listed below that were licensed under the Apache
+License, Version 2.0 (the &quot;License&quot;); you may not use this file
+except in compliance with the License. You may obtain a copy of the License at <a
+href="http://www.apache.org/licenses/LICENSE-2.0"
+title="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>.
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an &quot;AS IS&quot; BASIS,&nbsp;&nbsp;
+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.</span></p>
+
+<p style='margin-left:1.5in'><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>Apache
+Axis 1.1, � 2001-2004, Apache Software Foundation<br>
+Apache Batik SVG Toolkit 1.6, � 2005, Apache Software Foundation<br>
+Apache Commons Logging 1.0.4, � 2004, Apache Software Foundation<br>
+Apache Velocity 1.4, � 2004, Apache Software Foundation<br>
+Apache Xalan 2.6.0, � 2004, Apache Software Foundation</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>BSD
+Licensed Products</span></u><span style='font-size:10.0pt'>:</span></p>
+
+<p style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>Easing
+Equations Copyright (c) 2001-2003, Robert Penner</span></p>
+
+<p style='margin-left:1.0in'><span style='font-size:10.0pt;font-family:"Times New Roman","serif"'>All
+rights reserved.</span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>Redistribution
+and use in source and binary forms, with or without modification, are permitted
+provided that the following conditions are met:</span></p>
+
+<p class=MsoNormal style='margin-left:1.5in;text-indent:-.25in'><span
+style='font-size:10.0pt;font-family:Symbol'>�<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><span style='font-size:10.0pt'>Redistributions of source code
+must retain the above copyright notice, this list of conditions and the
+following disclaimer. </span></p>
+
+<p class=MsoNormal style='margin-left:1.5in;text-indent:-.25in'><span
+style='font-size:10.0pt;font-family:Symbol'>�<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><span style='font-size:10.0pt'>Redistributions in binary form
+must reproduce the above copyright notice, this list of conditions and the
+following disclaimer in the documentation and/or other materials provided with
+the distribution. </span></p>
+
+<p class=MsoNormal style='margin-left:1.5in;text-indent:-.25in'><span
+style='font-size:10.0pt;font-family:Symbol'>�<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</span></span><span style='font-size:10.0pt'>Neither the name of the
+&lt;ORGANIZATION&gt; nor the names of its contributors may be used to endorse
+or promote products derived from this software without specific prior written
+permission. </span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt'>THIS
+SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS
+IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE<span
+style='color:blue'>.</span></span></p>
+
+<p class=MsoNormal style='margin-left:1.0in'><span style='font-size:10.0pt;
+color:blue'>&nbsp;</span></p>
+
+</div>
+
+</body>
+
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/IDEA/projects/java/BlazeDS.ipr
----------------------------------------------------------------------
diff --git a/development/IDEA/projects/java/BlazeDS.ipr b/development/IDEA/projects/java/BlazeDS.ipr
new file mode 100755
index 0000000..3414d2b
--- /dev/null
+++ b/development/IDEA/projects/java/BlazeDS.ipr
@@ -0,0 +1,404 @@
+<?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.
+
+-->
+<project version="4">
+  <component name="AntConfiguration">
+    <defaultAnt bundledAnt="true" />
+  </component>
+  <component name="BuildJarProjectSettings">
+    <option name="BUILD_JARS_ON_MAKE" value="false" />
+  </component>
+  <component name="CheckStyle-IDEA">
+    <option name="configuration">
+      <map>
+        <entry key="active-configuration" value="FILE:C:\dev\DataServices\trunk\lib\thirdparty\tools\checkstyle\checkstyle5.xml:LCDS rules" />
+        <entry key="check-test-classes" value="false" />
+        <entry key="location-0" value="CLASSPATH:/sun_checks.xml:The default CheckStyle rules." />
+        <entry key="location-1" value="FILE:C:\dev\DataServices\trunk\lib\thirdparty\tools\checkstyle\checkstyle5.xml:LCDS rules" />
+        <entry key="property-1.basedir" value="c:\dev\DataServices\trunk" />
+        <entry key="thirdparty-classpath" value="" />
+      </map>
+    </option>
+  </component>
+  <component name="CodeStyleProjectProfileManger">
+    <option name="PROJECT_PROFILE" />
+    <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
+  </component>
+  <component name="CodeStyleSettingsManager">
+    <option name="PER_PROJECT_SETTINGS">
+      <value>
+        <option name="BRACE_STYLE" value="2" />
+        <option name="CLASS_BRACE_STYLE" value="2" />
+        <option name="METHOD_BRACE_STYLE" value="2" />
+        <option name="ELSE_ON_NEW_LINE" value="true" />
+        <option name="WHILE_ON_NEW_LINE" value="true" />
+        <option name="CATCH_ON_NEW_LINE" value="true" />
+        <option name="FINALLY_ON_NEW_LINE" value="true" />
+        <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="50" />
+        <option name="IF_BRACE_FORCE" value="1" />
+        <option name="DOWHILE_BRACE_FORCE" value="1" />
+        <option name="WHILE_BRACE_FORCE" value="1" />
+        <option name="FOR_BRACE_FORCE" value="1" />
+        <ADDITIONAL_INDENT_OPTIONS fileType="groovy">
+          <option name="INDENT_SIZE" value="2" />
+          <option name="CONTINUATION_INDENT_SIZE" value="8" />
+          <option name="TAB_SIZE" value="4" />
+          <option name="USE_TAB_CHARACTER" value="false" />
+          <option name="SMART_TABS" value="false" />
+          <option name="LABEL_INDENT_SIZE" value="0" />
+          <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+        </ADDITIONAL_INDENT_OPTIONS>
+        <ADDITIONAL_INDENT_OPTIONS fileType="gsp">
+          <option name="INDENT_SIZE" value="2" />
+          <option name="CONTINUATION_INDENT_SIZE" value="8" />
+          <option name="TAB_SIZE" value="4" />
+          <option name="USE_TAB_CHARACTER" value="false" />
+          <option name="SMART_TABS" value="false" />
+          <option name="LABEL_INDENT_SIZE" value="0" />
+          <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+        </ADDITIONAL_INDENT_OPTIONS>
+        <ADDITIONAL_INDENT_OPTIONS fileType="java">
+          <option name="INDENT_SIZE" value="4" />
+          <option name="CONTINUATION_INDENT_SIZE" value="8" />
+          <option name="TAB_SIZE" value="4" />
+          <option name="USE_TAB_CHARACTER" value="false" />
+          <option name="SMART_TABS" value="false" />
+          <option name="LABEL_INDENT_SIZE" value="0" />
+          <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+        </ADDITIONAL_INDENT_OPTIONS>
+        <ADDITIONAL_INDENT_OPTIONS fileType="js">
+          <option name="INDENT_SIZE" value="4" />
+          <option name="CONTINUATION_INDENT_SIZE" value="8" />
+          <option name="TAB_SIZE" value="4" />
+          <option name="USE_TAB_CHARACTER" value="false" />
+          <option name="SMART_TABS" value="false" />
+          <option name="LABEL_INDENT_SIZE" value="0" />
+          <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+        </ADDITIONAL_INDENT_OPTIONS>
+        <ADDITIONAL_INDENT_OPTIONS fileType="jsp">
+          <option name="INDENT_SIZE" value="4" />
+          <option name="CONTINUATION_INDENT_SIZE" value="8" />
+          <option name="TAB_SIZE" value="4" />
+          <option name="USE_TAB_CHARACTER" value="false" />
+          <option name="SMART_TABS" value="false" />
+          <option name="LABEL_INDENT_SIZE" value="0" />
+          <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+        </ADDITIONAL_INDENT_OPTIONS>
+        <ADDITIONAL_INDENT_OPTIONS fileType="sql">
+          <option name="INDENT_SIZE" value="2" />
+          <option name="CONTINUATION_INDENT_SIZE" value="8" />
+          <option name="TAB_SIZE" value="4" />
+          <option name="USE_TAB_CHARACTER" value="false" />
+          <option name="SMART_TABS" value="false" />
+          <option name="LABEL_INDENT_SIZE" value="0" />
+          <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+        </ADDITIONAL_INDENT_OPTIONS>
+        <ADDITIONAL_INDENT_OPTIONS fileType="xml">
+          <option name="INDENT_SIZE" value="4" />
+          <option name="CONTINUATION_INDENT_SIZE" value="8" />
+          <option name="TAB_SIZE" value="4" />
+          <option name="USE_TAB_CHARACTER" value="false" />
+          <option name="SMART_TABS" value="false" />
+          <option name="LABEL_INDENT_SIZE" value="0" />
+          <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+        </ADDITIONAL_INDENT_OPTIONS>
+        <ADDITIONAL_INDENT_OPTIONS fileType="yml">
+          <option name="INDENT_SIZE" value="2" />
+          <option name="CONTINUATION_INDENT_SIZE" value="8" />
+          <option name="TAB_SIZE" value="4" />
+          <option name="USE_TAB_CHARACTER" value="false" />
+          <option name="SMART_TABS" value="false" />
+          <option name="LABEL_INDENT_SIZE" value="0" />
+          <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+        </ADDITIONAL_INDENT_OPTIONS>
+      </value>
+    </option>
+    <option name="USE_PER_PROJECT_SETTINGS" value="true" />
+  </component>
+  <component name="CompilerConfiguration">
+    <option name="DEFAULT_COMPILER" value="Javac" />
+    <excludeFromCompile>
+      <file url="file://$PROJECT_DIR$/../../../../modules/opt/src/tomcat/flex/messaging/security/TomcatValve4150.java" />
+    </excludeFromCompile>
+    <resourceExtensions>
+      <entry name=".+\.(properties|xml|html|dtd|tld)" />
+      <entry name=".+\.(gif|png|jpeg|jpg)" />
+    </resourceExtensions>
+    <wildcardResourcePatterns>
+      <entry name="?*.properties" />
+      <entry name="?*.xml" />
+      <entry name="?*.gif" />
+      <entry name="?*.png" />
+      <entry name="?*.jpeg" />
+      <entry name="?*.jpg" />
+      <entry name="?*.html" />
+      <entry name="?*.dtd" />
+      <entry name="?*.tld" />
+    </wildcardResourcePatterns>
+    <annotationProcessing enabled="false" useClasspath="true" />
+  </component>
+  <component name="CopyrightManager" default="">
+    <module2copyright />
+  </component>
+  <component name="DependenciesAnalyzeManager">
+    <option name="myForwardDirection" value="false" />
+  </component>
+  <component name="DependencyValidationManager">
+    <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+  </component>
+  <component name="EclipseCompilerSettings">
+    <option name="GENERATE_NO_WARNINGS" value="true" />
+    <option name="DEPRECATION" value="false" />
+  </component>
+  <component name="EclipseEmbeddedCompilerSettings">
+    <option name="DEBUGGING_INFO" value="true" />
+    <option name="GENERATE_NO_WARNINGS" value="true" />
+    <option name="DEPRECATION" value="false" />
+    <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+    <option name="MAXIMUM_HEAP_SIZE" value="128" />
+  </component>
+  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+  <component name="EntryPointsManager">
+    <entry_points version="2.0" />
+  </component>
+  <component name="ExportToHTMLSettings">
+    <option name="PRINT_LINE_NUMBERS" value="false" />
+    <option name="OPEN_IN_BROWSER" value="false" />
+    <option name="OUTPUT_DIRECTORY" />
+  </component>
+  <component name="IdProvider" IDEtalkID="5AAD6132EF979FFD77F94B45063DD190" />
+  <component name="InspectionProjectProfileManager">
+    <profiles>
+      <profile version="1.0" is_locked="false">
+        <option name="myName" value="Project Default" />
+        <option name="myLocal" value="false" />
+        <inspection_tool class="JavaDoc" enabled="false" level="WARNING" enabled_by_default="false">
+          <option name="TOP_LEVEL_CLASS_OPTIONS">
+            <value>
+              <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+              <option name="REQUIRED_TAGS" value="" />
+            </value>
+          </option>
+          <option name="INNER_CLASS_OPTIONS">
+            <value>
+              <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+              <option name="REQUIRED_TAGS" value="" />
+            </value>
+          </option>
+          <option name="METHOD_OPTIONS">
+            <value>
+              <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+              <option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
+            </value>
+          </option>
+          <option name="FIELD_OPTIONS">
+            <value>
+              <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+              <option name="REQUIRED_TAGS" value="" />
+            </value>
+          </option>
+          <option name="IGNORE_DEPRECATED" value="false" />
+          <option name="IGNORE_JAVADOC_PERIOD" value="true" />
+          <option name="IGNORE_DUPLICATED_THROWS" value="false" />
+          <option name="myAdditionalJavadocTags" value="" />
+        </inspection_tool>
+      </profile>
+    </profiles>
+    <option name="PROJECT_PROFILE" value="Project Default" />
+    <option name="USE_PROJECT_PROFILE" value="true" />
+    <version value="1.0" />
+  </component>
+  <component name="JavadocGenerationManager">
+    <option name="OUTPUT_DIRECTORY" />
+    <option name="OPTION_SCOPE" value="protected" />
+    <option name="OPTION_HIERARCHY" value="true" />
+    <option name="OPTION_NAVIGATOR" value="true" />
+    <option name="OPTION_INDEX" value="true" />
+    <option name="OPTION_SEPARATE_INDEX" value="true" />
+    <option name="OPTION_DOCUMENT_TAG_USE" value="false" />
+    <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
+    <option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
+    <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
+    <option name="OPTION_DEPRECATED_LIST" value="true" />
+    <option name="OTHER_OPTIONS" value="" />
+    <option name="HEAP_SIZE" />
+    <option name="LOCALE" />
+    <option name="OPEN_IN_BROWSER" value="true" />
+  </component>
+  <component name="Palette2">
+    <group name="Swing">
+      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+      </item>
+      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
+        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+        <initial-values>
+          <property name="text" value="Button" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="RadioButton" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="CheckBox" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="Label" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+          <preferred-size width="-1" height="20" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+      </item>
+    </group>
+  </component>
+  <component name="ProjectDetails">
+    <option name="projectName" value="BlazeDS" />
+  </component>
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/common.iml" filepath="$PROJECT_DIR$/common.iml" />
+      <module fileurl="file://$PROJECT_DIR$/core.iml" filepath="$PROJECT_DIR$/core.iml" />
+      <module fileurl="file://$PROJECT_DIR$/opt.iml" filepath="$PROJECT_DIR$/opt.iml" />
+      <module fileurl="file://$PROJECT_DIR$/proxy.iml" filepath="$PROJECT_DIR$/proxy.iml" />
+      <module fileurl="file://$PROJECT_DIR$/remoting.iml" filepath="$PROJECT_DIR$/remoting.iml" />
+    </modules>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.5" />
+  <component name="RMI Configuration">
+    <Server />
+    <Port>0</Port>
+    <ProjectOutput>false</ProjectOutput>
+    <CODEBASE />
+  </component>
+  <component name="ResourceManagerContainer">
+    <option name="myResourceBundles">
+      <value>
+        <list size="0" />
+      </value>
+    </option>
+  </component>
+  <component name="SvnBranchConfigurationManager">
+    <option name="mySupportsUserInfoFilter" value="true" />
+  </component>
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="" />
+    <mapping directory="$PROJECT_DIR$/../../../../modules/common" vcs="svn" />
+    <mapping directory="$PROJECT_DIR$/../../../../modules/core" vcs="svn" />
+    <mapping directory="$PROJECT_DIR$/../../../../modules/opt" vcs="svn" />
+    <mapping directory="$PROJECT_DIR$/../../../../modules/proxy" vcs="svn" />
+    <mapping directory="$PROJECT_DIR$/../../../../modules/remoting" vcs="svn" />
+  </component>
+  <component name="WebServicesPlugin" addRequiredLibraries="true" />
+</project>
+

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/IDEA/projects/java/blazeds.xml
----------------------------------------------------------------------
diff --git a/development/IDEA/projects/java/blazeds.xml b/development/IDEA/projects/java/blazeds.xml
new file mode 100755
index 0000000..cc40733
--- /dev/null
+++ b/development/IDEA/projects/java/blazeds.xml
@@ -0,0 +1,88 @@
+<?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.
+
+-->
+<code_scheme name="blazeds">
+  <option name="BRACE_STYLE" value="2" />
+  <option name="CLASS_BRACE_STYLE" value="2" />
+  <option name="METHOD_BRACE_STYLE" value="2" />
+  <option name="ELSE_ON_NEW_LINE" value="true" />
+  <option name="WHILE_ON_NEW_LINE" value="true" />
+  <option name="CATCH_ON_NEW_LINE" value="true" />
+  <option name="FINALLY_ON_NEW_LINE" value="true" />
+  <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="50" />
+  <option name="IF_BRACE_FORCE" value="1" />
+  <option name="DOWHILE_BRACE_FORCE" value="1" />
+  <option name="WHILE_BRACE_FORCE" value="1" />
+  <option name="FOR_BRACE_FORCE" value="1" />
+  <ADDITIONAL_INDENT_OPTIONS fileType="groovy">
+    <option name="INDENT_SIZE" value="2" />
+    <option name="CONTINUATION_INDENT_SIZE" value="8" />
+    <option name="TAB_SIZE" value="4" />
+    <option name="USE_TAB_CHARACTER" value="false" />
+    <option name="SMART_TABS" value="false" />
+    <option name="LABEL_INDENT_SIZE" value="0" />
+    <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+  </ADDITIONAL_INDENT_OPTIONS>
+  <ADDITIONAL_INDENT_OPTIONS fileType="gsp">
+    <option name="INDENT_SIZE" value="2" />
+    <option name="CONTINUATION_INDENT_SIZE" value="8" />
+    <option name="TAB_SIZE" value="4" />
+    <option name="USE_TAB_CHARACTER" value="false" />
+    <option name="SMART_TABS" value="false" />
+    <option name="LABEL_INDENT_SIZE" value="0" />
+    <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+  </ADDITIONAL_INDENT_OPTIONS>
+  <ADDITIONAL_INDENT_OPTIONS fileType="java">
+    <option name="INDENT_SIZE" value="4" />
+    <option name="CONTINUATION_INDENT_SIZE" value="8" />
+    <option name="TAB_SIZE" value="4" />
+    <option name="USE_TAB_CHARACTER" value="false" />
+    <option name="SMART_TABS" value="false" />
+    <option name="LABEL_INDENT_SIZE" value="0" />
+    <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+  </ADDITIONAL_INDENT_OPTIONS>
+  <ADDITIONAL_INDENT_OPTIONS fileType="js">
+    <option name="INDENT_SIZE" value="4" />
+    <option name="CONTINUATION_INDENT_SIZE" value="8" />
+    <option name="TAB_SIZE" value="4" />
+    <option name="USE_TAB_CHARACTER" value="false" />
+    <option name="SMART_TABS" value="false" />
+    <option name="LABEL_INDENT_SIZE" value="0" />
+    <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+  </ADDITIONAL_INDENT_OPTIONS>
+  <ADDITIONAL_INDENT_OPTIONS fileType="jsp">
+    <option name="INDENT_SIZE" value="4" />
+    <option name="CONTINUATION_INDENT_SIZE" value="8" />
+    <option name="TAB_SIZE" value="4" />
+    <option name="USE_TAB_CHARACTER" value="false" />
+    <option name="SMART_TABS" value="false" />
+    <option name="LABEL_INDENT_SIZE" value="0" />
+    <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+  </ADDITIONAL_INDENT_OPTIONS>
+  <ADDITIONAL_INDENT_OPTIONS fileType="xml">
+    <option name="INDENT_SIZE" value="4" />
+    <option name="CONTINUATION_INDENT_SIZE" value="8" />
+    <option name="TAB_SIZE" value="4" />
+    <option name="USE_TAB_CHARACTER" value="false" />
+    <option name="SMART_TABS" value="false" />
+    <option name="LABEL_INDENT_SIZE" value="0" />
+    <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+  </ADDITIONAL_INDENT_OPTIONS>
+</code_scheme>
+


[06/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/MessageBrokerServlet.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/MessageBrokerServlet.java b/modules/core/src/flex/messaging/MessageBrokerServlet.java
new file mode 100755
index 0000000..aaa60d8
--- /dev/null
+++ b/modules/core/src/flex/messaging/MessageBrokerServlet.java
@@ -0,0 +1,461 @@
+/*
+ * 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.messaging;
+
+import flex.management.MBeanLifecycleManager;
+import flex.management.MBeanServerLocatorFactory;
+import flex.messaging.config.ConfigurationManager;
+import flex.messaging.config.FlexConfigurationManager;
+import flex.messaging.config.MessagingConfiguration;
+import flex.messaging.endpoints.Endpoint;
+import flex.messaging.io.SerializationContext;
+import flex.messaging.io.TypeMarshallingContext;
+import flex.messaging.log.HTTPRequestLog;
+import flex.messaging.log.Log;
+import flex.messaging.log.LogCategories;
+import flex.messaging.log.Logger;
+import flex.messaging.log.LoggingHttpServletRequestWrapper;
+import flex.messaging.log.ServletLogTarget;
+import flex.messaging.services.AuthenticationService;
+import flex.messaging.util.ClassUtil;
+import flex.messaging.util.ExceptionUtil;
+import flex.messaging.util.Trace;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.Principal;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * The MessageBrokerServlet bootstraps the MessageBroker,
+ * adds endpoints to it, and starts the broker. The servlet
+ * also acts as a facade for all http-based endpoints, in that
+ * the servlet receives the http request and then delegates to
+ * an endpoint that can handle the request's content type. This
+ * does not occur for non-http endpoints, such as the rtmp endpoint.
+ *
+ * @author sneville
+ * @see flex.messaging.MessageBroker
+ * @exclude
+ */
+public class MessageBrokerServlet extends HttpServlet
+{
+    static final long serialVersionUID = -5293855229461612246L;
+
+    public static final String LOG_CATEGORY_STARTUP_BROKER = LogCategories.STARTUP_MESSAGEBROKER;
+    private static final String STRING_UNDEFINED_APPLICATION = "undefined";
+
+    private MessageBroker broker;
+    private HttpFlexSessionProvider httpFlexSessionProvider;
+    private static String FLEXDIR = "/WEB-INF/flex/";
+    private boolean log_errors = false;
+
+    /**
+     * Initializes the servlet in its web container, then creates
+     * the MessageBroker and adds Endpoints and Services to that broker.
+     * This servlet may keep a reference to an endpoint if it needs to
+     * delegate to it in the <code>service</code> method.
+     */
+    public void init(ServletConfig servletConfig) throws ServletException
+    {
+        super.init(servletConfig);
+
+        // allocate thread local variables
+        createThreadLocals();
+
+        // Set the servlet config as thread local
+        FlexContext.setThreadLocalObjects(null, null, null, null, null, servletConfig);
+
+        ServletLogTarget.setServletContext(servletConfig.getServletContext());
+
+        ClassLoader loader = getClassLoader();
+
+        if ("true".equals(servletConfig.getInitParameter("useContextClassLoader")))
+        {
+            loader = Thread.currentThread().getContextClassLoader();
+        }
+
+        // Should we wrap http request for later error logging?
+        log_errors = HTTPRequestLog.init(getServletContext());
+
+        // Start the broker
+        try
+        {
+            // Get the configuration manager
+            ConfigurationManager configManager = loadMessagingConfiguration(servletConfig);
+
+            // Load configuration
+            MessagingConfiguration config = configManager.getMessagingConfiguration(servletConfig);
+
+            // Set up logging system ahead of everything else.
+            config.createLogAndTargets();
+
+            // Create broker.
+            broker = config.createBroker(servletConfig.getInitParameter("messageBrokerId"), loader);
+
+            // Set the servlet config as thread local
+            FlexContext.setThreadLocalObjects(null, null, broker, null, null, servletConfig);
+
+            setupPathResolvers();
+
+            // Set initial servlet context on broker
+            broker.setServletContext(servletConfig.getServletContext());
+
+            Logger logger = Log.getLogger(ConfigurationManager.LOG_CATEGORY);
+            if (Log.isInfo())
+            {
+                logger.info(VersionInfo.buildMessage());
+            }
+
+            // Create endpoints, services, security, and logger on the broker based on configuration
+            config.configureBroker(broker);
+
+            long timeBeforeStartup = 0;
+            if (Log.isDebug())
+            {
+                timeBeforeStartup = System.currentTimeMillis();
+                Log.getLogger(LOG_CATEGORY_STARTUP_BROKER).debug("MessageBroker with id '{0}' is starting.",
+                        new Object[]{broker.getId()});
+            }
+
+            //initialize the httpSessionToFlexSessionMap
+            synchronized(HttpFlexSession.mapLock)
+            {
+                if (servletConfig.getServletContext().getAttribute(HttpFlexSession.SESSION_MAP) == null)
+                    servletConfig.getServletContext().setAttribute(HttpFlexSession.SESSION_MAP, new ConcurrentHashMap());
+            }
+
+            broker.start();
+
+            if (Log.isDebug())
+            {
+                long timeAfterStartup = System.currentTimeMillis();
+                Long diffMillis = timeAfterStartup - timeBeforeStartup;
+                Log.getLogger(LOG_CATEGORY_STARTUP_BROKER).debug("MessageBroker with id '{0}' is ready (startup time: '{1}' ms)",
+                        new Object[]{broker.getId(), diffMillis});
+            }
+
+            // Report replaced tokens
+            configManager.reportTokens();
+
+            // Report any unused properties.
+            config.reportUnusedProperties();
+
+            // Setup provider for FlexSessions that wrap underlying J2EE HttpSessions.
+            httpFlexSessionProvider = new HttpFlexSessionProvider();
+            broker.getFlexSessionManager().registerFlexSessionProvider(HttpFlexSession.class, httpFlexSessionProvider);
+
+            // clear the broker and servlet config as this thread is done
+            FlexContext.clearThreadLocalObjects();
+        }
+        catch (Throwable t)
+        {
+            // On any unhandled exception destroy the broker, log it and rethrow.
+            String applicationName = servletConfig.getServletContext().getServletContextName();
+            if (applicationName == null)
+                applicationName = STRING_UNDEFINED_APPLICATION;
+
+            System.err.println("**** MessageBrokerServlet in application '" + applicationName
+                    + "' failed to initialize due to runtime exception: "
+                    + ExceptionUtil.exceptionFollowedByRootCausesToString(t));
+            destroy();
+            // We used to throw  UnavailableException, but Weblogic didn't mark the webapp as failed. See bug FBR-237
+            throw new ServletException(t);
+        }
+    }
+
+    private void setupPathResolvers()
+    {
+        setupExternalPathResolver();
+        setupInternalPathResolver();
+    }
+
+    private void setupExternalPathResolver()
+    {
+        broker.setExternalPathResolver(
+                new MessageBroker.PathResolver()
+                {
+                    public InputStream resolve(String filename) throws FileNotFoundException
+                    {
+                        return new FileInputStream(new File(filename));
+                    }
+                }
+        );
+    }
+
+    private void setupInternalPathResolver()
+    {
+        broker.setInternalPathResolver(
+                new MessageBroker.InternalPathResolver()
+                {
+                    public InputStream resolve(String filename)
+                    {
+                        return getServletContext().getResourceAsStream(FLEXDIR + filename);
+                    }
+                }
+        );
+    }
+
+    private static ConfigurationManager loadMessagingConfiguration(ServletConfig servletConfig)
+    {
+        ConfigurationManager manager = null;
+        Class managerClass;
+        String className;
+
+        // Check for Custom Configuration Manager Specification
+        if (servletConfig != null)
+        {
+            String p = servletConfig.getInitParameter("services.configuration.manager");
+            if (p != null)
+            {
+                className = p.trim();
+                try
+                {
+                    managerClass = ClassUtil.createClass(className);
+                    manager = (ConfigurationManager)managerClass.newInstance();
+                }
+                catch (Throwable t)
+                {
+                    if (Trace.config) // Log is not initialized yet.
+                        Trace.trace("Could not load configuration manager as: " + className);
+                }
+            }
+        }
+
+        if (manager == null)
+        {
+            manager = new FlexConfigurationManager();
+        }
+
+        return manager;
+    }
+
+    /**
+     * Stops all endpoints in the MessageBroker, giving them a chance
+     * to perform any endpoint-specific clean up.
+     */
+    public void destroy()
+    {
+        if (broker != null)
+        {
+            broker.stop();
+            if (broker.isManaged())
+            {
+                MBeanLifecycleManager.unregisterRuntimeMBeans(broker);
+            }
+            // release static thread locals
+            destroyThreadLocals();
+        }
+    }
+
+    /**
+     * Handle an incoming request, and delegate to an endpoint based on
+     * content type, if appropriate. The content type mappings for endpoints
+     * are not externally configurable, and currently the AmfEndpoint
+     * is the only delegate.
+     */
+    public void service(HttpServletRequest req, HttpServletResponse res)
+    {
+        if (log_errors)
+        {
+            // Create a wrapper for the request object so we can save the body content
+            LoggingHttpServletRequestWrapper wrapper = new LoggingHttpServletRequestWrapper(req);
+            req = wrapper;
+
+            try
+            {
+                // Read the body content
+                wrapper.doReadBody();
+            }
+            catch (IOException ignore)
+            {
+                // ignore, the wrapper will preserve what content we were able to read.
+            }
+        }
+
+        try
+        {
+            // Update thread locals
+            broker.initThreadLocals();
+            // Set this first so it is in place for the session creation event.  The
+            // current session is set by the FlexSession stuff right when it is available.
+            // The threadlocal FlexClient is set up during message deserialization in the
+            // MessageBrokerFilter.
+            FlexContext.setThreadLocalObjects(null, null, broker, req, res, getServletConfig());
+
+            HttpFlexSession fs = httpFlexSessionProvider.getOrCreateSession(req);
+            Principal principal;
+            if(FlexContext.isPerClientAuthentication())
+            {
+                principal = FlexContext.getUserPrincipal();
+            }
+            else
+            {
+                principal = fs.getUserPrincipal();
+            }
+
+            if (principal == null && req.getHeader("Authorization") != null)
+            {
+                String encoded = req.getHeader("Authorization");
+                if (encoded.indexOf("Basic") > -1)
+                {
+                    encoded = encoded.substring(6); //Basic.length()+1
+                    try
+                    {
+                        ((AuthenticationService)broker.getService(AuthenticationService.ID)).decodeAndLogin(encoded, broker.getLoginManager());
+                    }
+                    catch (Exception e)
+                    {
+                        if (Log.isDebug())
+                            Log.getLogger(LogCategories.SECURITY).info("Authentication service could not decode and login: " + e.getMessage());
+                    }
+                }
+            }
+
+            String contextPath = req.getContextPath();
+            String pathInfo = req.getPathInfo();
+            String endpointPath = req.getServletPath();
+            if (pathInfo != null)
+                endpointPath = endpointPath + pathInfo;
+
+            Endpoint endpoint;
+            try
+            {
+                endpoint = broker.getEndpoint(endpointPath, contextPath);
+            }
+            catch (MessageException me)
+            {
+                if (Log.isInfo())
+                    Log.getLogger(LogCategories.ENDPOINT_GENERAL).info("Received invalid request for endpoint path '{0}'.", new Object[] {endpointPath});
+
+                if (!res.isCommitted())
+                {
+                    try
+                    {
+                        res.sendError(HttpServletResponse.SC_NOT_FOUND);
+                    }
+                    catch (IOException ignore)
+                    {}
+                }
+
+                return;
+            }
+
+            try
+            {
+                if (Log.isInfo())
+                {
+                    Log.getLogger(LogCategories.ENDPOINT_GENERAL).info("Channel endpoint {0} received request.",
+                                                                       new Object[] {endpoint.getId()});
+                }
+                endpoint.service(req, res);
+            }
+            catch (UnsupportedOperationException ue)
+            {
+                if (Log.isInfo())
+                {
+                    Log.getLogger(LogCategories.ENDPOINT_GENERAL).info("Channel endpoint {0} received request for an unsupported operation.",
+                                                                       new Object[] {endpoint.getId()},
+                                                                       ue);
+                }
+
+                if (!res.isCommitted())
+                {
+                    try
+                    {
+                        res.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+                    }
+                    catch (IOException ignore)
+                    {}
+                }
+            }
+        }
+        catch (Throwable t)
+        {
+            // Final resort catch block as recommended by Fortify as a potential System info leak
+            try
+            {
+                Log.getLogger(LogCategories.ENDPOINT_GENERAL).error("Unexpected error encountered in Message Broker servlet", t);
+                res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+            }
+            catch (IOException ignore)
+            {
+                // ignore
+            }
+
+        }
+        finally
+        {
+            if (log_errors)
+            {
+                String info = (String) req.getAttribute(HTTPRequestLog.HTTP_ERROR_INFO);
+                if (info != null)
+                {
+                    // Log the HttpRequest data
+                    System.out.println("Exception occurred while processing HTTP request: " + info + ", request details logged in " + HTTPRequestLog.getFileName());
+                    HTTPRequestLog.outputRequest(info, req);
+                }
+            }
+
+            FlexContext.clearThreadLocalObjects();
+        }
+    }
+
+    /**
+     * Hook for subclasses to override the class loader to use for loading user defined classes.
+     *
+     * @return the class loader for this class
+     */
+    protected ClassLoader getClassLoader()
+    {
+        return this.getClass().getClassLoader();
+    }
+
+    /** @exclude */
+    // Call ONLY on servlet startup
+    public static void createThreadLocals()
+    {
+        // allocate static thread local objects
+        FlexContext.createThreadLocalObjects();
+        SerializationContext.createThreadLocalObjects();
+        TypeMarshallingContext.createThreadLocalObjects();
+    }
+
+    /** @exclude */
+    // Call ONLY on servlet shutdown
+    protected static void destroyThreadLocals()
+    {
+        // clear static member variables
+        Log.clear();
+        MBeanServerLocatorFactory.clear();
+
+        // Destroy static thread local objects
+        FlexContext.releaseThreadLocalObjects();
+        SerializationContext.releaseThreadLocalObjects();
+        TypeMarshallingContext.releaseThreadLocalObjects();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/MessageClient.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/MessageClient.java b/modules/core/src/flex/messaging/MessageClient.java
new file mode 100755
index 0000000..e9c8ccc
--- /dev/null
+++ b/modules/core/src/flex/messaging/MessageClient.java
@@ -0,0 +1,1144 @@
+/*
+ * 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.messaging;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CopyOnWriteArraySet;
+
+import flex.messaging.client.FlexClient;
+import flex.messaging.client.FlexClientOutboundQueueProcessor;
+import flex.messaging.client.OutboundQueueThrottleManager;
+import flex.messaging.config.ThrottleSettings;
+import flex.messaging.config.ThrottleSettings.Policy;
+import flex.messaging.log.LogCategories;
+import flex.messaging.log.Log;
+import flex.messaging.messages.AsyncMessage;
+import flex.messaging.messages.CommandMessage;
+import flex.messaging.messages.Message;
+import flex.messaging.services.MessageService;
+import flex.messaging.services.messaging.Subtopic;
+import flex.messaging.services.messaging.selector.JMSSelector;
+import flex.messaging.services.messaging.selector.JMSSelectorException;
+import flex.messaging.util.ExceptionUtil;
+import flex.messaging.util.TimeoutAbstractObject;
+import flex.messaging.util.StringUtils;
+
+/**
+ * Represents a client-side MessageAgent instance.
+ * Currently a server-side MessageClient is only created if its client-side counterpart has subscribed
+ * to a destination for pushed data (e.g. Consumer). Client-side Producers do not result in the creation of
+ * corresponding server-side MessageClient instances.
+ *
+ * Client-side MessageAgents communicate with the server over a Channel that corresponds to a FlexSession.
+ * Server-side MessageClient instances are always created in the context of a FlexSession and when the FlexSession
+ * is invalidated any associated MessageClients are invalidated as well.
+ *
+ * MessageClients may also be timed out on a per-destination basis and this is based on subscription inactivity.
+ * If no messages are pushed to the MessageClient within the destination's subscription timeout period the
+ * MessageClient will be shutdown even if the associated FlexSession is still active and connected.
+ * Per-destination subscription timeout is an optional configuration setting, and should only be used when inactive
+ * subscriptions should be shut down opportunistically to preserve server resources.
+ */
+public class MessageClient extends TimeoutAbstractObject implements Serializable
+{
+    //--------------------------------------------------------------------------
+    //
+    // Public Static Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Log category for MessageClient related messages.
+     */
+    public static final String MESSAGE_CLIENT_LOG_CATEGORY = LogCategories.CLIENT_MESSAGECLIENT;
+
+    //--------------------------------------------------------------------------
+    //
+    // Static Constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Serializable to support broadcasting subscription state across the cluster for
+     * optimized message routing.
+     */
+    static final long serialVersionUID = 3730240451524954453L;
+
+    //--------------------------------------------------------------------------
+    //
+    // Static Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * The list of MessageClient created listeners.
+     */
+    private static final CopyOnWriteArrayList<MessageClientListener> createdListeners = new CopyOnWriteArrayList<MessageClientListener>();
+
+    //--------------------------------------------------------------------------
+    //
+    // Static Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Adds a MessageClient created listener.
+     *
+     * @see flex.messaging.MessageClientListener
+     *
+     * @param listener The listener to add.
+     */
+    public static void addMessageClientCreatedListener(MessageClientListener listener)
+    {
+        if (listener != null)
+            createdListeners.addIfAbsent(listener);
+    }
+
+    /**
+     * Removes a MessageClient created listener.
+     *
+     * @see flex.messaging.MessageClientListener
+     *
+     * @param listener The listener to remove.
+     */
+    public static void removeMessageClientCreatedListener(MessageClientListener listener)
+    {
+        if (listener != null)
+            createdListeners.remove(listener);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Private Static Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Utility method.
+     */
+    private static boolean equalStrings(String a, String b)
+    {
+        return a == b || (a != null && a.equals(b));
+    }
+
+    /**
+     * Utility method.
+     */
+    static int compareStrings(String a, String b)
+    {
+        if (a == b)
+            return 0;
+
+        if (a != null && b != null)
+            return a.compareTo(b);
+
+        if (a == null)
+            return -1;
+
+        return 1;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @exclude
+     * Constructs a new MessageClient for local use.
+     *
+     * @param clientId The clientId for the MessageClient.
+     * @param destination The destination the MessageClient is subscribed to.
+     * @param endpointId The Id of the endpoint this MessageClient subscription was created over.
+     */
+    public MessageClient(Object clientId, Destination destination, String endpointId)
+    {
+        this(clientId, destination, endpointId, true);
+    }
+
+    /**
+     * @exclude
+     * Constructs a new MessageClient.
+     *
+     * @param clientId The clientId for the MessageClient.
+     * @param destination The destination the MessageClient is subscribed to.
+     * @param endpointId The Id of the endpoint this MessageClient subscription was created over.
+     * @param useSession RemoteMessageClient instances should not be associated with a FlexSession (pass false).
+     */
+    public MessageClient(Object clientId, Destination destination, String endpointId, boolean useSession)
+    {
+        valid = true;
+        this.clientId = clientId;
+        this.destination = destination;
+        this.endpointId = endpointId;
+        destinationId = destination.getId();
+        updateLastUse(); // Initialize last use timestamp to construct time.
+
+        /* If this is for a remote server, we do not associate with the session. */
+        if (useSession)
+        {
+            flexSession = FlexContext.getFlexSession();
+            flexSession.registerMessageClient(this);
+
+            flexClient = FlexContext.getFlexClient();
+            flexClient.registerMessageClient(this);
+
+            // SubscriptionManager will notify the created listeners, once
+            // subscription state is setup completely.
+            // notifyCreatedListeners();
+        }
+        else
+        {
+            flexClient = null;
+            flexSession = null;
+            // Use an instance level lock.
+            lock = new Object();
+            // On a remote server we don't notify created listeners.
+        }
+
+        if (Log.isDebug())
+            Log.getLogger(MESSAGE_CLIENT_LOG_CATEGORY).debug("MessageClient created with clientId '" + this.clientId + "' for destination '" + destinationId + "'.");
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  This flag is set to true when the client channel that this subscription was
+     *  established over is disconnected.
+     *  It supports cleaning up per-endpoint outbound queues maintained by the FlexClient.
+     *  If the client notifies the server that its channel is disconnecting, the FlexClient
+     *  does not need to maintain an outbound queue containing a subscription invalidation
+     *  message for this MessageClient to send to the client.
+     */
+    private volatile boolean clientChannelDisconnected;
+
+    /**
+     *  The clientId for the MessageClient.
+     *  This value is specified by the client directly or is autogenerated on the client.
+     */
+    protected final Object clientId;
+
+    /**
+     * Internal reference to the associated Destination; don't expose this in the public API.
+     */
+    protected final Destination destination;
+
+    /**
+     *  The destination the MessageClient is subscribed to.
+     */
+    protected final String destinationId;
+
+    /**
+     * The set of session destroy listeners to notify when the session is destroyed.
+     */
+    private transient volatile CopyOnWriteArrayList destroyedListeners;
+
+    /**
+     * The Id for the endpoint this MessageClient subscription was created over.
+     */
+    private String endpointId;
+
+    /**
+     * The FlexClient associated with the MessageClient.
+     */
+    private final transient FlexClient flexClient;
+
+    /**
+     * The FlexSession associated with the MessageClient.
+     * Not final because this needs to be reset if the subscription fails over to a new endpoint.
+     */
+    private transient FlexSession flexSession;
+
+    /**
+     * Flag used to break cycles during invalidation.
+     */
+    private boolean invalidating;
+
+    /**
+     * The lock to use to guard all state changes for the MessageClient.
+     */
+    protected Object lock = new Object();
+
+    /**
+     * Flag indicating whether the MessageClient is attempting to notify the remote client of
+     * its invalidation.
+     */
+    private volatile boolean attemptingInvalidationClientNotification;
+
+    /**
+     * A counter used to control invalidation for a MessageClient that has multiple
+     * subscriptions to its destination.
+     * Unsubscribing from one will not invalidate the MessageClient as long as other
+     * subscriptions remain active.
+     */
+    private transient int numReferences;
+
+    /**
+     * A set of all of the subscriptions managed by this message client.
+     */
+    protected final Set<SubscriptionInfo> subscriptions = new CopyOnWriteArraySet<SubscriptionInfo>();
+
+    /**
+     * Flag indicating whether this client is valid or not.
+     */
+    protected boolean valid;
+
+    /**
+     * Flag that indicates whether the MessageClient has a per-destination subscription timeout.
+     * If false, the MessageClient will remain valid until its associated FlexSession is invalidated.
+     */
+    private volatile boolean willTimeout;
+
+    /**
+     * Has anyone explicitly registered this message client.  This indicates that
+     * there is a reference to this MessageClient which is not an explicit subscription.
+     * This is a hook for FDMS and other adapters which want to use pushMessageToClients
+     * with clientIds but that do not want the subscription manager to manage subscriptions
+     * for them.
+     */
+    private volatile boolean registered = false;
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Returns the clientId for the MessageClient.
+     *
+     * @return The clientId for the MessageClient.
+     */
+    public Object getClientId()
+    {
+        return clientId; // Field is final; no need to sync.
+    }
+
+    /**
+     * Returns the destination the MessageClient is subscribed to.
+     *
+     * @return The destination the MessageClient is subscribed to.
+     */
+    public Destination getDestination()
+    {
+        return destination; // Field is final; no need to sync.
+    }
+
+    /**
+     * Returns the id of the destination the MessageClient is subscribed to.
+     *
+     * @return The id of the destination the MessageClient is subscribed to.
+     */
+    public String getDestinationId()
+    {
+        return destinationId; // Field is final; no need to sync.
+    }
+
+    /**
+     * Returns the Id for the endpoint the MessageClient subscription was created over.
+     *
+     * @return The Id for the endpoint the MessageClient subscription was created over.
+     */
+    public String getEndpointId()
+    {
+        return endpointId; // Field is final; no need to sync.
+    }
+
+    /**
+     * Returns the FlexClient associated with this MessageClient.
+     *
+     * @return The FlexClient assocaited with this MessageClient.
+     */
+    public FlexClient getFlexClient()
+    {
+        return flexClient; // Field is final; no need to sync.
+    }
+
+    /**
+     * Returns the FlexSession associated with this MessageClient.
+     *
+     * @return The FlexSession associated with this MessageClient.
+     */
+    public FlexSession getFlexSession()
+    {
+        synchronized (lock)
+        {
+            return flexSession;
+        }
+    }
+
+    /**
+     * Returns the number of subscriptions associated with this MessageClient.
+     *
+     * @return The number of subscriptions associated with this MessageClient.
+     */
+    public int getSubscriptionCount()
+    {
+        int count;
+
+        synchronized (lock)
+        {
+            count = subscriptions != null? subscriptions.size() : 0;
+        }
+
+        return count;
+    }
+
+    /**
+     * @exclude
+     * This is used for FlexClient outbound queue management. When a MessageClient is invalidated
+     * if it is attempting to notify the client, then we must leave the outbound queue containing
+     * the notification in place. Otherwise, any messages queued for the subscription may be
+     * removed from the queue and possibly shut down immediately.
+     */
+    public boolean isAttemptingInvalidationClientNotification()
+    {
+        return attemptingInvalidationClientNotification;
+    }
+
+    /**
+     * @exclude
+     * This is set to true when the MessageClient is invalidated due to the client
+     * channel the subscription was established over disconnecting.
+     * It allows the FlexClient class to cleanup the outbound queue for the channel's
+     * corresponding server endpoint for the remote client, because we know that no
+     * currently queued messages need to be retained for delivery.
+     */
+    public void setClientChannelDisconnected(boolean value)
+    {
+        clientChannelDisconnected = value;
+    }
+
+    /**
+     * @exclude
+     */
+    public boolean isClientChannelDisconnected()
+    {
+        return clientChannelDisconnected;
+    }
+
+    /**
+     * @exclude
+     * This is true when some code other than the SubscriptionManager
+     * is maintaining subscriptions for this message client.  It ensures
+     * that we have this MessageClient kept around until the session
+     * expires.
+     */
+    public void setRegistered(boolean reg)
+    {
+        registered = reg;
+    }
+
+    /**
+     * @exclude
+     */
+    public boolean isRegistered()
+    {
+        return registered;
+    }
+
+    /**
+     * Adds a MessageClient destroy listener.
+     *
+     * @see flex.messaging.MessageClientListener
+     *
+     * @param listener The listener to add.
+     */
+    public void addMessageClientDestroyedListener(MessageClientListener listener)
+    {
+        if (listener != null)
+        {
+            checkValid();
+
+            if (destroyedListeners == null)
+            {
+                synchronized (lock)
+                {
+                    if (destroyedListeners == null)
+                        destroyedListeners = new CopyOnWriteArrayList();
+                }
+            }
+
+            destroyedListeners.addIfAbsent(listener);
+        }
+    }
+
+    /**
+     * Removes a MessageClient destroyed listener.
+     *
+     * @see flex.messaging.MessageClientListener
+     *
+     * @param listener The listener to remove.
+     */
+    public void removeMessageClientDestroyedListener(MessageClientListener listener)
+    {
+        // No need to check validity; removing a listener is always ok.
+        if (listener != null && destroyedListeners != null)
+            destroyedListeners.remove(listener);
+    }
+
+    /**
+     * @exclude
+     * Adds a subscription to the subscription set for this MessageClient.
+     *
+     * @param selector The selector expression used for the subscription.
+     * @param subtopic The subtopic used for the subscription.
+     * @param maxFrequency The maximum number of messages the client wants to
+     * receive per second (0 disables this limit).
+     */
+    public void addSubscription(String selector, String subtopic, int maxFrequency)
+    {
+        synchronized (lock)
+        {
+            checkValid();
+
+            incrementReferences();
+
+            // Create and add the subscription to the subscriptions set.
+            SubscriptionInfo si = new SubscriptionInfo(selector, subtopic, maxFrequency);
+            subscriptions.add(si);
+
+            registerSubscriptionWithThrottleManager(si);
+        }
+    }
+
+    /**
+     * @exclude
+     * Registers  the subscription with the outbound queue processor's throttle
+     * manager, if one exists.
+     *
+     * @param si The subscription info object.
+     */
+    public void registerSubscriptionWithThrottleManager(SubscriptionInfo si)
+    {
+        // Register the destination that will setup client level outbound throttling.
+        ThrottleSettings ts = destination.getNetworkSettings().getThrottleSettings();
+        if (ts.getOutboundPolicy() != Policy.NONE && (ts.isOutboundClientThrottleEnabled() || si.maxFrequency > 0))
+        {
+            // Setup the client level outbound throttling, and register the destination
+            // only if the policy is not NONE, and a throttling limit is specified
+            // either at the destination or by consumer.
+            OutboundQueueThrottleManager throttleManager = getThrottleManager(true);
+            if (throttleManager != null)
+                throttleManager.registerDestination(destinationId, ts.getOutgoingClientFrequency(), ts.getOutboundPolicy());
+        }
+        else if (si.maxFrequency > 0) // Let the client know that maxFrequency will be ignored.
+        {
+            if (Log.isWarn())
+                Log.getLogger(MESSAGE_CLIENT_LOG_CATEGORY).warn("MessageClient with clientId '"
+                        + clientId + "' for destination '" + destinationId
+                        + "' specified a maxFrequency value of '" + si.maxFrequency
+                        + "' but the destination does not define a throttling policy. This value will be ignored.");
+        }
+
+        // Now, register the subscription.
+        OutboundQueueThrottleManager throttleManager = getThrottleManager(false);
+        if (throttleManager != null)
+            throttleManager.registerSubscription(destinationId, si);
+    }
+
+    /**
+     * @exclude
+     * Removes a subscription from the subscription set for this MessageClient.
+     *
+     * @param selector The selector expression for the subscription.
+     * @param subtopic The subtopic for the subscription.
+     * @return true if no subscriptions remain for this MessageClient; otherwise false.
+     */
+    public boolean removeSubscription(String selector, String subtopic)
+    {
+        synchronized (lock)
+        {
+            SubscriptionInfo si = new SubscriptionInfo(selector, subtopic);
+            if (subscriptions.remove(si))
+            {
+                unregisterSubscriptionWithThrottleManager(si);
+                return decrementReferences();
+            }
+            else if (Log.isError())
+            {
+                Log.getLogger(MessageService.LOG_CATEGORY).error("Error - unable to find subscription to remove for MessageClient: "
+                        + clientId + " selector: " + selector + " subtopic: " + subtopic);
+            }
+            return numReferences == 0;
+        }
+    }
+
+    /**
+     * @exclude
+     * We use the same MessageClient for more than one subscription with different
+     * selection criteria.  This tracks the number of subscriptions that are active
+     * so that we know when we are finished.
+     */
+    public void incrementReferences()
+    {
+        synchronized (lock)
+        {
+            numReferences++;
+        }
+    }
+
+    /**
+     * @exclude
+     * Decrements the numReferences variable and returns true if this was the last reference.
+     */
+    public boolean decrementReferences()
+    {
+        synchronized (lock)
+        {
+            if (--numReferences == 0)
+            {
+                cancelTimeout();
+                if (destination instanceof MessageDestination)
+                {
+                    MessageDestination msgDestination = (MessageDestination)destination;
+                    if (msgDestination.getThrottleManager() != null)
+                        msgDestination.getThrottleManager().removeClientThrottleMark(clientId);
+                }
+                return true;
+            }
+            return false;
+        }
+    }
+
+    /**
+     * @exclude
+     * Invoked by SubscriptionManager once the subscription state is setup completely
+     * for the MessageClient..
+     */
+    public void notifyCreatedListeners()
+    {
+        // Notify MessageClient created listeners.
+        if (!createdListeners.isEmpty())
+        {
+            // CopyOnWriteArrayList is iteration-safe from ConcurrentModificationExceptions.
+            for (Iterator iter = createdListeners.iterator(); iter.hasNext();)
+                ((MessageClientListener)iter.next()).messageClientCreated(this);
+        }
+    }
+
+    /**
+     * @exclude
+     * Invoked by SubscriptionManager while handling a subscribe request.
+     * If the request is updating an existing subscription the 'push' state in the associated FlexClient
+     * may need to be updated to ensure that the correct endpoint is used for this subscription.
+     *
+     * @param newEndpointId The id for the new endpoint that the subscription may have failed over to.
+     */
+    public void resetEndpoint(String newEndpointId)
+    {
+        String oldEndpointId = null;
+        FlexSession oldSession = null;
+        FlexSession newSession = FlexContext.getFlexSession();
+        synchronized (lock)
+        {
+            // If anything is null, or nothing has changed, no need for a reset.
+            if (endpointId == null || newEndpointId == null || flexSession == null || newSession == null || (endpointId.equals(newEndpointId) && flexSession.equals(newSession)))
+                return;
+
+            oldEndpointId = endpointId;
+            endpointId = newEndpointId;
+
+            oldSession = flexSession;
+            flexSession = newSession;
+        }
+
+        // Unregister in order to reset the proper push settings in the re-registration below once the session association has been patched.
+        if (flexClient != null)
+            flexClient.unregisterMessageClient(this);
+
+        // Clear out any reference to this subscription that the previously associated session has.
+        if (oldSession != null)
+            oldSession.unregisterMessageClient(this);
+
+        // Associate the current session with this subscription.
+        if (flexSession != null)
+            flexSession.registerMessageClient(this);
+
+        // Reset proper push settings.
+        if (flexClient != null)
+            flexClient.registerMessageClient(this);
+
+        if (Log.isDebug())
+        {
+            String msg = "MessageClient with clientId '" + clientId + "' for destination '" + destinationId + "' has been reset as a result of a resubscribe.";
+            if (oldEndpointId != null && !oldEndpointId.equals(newEndpointId))
+                msg += " Endpoint change [" + oldEndpointId + " -> " + newEndpointId + "]";
+            if ((oldSession != null) && (newSession != null) && (oldSession != newSession)) // Test identity.
+                msg += " FlexSession change [" + oldSession.getClass().getName() + ":" + oldSession.getId() + " -> " + newSession.getClass().getName() + ":" + newSession.getId() + "]";
+
+            Log.getLogger(MESSAGE_CLIENT_LOG_CATEGORY).debug(msg);
+        }
+    }
+
+    /**
+     * @exclude
+     * Used to test whether this client should receive this message
+     * based on the list of subscriptions we have recorded for it.
+     * It must match both the subtopic and the selector expression.
+     * Usually this is done by the subscription manager - this logic is
+     * only here to maintain api compatibility with one of the variants
+     * of the pushMessageToClients which has subscriberIds and an evalSelector
+     * property.
+     *
+     * @param message The message to test.
+     */
+    public boolean testMessage(Message message, MessageDestination destination)
+    {
+        String subtopic = (String) message.getHeader(AsyncMessage.SUBTOPIC_HEADER_NAME);
+        String subtopicSeparator = destination.getServerSettings().getSubtopicSeparator();
+        synchronized (lock)
+        {
+            for (SubscriptionInfo si : subscriptions)
+            {
+                if (si.matches(message, subtopic, subtopicSeparator))
+                    return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Returns true if the MessageClient is valid; false if it has been invalidated.
+     *
+     * @return true if the MessageClient is valid; otherwise false.
+     */
+    public boolean isValid()
+    {
+        synchronized (lock)
+        {
+            return valid;
+        }
+    }
+    
+    /**
+     * Invalidates the MessageClient.
+     */
+    public void invalidate()
+    {
+        invalidate(false /* don't attempt to notify the client */);
+    }
+
+    /**
+     * Invalidates the MessageClient, and optionally attempts to notify the client that
+     * this subscription has been invalidated.
+     * This overload is used when a subscription is timed out while the client is still
+     * actively connected to the server but should also be used by any custom code on the server
+     * that invalidates MessageClients but wishes to notify the client cleanly.
+     *
+     * @param notifyClient <code>true</code> to notify the client that its subscription has been
+     *                     invalidated.
+     */
+    public void invalidate(boolean notifyClient)
+    {
+        synchronized (lock)
+        {
+            if (!valid || invalidating)
+                return; // Already shutting down.
+
+            invalidating = true; // This thread gets to shut the MessageClient down.
+            cancelTimeout();
+        }
+
+        // Record whether we're attempting to notify the client or not.
+        attemptingInvalidationClientNotification = notifyClient;
+
+        // Build a subscription invalidation message and push to the client if it is still valid.
+        if (notifyClient && flexClient != null && flexClient.isValid())
+        {
+            CommandMessage msg = new CommandMessage();
+            msg.setDestination(destination.getId());
+            msg.setClientId(clientId);
+            msg.setOperation(CommandMessage.SUBSCRIPTION_INVALIDATE_OPERATION);
+            Set subscriberIds = new TreeSet();
+            subscriberIds.add(clientId);
+            try
+            {
+                if (destination instanceof MessageDestination)
+                {
+                    MessageDestination msgDestination = (MessageDestination)destination;
+                    ((MessageService)msgDestination.getService()).pushMessageToClients(msgDestination, subscriberIds, msg, false /* don't eval selector */);
+                }
+            }
+            catch (MessageException ignore) {}
+        }
+
+        // Notify messageClientDestroyed listeners that we're being invalidated.
+        if (destroyedListeners != null && !destroyedListeners.isEmpty())
+        {
+            for (Iterator iter = destroyedListeners.iterator(); iter.hasNext();)
+            {
+                ((MessageClientListener)iter.next()).messageClientDestroyed(this);
+            }
+            destroyedListeners.clear();
+        }
+
+        // And generate unsubscribe messages for all of the MessageClient's subscriptions and
+        // route them to the destination this MessageClient is subscribed to.
+        // The reason we send a message to the service rather than just going straight to the SubscriptionManager
+        // is that some adapters manage their own subscription state (i.e. JMS) in addition to us keeping track of
+        // things with our SubscriptionManager.
+        ArrayList<CommandMessage> unsubMessages = new ArrayList<CommandMessage>();
+        synchronized (lock)
+        {
+            for (SubscriptionInfo subInfo : subscriptions)
+            {
+                CommandMessage unsubMessage = new CommandMessage();
+                unsubMessage.setDestination(destination.getId());
+                unsubMessage.setClientId(clientId);
+                unsubMessage.setOperation(CommandMessage.UNSUBSCRIBE_OPERATION);
+                unsubMessage.setHeader(CommandMessage.SUBSCRIPTION_INVALIDATED_HEADER, Boolean.TRUE);
+                unsubMessage.setHeader(CommandMessage.SELECTOR_HEADER, subInfo.selector);
+                unsubMessage.setHeader(AsyncMessage.SUBTOPIC_HEADER_NAME, subInfo.subtopic);
+                unsubMessages.add(unsubMessage);
+            }
+        }
+        // Release the lock and send the unsub messages.
+        for (CommandMessage unsubMessage : unsubMessages)
+        {
+            try
+            {
+                destination.getService().serviceCommand(unsubMessage);
+            }
+            catch (MessageException me)
+            {
+                if (Log.isDebug())
+                    Log.getLogger(MESSAGE_CLIENT_LOG_CATEGORY).debug("MessageClient: " + getClientId() + " issued an unsubscribe message during invalidation that was not processed but will continue with invalidation. Reason: " + ExceptionUtil.toString(me));
+            }
+        }
+
+        synchronized (lock)
+        {
+            // If we didn't clean up all subscriptions log an error and continue with shutdown.
+            int remainingSubscriptionCount = subscriptions.size();
+            if (remainingSubscriptionCount > 0 && Log.isError())
+                Log.getLogger(MESSAGE_CLIENT_LOG_CATEGORY).error("MessageClient: " + getClientId() + " failed to remove " + remainingSubscriptionCount + " subscription(s) during invalidation");
+        }
+
+        // If someone registered this message client, invalidating it will free
+        // their reference which will typically also remove this message client.
+        if (registered && destination instanceof MessageDestination)
+            ((MessageDestination)destination).getSubscriptionManager().releaseMessageClient(this);
+
+        synchronized (lock)
+        {
+            valid = false;
+            invalidating = false;
+        }
+
+        if (Log.isDebug())
+            Log.getLogger(MESSAGE_CLIENT_LOG_CATEGORY).debug("MessageClient with clientId '" + clientId + "' for destination '" + destinationId + "' has been invalidated.");
+    }
+
+    /**
+     * Pushes the supplied message and then invalidates the MessageClient.
+     *
+     * @param message The message to push to the client before invalidating.
+     * When message is null, MessageClient is invalidated silently.
+     */
+    public void invalidate(Message message)
+    {
+        if (message != null)
+        {
+            message.setDestination(destination.getId());
+            message.setClientId(clientId);
+
+            Set subscriberIds = new TreeSet();
+            subscriberIds.add(clientId);
+            try
+            {
+                if (destination instanceof MessageDestination)
+                {
+                    MessageDestination msgDestination = (MessageDestination)destination;
+                    ((MessageService)msgDestination.getService()).pushMessageToClients(msgDestination, subscriberIds, message, false /* don't eval selector */);
+                }
+            }
+            catch (MessageException ignore) {}
+
+            invalidate(true /* attempt to notify remote client */);
+        }
+        else
+        {
+            invalidate();
+        }
+    }
+
+    /**
+     * @exclude
+     * Compares this MessageClient to the specified object. The result is true if
+     * the argument is not null and is a MessageClient instance with a matching
+     * clientId value.
+     *
+     * @param o The object to compare this MessageClient to.
+     * @return true if the MessageClient is equal; otherwise false.
+     */
+    public boolean equals(Object o)
+    {
+        if (o instanceof MessageClient)
+        {
+            MessageClient c = (MessageClient) o;
+            if (c != null && c.getClientId().equals(clientId))
+                return true;
+        }
+        return false;
+    }
+
+    /**
+     * @exclude
+     * Returns the hash code for this MessageClient. The returned value is
+     * the hash code for the MessageClient's clientId property.
+     *
+     * @return The hash code value for this MessageClient.
+     */
+    @Override
+    public int hashCode()
+    {
+        return getClientId().hashCode();
+    }
+
+    /**
+     * @exclude
+     * The String representation of this MessageClient is returned (its clientId value).
+     *
+     * @return The clientId value for this MessageClient.
+     */
+    @Override
+    public String toString()
+    {
+        return String.valueOf(clientId);
+    }
+
+    //----------------------------------
+    //  TimeoutAbstractObject overrides
+    //----------------------------------
+
+    /**
+     * @exclude
+     * Implements TimeoutCapable.
+     * This method returns the timeout value configured for the MessageClient's destination.
+     */
+    @Override
+    public long getTimeoutPeriod()
+    {
+        return (destination instanceof MessageDestination) ? 
+                ((MessageDestination)destination).getSubscriptionManager().getSubscriptionTimeoutMillis() : 0;
+    }
+
+    /**
+     * @exclude
+     * Implements TimeoutCapable.
+     * This method is invoked when the MessageClient has timed out and it
+     * invalidates the MessageClient.
+     */
+    public void timeout()
+    {
+        invalidate(true /* notify client */);
+    }
+
+    /**
+     * @exclude
+     * Returns true if a timeout task is running for this MessageClient.
+     */
+    public boolean isTimingOut()
+    {
+        return willTimeout;
+    }
+
+    /**
+     * @exclude
+     * Records whether a timeout task is running for this MessageClient.
+     */
+    public void setTimingOut(boolean value)
+    {
+        willTimeout = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Utility method that tests validity and throws an exception if the instance
+     * has been invalidated.
+     */
+    private void checkValid()
+    {
+        synchronized (lock)
+        {
+            if (!valid)
+            {
+                throw new RuntimeException("MessageClient has been invalidated."); // TODO - localize
+            }
+        }
+    }
+
+    private OutboundQueueThrottleManager getThrottleManager(boolean create)
+    {
+        if (flexClient != null)
+        {
+            FlexClientOutboundQueueProcessor processor = flexClient.getOutboundQueueProcessor(endpointId);
+            if (processor != null)
+                return create? processor.getOrCreateOutboundQueueThrottleManager() : processor.getOutboundQueueThrottleManager();
+        }
+        return null;
+    }
+
+    private void unregisterSubscriptionWithThrottleManager(SubscriptionInfo si)
+    {
+        OutboundQueueThrottleManager throttleManager = getThrottleManager(false);
+        if (throttleManager != null)
+            throttleManager.unregisterSubscription(destinationId, si);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Nested Classes
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Represents a MessageClient's subscription to a destination.
+     * It captures the optional selector expression and subtopic for the
+     * subscription.
+     */
+    public static class SubscriptionInfo implements Comparable
+    {
+        public String selector, subtopic;
+        public int maxFrequency; // maxFrequency per subscription. Not used in BlazeDS.
+
+        public SubscriptionInfo(String sel, String sub)
+        {
+            this(sel, sub, 0);
+        }
+
+        public SubscriptionInfo(String sel, String sub, int maxFrequency)
+        {
+            this.selector = sel;
+            this.subtopic = sub;
+            this.maxFrequency = maxFrequency;
+        }
+
+        @Override
+        public boolean equals(Object o)
+        {
+            if (o instanceof SubscriptionInfo)
+            {
+                SubscriptionInfo other = (SubscriptionInfo) o;
+                return equalStrings(other.selector, selector) &&
+                       equalStrings(other.subtopic, subtopic);
+            }
+            return false;
+        }
+
+        @Override
+        public int hashCode()
+        {
+            return (selector == null ? 0 : selector.hashCode()) +
+                   (subtopic == null ? 1 : subtopic.hashCode());
+        }
+
+        /**
+         * Compares the two subscription infos (being careful to
+         * ensure we compare in a consistent way if the arguments
+         * are switched).
+         * @param o the object to compare
+         * @return int the compare result
+         */
+        public int compareTo(Object o)
+        {
+            SubscriptionInfo other = (SubscriptionInfo) o;
+            int result;
+
+            if ((result = compareStrings(other.selector, selector)) != 0)
+                return result;
+            else if ((result = compareStrings(other.subtopic, subtopic)) != 0)
+                return result;
+
+            return 0;
+        }
+
+        /**
+         * Check whether the message matches with selected subtopic.
+         * @param message current message
+         * @param subtopicToMatch subtopc string
+         * @param subtopicSeparator suptopic separator 
+         * @return true if the message matches the subtopic
+         */
+        public boolean matches(Message message, String subtopicToMatch, String subtopicSeparator)
+        {
+            if ((subtopicToMatch == null && subtopic != null) || (subtopicToMatch != null && subtopic == null))
+                return false; // If either defines a subtopic, they both must define one.
+
+            // If both define a subtopic, they must match.
+            if (subtopicToMatch != null && subtopic != null)
+            {
+                Subtopic consumerSubtopic = new Subtopic(subtopic, subtopicSeparator);
+                Subtopic messageSubtopic = new Subtopic(subtopicToMatch, subtopicSeparator);
+                if (!consumerSubtopic.matches(messageSubtopic))
+                    return false; // Not a match.
+            }
+
+            if (selector == null)
+                return true;
+
+            JMSSelector jmsSelector = new JMSSelector(selector);
+            try
+            {
+                if (jmsSelector.match(message))
+                    return true;
+            }
+            catch (JMSSelectorException jmse)
+            {
+                // Log a warning for this client's selector and continue
+                if (Log.isWarn())
+                {
+                    Log.getLogger(JMSSelector.LOG_CATEGORY).warn("Error processing message selector: " +
+                         jmse.toString() + StringUtils.NEWLINE +
+                         "  incomingMessage: " + message + StringUtils.NEWLINE +
+                         "  selector: " + selector + StringUtils.NEWLINE);
+                }
+            }
+            return false;
+        }
+
+        /**
+         * Returns a String representation of the subscription info.
+         * @return String the string representation of the subscription info
+         */
+        public String toString()
+        {
+            StringBuffer sb = new StringBuffer();
+            sb.append("Subtopic: " + subtopic + StringUtils.NEWLINE);
+            sb.append("Selector: " + selector + StringUtils.NEWLINE);
+            if (maxFrequency > 0)
+                sb.append("maxFrequency: " + maxFrequency);
+            return sb.toString();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/MessageClientListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/MessageClientListener.java b/modules/core/src/flex/messaging/MessageClientListener.java
new file mode 100755
index 0000000..e77b31d
--- /dev/null
+++ b/modules/core/src/flex/messaging/MessageClientListener.java
@@ -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 flex.messaging;
+
+/**
+ * Interface to be notified when a MessageClient is created or destroyed. Implementations of this interface
+ * may add themselves as listeners statically via <code>MessageClient.addMessageClientCreatedListener()</code>.
+ * To listen for MessageClient destruction, the implementation class instance must add itself as a listener to
+ * a specific MessageClient instance via the <code>addMessageClientDestroyedListener()</code> method.
+ */
+public interface MessageClientListener 
+{
+    /**
+     * Notification that a MessageClient was created.
+     * 
+     * @param messageClient The MessageClient that was created.
+     */
+    void messageClientCreated(MessageClient messageClient);
+    
+    /**
+     * Notification that a MessageClient is about to be destroyed.
+     * 
+     * @param messageClient The MessageClient that will be destroyed.
+     */
+    void messageClientDestroyed(MessageClient messageClient);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/MessageDestination.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/MessageDestination.java b/modules/core/src/flex/messaging/MessageDestination.java
new file mode 100755
index 0000000..5552b7a
--- /dev/null
+++ b/modules/core/src/flex/messaging/MessageDestination.java
@@ -0,0 +1,491 @@
+/*
+ * 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.messaging;
+
+import flex.management.runtime.messaging.MessageDestinationControl;
+import flex.management.runtime.messaging.services.messaging.SubscriptionManagerControl;
+import flex.management.runtime.messaging.services.messaging.ThrottleManagerControl;
+import flex.messaging.config.ConfigurationConstants;
+import flex.messaging.config.ConfigurationException;
+import flex.messaging.config.DestinationSettings;
+import flex.messaging.config.ThrottleSettings;
+import flex.messaging.config.ConfigMap;
+import flex.messaging.config.NetworkSettings;
+import flex.messaging.config.ServerSettings;
+import flex.messaging.config.ThrottleSettings.Policy;
+import flex.messaging.log.LogCategories;
+import flex.messaging.services.MessageService;
+import flex.messaging.services.Service;
+import flex.messaging.services.messaging.SubscriptionManager;
+import flex.messaging.services.messaging.RemoteSubscriptionManager;
+import flex.messaging.services.messaging.ThrottleManager;
+import flex.messaging.services.messaging.MessagingConstants;
+import flex.messaging.util.ClassUtil;
+
+/**
+ * A logical reference to a MessageDestination.
+ */
+public class MessageDestination extends FactoryDestination
+{
+    static final long serialVersionUID = -2016911808141319012L;
+
+    /** Log category for <code>MessageDestination</code>.*/
+    public static final String LOG_CATEGORY = LogCategories.SERVICE_MESSAGE;
+
+    // Errors
+    private static final int UNSUPPORTED_POLICY = 10124;
+
+    // Destination properties
+    private transient ServerSettings serverSettings;
+
+    // Destination internal
+    private transient SubscriptionManager subscriptionManager;
+    private transient RemoteSubscriptionManager remoteSubscriptionManager;
+    private transient ThrottleManager throttleManager;
+
+    private transient MessageDestinationControl controller;
+
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Constructs an unmanaged <code>MessageDestination</code> instance.
+     */
+    public MessageDestination()
+    {
+        this(false);
+    }
+
+    /**
+     * Constructs a <code>MessageDestination</code> with the indicated management.
+     *
+     * @param enableManagement <code>true</code> if the <code>MessageDestination</code>
+     * is manageable; otherwise <code>false</code>.
+     */
+    public MessageDestination(boolean enableManagement)
+    {
+        super(enableManagement);
+
+        serverSettings = new ServerSettings();
+
+        // Managers
+        subscriptionManager = new SubscriptionManager(this);
+        remoteSubscriptionManager = new RemoteSubscriptionManager(this);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Initialize, validate, start, and stop methods.
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Initializes the <code>MessageDestination</code> with the properties.
+     * If subclasses override, they must call <code>super.initialize()</code>.
+     *
+     * @param id The id of the destination.
+     * @param properties Properties for the <code>MessageDestination</code>.
+     */
+    @Override
+    public void initialize(String id, ConfigMap properties)
+    {
+        super.initialize(id, properties);
+
+        if (properties == null || properties.size() == 0)
+            return;
+
+        // Network properties
+        network(properties);
+
+        // Server properties
+        server(properties);
+    }
+
+    /**
+     * Sets up the throttle manager before it starts.
+     */
+    @Override
+    public void start()
+    {
+        // Create the throttle manager, only if needed.
+        if (networkSettings.getThrottleSettings() != null)
+        {
+            ThrottleSettings settings = networkSettings.getThrottleSettings();
+            if (settings.isClientThrottleEnabled() || settings.isDestinationThrottleEnabled())
+            {
+                settings.setDestinationName(getId());
+                throttleManager = createThrottleManager();
+                throttleManager.setThrottleSettings(settings);
+                throttleManager.start();
+            }
+        }
+        super.start();
+    }
+
+    /**
+     * Stops the subscription, remote subscription, and throttle managers and
+     * then calls super class's stop.
+     */
+    @Override
+    public void stop()
+    {
+        if (isStarted())
+        {
+            subscriptionManager.stop();
+            remoteSubscriptionManager.stop();
+            if (throttleManager != null)
+                throttleManager.stop();
+        }
+        super.stop();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Getters and Setters for Destination properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Sets the <code>NetworkSettings</code> of the <code>MessageDestination</code>.
+     *
+     * @param networkSettings The <code>NetworkSettings</code> of the <code>MessageDestination</code>
+     */
+    @Override
+    public void setNetworkSettings(NetworkSettings networkSettings)
+    {
+        super.setNetworkSettings(networkSettings);
+
+        // Set the subscription manager settings if needed.
+        if (networkSettings.getSubscriptionTimeoutMinutes() > 0)
+        {
+            long subscriptionTimeoutMillis = networkSettings.getSubscriptionTimeoutMinutes() * 60L * 1000L; // Convert to millis.
+            subscriptionManager.setSubscriptionTimeoutMillis(subscriptionTimeoutMillis);
+        }
+    }
+
+    /**
+     * Returns the <code>ServerSettings</code> of the <code>MessageDestination</code>.
+     *
+     * @return The <code>ServerSettings</code> of the <code>MessageDestination</code>.
+     */
+    public ServerSettings getServerSettings()
+    {
+        return serverSettings;
+    }
+
+    /**
+     * Sets the <code>ServerSettings</code> of the <code>MessageDestination</code>.
+     *
+     * @param serverSettings The <code>ServerSettings</code> of the <code>MessageDestination</code>
+     */
+    public void setServerSettings(ServerSettings serverSettings)
+    {
+        this.serverSettings = serverSettings;
+    }
+
+    /**
+     * Casts the <code>Service</code> into <code>MessageService</code>
+     * and calls super.setService.
+     *
+     * @param service The <code>Service</code> managing this <code>Destination</code>.
+     */
+    @Override
+    public void setService(Service service)
+    {
+        MessageService messageService = (MessageService)service;
+        super.setService(messageService);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Other Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @exclude
+     * Returns a <tt>ConfigMap</tt> of destination properties that the client
+     * needs. This includes properties from <code>super{@link #describeDestination(boolean)}</code>
+     * and it also includes outbound throttling policy that the edge server might need.
+     *
+     * @param onlyReliable Determines whether only reliable destination configuration should be returned.
+     * @return A <tt>ConfigMap</tt> of destination properties that the client needs.
+     */
+    @Override
+    public ConfigMap describeDestination(boolean onlyReliable)
+    {
+        ConfigMap destinationConfig = super.describeDestination(onlyReliable);
+        if (destinationConfig == null)
+            return null;
+
+        if (throttleManager == null)
+            return destinationConfig;
+
+        Policy outboundPolicy = throttleManager.getOutboundPolicy();
+        if (outboundPolicy == null || outboundPolicy == Policy.NONE)
+            return destinationConfig;
+
+        // Add the outbound throttle policy to network properties section as appropriate.
+        ConfigMap properties = destinationConfig.getPropertyAsMap(ConfigurationConstants.PROPERTIES_ELEMENT, null);
+        if (properties == null)
+        {
+            properties = new ConfigMap();
+            destinationConfig.addProperty(ConfigurationConstants.PROPERTIES_ELEMENT, properties);
+        }
+
+        ConfigMap network = properties.getPropertyAsMap(NetworkSettings.NETWORK_ELEMENT, null);
+        if (network == null)
+        {
+            network = new ConfigMap();
+            properties.addProperty(NetworkSettings.NETWORK_ELEMENT, network);
+        }
+
+        ConfigMap throttleOutbound = new ConfigMap();
+        throttleOutbound.addProperty(ThrottleSettings.ELEMENT_POLICY, throttleManager.getOutboundPolicy().toString());
+        network.addProperty(ThrottleSettings.ELEMENT_OUTBOUND, throttleOutbound);
+
+        return destinationConfig;
+    }
+
+    /** @exclude */
+    public SubscriptionManager getSubscriptionManager()
+    {
+        return subscriptionManager;
+    }
+
+    /** @exclude */
+    public RemoteSubscriptionManager getRemoteSubscriptionManager()
+    {
+        return remoteSubscriptionManager;
+    }
+
+    /** @exclude */
+    public ThrottleManager getThrottleManager()
+    {
+        return throttleManager;
+    }
+
+    /** @exclude **/
+    @Override
+    public boolean equals(Object o)
+    {
+        if (o instanceof Destination)
+        {
+            Destination d = (Destination)o;
+            String serviceType1 = d.getServiceType();
+            String serviceType2 = getServiceType();
+            if ((serviceType1 == null && serviceType2 == null) || (serviceType1 != null && serviceType1.equals(serviceType2)))
+            {
+                String id1 = d.getId();
+                String id2 = getId();
+                if ((id1 == null && id2 == null) || (id1 != null && id1.equals(id2)))
+                    return true;
+            }
+        }
+        return false;
+    }
+
+    /** @exclude **/
+    @Override
+    public int hashCode()
+    {
+        return (getServiceType() == null ? 0 : getServiceType().hashCode()) * 100003 +
+            (getId() == null ? 0 : getId().hashCode());
+    }
+
+    /** @exclude **/
+    @Override
+    public String toString()
+    {
+        return getServiceType() + "#" + getId();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Protected/Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+    protected ThrottleManager createThrottleManager()
+    {
+        Service service = getService();
+        if (service == null || service.getMessageBroker() == null)
+            return new ThrottleManager(); // Return the default.
+
+        try
+        {
+            Class<? extends ThrottleManager> throttleManagerClass = service.getMessageBroker().getThrottleManagerClass();
+            Object instance = ClassUtil.createDefaultInstance(throttleManagerClass, null);
+            if (instance instanceof ThrottleManager)
+                return (ThrottleManager)instance;
+        }
+        catch (Throwable t)
+        {
+            // NOWARN
+        }
+
+        return new ThrottleManager(); // Return the default.
+    }
+
+    protected void network(ConfigMap properties)
+    {
+        ConfigMap network = properties.getPropertyAsMap(NetworkSettings.NETWORK_ELEMENT, null);
+        if (network == null)
+            return;
+
+        // Get implementation specific network settings, including subclasses!
+        NetworkSettings ns = getNetworkSettings();
+
+        // Subscriber timeout; first check for subscription-timeout-minutes and fallback to legacy session-timeout.
+        int useLegacyPropertyToken = -999999;
+        int subscriptionTimeoutMinutes = network.getPropertyAsInt(NetworkSettings.SUBSCRIPTION_TIMEOUT_MINUTES, useLegacyPropertyToken);
+        if (subscriptionTimeoutMinutes == useLegacyPropertyToken)
+            subscriptionTimeoutMinutes = network.getPropertyAsInt(NetworkSettings.SESSION_TIMEOUT, NetworkSettings.DEFAULT_TIMEOUT);
+        ns.setSubscriptionTimeoutMinutes(subscriptionTimeoutMinutes);
+
+        // Throttle Settings
+        ThrottleSettings ts = ns.getThrottleSettings();
+        ts.setDestinationName(getId());
+        throttle(ts, network);
+
+        setNetworkSettings(ns);
+    }
+
+    protected void throttle(ThrottleSettings ts, ConfigMap network)
+    {
+        ConfigMap inbound = network.getPropertyAsMap(ThrottleSettings.ELEMENT_INBOUND, null);
+        if (inbound != null)
+        {
+            ThrottleSettings.Policy policy = getPolicyFromThrottleSettings(inbound);
+            ts.setInboundPolicy(policy);
+            int destFreq = inbound.getPropertyAsInt(ThrottleSettings.ELEMENT_DEST_FREQ, 0);
+            ts.setIncomingDestinationFrequency(destFreq);
+            int clientFreq = inbound.getPropertyAsInt(ThrottleSettings.ELEMENT_CLIENT_FREQ, 0);
+            ts.setIncomingClientFrequency(clientFreq);
+        }
+
+        ConfigMap outbound = network.getPropertyAsMap(ThrottleSettings.ELEMENT_OUTBOUND, null);
+        if (outbound != null)
+        {
+            ThrottleSettings.Policy policy = getPolicyFromThrottleSettings(outbound);
+            ts.setOutboundPolicy(policy);
+            int destFreq = outbound.getPropertyAsInt(ThrottleSettings.ELEMENT_DEST_FREQ, 0);
+            ts.setOutgoingDestinationFrequency(destFreq);
+            int clientFreq = outbound.getPropertyAsInt(ThrottleSettings.ELEMENT_CLIENT_FREQ, 0);
+            ts.setOutgoingClientFrequency(clientFreq);
+        }
+    }
+
+    private ThrottleSettings.Policy getPolicyFromThrottleSettings(ConfigMap settings)
+    {
+        String policyString = settings.getPropertyAsString(ThrottleSettings.ELEMENT_POLICY, null);
+        ThrottleSettings.Policy policy = ThrottleSettings.Policy.NONE;
+        if (policyString == null)
+            return policy;
+        try
+        {
+            policy = ThrottleSettings.parsePolicy(policyString);
+        }
+        catch (ConfigurationException exception)
+        {
+            ConfigurationException ce = new ConfigurationException();
+            ce.setMessage(UNSUPPORTED_POLICY, new Object[] {getId(), policyString});
+            throw ce;
+        }
+        return policy;
+    }
+
+    protected void server(ConfigMap properties)
+    {
+        ConfigMap server = properties.getPropertyAsMap(DestinationSettings.SERVER_ELEMENT, null);
+        if (server == null)
+            return;
+
+        long ttl = server.getPropertyAsLong(MessagingConstants.TIME_TO_LIVE_ELEMENT, -1);
+        serverSettings.setMessageTTL(ttl);
+
+        boolean durable = server.getPropertyAsBoolean(MessagingConstants.IS_DURABLE_ELEMENT, false);
+        serverSettings.setDurable(durable);
+
+        boolean allowSubtopics = server.getPropertyAsBoolean(MessagingConstants.ALLOW_SUBTOPICS_ELEMENT, false);
+        serverSettings.setAllowSubtopics(allowSubtopics);
+
+        boolean disallowWildcardSubtopics = server.getPropertyAsBoolean(MessagingConstants.DISALLOW_WILDCARD_SUBTOPICS_ELEMENT, false);
+        serverSettings.setDisallowWildcardSubtopics(disallowWildcardSubtopics);
+
+        int priority = server.getPropertyAsInt(MessagingConstants.MESSAGE_PRIORITY, -1);
+        if (priority != -1)
+            serverSettings.setPriority(priority);
+
+        String subtopicSeparator = server.getPropertyAsString(MessagingConstants.SUBTOPIC_SEPARATOR_ELEMENT, MessagingConstants.DEFAULT_SUBTOPIC_SEPARATOR);
+        serverSettings.setSubtopicSeparator(subtopicSeparator);
+
+        String routingMode = server.getPropertyAsString(MessagingConstants.CLUSTER_MESSAGE_ROUTING, "server-to-server");
+        serverSettings.setBroadcastRoutingMode(routingMode);
+    }
+
+    /**
+     * Returns the log category of the <code>MessageDestination</code>.
+     *
+     * @return The log category of the component.
+     */
+    @Override
+    protected String getLogCategory()
+    {
+        return LOG_CATEGORY;
+    }
+
+    /**
+     * Invoked automatically to allow the <code>MessageDestination</code> to setup its corresponding
+     * MBean control.
+     *
+     * @param service The <code>Service</code> that manages this <code>MessageDestination</code>.
+     */
+    @Override
+    protected void setupDestinationControl(Service service)
+    {
+        controller = new MessageDestinationControl(this, service.getControl());
+        controller.register();
+        setControl(controller);
+        setupThrottleManagerControl(controller);
+        setupSubscriptionManagerControl(controller);
+    }
+
+    protected void setupThrottleManagerControl(MessageDestinationControl destinationControl)
+    {
+        if (throttleManager != null)
+        {
+            ThrottleManagerControl throttleManagerControl = new ThrottleManagerControl(throttleManager, destinationControl);
+            throttleManagerControl.register();
+            throttleManager.setControl(throttleManagerControl);
+            throttleManager.setManaged(true);
+            destinationControl.setThrottleManager(throttleManagerControl.getObjectName());
+        }
+    }
+
+    private void setupSubscriptionManagerControl(MessageDestinationControl destinationControl)
+    {
+        SubscriptionManagerControl subscriptionManagerControl = new SubscriptionManagerControl(getSubscriptionManager(), destinationControl);
+        subscriptionManagerControl.register();
+        getSubscriptionManager().setControl(subscriptionManagerControl);
+        getSubscriptionManager().setManaged(true);
+        destinationControl.setSubscriptionManager(subscriptionManagerControl.getObjectName());
+    }
+}


[12/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/MessageDestinationControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/MessageDestinationControl.java b/modules/core/src/flex/management/runtime/messaging/MessageDestinationControl.java
new file mode 100755
index 0000000..2cefc37
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/MessageDestinationControl.java
@@ -0,0 +1,312 @@
+/*
+ * 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.management.runtime.messaging;
+
+import java.util.Date;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import flex.management.BaseControl;
+import flex.management.runtime.AdminConsoleTypes;
+import flex.messaging.Destination;
+
+import javax.management.ObjectName;
+
+/**
+ * The <code>MessageDestinationControl</code> class is the MBean implementation for
+ * monitoring and managing a <code>MessageDestination</code> at runtime.
+ * 
+ * @author shodgson
+ */
+public class MessageDestinationControl extends DestinationControl implements
+        MessageDestinationControlMBean
+{
+    private static final String TYPE = "MessageDestination";
+    private ObjectName messageCache;
+    private ObjectName throttleManager;
+    private ObjectName subscriptionManager;
+
+    private AtomicInteger serviceMessageCount = new AtomicInteger(0);
+    private Date lastServiceMessageTimestamp;
+    private long serviceMessageStart;
+    private AtomicInteger serviceCommandCount = new AtomicInteger(0);
+    private Date lastServiceCommandTimestamp;
+    private long serviceCommandStart;
+    private AtomicInteger serviceMessageFromAdapterCount = new AtomicInteger(0);
+    private Date lastServiceMessageFromAdapterTimestamp;
+    private long serviceMessageFromAdapterStart;   
+    /**
+     * Constructs a new <code>MessageDestinationControl</code> instance.
+     * 
+     * @param destination The destination managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public MessageDestinationControl(Destination destination, BaseControl parent)
+    {
+        super(destination, parent);          
+        serviceMessageStart = System.currentTimeMillis();
+        serviceCommandStart = serviceMessageStart;
+        serviceMessageFromAdapterStart = serviceMessageStart;             
+    }
+    
+    protected void onRegistrationComplete()
+    {
+        String name = this.getObjectName().getCanonicalName();
+        
+        String[] pollablePerInterval = { "ServiceCommandCount", "ServiceMessageCount",
+                "ServiceMessageFromAdapterCount" };
+        String[] pollableGeneral = { "ServiceCommandFrequency", "ServiceMessageFrequency",
+                "ServiceMessageFromAdapterFrequency", "LastServiceCommandTimestamp", 
+                "LastServiceMessageTimestamp", "LastServiceMessageFromAdapterTimestamp"};
+        
+        getRegistrar().registerObjects(
+                new int[] {AdminConsoleTypes.DESTINATION_POLLABLE, AdminConsoleTypes.GRAPH_BY_POLL_INTERVAL},
+                name, pollablePerInterval);
+        getRegistrar().registerObjects(AdminConsoleTypes.DESTINATION_POLLABLE, name,
+                pollableGeneral);
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.BaseControlMBean#getType()
+     */
+    public String getType()
+    {
+        return TYPE;
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.MessageDestinationControlMBean#getMessageCache()
+     */
+    public ObjectName getMessageCache()
+    {
+        return messageCache;
+    }
+    
+    /**
+     * Sets the <code>ObjectName</code> for the message cache used by the managed destination.
+     * 
+     * @param value The <code>ObjectName</code> for the message cache.
+     */
+    public void setMessageCache(ObjectName value)
+    {
+        messageCache = value;
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.MessageDestinationControlMBean#getThrottleManager()
+     */
+    public ObjectName getThrottleManager()
+    {
+        return throttleManager;
+    }
+    
+    /**
+     * Sets the <code>ObjectName</code> for the throttle manager used by the managed destination.
+     * 
+     * @param value The <code>ObjectName</code> for the throttle manager.
+     */
+    public void setThrottleManager(ObjectName value)
+    {
+        throttleManager = value;
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.MessageDestinationControlMBean#getSubscriptionManager()
+     */
+    public ObjectName getSubscriptionManager()
+    {
+        return subscriptionManager;
+    }
+    
+    /**
+     * Sets the <code>ObjectName</code> for the subscription manager used by the managed destination.
+     * 
+     * @param value The <code>ObjectName</code> for the subscription manager.
+     */
+    public void setSubscriptionManager(ObjectName value)
+    {
+        subscriptionManager = value;
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageDestinationControlMBean#getServiceMessageCount()
+     */
+    public Integer getServiceMessageCount()
+    {
+        return Integer.valueOf(serviceMessageCount.get());
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageDestinationControlMBean#resetServiceMessageCount()
+     */
+    public void resetServiceMessageCount()
+    {
+        serviceMessageStart = System.currentTimeMillis();
+        serviceMessageCount = new AtomicInteger(0);
+        lastServiceMessageTimestamp = null;
+    }
+    
+    /**
+     * Increments the count of messages serviced.
+     */
+    public void incrementServiceMessageCount()
+    {
+        serviceMessageCount.incrementAndGet();
+        lastServiceMessageTimestamp = new Date();
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageDestinationControlMBean#getLastServiceMessageTimestamp()
+     */
+    public Date getLastServiceMessageTimestamp()
+    {
+        return lastServiceMessageTimestamp;
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageDestinationControlMBean#getServiceMessageFrequency()
+     */
+    public Double getServiceMessageFrequency()
+    {
+        if (serviceMessageCount.get() > 0)
+        {
+            double runtime = differenceInMinutes(serviceMessageStart, System.currentTimeMillis());
+            return new Double(serviceMessageCount.get()/runtime);
+        }
+        else
+        {
+            return new Double(0);
+        }
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageDestinationControlMBean#getServiceCommandCount()
+     */
+    public Integer getServiceCommandCount()
+    {        
+        return Integer.valueOf(serviceCommandCount.get());
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageDestinationControlMBean#resetServiceCommandCount()
+     */
+    public void resetServiceCommandCount()
+    {
+        serviceCommandStart = System.currentTimeMillis();
+        serviceCommandCount = new AtomicInteger(0);
+        lastServiceCommandTimestamp = null;
+    }
+    
+    /**
+     * Increments the count of command messages serviced.
+     */
+    public void incrementServiceCommandCount()
+    {
+        serviceCommandCount.incrementAndGet();
+        lastServiceCommandTimestamp = new Date();
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageDestinationControlMBean#getLastServiceCommandTimestamp()
+     */
+    public Date getLastServiceCommandTimestamp()
+    {
+        return lastServiceCommandTimestamp;
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageDestinationControlMBean#getServiceCommandFrequency()
+     */
+    public Double getServiceCommandFrequency()
+    {
+        if (serviceCommandCount.get() > 0)
+        {
+            double runtime = differenceInMinutes(serviceCommandStart, System.currentTimeMillis());
+            return new Double(serviceCommandCount.get()/runtime);
+        }
+        else
+        {
+            return new Double(0);
+        }
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageDestinationControlMBean#getServiceMessageFromAdapterCount()
+     */
+    public Integer getServiceMessageFromAdapterCount()
+    {
+        return Integer.valueOf(serviceMessageFromAdapterCount.get());
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageDestinationControlMBean#resetServiceMessageFromAdapterCount()
+     */
+    public void resetServiceMessageFromAdapterCount()
+    {
+        serviceMessageFromAdapterStart = System.currentTimeMillis();
+        serviceMessageFromAdapterCount = new AtomicInteger(0);
+        lastServiceMessageFromAdapterTimestamp = null;
+    }
+    
+    /**
+     * Increments the count of messages from adapters processed.
+     */
+    public void incrementServiceMessageFromAdapterCount()
+    {
+        serviceMessageFromAdapterCount.incrementAndGet();
+        lastServiceMessageFromAdapterTimestamp = new Date();
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageDestinationControlMBean#getLastServiceMessageFromAdapterTimestamp()
+     */
+    public Date getLastServiceMessageFromAdapterTimestamp()
+    {
+        return lastServiceMessageFromAdapterTimestamp;
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageDestinationControlMBean#getServiceMessageFromAdapterFrequency()
+     */
+    public Double getServiceMessageFromAdapterFrequency()
+    {
+        if (serviceMessageFromAdapterCount.get() > 0)
+        {
+            double runtime = differenceInMinutes(serviceMessageFromAdapterStart, System.currentTimeMillis());
+            return new Double(serviceMessageFromAdapterCount.get()/runtime);
+        }
+        else
+        {
+            return new Double(0);
+        }
+    }    
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/MessageDestinationControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/MessageDestinationControlMBean.java b/modules/core/src/flex/management/runtime/messaging/MessageDestinationControlMBean.java
new file mode 100755
index 0000000..43da0a7
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/MessageDestinationControlMBean.java
@@ -0,0 +1,155 @@
+/*
+ * 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.management.runtime.messaging;
+
+import java.io.IOException;
+import java.util.Date;
+
+import javax.management.ObjectName;
+
+
+/**
+ * Defines the runtime monitoring and management interface for managed
+ * <code>MessageDestination</code>s.
+ *
+ * @author shodgson
+ */
+public interface MessageDestinationControlMBean extends DestinationControlMBean
+{
+    /**
+     * Returns the <code>ObjectName</code> for the message cache used by the managed
+     * destination.
+     *
+     * @return The <code>ObjectName</code> for the message cache.
+     * @throws IOException Throws IOException.
+     */
+    ObjectName getMessageCache() throws IOException;
+
+    /**
+     * Returns the <code>ObjectName</code> for the throttle manager used by the
+     * managed destination.
+     *
+     * @return The <code>ObjectName</code> for the throttle manager.
+     * @throws IOException Throws IOException.
+     */
+    ObjectName getThrottleManager() throws IOException;
+
+    /**
+     * Returns the <code>ObjectName</code> for the subscription manager used
+     * by the managed destination.
+     *
+     * @return The <code>ObjectName</code> for the subscription manager.
+     * @throws IOException Throws IOException.
+     */
+    ObjectName getSubscriptionManager() throws IOException;
+
+    /**
+     * Returns the number of service message invocations.
+     *
+     * @return The number of service message invocations.
+     * @throws IOException Throws IOException.
+     */
+    Integer getServiceMessageCount() throws IOException;
+
+    /**
+     * Resets the count of service message invocations.
+     *
+     * @throws IOException Throws IOException.
+     */
+    void resetServiceMessageCount() throws IOException;
+
+    /**
+     * Returns the timestamp for the most recent service message
+     * invocation.
+     *
+     * @return The timestamp for the most recent service message invocation.
+     * @throws IOException Throws IOException.
+     */
+    Date getLastServiceMessageTimestamp() throws IOException;
+
+    /**
+     * Returns the number of service message invocations per minute.
+     *
+     * @return The number of service message invocations per minute.
+     * @throws IOException Throws IOException.
+     */
+    Double getServiceMessageFrequency() throws IOException;
+
+    /**
+     * Returns the number of service command invocations.
+     *
+     * @return The number of service command invocations.
+     * @throws IOException Throws IOException.
+     */
+    Integer getServiceCommandCount() throws IOException;
+
+    /**
+     * Resets the count of service command invocations.
+     *
+     * @throws IOException Throws IOException.
+     */
+    void resetServiceCommandCount() throws IOException;
+
+    /**
+     * Returns the timestamp for the most recent service command invocation.
+     *
+     * @return The timestamp for the most recent service command invocation.
+     * @throws IOException Throws IOException.
+     */
+    Date getLastServiceCommandTimestamp() throws IOException;
+
+    /**
+     * Returns the number of service command invocations per minute.
+     *
+     * @return The number of service command invocations per minute.
+     * @throws IOException Throws IOException.
+     */
+    Double getServiceCommandFrequency() throws IOException;
+
+    /**
+     * Returns the number of messages from an adapter that the managed service
+     * has processed.
+     *
+     * @return The number of messages from an adapter that the managed service
+     * has processed
+     * @throws IOException Throws IOException.
+     */
+    Integer getServiceMessageFromAdapterCount() throws IOException;
+
+    /**
+     * Resets the count of service message from adapter invocations.
+     *
+     * @throws IOException Throws IOException.
+     */
+    void resetServiceMessageFromAdapterCount() throws IOException;
+
+    /**
+     * Returns the timestamp of the most recent service message from adapter invocation.
+     *
+     * @return The timestamp of the most recent service message from adapter invocation.
+     * @throws IOException Throws IOException.
+     */
+    Date getLastServiceMessageFromAdapterTimestamp() throws IOException;
+
+    /**
+     * Returns the number of service message from adapter invocations per minute.
+     *
+     * @return The number of service message from adapter invocations per minute.
+     * @throws IOException Throws IOException.
+     */
+    Double getServiceMessageFromAdapterFrequency() throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/client/FlexClientManagerControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/client/FlexClientManagerControl.java b/modules/core/src/flex/management/runtime/messaging/client/FlexClientManagerControl.java
new file mode 100755
index 0000000..70fe26b
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/client/FlexClientManagerControl.java
@@ -0,0 +1,99 @@
+/*
+ * 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.management.runtime.messaging.client;
+
+import flex.management.BaseControl;
+import flex.management.runtime.AdminConsoleTypes;
+import flex.messaging.client.FlexClientManager;
+
+/**
+ * @author majacobs
+ *
+ * @exclude
+ */
+public class FlexClientManagerControl extends BaseControl implements FlexClientManagerControlMBean
+{
+    private FlexClientManager flexClientManager;
+    
+    public FlexClientManagerControl(BaseControl parent, FlexClientManager manager)
+    {
+        super(parent);        
+        flexClientManager = manager;
+    }
+    
+    public void onRegistrationComplete()
+    {
+        String name = getObjectName().getCanonicalName();
+        getRegistrar().registerObject(AdminConsoleTypes.GENERAL_POLLABLE, name, "FlexClientCount");
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.BaseControl#getId()
+     */
+    public String getId()
+    {
+        return flexClientManager.getId();
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.BaseControl#getType()
+     */
+    public String getType()
+    {
+        return flexClientManager.getId();
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.client.FlexClientManagerControlMBean#getClientIds()
+     */
+    public String[] getClientIds() 
+    {
+        return flexClientManager.getClientIds();
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.client.FlexClientManagerControlMBean#getClientLastUse(java.lang.String)
+     */
+    public Long getClientLastUse(String clientId)
+    {
+        return new Long(flexClientManager.getFlexClient(clientId).getLastUse());
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.client.FlexClientManagerControlMBean#getClientSessionCount(java.lang.String)
+     */
+    public Integer getClientSessionCount(String clientId)
+    {
+        return new Integer(flexClientManager.getFlexClient(clientId).getSessionCount());
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.client.FlexClientManagerControlMBean#getClientSubscriptionCount(java.lang.String)
+     */
+    public Integer getClientSubscriptionCount(String clientId)
+    {
+        return new Integer(flexClientManager.getFlexClient(clientId).getSubscriptionCount());
+    }
+    
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.client.FlexClientManagerControlMBean#getFlexClientCount()
+     */
+    public Integer getFlexClientCount() 
+    {
+        return new Integer(flexClientManager.getFlexClientCount());
+    }    
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/client/FlexClientManagerControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/client/FlexClientManagerControlMBean.java b/modules/core/src/flex/management/runtime/messaging/client/FlexClientManagerControlMBean.java
new file mode 100755
index 0000000..f56419b
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/client/FlexClientManagerControlMBean.java
@@ -0,0 +1,70 @@
+/*
+ * 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.management.runtime.messaging.client;
+
+import java.io.IOException;
+
+import flex.management.BaseControlMBean;
+
+/**
+ * Defines the runtime monitoring and management interface for managed flex client managers.
+ */
+public interface FlexClientManagerControlMBean extends BaseControlMBean
+{
+    /**
+     * Returns ids of managed clients.
+     *
+     * @return An array of client ids.
+     * @throws IOException Throws IOException.
+     */
+    String[] getClientIds() throws IOException;
+
+    /**
+     * Returns the number of subscriptions for the client with the clientId.
+     *
+     * @param clientId The client id.
+     * @return The number of subscriptions for the client with the cliendId
+     * @throws IOException Throws IOException.
+     */
+    Integer getClientSubscriptionCount(String clientId) throws IOException;
+
+    /**
+     * Returns the number of sessiosn for the client with the clientId.
+     *
+     * @param clientId The client id.
+     * @return The number of sessions for the client with the cliendId
+     * @throws IOException Throws IOException.
+     */
+    Integer getClientSessionCount(String clientId) throws IOException;
+
+    /**
+     * Returns the last use by the client with the clientId.
+     *
+     * @param clientId The client id.
+     * @return The last use by the client with the clientId
+     * @throws IOException Throws IOException.
+     */
+    Long getClientLastUse(String clientId) throws IOException;
+
+    /**
+     * Returns the number of clients.
+     *
+     * @return The number of clients.
+     * @throws IOException Throws IOException.
+     */
+    Integer getFlexClientCount() throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/client/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/client/package-info.java b/modules/core/src/flex/management/runtime/messaging/client/package-info.java
new file mode 100755
index 0000000..e09baf8
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/client/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * 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.management.runtime.messaging.client;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControl.java b/modules/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControl.java
new file mode 100755
index 0000000..f127ba6
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControl.java
@@ -0,0 +1,50 @@
+/*
+ * 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.management.runtime.messaging.endpoints;
+
+import flex.management.BaseControl;
+import flex.messaging.endpoints.AMFEndpoint;
+
+/**
+ * The <code>AMFEndpointControl</code> class is the MBean implemenation
+ * for monitoring and managing an <code>AMFEndpoint</code> at runtime.
+ *
+ * @author shodgson
+ */
+public class AMFEndpointControl extends PollingEndpointControl implements
+        AMFEndpointControlMBean
+{
+    private static final String TYPE = "AMFEndpoint";
+
+    /**
+     * Constructs a <code>AMFEndpointControl</code>, assigning managed message
+     * endpoint and parent MBean.
+     *
+     * @param endpoint The <code>AMFEndpoint</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public AMFEndpointControl(AMFEndpoint endpoint, BaseControl parent)
+    {
+        super(endpoint, parent);
+    }
+
+    /** {@inheritDoc} */
+    public String getType()
+    {
+        return TYPE;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControlMBean.java b/modules/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControlMBean.java
new file mode 100755
index 0000000..6c221b8
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/AMFEndpointControlMBean.java
@@ -0,0 +1,28 @@
+/*
+ * 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.management.runtime.messaging.endpoints;
+
+
+/**
+ * Defines the runtime monitoring and management interface for managed AMF endpoints.
+ *
+ * @author shodgson
+ */
+public interface AMFEndpointControlMBean extends PollingEndpointControlMBean
+{
+    // Empty for now.
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/EndpointControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/EndpointControl.java b/modules/core/src/flex/management/runtime/messaging/endpoints/EndpointControl.java
new file mode 100755
index 0000000..2d127ce
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/EndpointControl.java
@@ -0,0 +1,241 @@
+/*
+ * 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.management.runtime.messaging.endpoints;
+
+import flex.management.BaseControl;
+import flex.management.runtime.AdminConsoleTypes;
+import flex.management.runtime.messaging.MessageBrokerControl;
+import flex.messaging.config.SecurityConstraint;
+import flex.messaging.endpoints.Endpoint;
+
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ * The <code>EndpointControl</code> class is the MBean implementation for
+ * monitoring and managing an <code>Endpoint</code> at runtime.
+ *
+ * @author shodgson
+ */
+public abstract class EndpointControl extends BaseControl implements EndpointControlMBean
+{
+    protected Endpoint endpoint;
+    private AtomicInteger serviceMessageCount = new AtomicInteger(0);
+    private Date lastServiceMessageTimestamp;
+    private long serviceMessageStart;
+    private AtomicLong bytesDeserialized = new AtomicLong(0);
+    private AtomicLong bytesSerialized = new AtomicLong(0);
+
+    /**
+     * Constructs an <code>EndpointControl</code>, assigning its managed endpoint and
+     * parent MBean.
+     *
+     * @param endpoint The <code>Endpoint</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public EndpointControl(Endpoint endpoint, BaseControl parent)
+    {
+        super(parent);
+        this.endpoint = endpoint;
+        serviceMessageStart = System.currentTimeMillis();
+    }
+
+
+    protected void onRegistrationComplete()
+    {
+        String name = this.getObjectName().getCanonicalName();
+        String[] generalNames = { "SecurityConstraint"};
+        String[] generalPollables = { "ServiceMessageCount", "LastServiceMessageTimestamp", "ServiceMessageFrequency"};
+        String[] pollableGraphByInterval = {"BytesDeserialized", "BytesSerialized"};
+
+        getRegistrar().registerObjects(AdminConsoleTypes.ENDPOINT_SCALAR,
+                name, generalNames);
+        getRegistrar().registerObjects(AdminConsoleTypes.ENDPOINT_POLLABLE,
+                name, generalPollables);
+        getRegistrar().registerObjects(new int[] {AdminConsoleTypes.GRAPH_BY_POLL_INTERVAL, AdminConsoleTypes.ENDPOINT_POLLABLE},
+                name, pollableGraphByInterval);
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.BaseControlMBean#getId()
+     */
+    public String getId()
+    {
+        return endpoint.getId();
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.EndpointControlMBean#isRunning()
+     */
+    public Boolean isRunning()
+    {
+        return Boolean.valueOf(endpoint.isStarted());
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.EndpointControlMBean#getStartTimestamp()
+     */
+    public Date getStartTimestamp()
+    {
+        return startTimestamp;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.EndpointControlMBean#getServiceMessageCount()
+     */
+    public Integer getServiceMessageCount()
+    {
+        return Integer.valueOf(serviceMessageCount.get());
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.EndpointControlMBean#resetServiceMessageCount()
+     */
+    public void resetServiceMessageCount()
+    {
+        serviceMessageStart = System.currentTimeMillis();
+        serviceMessageCount = new AtomicInteger(0);
+        lastServiceMessageTimestamp = null;
+    }
+
+    /**
+     * Increments the count of <code>serviceMessage()</code> invocations by the endpoint.
+     */
+    public void incrementServiceMessageCount()
+    {
+        serviceMessageCount.incrementAndGet();
+        lastServiceMessageTimestamp = new Date();
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.EndpointControlMBean#getLastServiceMessageTimestamp()
+     */
+    public Date getLastServiceMessageTimestamp()
+    {
+        return lastServiceMessageTimestamp;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.EndpointControlMBean#getServiceMessageFrequency()
+     */
+    public Double getServiceMessageFrequency()
+    {
+        if (serviceMessageCount.get() > 0)
+        {
+            double runtime = differenceInMinutes(serviceMessageStart, System.currentTimeMillis());
+            return new Double(serviceMessageCount.get()/runtime);
+        }
+        else
+        {
+            return new Double(0);
+        }
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see javax.management.MBeanRegistration#preDeregister()
+     */
+    public void preDeregister() throws Exception
+    {
+        MessageBrokerControl parent = (MessageBrokerControl)getParentControl();
+        parent.removeEndpoint(getObjectName());
+    }
+
+    public String getURI()
+    {
+        return endpoint.getUrl();
+    }
+
+    public String getSecurityConstraint()
+    {
+        return getSecurityConstraintOf(endpoint);
+    }
+
+    public static String getSecurityConstraintOf(Endpoint endpoint)
+    {
+        String result = "None";
+
+        SecurityConstraint constraint = endpoint.getSecurityConstraint();
+        if (constraint != null)
+        {
+            String authMethod = constraint.getMethod();
+            if (authMethod != null)
+            {
+                StringBuffer buffer = new StringBuffer();
+                buffer.append(authMethod);
+
+                List roles = constraint.getRoles();
+                if ((roles != null) && !roles.isEmpty())
+                {
+                    buffer.append(':');
+                    for (int i = 0; i < roles.size(); i++)
+                    {
+                        if (i > 0)
+                        {
+                            buffer.append(',');
+                        }
+                        buffer.append(' ');
+                        buffer.append(roles.get(i));
+                    }
+                }
+                result = buffer.toString();
+            }
+        }
+        return result;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.EndpointControlMBean#getBytesDeserialized()
+     */
+    public Long getBytesDeserialized(){
+        return Long.valueOf(bytesDeserialized.get());
+    }
+
+    /**
+     * Increments the count of bytes deserialized by the endpoint.
+     * @param currentBytesDeserialized the bytes is deserialized
+     */
+    public void addToBytesDeserialized(int currentBytesDeserialized) {
+        bytesDeserialized.addAndGet(currentBytesDeserialized);
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.EndpointControlMBean#getBytesSerialized()
+     */
+    public Long getBytesSerialized() {
+        return Long.valueOf(bytesSerialized.get());
+    }
+
+    /**
+     * Increments the count of bytes serialized by the endpoint.
+     * @param currentBytesSerialized the bytes is serialized
+     */
+    public void addToBytesSerialized(int currentBytesSerialized) {
+        bytesSerialized.addAndGet(currentBytesSerialized);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/EndpointControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/EndpointControlMBean.java b/modules/core/src/flex/management/runtime/messaging/endpoints/EndpointControlMBean.java
new file mode 100755
index 0000000..d0aa61a
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/EndpointControlMBean.java
@@ -0,0 +1,113 @@
+/*
+ * 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.management.runtime.messaging.endpoints;
+
+import flex.management.BaseControlMBean;
+
+import java.io.IOException;
+import java.util.Date;
+
+/**
+ * Defines the runtime monitoring and management interface for managed endpoints.
+ *
+ * @author shodgson
+ */
+public interface EndpointControlMBean extends BaseControlMBean
+{
+    /**
+     * Returns <code>true</code> if the <code>Endpoint</code> is running.
+     *
+     * @return <code>true</code> if the <code>Endpoint</code> is running.
+     * @throws IOException Throws IOException.
+     */
+    Boolean isRunning() throws IOException;
+
+    /**
+     * Returns the start timestamp for the <code>Endpoint</code>.
+     *
+     * @return The start timestamp for the <code>Endpoint</code>.
+     * @throws IOException Throws IOException.
+     */
+    Date getStartTimestamp() throws IOException;
+
+    /**
+     * Returns the count of messages decoded by this endpoint and routed to the broker.
+     *
+     * @return The count of messages decoded by this endpoint and routed to the broker.
+     * @throws IOException Throws IOException.
+     */
+    Integer getServiceMessageCount() throws IOException;
+
+    /**
+     * Resets the count of service message invocations.
+     *
+     * @throws IOException Throws IOException.
+     */
+    void resetServiceMessageCount() throws IOException;
+
+    /**
+     * Returns the timestamp for the most recent message decoded by this endpoint and
+     * routed to the broker.
+     *
+     * @return The timestamp for the most recent message decoded by this endpoint and
+     * routed to the broker.
+     * @throws IOException Throws IOException.
+     */
+    Date getLastServiceMessageTimestamp() throws IOException;
+
+    /**
+     * Returns the number of service message invocations per minute.
+     *
+     * @return The number of service message invocations per minute.
+     * @throws IOException Throws IOException.
+     */
+    Double getServiceMessageFrequency() throws IOException;
+
+    /**
+     * Returns the URI that corresponds to this endpoint.
+     *
+     * @return The URI that corresponds to this endpoint.
+     * @throws IOException Throws IOException.
+     */
+    String getURI() throws IOException;
+
+    /**
+     * Returns the security constraint that is associated with this endpoint.
+     *
+     * @return The security constraint that is associated with this endpoint.
+     * @throws IOException Throws IOException.
+     */
+    String getSecurityConstraint() throws IOException;
+
+    /**
+     * Returns the total Bytes that have been deserialized by this endpoint
+     * during its lifetime.
+     *
+     * @return total Bytes deserialized.
+     * @throws IOException Throws IOException.
+     */
+    Long getBytesDeserialized() throws IOException;
+
+    /**
+     * Returns the total Bytes that have been serialized by this endpoint
+     * during its lifetime.
+     *
+     * @return total Bytes serialized.
+     * @throws IOException Throws IOException.
+     */
+    Long getBytesSerialized() throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControl.java b/modules/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControl.java
new file mode 100755
index 0000000..6dc52ac
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControl.java
@@ -0,0 +1,50 @@
+/*
+ * 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.management.runtime.messaging.endpoints;
+
+import flex.management.BaseControl;
+import flex.messaging.endpoints.HTTPEndpoint;
+
+/**
+ * The <code>HTTPEndpointControl</code> class is the MBean implemenation
+ * for monitoring and managing a <code>HTTPEndpoint</code> at runtime.
+ *
+ * @author shodgson
+ */
+public class HTTPEndpointControl extends PollingEndpointControl implements
+    HTTPEndpointControlMBean
+{
+    private static final String TYPE = "HTTPEndpoint";
+
+    /**
+     * Constructs a <code>HTTPEndpointControl</code>, assigning managed message
+     * endpoint and parent MBean.
+     *
+     * @param endpoint The <code>HTTPEndpoint</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public HTTPEndpointControl(HTTPEndpoint endpoint, BaseControl parent)
+    {
+        super(endpoint, parent);
+    }
+
+    /** {@inheritDoc} */
+    public String getType()
+    {
+        return TYPE;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControlMBean.java b/modules/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControlMBean.java
new file mode 100755
index 0000000..fce75d2
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/HTTPEndpointControlMBean.java
@@ -0,0 +1,27 @@
+/*
+ * 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.management.runtime.messaging.endpoints;
+
+/**
+ * Defines the runtime monitoring and management interface for managed HTTP endpoints.
+ *
+ * @author shodgson
+ */
+public interface HTTPEndpointControlMBean extends PollingEndpointControlMBean
+{
+    // Empty for now.
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControl.java b/modules/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControl.java
new file mode 100755
index 0000000..7cdbb74
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControl.java
@@ -0,0 +1,72 @@
+/*
+ * 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.management.runtime.messaging.endpoints;
+
+import flex.management.BaseControl;
+import flex.management.runtime.AdminConsoleTypes;
+import flex.messaging.endpoints.BasePollingHTTPEndpoint;
+
+/**
+ * The <tt>PollingEndpointControl</tt> class is the base MBean implementation
+ * for monitoring and managing a <tt>BasePollingHTTPEndpoint</tt> at runtime.
+ */
+public abstract class PollingEndpointControl extends EndpointControl implements
+        PollingEndpointControlMBean
+{
+    /**
+     * Constructs a <tt>PollingEndpointControl</tt>, assigning managed message
+     * endpoint and parent MBean.
+     *
+     * @param endpoint The <code>BasePollingHTTPEndpoint</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public PollingEndpointControl(BasePollingHTTPEndpoint endpoint, BaseControl parent)
+    {
+        super(endpoint, parent);
+    }
+
+    protected void onRegistrationComplete()
+    {
+        super.onRegistrationComplete();
+
+        String name = this.getObjectName().getCanonicalName();
+        String[] generalPollables = {"WaitingPollRequestsCount"};
+
+        getRegistrar().registerObjects(AdminConsoleTypes.ENDPOINT_POLLABLE, name, generalPollables);
+        getRegistrar().registerObject(AdminConsoleTypes.ENDPOINT_SCALAR, name, "MaxWaitingPollRequests");
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.endpoints.PollingEndpointControlMBean#getMaxWaitingPollRequests()
+     */
+    public Integer getMaxWaitingPollRequests()
+    {
+        int maxWaitingPollRequests = ((BasePollingHTTPEndpoint)endpoint).getMaxWaitingPollRequests();
+        return new Integer(maxWaitingPollRequests);
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.endpoints.PollingEndpointControlMBean#getWaitingPollRequestsCount()
+     */
+    public Integer getWaitingPollRequestsCount()
+    {
+        int waitingPollRequestsCount = ((BasePollingHTTPEndpoint)endpoint).getWaitingPollRequestsCount();
+        return new Integer(waitingPollRequestsCount);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControlMBean.java b/modules/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControlMBean.java
new file mode 100755
index 0000000..016b276
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/PollingEndpointControlMBean.java
@@ -0,0 +1,45 @@
+/*
+ * 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.management.runtime.messaging.endpoints;
+
+import java.io.IOException;
+
+/**
+ * Defines the runtime monitoring and management interface for managed polling
+ * endpoints.
+ */
+public interface PollingEndpointControlMBean extends EndpointControlMBean
+{
+    /**
+     * Returns the maximum number of server poll response threads that will be
+     * waiting for messages to arrive for clients.
+     *
+     * @return The maximum number of server poll response threads that will be
+     * waiting for messages to arrive for clients.
+     * @throws IOException Throws IOException.
+     */
+    Integer getMaxWaitingPollRequests() throws IOException;
+
+    /**
+     * Returns the number of request threads that are currently in the wait state
+     * (including those on their way into or out of it).
+     *
+     * @return The number of request threads that are currently in the wait state.
+     * @throws IOException Throws IOException.
+     */
+    Integer getWaitingPollRequestsCount() throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControl.java b/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControl.java
new file mode 100755
index 0000000..15b29bc
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControl.java
@@ -0,0 +1,48 @@
+/*
+ * 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.management.runtime.messaging.endpoints;
+
+import flex.management.BaseControl;
+import flex.messaging.endpoints.StreamingAMFEndpoint;
+
+/**
+ * The <code>StreamingAMFEndpointControl</code> class is the MBean implemenation
+ * for monitoring and managing an <code>StreamingAMFEndpoint</code> at runtime.
+ */
+public class StreamingAMFEndpointControl extends StreamingEndpointControl implements
+        StreamingAMFEndpointControlMBean
+{
+    private static final String TYPE = "StreamingAMFEndpoint";
+
+    /**
+     * Constructs a <code>StreamingAMFEndpointControl</code>, assigning managed message
+     * endpoint and parent MBean.
+     *
+     * @param endpoint The <code>StreamingAMFEndpoint</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public StreamingAMFEndpointControl(StreamingAMFEndpoint endpoint, BaseControl parent)
+    {
+        super(endpoint, parent);
+    }
+
+    /** {@inheritDoc} */
+    public String getType()
+    {
+        return TYPE;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControlMBean.java b/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControlMBean.java
new file mode 100755
index 0000000..fffa29b
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingAMFEndpointControlMBean.java
@@ -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.
+ */
+package flex.management.runtime.messaging.endpoints;
+
+/**
+ * Defines the runtime monitoring and management interface for managed streaming 
+ * AMF endpoints.
+ */
+public interface StreamingAMFEndpointControlMBean extends StreamingEndpointControlMBean
+{
+    // Empty for now
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControl.java b/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControl.java
new file mode 100755
index 0000000..1d50bb8
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControl.java
@@ -0,0 +1,133 @@
+/*
+ * 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.management.runtime.messaging.endpoints;
+
+import java.util.Date;
+
+import flex.management.BaseControl;
+import flex.management.runtime.AdminConsoleTypes;
+import flex.messaging.endpoints.BaseStreamingHTTPEndpoint;
+
+/**
+ * The <code>StreamingEndpointControl</code> class is the base MBean implementation
+ * for monitoring and managing a <code>BaseStreamingHTTPEndpoint</code> at runtime.
+ */
+public abstract class StreamingEndpointControl extends EndpointControl implements
+        StreamingEndpointControlMBean
+{   
+    private int pushCount;
+    private Date lastPushTimeStamp;
+    private long pushStart;
+    
+    /**
+     * Constructs a <code>StreamingEndpointControl</code>, assigning managed message 
+     * endpoint and parent MBean.
+     * 
+     * @param endpoint The <code>BaseStreamingHTTPEndpoint</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public StreamingEndpointControl(BaseStreamingHTTPEndpoint endpoint, BaseControl parent)
+    {
+        super(endpoint, parent);
+    }
+        
+    protected void onRegistrationComplete()
+    {
+        super.onRegistrationComplete();
+        
+        String name = this.getObjectName().getCanonicalName();
+        String[] generalPollables = { "LastPushTimestamp", "PushCount", "PushFrequency", "StreamingClientsCount"};
+        
+        getRegistrar().registerObjects(AdminConsoleTypes.ENDPOINT_POLLABLE, name, generalPollables);
+        getRegistrar().registerObject(AdminConsoleTypes.ENDPOINT_SCALAR, name, "MaxStreamingClients");
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.endpoints.StreamingEndpointControlMBean#getMaxStreamingClients()
+     */
+    public Integer getMaxStreamingClients() 
+    {
+        int maxStreamingClientsCount = ((BaseStreamingHTTPEndpoint)endpoint).getMaxStreamingClients();
+        return new Integer(maxStreamingClientsCount);
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.endpoints.StreamingEndpointControlMBean#getPushCount()
+     */
+    public Integer getPushCount()
+    {
+        return new Integer(pushCount);
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.endpoints.StreamingEndpointControlMBean#resetPushCount()
+     */
+    public void resetPushCount()
+    {
+        pushStart = System.currentTimeMillis();
+        pushCount = 0;
+        lastPushTimeStamp = null;
+    }
+    
+    /**
+     * Increments the count of messages pushed by the endpoint.
+     */
+    public void incrementPushCount()
+    {
+        ++pushCount;
+        lastPushTimeStamp = new Date();
+    }    
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.endpoints.StreamingEndpointControlMBean#getLastPushTimestamp()
+     */
+    public Date getLastPushTimestamp()
+    {
+        return lastPushTimeStamp;
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.endpoints.StreamingEndpointControlMBean#getPushFrequency()
+     */
+    public Double getPushFrequency()
+    {
+        if (pushCount > 0)
+        {
+            double runtime = differenceInMinutes(pushStart, System.currentTimeMillis());
+            return new Double(pushCount/runtime);
+        }
+        else
+        {
+            return new Double(0);
+        }
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.messaging.endpoints.StreamingEndpointControlMBean#isRunning()
+     */
+    public Integer getStreamingClientsCount()
+    {
+        int streamingClientsCount = ((BaseStreamingHTTPEndpoint)endpoint).getStreamingClientsCount();
+        return new Integer(streamingClientsCount);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControlMBean.java b/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControlMBean.java
new file mode 100755
index 0000000..69c6409
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingEndpointControlMBean.java
@@ -0,0 +1,76 @@
+/*
+ * 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.management.runtime.messaging.endpoints;
+
+import java.io.IOException;
+import java.util.Date;
+
+/**
+ * Defines the runtime monitoring and management interface for managed streaming
+ * endpoints.
+ */
+public interface StreamingEndpointControlMBean extends EndpointControlMBean
+{
+    /**
+     * Returns the maximum number of clients that will be allowed to establish
+     * a streaming HTTP connection with the endpoint.
+     *
+     * @return The maximum number of clients that will be allowed to establish
+     * a streaming HTTP connection with the endpoint.
+     * @throws IOException Throws IOException.
+     */
+    Integer getMaxStreamingClients() throws IOException;
+
+    /**
+     * Returns the count of push invocations.
+     *
+     * @return The count of push invocations.
+     * @throws IOException Throws IOException.
+     */
+    Integer getPushCount() throws IOException;
+
+    /**
+     * Resets the count of push invocations.
+     *
+     * @throws IOException Throws IOException.
+     */
+    void resetPushCount() throws IOException;
+
+    /**
+     * Returns the timestamp for the most recent push invocation.
+     *
+     * @return The timestamp for the most recent push invocation.
+     * @throws IOException Throws IOException.
+     */
+    Date getLastPushTimestamp() throws IOException;
+
+    /**
+     * Returns the number of push invocations per minute.
+     *
+     * @return The number of push invocations per minute.
+     * @throws IOException Throws IOException.
+     */
+    Double getPushFrequency() throws IOException;
+
+    /**
+     * Returns the the number of clients that are currently in the streaming state.
+     *
+     * @return The number of clients that are currently in the streaming state.
+     * @throws IOException Throws IOException.
+     */
+    Integer getStreamingClientsCount() throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControl.java b/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControl.java
new file mode 100755
index 0000000..1ce6d5d
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControl.java
@@ -0,0 +1,48 @@
+/*
+ * 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.management.runtime.messaging.endpoints;
+
+import flex.management.BaseControl;
+import flex.messaging.endpoints.StreamingHTTPEndpoint;
+
+/**
+ * The <code>StreamingHTTPEndpointControl</code> class is the MBean implemenation
+ * for monitoring and managing a <code>StreamingHTTPEndpoint</code> at runtime.
+ */
+public class StreamingHTTPEndpointControl extends StreamingEndpointControl implements
+    StreamingHTTPEndpointControlMBean
+{
+    private static final String TYPE = "StreamingHTTPEndpoint";
+
+    /**
+     * Constructs a <code>StreamingHTTPEndpointControl</code>, assigning managed message
+     * endpoint and parent MBean.
+     *
+     * @param endpoint The <code>StreamingHTTPEndpoint</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public StreamingHTTPEndpointControl(StreamingHTTPEndpoint endpoint, BaseControl parent)
+    {
+        super(endpoint, parent);
+    }
+
+    /** {@inheritDoc} */
+    public String getType()
+    {
+        return TYPE;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControlMBean.java b/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControlMBean.java
new file mode 100755
index 0000000..449253a
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/StreamingHTTPEndpointControlMBean.java
@@ -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.
+ */
+package flex.management.runtime.messaging.endpoints;
+
+/**
+ * Defines the runtime monitoring and management interface for managed streaming 
+ * HTTP endpoints.
+ */
+public interface StreamingHTTPEndpointControlMBean extends StreamingEndpointControlMBean
+{
+    // Empty for now
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/endpoints/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/endpoints/package-info.java b/modules/core/src/flex/management/runtime/messaging/endpoints/package-info.java
new file mode 100755
index 0000000..c04121d
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/endpoints/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * 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.management.runtime.messaging.endpoints;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/log/LogControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/log/LogControl.java b/modules/core/src/flex/management/runtime/messaging/log/LogControl.java
new file mode 100755
index 0000000..ab26864
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/log/LogControl.java
@@ -0,0 +1,149 @@
+/*
+ * 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.management.runtime.messaging.log;
+
+import flex.management.BaseControl;
+import flex.messaging.log.AbstractTarget;
+import flex.messaging.log.Log;
+import flex.messaging.log.Target;
+
+/**
+ * The <code>LogControl</code> class is the MBean implemenation
+ * for monitoring and managing a <code>Log</code> at runtime through the <code>LogManager</code>.
+ * @author majacobs
+ *
+ */
+public class LogControl extends BaseControl implements
+        LogControlMBean
+{
+
+    private static final String TYPE = "Log"; // The type registered with the mbean server
+    private LogManager logManager; // Reference to the LogManager which interfaces with Log
+        
+    
+    /**
+     * Creates the mbean and registers it with the mbean server.
+     * 
+     * @param parent BaseControl
+     * @param manager A reference to the LogManager
+     */
+    public LogControl(BaseControl parent, LogManager manager)
+    {
+        super(parent);
+        this.logManager = manager;
+        register();
+    }
+    
+    
+    /**
+     * Sets the logging level for the target associated with the unique ID searchId.
+     * @param searchId the search ID
+     * @param level the log level
+     */
+    public void changeTargetLevel(String searchId, String level)
+    {
+        Target selectedTarget = Log.getTarget(searchId);
+        if (selectedTarget != null)
+        {
+            selectedTarget.setLevel(new Short(level).shortValue());
+        }
+    }
+    
+    /* (non-Javadoc)
+     * @see flex.management.BaseControl#getId()
+     */
+    public String getId()
+    {
+        return logManager.getId();
+    }
+    
+    /* (non-Javadoc)
+     * @see flex.management.BaseControl#getType()
+     */
+    public String getType()
+    {
+        return TYPE;
+    }
+
+    /**
+     * Return a string array of the loggers.
+     * @return a string array of loggers
+     */
+    public String[] getLoggers()
+    {
+        return logManager.getLoggers();
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.log.LogControlMBean#getTargets()
+     */
+    public String[] getTargets()
+    {
+        return logManager.getTargetIds();
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.log.LogControlMBean#addFilterForTarget(java.lang.String, java.lang.String)
+     */
+    public void addFilterForTarget(String targetId, String filter)
+    {
+        AbstractTarget target = (AbstractTarget) logManager.getTarget(targetId);
+        
+        if (target != null && logManager.checkFilter(filter))
+            target.addFilter(filter);
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.log.LogControlMBean#getTargetFilters(java.lang.String)
+     */
+    public String[] getTargetFilters(String targetId)
+    {
+        return logManager.getTargetFilters(targetId);
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.log.LogControlMBean#removeFilterForTarget(java.lang.String, java.lang.String)
+     */
+    public void removeFilterForTarget(String targetId, String filter)
+    {
+        AbstractTarget target = (AbstractTarget) logManager.getTarget(targetId);
+        
+        if (target != null && target.containsFilter(filter))
+            target.removeFilter(filter);
+    }
+    
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.log.LogControlMBean#getCategories()
+     */
+    public String[] getCategories()
+    {
+        return (String[]) logManager.getCategories().toArray(new String[0]);
+    }
+
+
+    public Integer getTargetLevel(String searchId)
+    {
+        AbstractTarget target = (AbstractTarget) logManager.getTarget(searchId);
+        
+        if (target != null)
+        {
+            return new Integer(target.getLevel());
+        } else
+            return new Integer(-1);
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/log/LogControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/log/LogControlMBean.java b/modules/core/src/flex/management/runtime/messaging/log/LogControlMBean.java
new file mode 100755
index 0000000..b4b129f
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/log/LogControlMBean.java
@@ -0,0 +1,80 @@
+/*
+ * 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.management.runtime.messaging.log;
+
+import flex.management.BaseControlMBean;
+
+
+/**
+ * Defines the exposed properties and operations of the LogControl.
+ */
+public interface LogControlMBean extends BaseControlMBean
+{
+    /**
+     * Returns the array of log targets.
+     *
+     * @return The array of log targets.
+     */
+    String[] getTargets();
+
+    /**
+     * Returns the array of log target filters.
+     *
+     * @param targetId The target id.
+     * @return The array of log target filters.
+     */
+    String[] getTargetFilters(String targetId);
+
+    /**
+     * Returns the array of log categories.
+     *
+     * @return The array of log categories.
+     */
+    String[] getCategories();
+
+    /**
+     * Returns the target level.
+     *
+     * @param targetId The target id.
+     * @return The target level.
+     */
+    Integer getTargetLevel(String targetId);
+
+    /**
+     * Changes the target level.
+     *
+     * @param targetId The target id.
+     * @param level The target level.
+     */
+    void changeTargetLevel(String targetId, String level);
+
+    /**
+     * Adds a filter for the target.
+     *
+     * @param filter The filter.
+     * @param targetId The target id.
+     */
+    void addFilterForTarget(String filter, String targetId);
+
+    /**
+     * Removes a filter from the target.
+     *
+     * @param filter The filter.
+     * @param targetId The target id.
+     */
+    void removeFilterForTarget(String filter, String targetId);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/log/LogManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/log/LogManager.java b/modules/core/src/flex/management/runtime/messaging/log/LogManager.java
new file mode 100755
index 0000000..d6b72bc
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/log/LogManager.java
@@ -0,0 +1,266 @@
+/*
+ * 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.management.runtime.messaging.log;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.lang.reflect.Field;
+
+import flex.management.ManageableComponent;
+import flex.messaging.config.ConfigurationException;
+import flex.messaging.log.Log;
+import flex.messaging.log.LogCategories;
+import flex.messaging.log.Target;
+
+
+/**
+ * The LogManager is an interface between the Log and the LogControl which exists
+ * because Log lives in the common package, so it cannot extend ManageableComponent itself,
+ * which is necessary for a class to be exposed through MBeans.
+ *
+ * @author majacobs
+ *
+ */
+public class LogManager extends ManageableComponent
+{
+
+    private static final String LOG_CATEGORY = LogCategories.CONFIGURATION; // Log category used by LogManager (ManageableComponent)
+    private static final int NULL_LOG_REF_EXCEPTION = 10031;
+
+    private Log log;
+    private String ID = "log";
+    private CategoryManager categoryManager;
+    private LogControl controller;
+
+    private boolean isSetup;
+
+    /**
+     * Public constructor required by ManageableComponent.
+     */
+    public LogManager()
+    {
+        this(true);
+    }
+
+    public LogManager(boolean enableManagement)
+    {
+        super(enableManagement);
+        setId(ID);
+
+        categoryManager = new CategoryManager();
+
+    }
+
+
+    public void setupLogControl()
+    {
+        if (!isSetup)
+        {
+            controller = new LogControl(getParent().getControl(), this);
+            setControl(controller);
+            controller.register();
+            isSetup = true;
+        }
+    }
+
+    public void stop()
+    {
+        if (!isStarted())
+        {
+            return;
+        }
+
+
+        super.stop();
+
+        // Remove management
+        if (isManaged())
+        {
+            if (getControl() != null)
+            {
+                getControl().unregister();
+                setControl(null);
+            }
+            setManaged(false);
+        }
+    }
+
+    public void setLog(Log logInstance)
+    {
+        log = logInstance;
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.ManageableComponent#getLogCategory()
+     */
+    protected String getLogCategory()
+    {
+        return LOG_CATEGORY;
+    }
+
+    /**
+     * Gets the Loggers as a string array.
+     * @return a String array
+     */
+    public String[] getLoggers()
+    {
+        return log.getLoggers();
+    }
+
+    /**
+     * Gets the Target IDs.
+     * @return a string array
+     */
+    public String[] getTargetIds()
+    {
+        return (String[]) Log.getTargetMap().keySet().toArray(new String[0]);
+    }
+
+    /**
+     * Get a Target for a targetId.
+     *
+     * @param targetId the target ID
+     * @return the target from the Log, or null if it is not found
+     */
+    public Target getTarget(String targetId)
+    {
+        return (Target) Log.getTargetMap().get(targetId);
+    }
+
+    /**
+     * Gets the filters for a given target.
+     * @param targetId the target ID
+     * @return a string array
+     */
+    public String[] getTargetFilters(String targetId)
+    {
+
+        Target target = getTarget(targetId);
+
+        if (target == null)
+            return new String[0];
+
+        List filterObjects = target.getFilters();
+        String[] filters = new String[filterObjects.size()];
+        for (int i = 0; i < filterObjects.size(); i++)
+        {
+            filters[i] = (String)filterObjects.get(i);
+        }
+
+        return filters;
+    }
+
+    /**
+     * Check whether a filter is valid.
+     * @param filter the filter string to check
+     * @return whether the category exists in LogCategories
+     */
+    public boolean checkFilter(String filter)
+    {
+        return categoryManager.checkFilter(filter);
+    }
+
+    /**
+     * Return a list of categories in LogCategories.
+     * @return the list of categories in LogCategories
+     */
+    public List getCategories()
+    {
+        return categoryManager.getCategories();
+    }
+
+    protected void validate()
+    {
+        if (isValid())
+            return;
+
+        super.validate();
+
+        if (log == null)
+        {
+            invalidate();
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(NULL_LOG_REF_EXCEPTION, new Object[]{});
+            throw ex;
+        }
+
+    }
+
+    /**
+     * This private class keeps track of what categories exist in LogCategories by implementing
+     * LogCategories and reflecting the interface's properties.
+     *
+     * @author majacobs
+     *
+     */
+    private class CategoryManager implements LogCategories
+    {
+        private List categories;
+
+        /**
+         * Construct an ArrayList for each category in the reflected public properties
+         * Note this will be incorrect if additional public properties are added to this class
+         * or to the interface LogCategories.
+         */
+        public CategoryManager()
+        {
+            categories = new ArrayList();
+
+            Field[] categoryFields = this.getClass().getFields();
+            for (int i = 0; i < categoryFields.length; i++)
+            {
+                try
+                {
+                    categories.add((String)categoryFields[i].get(this));
+                }
+                catch (IllegalAccessException iae)
+                {
+                    // Illegal Access on reflection
+                }
+            }
+        }
+
+
+        /**
+         * Check if any categories match with the filter (the filter is valid or not).
+         * @param filter the filter string to check
+         * @return whether the filter is valid  (with or without a trailing .*)
+         */
+        public boolean checkFilter(String filter)
+        {
+
+            for (int i = 0; i < categories.size(); i++)
+            {
+                if (Log.checkFilterToCategory((String)filter, (String)categories.get(i)))
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        /**
+         * Return a list of log categories.
+         * @return List a list of the categories
+         */
+        public List getCategories()
+        {
+            return Collections.unmodifiableList(new ArrayList(categories));
+        }
+    }
+}


[46/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/history/history.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/history/history.js b/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/history/history.js
new file mode 100755
index 0000000..0f82450
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/history/history.js
@@ -0,0 +1,722 @@
+/*
+ * 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.
+ */
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        ie8: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+        if (browser.version == 8)
+        {
+            browser.ie = false;
+            browser.ie8 = true;
+        }
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    function hashChangeHandler()
+    {
+        currentHref = document.location.href;
+        var flexAppUrl = getHash();
+        //ADR: to fix multiple
+        if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+            var pl = getPlayers();
+            for (var i = 0; i < pl.length; i++) {
+                pl[i].browserURLChange(flexAppUrl);
+            }
+        } else {
+            getPlayer().browserURLChange(flexAppUrl);
+        }
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+        var i;
+
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+                for (i = 0; i < o.length; i++) {
+                    if (typeof o[i].browserURLChange != "undefined")
+                        return o[i];
+                }
+                for (i = 0; i < e.length; i++) {
+                    if (typeof e[i].browserURLChange != "undefined")
+                        return e[i];
+                }
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+            for (i = 0; i < e.length; i++) {
+                if (typeof e[i].browserURLChange != "undefined")
+                {
+                    return e[i];
+                }
+            }
+            for (i = 0; i < o.length; i++) {
+                if (typeof o[i].browserURLChange != "undefined")
+                {
+                    return o[i];
+                }
+            }
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var i;
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+                        currentHref = document.location.href;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                var flexAppUrl = getHash();
+                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
+                {    
+                    // If it did change and we're running Safari 3.x or earlier, 
+                    // then we have to look the old state up in our hand-maintained 
+                    // array since document.location.hash won't have changed, 
+                    // then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                    flexAppUrl = historyHash[currentHistoryLength];
+                }
+
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            iframe.src = 'javascript:false;'; 
+
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox || browser.ie8)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+
+        if (browser.ie8)        
+            document.body.onhashchange = hashChangeHandler;
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        },
+        getUserAgent: function() {
+            return navigator.userAgent;
+        },
+        getPlatform: function() {
+            return navigator.platform;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/history/historyFrame.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/history/historyFrame.html b/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/history/historyFrame.html
new file mode 100755
index 0000000..63bdd3e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/history/historyFrame.html
@@ -0,0 +1,45 @@
+<!--
+  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>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/index.template.html b/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/index.template.html
new file mode 100755
index 0000000..e3e9c81
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/swfobject.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/swfobject.js b/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/swfobject.js
new file mode 100755
index 0000000..07730fa
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/swfobject.js
@@ -0,0 +1,793 @@
+/*
+ * 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.
+ */
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+	
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+		ON_READY_STATE_CHANGE = "onreadystatechange",
+		
+		win = window,
+		doc = document,
+		nav = navigator,
+		
+		plugin = false,
+		domLoadFnArr = [main],
+		regObjArr = [],
+		objIdArr = [],
+		listenersArr = [],
+		storedAltContent,
+		storedAltContentId,
+		storedCallbackFn,
+		storedCallbackObj,
+		isDomLoaded = false,
+		isExpressInstallActive = false,
+		dynamicStylesheet,
+		dynamicStylesheetMedia,
+		autoHideShow = true,
+	
+	/* Centralized function for browser feature detection
+		- User agent string detection is only used when no good alternative is possible
+		- Is executed directly for optimal performance
+	*/	
+	ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+			u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+				plugin = true;
+				ie = false; // cascaded feature detection for Internet Explorer
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			try {
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+				if (a) { // a will return null when ActiveX is disabled
+					d = a.GetVariable("$version");
+					if (d) {
+						ie = true; // cascaded feature detection for Internet Explorer
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+			}
+			catch(e) {}
+		}
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+	}(),
+	
+	/* Cross-browser onDomLoad
+		- Will fire an event as soon as the DOM of a web page is loaded
+		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+		- Regular onload serves as fallback
+	*/ 
+	onDomLoad = function() {
+		if (!ua.w3) { return; }
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+			callDomLoadFunctions();
+		}
+		if (!isDomLoaded) {
+			if (typeof doc.addEventListener != UNDEF) {
+				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+			}		
+			if (ua.ie && ua.win) {
+				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+					if (doc.readyState == "complete") {
+						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+						callDomLoadFunctions();
+					}
+				});
+				if (win == top) { // if not inside an iframe
+					(function(){
+						if (isDomLoaded) { return; }
+						try {
+							doc.documentElement.doScroll("left");
+						}
+						catch(e) {
+							setTimeout(arguments.callee, 0);
+							return;
+						}
+						callDomLoadFunctions();
+					})();
+				}
+			}
+			if (ua.wk) {
+				(function(){
+					if (isDomLoaded) { return; }
+					if (!/loaded|complete/.test(doc.readyState)) {
+						setTimeout(arguments.callee, 0);
+						return;
+					}
+					callDomLoadFunctions();
+				})();
+			}
+			addLoadEvent(callDomLoadFunctions);
+		}
+	}();
+	
+	function callDomLoadFunctions() {
+		if (isDomLoaded) { return; }
+		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+			t.parentNode.removeChild(t);
+		}
+		catch (e) { return; }
+		isDomLoaded = true;
+		var dl = domLoadFnArr.length;
+		for (var i = 0; i < dl; i++) {
+			domLoadFnArr[i]();
+		}
+	}
+	
+	function addDomLoadEvent(fn) {
+		if (isDomLoaded) {
+			fn();
+		}
+		else { 
+			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+		}
+	}
+	
+	/* Cross-browser onload
+		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+		- Will fire an event as soon as a web page including all of its assets are loaded 
+	 */
+	function addLoadEvent(fn) {
+		if (typeof win.addEventListener != UNDEF) {
+			win.addEventListener("load", fn, false);
+		}
+		else if (typeof doc.addEventListener != UNDEF) {
+			doc.addEventListener("load", fn, false);
+		}
+		else if (typeof win.attachEvent != UNDEF) {
+			addListener(win, "onload", fn);
+		}
+		else if (typeof win.onload == "function") {
+			var fnOld = win.onload;
+			win.onload = function() {
+				fnOld();
+				fn();
+			};
+		}
+		else {
+			win.onload = fn;
+		}
+	}
+	
+	/* Main function
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
+	*/
+	function main() { 
+		if (plugin) {
+			testPlayerVersion();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Detect the Flash Player version for non-Internet Explorer browsers
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+		  a. Both release and build numbers can be detected
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+	*/
+	function testPlayerVersion() {
+		var b = doc.getElementsByTagName("body")[0];
+		var o = createElement(OBJECT);
+		o.setAttribute("type", FLASH_MIME_TYPE);
+		var t = b.appendChild(o);
+		if (t) {
+			var counter = 0;
+			(function(){
+				if (typeof t.GetVariable != UNDEF) {
+					var d = t.GetVariable("$version");
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				else if (counter < 10) {
+					counter++;
+					setTimeout(arguments.callee, 10);
+					return;
+				}
+				b.removeChild(o);
+				t = null;
+				matchVersions();
+			})();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Perform Flash Player and SWF version matching; static publishing only
+	*/
+	function matchVersions() {
+		var rl = regObjArr.length;
+		if (rl > 0) {
+			for (var i = 0; i < rl; i++) { // for each registered object element
+				var id = regObjArr[i].id;
+				var cb = regObjArr[i].callbackFn;
+				var cbObj = {success:false, id:id};
+				if (ua.pv[0] > 0) {
+					var obj = getElementById(id);
+					if (obj) {
+						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+							setVisibility(id, true);
+							if (cb) {
+								cbObj.success = true;
+								cbObj.ref = getObjectById(id);
+								cb(cbObj);
+							}
+						}
+						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+							var att = {};
+							att.data = regObjArr[i].expressInstall;
+							att.width = obj.getAttribute("width") || "0";
+							att.height = obj.getAttribute("height") || "0";
+							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+							// parse HTML object param element's name-value pairs
+							var par = {};
+							var p = obj.getElementsByTagName("param");
+							var pl = p.length;
+							for (var j = 0; j < pl; j++) {
+								if (p[j].getAttribute("name").toLowerCase() != "movie") {
+									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+								}
+							}
+							showExpressInstall(att, par, id, cb);
+						}
+						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+							displayAltContent(obj);
+							if (cb) { cb(cbObj); }
+						}
+					}
+				}
+				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+					setVisibility(id, true);
+					if (cb) {
+						var o = getObjectById(id); // test whether there is an HTML object element or not
+						if (o && typeof o.SetVariable != UNDEF) { 
+							cbObj.success = true;
+							cbObj.ref = o;
+						}
+						cb(cbObj);
+					}
+				}
+			}
+		}
+	}
+	
+	function getObjectById(objectIdStr) {
+		var r = null;
+		var o = getElementById(objectIdStr);
+		if (o && o.nodeName == "OBJECT") {
+			if (typeof o.SetVariable != UNDEF) {
+				r = o;
+			}
+			else {
+				var n = o.getElementsByTagName(OBJECT)[0];
+				if (n) {
+					r = n;
+				}
+			}
+		}
+		return r;
+	}
+	
+	/* Requirements for Adobe Express Install
+		- only one instance can be active at a time
+		- fp 6.0.65 or higher
+		- Win/Mac OS only
+		- no Webkit engines older than version 312
+	*/
+	function canExpressInstall() {
+		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+	}
+	
+	/* Show the Adobe Express Install dialog
+		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+	*/
+	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+		isExpressInstallActive = true;
+		storedCallbackFn = callbackFn || null;
+		storedCallbackObj = {success:false, id:replaceElemIdStr};
+		var obj = getElementById(replaceElemIdStr);
+		if (obj) {
+			if (obj.nodeName == "OBJECT") { // static publishing
+				storedAltContent = abstractAltContent(obj);
+				storedAltContentId = null;
+			}
+			else { // dynamic publishing
+				storedAltContent = obj;
+				storedAltContentId = replaceElemIdStr;
+			}
+			att.id = EXPRESS_INSTALL_ID;
+			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+				fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+			if (typeof par.flashvars != UNDEF) {
+				par.flashvars += "&" + fv;
+			}
+			else {
+				par.flashvars = fv;
+			}
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			if (ua.ie && ua.win && obj.readyState != 4) {
+				var newObj = createElement("div");
+				replaceElemIdStr += "SWFObjectNew";
+				newObj.setAttribute("id", replaceElemIdStr);
+				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						obj.parentNode.removeChild(obj);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			createSWF(att, par, replaceElemIdStr);
+		}
+	}
+	
+	/* Functions to abstract and display alternative content
+	*/
+	function displayAltContent(obj) {
+		if (ua.ie && ua.win && obj.readyState != 4) {
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			var el = createElement("div");
+			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+			el.parentNode.replaceChild(abstractAltContent(obj), el);
+			obj.style.display = "none";
+			(function(){
+				if (obj.readyState == 4) {
+					obj.parentNode.removeChild(obj);
+				}
+				else {
+					setTimeout(arguments.callee, 10);
+				}
+			})();
+		}
+		else {
+			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+		}
+	} 
+
+	function abstractAltContent(obj) {
+		var ac = createElement("div");
+		if (ua.win && ua.ie) {
+			ac.innerHTML = obj.innerHTML;
+		}
+		else {
+			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+			if (nestedObj) {
+				var c = nestedObj.childNodes;
+				if (c) {
+					var cl = c.length;
+					for (var i = 0; i < cl; i++) {
+						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+							ac.appendChild(c[i].cloneNode(true));
+						}
+					}
+				}
+			}
+		}
+		return ac;
+	}
+	
+	/* Cross-browser dynamic SWF creation
+	*/
+	function createSWF(attObj, parObj, id) {
+		var r, el = getElementById(id);
+		if (ua.wk && ua.wk < 312) { return r; }
+		if (el) {
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+				attObj.id = id;
+			}
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+				var att = "";
+				for (var i in attObj) {
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+						if (i.toLowerCase() == "data") {
+							parObj.movie = attObj[i];
+						}
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							att += ' class="' + attObj[i] + '"';
+						}
+						else if (i.toLowerCase() != "classid") {
+							att += ' ' + i + '="' + attObj[i] + '"';
+						}
+					}
+				}
+				var par = "";
+				for (var j in parObj) {
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+					}
+				}
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+				r = getElementById(attObj.id);	
+			}
+			else { // well-behaving browsers
+				var o = createElement(OBJECT);
+				o.setAttribute("type", FLASH_MIME_TYPE);
+				for (var m in attObj) {
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							o.setAttribute("class", attObj[m]);
+						}
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+							o.setAttribute(m, attObj[m]);
+						}
+					}
+				}
+				for (var n in parObj) {
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+						createObjParam(o, n, parObj[n]);
+					}
+				}
+				el.parentNode.replaceChild(o, el);
+				r = o;
+			}
+		}
+		return r;
+	}
+	
+	function createObjParam(el, pName, pValue) {
+		var p = createElement("param");
+		p.setAttribute("name", pName);	
+		p.setAttribute("value", pValue);
+		el.appendChild(p);
+	}
+	
+	/* Cross-browser SWF removal
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
+	*/
+	function removeSWF(id) {
+		var obj = getElementById(id);
+		if (obj && obj.nodeName == "OBJECT") {
+			if (ua.ie && ua.win) {
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						removeObjectInIE(id);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			else {
+				obj.parentNode.removeChild(obj);
+			}
+		}
+	}
+	
+	function removeObjectInIE(id) {
+		var obj = getElementById(id);
+		if (obj) {
+			for (var i in obj) {
+				if (typeof obj[i] == "function") {
+					obj[i] = null;
+				}
+			}
+			obj.parentNode.removeChild(obj);
+		}
+	}
+	
+	/* Functions to optimize JavaScript compression
+	*/
+	function getElementById(id) {
+		var el = null;
+		try {
+			el = doc.getElementById(id);
+		}
+		catch (e) {}
+		return el;
+	}
+	
+	function createElement(el) {
+		return doc.createElement(el);
+	}
+	
+	/* Updated attachEvent function for Internet Explorer
+		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+	*/	
+	function addListener(target, eventType, fn) {
+		target.attachEvent(eventType, fn);
+		listenersArr[listenersArr.length] = [target, eventType, fn];
+	}
+	
+	/* Flash Player and SWF content version matching
+	*/
+	function hasPlayerVersion(rv) {
+		var pv = ua.pv, v = rv.split(".");
+		v[0] = parseInt(v[0], 10);
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+		v[2] = parseInt(v[2], 10) || 0;
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+	}
+	
+	/* Cross-browser dynamic CSS creation
+		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+	*/	
+	function createCSS(sel, decl, media, newStyle) {
+		if (ua.ie && ua.mac) { return; }
+		var h = doc.getElementsByTagName("head")[0];
+		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+		var m = (media && typeof media == "string") ? media : "screen";
+		if (newStyle) {
+			dynamicStylesheet = null;
+			dynamicStylesheetMedia = null;
+		}
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+			// create dynamic stylesheet + get a global reference to it
+			var s = createElement("style");
+			s.setAttribute("type", "text/css");
+			s.setAttribute("media", m);
+			dynamicStylesheet = h.appendChild(s);
+			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+			}
+			dynamicStylesheetMedia = m;
+		}
+		// add style rule
+		if (ua.ie && ua.win) {
+			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+				dynamicStylesheet.addRule(sel, decl);
+			}
+		}
+		else {
+			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+			}
+		}
+	}
+	
+	function setVisibility(id, isVisible) {
+		if (!autoHideShow) { return; }
+		var v = isVisible ? "visible" : "hidden";
+		if (isDomLoaded && getElementById(id)) {
+			getElementById(id).style.visibility = v;
+		}
+		else {
+			createCSS("#" + id, "visibility:" + v);
+		}
+	}
+
+	/* Filter to avoid XSS attacks
+	*/
+	function urlEncodeIfNecessary(s) {
+		var regex = /[\\\"<>\.;]/;
+		var hasBadChars = regex.exec(s) != null;
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+	}
+	
+	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+	*/
+	var cleanup = function() {
+		if (ua.ie && ua.win) {
+			window.attachEvent("onunload", function() {
+				// remove listeners to avoid memory leaks
+				var ll = listenersArr.length;
+				for (var i = 0; i < ll; i++) {
+					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+				}
+				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+				var il = objIdArr.length;
+				for (var j = 0; j < il; j++) {
+					removeSWF(objIdArr[j]);
+				}
+				// cleanup library's main closures to avoid memory leaks
+				for (var k in ua) {
+					ua[k] = null;
+				}
+				ua = null;
+				for (var l in swfobject) {
+					swfobject[l] = null;
+				}
+				swfobject = null;
+			});
+		}
+	}();
+	
+	return {
+		/* Public API
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
+		*/ 
+		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+			if (ua.w3 && objectIdStr && swfVersionStr) {
+				var regObj = {};
+				regObj.id = objectIdStr;
+				regObj.swfVersion = swfVersionStr;
+				regObj.expressInstall = xiSwfUrlStr;
+				regObj.callbackFn = callbackFn;
+				regObjArr[regObjArr.length] = regObj;
+				setVisibility(objectIdStr, false);
+			}
+			else if (callbackFn) {
+				callbackFn({success:false, id:objectIdStr});
+			}
+		},
+		
+		getObjectById: function(objectIdStr) {
+			if (ua.w3) {
+				return getObjectById(objectIdStr);
+			}
+		},
+		
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+			var callbackObj = {success:false, id:replaceElemIdStr};
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+				setVisibility(replaceElemIdStr, false);
+				addDomLoadEvent(function() {
+					widthStr += ""; // auto-convert to string
+					heightStr += "";
+					var att = {};
+					if (attObj && typeof attObj === OBJECT) {
+						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+							att[i] = attObj[i];
+						}
+					}
+					att.data = swfUrlStr;
+					att.width = widthStr;
+					att.height = heightStr;
+					var par = {}; 
+					if (parObj && typeof parObj === OBJECT) {
+						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+							par[j] = parObj[j];
+						}
+					}
+					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+							if (typeof par.flashvars != UNDEF) {
+								par.flashvars += "&" + k + "=" + flashvarsObj[k];
+							}
+							else {
+								par.flashvars = k + "=" + flashvarsObj[k];
+							}
+						}
+					}
+					if (hasPlayerVersion(swfVersionStr)) { // create SWF
+						var obj = createSWF(att, par, replaceElemIdStr);
+						if (att.id == replaceElemIdStr) {
+							setVisibility(replaceElemIdStr, true);
+						}
+						callbackObj.success = true;
+						callbackObj.ref = obj;
+					}
+					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+						att.data = xiSwfUrlStr;
+						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+						return;
+					}
+					else { // show alternative content
+						setVisibility(replaceElemIdStr, true);
+					}
+					if (callbackFn) { callbackFn(callbackObj); }
+				});
+			}
+			else if (callbackFn) { callbackFn(callbackObj);	}
+		},
+		
+		switchOffAutoHideShow: function() {
+			autoHideShow = false;
+		},
+		
+		ua: ua,
+		
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		},
+		
+		hasFlashPlayerVersion: hasPlayerVersion,
+		
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
+			if (ua.w3) {
+				return createSWF(attObj, parObj, replaceElemIdStr);
+			}
+			else {
+				return undefined;
+			}
+		},
+		
+		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+			if (ua.w3 && canExpressInstall()) {
+				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+			}
+		},
+		
+		removeSWF: function(objElemIdStr) {
+			if (ua.w3) {
+				removeSWF(objElemIdStr);
+			}
+		},
+		
+		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+			if (ua.w3) {
+				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+			}
+		},
+		
+		addDomLoadEvent: addDomLoadEvent,
+		
+		addLoadEvent: addLoadEvent,
+		
+		getQueryParamValue: function(param) {
+			var q = doc.location.search || doc.location.hash;
+			if (q) {
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+				if (param == null) {
+					return urlEncodeIfNecessary(q);
+				}
+				var pairs = q.split("&");
+				for (var i = 0; i < pairs.length; i++) {
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+					}
+				}
+			}
+			return "";
+		},
+		
+		// For internal usage only
+		expressInstallCallback: function() {
+			if (isExpressInstallActive) {
+				var obj = getElementById(EXPRESS_INSTALL_ID);
+				if (obj && storedAltContent) {
+					obj.parentNode.replaceChild(storedAltContent, obj);
+					if (storedAltContentId) {
+						setVisibility(storedAltContentId, true);
+						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+					}
+					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+				}
+				isExpressInstallActive = false;
+			} 
+		}
+	};
+}();

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/collaboration/src/Customer.as
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/collaboration/src/Customer.as b/apps/samples-spring/WEB-INF/flex-src/collaboration/src/Customer.as
new file mode 100755
index 0000000..18f0abe
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/collaboration/src/Customer.as
@@ -0,0 +1,34 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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]
+	public class Customer
+	{
+		public var firstName:String;
+		public var lastName:String;
+		public var usCitizen:Boolean;
+		public var address:String;
+		public var city:String;
+		public var state:String;
+		public var zip:String;
+		public var officePhone:String;
+		public var cellPhone:String;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/collaboration/src/collaboration.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/collaboration/src/collaboration.mxml b/apps/samples-spring/WEB-INF/flex-src/collaboration/src/collaboration.mxml
new file mode 100755
index 0000000..17e3603
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/collaboration/src/collaboration.mxml
@@ -0,0 +1,147 @@
+<?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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" 
+			   applicationComplete="init()" xmlns:local="*">
+
+	<fx:Script>
+		<![CDATA[
+		
+		import mx.events.IndexChangedEvent;
+		import mx.messaging.messages.AsyncMessage;
+		import mx.utils.UIDUtil;
+		import mx.messaging.events.MessageEvent;
+		import mx.events.PropertyChangeEvent;
+		
+		private var userId:String; // Unique user id
+		
+		private function init():void
+		{
+			userId = UIDUtil.createUID();	// Generate unique user id
+			customer.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, propertyChangeHandler);
+			consumer.subscribe();
+		}
+		
+		private function propertyChangeHandler(event:PropertyChangeEvent):void
+		{
+			sendMessage("propertyChange", {property: event.property, value: event.newValue});
+		}
+		
+		private function accordionChangeHandler(event:IndexChangedEvent):void
+		{
+			sendMessage("accordionChange", {selectedIndex: event.newIndex});
+		}
+		
+		private function messageHandler(event:MessageEvent):void
+		{
+			var remoteUserId:String = event.message.body.userId;
+			// If the message was sent by this user, don't handle it
+			if (remoteUserId == userId)
+			{
+				return;
+			}        	
+			
+			var data:Object = event.message.body.data
+			switch (event.message.body.action)
+			{
+				case "accordionChange":
+					accordion.selectedIndex = data.selectedIndex;
+					return;
+				case "propertyChange":
+					customer.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE, propertyChangeHandler); // avoid circularity
+					customer[data.property] = data.value; 
+					customer.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, propertyChangeHandler);
+					return;
+			}
+		}
+		
+		private function sendMessage(action:String, data:Object = null):void
+		{
+			var message:AsyncMessage = new AsyncMessage();
+			message.body.userId = userId;
+			message.body.action = action;
+			message.body.data = data;
+			producer.send(message);
+		}		
+		
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<local:Customer id="customer"/>
+		
+		<mx:ChannelSet id="cs">
+			<mx:StreamingAMFChannel uri="/samples-spring/messagebroker/streamingamf"/>
+			<mx:AMFChannel uri="/samples-spring/messagebroker/amflongpolling"/>
+			<mx:AMFChannel uri="/samples-spring/messagebroker/amfpolling"/>
+		</mx:ChannelSet>
+		
+		<mx:Producer id="producer" destination="chat" channelSet="{cs}"/>
+		<mx:Consumer id="consumer" destination="chat" channelSet="{cs}" message="messageHandler(event)"/>
+	</fx:Declarations>
+	
+	
+	<s:Panel title="Customer Information" top="12" bottom="12" left="12" right="12">
+		
+		<mx:Accordion id="accordion" width="100%" height="100%" openDuration="0"
+					  change="accordionChangeHandler(event)">
+			
+			<mx:Form label="General">
+				<mx:FormItem label="First Name">
+					<s:TextInput id="firstName" text="@{customer.firstName}"/>
+				</mx:FormItem>
+				<mx:FormItem label="Last Name">
+					<s:TextInput id="lastName" text="@{customer.lastName}"/>
+				</mx:FormItem>
+				<mx:FormItem>
+					<s:CheckBox id="usCitizen" selected="@{customer.usCitizen}" label="US Citizen"/>
+				</mx:FormItem>
+			</mx:Form>
+			
+			<mx:Form label="Address">
+				<mx:FormItem label="Address">
+					<s:TextInput id="address" text="@{customer.address}"/>
+				</mx:FormItem>
+				<mx:FormItem label="City">
+					<s:TextInput id="city" text="@{customer.city}"/>
+				</mx:FormItem>
+				<mx:FormItem label="State">
+					<s:TextInput id="state" text="@{customer.state}"/>
+				</mx:FormItem>
+				<mx:FormItem label="Zip">
+					<s:TextInput id="zip" text="@{customer.zip}"/>
+				</mx:FormItem>
+			</mx:Form>
+			
+			<mx:Form label="Phone">
+				<mx:FormItem label="Office">
+					<s:TextInput id="officePhone" text="@{customer.officePhone}"/>
+				</mx:FormItem>
+				<mx:FormItem label="Cell">
+					<s:TextInput id="cellPhone" text="@{customer.cellPhone}"/>
+				</mx:FormItem>
+			</mx:Form>
+			
+		</mx:Accordion>
+		
+	</s:Panel>
+	
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/companymgr/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/.actionScriptProperties b/apps/samples-spring/WEB-INF/flex-src/companymgr/.actionScriptProperties
new file mode 100755
index 0000000..afa8cdd
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="companymgr.mxml" projectUUID="7412f889-9564-46a9-9bb0-2aeee9a54877" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="companymgr.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/companymgr/.flexProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/.flexProperties b/apps/samples-spring/WEB-INF/flex-src/companymgr/.flexProperties
new file mode 100755
index 0000000..1d99468
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/.flexProperties
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/companymgr/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/.project b/apps/samples-spring/WEB-INF/flex-src/companymgr/.project
new file mode 100755
index 0000000..3aa892a
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/.project
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>companymgr</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/companymgr/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/build.xml b/apps/samples-spring/WEB-INF/flex-src/companymgr/build.xml
new file mode 100755
index 0000000..83a822e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/build.xml
@@ -0,0 +1,76 @@
+<?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-spring.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="context.root" value="samples-spring" />
+    <property name="application.name" value="companymgr" />
+    <property name="application.file" value="companymgr" />
+    <property name="application.bin.dir" value="${samples-spring.war}/companymgr" />
+    <property name="application.src.dir" value="${samples-spring.war}/WEB-INF/flex-src/companymgr/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-spring.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"
+            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-spring/WEB-INF/flex-src/companymgr/html-template/history/history.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/history/history.css b/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/history/history.css
new file mode 100755
index 0000000..4a7f791
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/history/history.css
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }


[42/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/history/history.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/history/history.js b/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/history/history.js
new file mode 100755
index 0000000..0f82450
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/history/history.js
@@ -0,0 +1,722 @@
+/*
+ * 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.
+ */
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        ie8: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+        if (browser.version == 8)
+        {
+            browser.ie = false;
+            browser.ie8 = true;
+        }
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    function hashChangeHandler()
+    {
+        currentHref = document.location.href;
+        var flexAppUrl = getHash();
+        //ADR: to fix multiple
+        if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+            var pl = getPlayers();
+            for (var i = 0; i < pl.length; i++) {
+                pl[i].browserURLChange(flexAppUrl);
+            }
+        } else {
+            getPlayer().browserURLChange(flexAppUrl);
+        }
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+        var i;
+
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+                for (i = 0; i < o.length; i++) {
+                    if (typeof o[i].browserURLChange != "undefined")
+                        return o[i];
+                }
+                for (i = 0; i < e.length; i++) {
+                    if (typeof e[i].browserURLChange != "undefined")
+                        return e[i];
+                }
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+            for (i = 0; i < e.length; i++) {
+                if (typeof e[i].browserURLChange != "undefined")
+                {
+                    return e[i];
+                }
+            }
+            for (i = 0; i < o.length; i++) {
+                if (typeof o[i].browserURLChange != "undefined")
+                {
+                    return o[i];
+                }
+            }
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var i;
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+                        currentHref = document.location.href;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                var flexAppUrl = getHash();
+                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
+                {    
+                    // If it did change and we're running Safari 3.x or earlier, 
+                    // then we have to look the old state up in our hand-maintained 
+                    // array since document.location.hash won't have changed, 
+                    // then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                    flexAppUrl = historyHash[currentHistoryLength];
+                }
+
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            iframe.src = 'javascript:false;'; 
+
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox || browser.ie8)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+
+        if (browser.ie8)        
+            document.body.onhashchange = hashChangeHandler;
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        },
+        getUserAgent: function() {
+            return navigator.userAgent;
+        },
+        getPlatform: function() {
+            return navigator.platform;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/history/historyFrame.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/history/historyFrame.html b/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/history/historyFrame.html
new file mode 100755
index 0000000..63bdd3e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/history/historyFrame.html
@@ -0,0 +1,45 @@
+<!--
+  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>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/index.template.html b/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/index.template.html
new file mode 100755
index 0000000..e3e9c81
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/swfobject.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/swfobject.js b/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/swfobject.js
new file mode 100755
index 0000000..07730fa
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/swfobject.js
@@ -0,0 +1,793 @@
+/*
+ * 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.
+ */
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+	
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+		ON_READY_STATE_CHANGE = "onreadystatechange",
+		
+		win = window,
+		doc = document,
+		nav = navigator,
+		
+		plugin = false,
+		domLoadFnArr = [main],
+		regObjArr = [],
+		objIdArr = [],
+		listenersArr = [],
+		storedAltContent,
+		storedAltContentId,
+		storedCallbackFn,
+		storedCallbackObj,
+		isDomLoaded = false,
+		isExpressInstallActive = false,
+		dynamicStylesheet,
+		dynamicStylesheetMedia,
+		autoHideShow = true,
+	
+	/* Centralized function for browser feature detection
+		- User agent string detection is only used when no good alternative is possible
+		- Is executed directly for optimal performance
+	*/	
+	ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+			u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+				plugin = true;
+				ie = false; // cascaded feature detection for Internet Explorer
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			try {
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+				if (a) { // a will return null when ActiveX is disabled
+					d = a.GetVariable("$version");
+					if (d) {
+						ie = true; // cascaded feature detection for Internet Explorer
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+			}
+			catch(e) {}
+		}
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+	}(),
+	
+	/* Cross-browser onDomLoad
+		- Will fire an event as soon as the DOM of a web page is loaded
+		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+		- Regular onload serves as fallback
+	*/ 
+	onDomLoad = function() {
+		if (!ua.w3) { return; }
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+			callDomLoadFunctions();
+		}
+		if (!isDomLoaded) {
+			if (typeof doc.addEventListener != UNDEF) {
+				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+			}		
+			if (ua.ie && ua.win) {
+				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+					if (doc.readyState == "complete") {
+						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+						callDomLoadFunctions();
+					}
+				});
+				if (win == top) { // if not inside an iframe
+					(function(){
+						if (isDomLoaded) { return; }
+						try {
+							doc.documentElement.doScroll("left");
+						}
+						catch(e) {
+							setTimeout(arguments.callee, 0);
+							return;
+						}
+						callDomLoadFunctions();
+					})();
+				}
+			}
+			if (ua.wk) {
+				(function(){
+					if (isDomLoaded) { return; }
+					if (!/loaded|complete/.test(doc.readyState)) {
+						setTimeout(arguments.callee, 0);
+						return;
+					}
+					callDomLoadFunctions();
+				})();
+			}
+			addLoadEvent(callDomLoadFunctions);
+		}
+	}();
+	
+	function callDomLoadFunctions() {
+		if (isDomLoaded) { return; }
+		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+			t.parentNode.removeChild(t);
+		}
+		catch (e) { return; }
+		isDomLoaded = true;
+		var dl = domLoadFnArr.length;
+		for (var i = 0; i < dl; i++) {
+			domLoadFnArr[i]();
+		}
+	}
+	
+	function addDomLoadEvent(fn) {
+		if (isDomLoaded) {
+			fn();
+		}
+		else { 
+			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+		}
+	}
+	
+	/* Cross-browser onload
+		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+		- Will fire an event as soon as a web page including all of its assets are loaded 
+	 */
+	function addLoadEvent(fn) {
+		if (typeof win.addEventListener != UNDEF) {
+			win.addEventListener("load", fn, false);
+		}
+		else if (typeof doc.addEventListener != UNDEF) {
+			doc.addEventListener("load", fn, false);
+		}
+		else if (typeof win.attachEvent != UNDEF) {
+			addListener(win, "onload", fn);
+		}
+		else if (typeof win.onload == "function") {
+			var fnOld = win.onload;
+			win.onload = function() {
+				fnOld();
+				fn();
+			};
+		}
+		else {
+			win.onload = fn;
+		}
+	}
+	
+	/* Main function
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
+	*/
+	function main() { 
+		if (plugin) {
+			testPlayerVersion();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Detect the Flash Player version for non-Internet Explorer browsers
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+		  a. Both release and build numbers can be detected
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+	*/
+	function testPlayerVersion() {
+		var b = doc.getElementsByTagName("body")[0];
+		var o = createElement(OBJECT);
+		o.setAttribute("type", FLASH_MIME_TYPE);
+		var t = b.appendChild(o);
+		if (t) {
+			var counter = 0;
+			(function(){
+				if (typeof t.GetVariable != UNDEF) {
+					var d = t.GetVariable("$version");
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				else if (counter < 10) {
+					counter++;
+					setTimeout(arguments.callee, 10);
+					return;
+				}
+				b.removeChild(o);
+				t = null;
+				matchVersions();
+			})();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Perform Flash Player and SWF version matching; static publishing only
+	*/
+	function matchVersions() {
+		var rl = regObjArr.length;
+		if (rl > 0) {
+			for (var i = 0; i < rl; i++) { // for each registered object element
+				var id = regObjArr[i].id;
+				var cb = regObjArr[i].callbackFn;
+				var cbObj = {success:false, id:id};
+				if (ua.pv[0] > 0) {
+					var obj = getElementById(id);
+					if (obj) {
+						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+							setVisibility(id, true);
+							if (cb) {
+								cbObj.success = true;
+								cbObj.ref = getObjectById(id);
+								cb(cbObj);
+							}
+						}
+						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+							var att = {};
+							att.data = regObjArr[i].expressInstall;
+							att.width = obj.getAttribute("width") || "0";
+							att.height = obj.getAttribute("height") || "0";
+							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+							// parse HTML object param element's name-value pairs
+							var par = {};
+							var p = obj.getElementsByTagName("param");
+							var pl = p.length;
+							for (var j = 0; j < pl; j++) {
+								if (p[j].getAttribute("name").toLowerCase() != "movie") {
+									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+								}
+							}
+							showExpressInstall(att, par, id, cb);
+						}
+						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+							displayAltContent(obj);
+							if (cb) { cb(cbObj); }
+						}
+					}
+				}
+				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+					setVisibility(id, true);
+					if (cb) {
+						var o = getObjectById(id); // test whether there is an HTML object element or not
+						if (o && typeof o.SetVariable != UNDEF) { 
+							cbObj.success = true;
+							cbObj.ref = o;
+						}
+						cb(cbObj);
+					}
+				}
+			}
+		}
+	}
+	
+	function getObjectById(objectIdStr) {
+		var r = null;
+		var o = getElementById(objectIdStr);
+		if (o && o.nodeName == "OBJECT") {
+			if (typeof o.SetVariable != UNDEF) {
+				r = o;
+			}
+			else {
+				var n = o.getElementsByTagName(OBJECT)[0];
+				if (n) {
+					r = n;
+				}
+			}
+		}
+		return r;
+	}
+	
+	/* Requirements for Adobe Express Install
+		- only one instance can be active at a time
+		- fp 6.0.65 or higher
+		- Win/Mac OS only
+		- no Webkit engines older than version 312
+	*/
+	function canExpressInstall() {
+		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+	}
+	
+	/* Show the Adobe Express Install dialog
+		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+	*/
+	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+		isExpressInstallActive = true;
+		storedCallbackFn = callbackFn || null;
+		storedCallbackObj = {success:false, id:replaceElemIdStr};
+		var obj = getElementById(replaceElemIdStr);
+		if (obj) {
+			if (obj.nodeName == "OBJECT") { // static publishing
+				storedAltContent = abstractAltContent(obj);
+				storedAltContentId = null;
+			}
+			else { // dynamic publishing
+				storedAltContent = obj;
+				storedAltContentId = replaceElemIdStr;
+			}
+			att.id = EXPRESS_INSTALL_ID;
+			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+				fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+			if (typeof par.flashvars != UNDEF) {
+				par.flashvars += "&" + fv;
+			}
+			else {
+				par.flashvars = fv;
+			}
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			if (ua.ie && ua.win && obj.readyState != 4) {
+				var newObj = createElement("div");
+				replaceElemIdStr += "SWFObjectNew";
+				newObj.setAttribute("id", replaceElemIdStr);
+				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						obj.parentNode.removeChild(obj);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			createSWF(att, par, replaceElemIdStr);
+		}
+	}
+	
+	/* Functions to abstract and display alternative content
+	*/
+	function displayAltContent(obj) {
+		if (ua.ie && ua.win && obj.readyState != 4) {
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			var el = createElement("div");
+			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+			el.parentNode.replaceChild(abstractAltContent(obj), el);
+			obj.style.display = "none";
+			(function(){
+				if (obj.readyState == 4) {
+					obj.parentNode.removeChild(obj);
+				}
+				else {
+					setTimeout(arguments.callee, 10);
+				}
+			})();
+		}
+		else {
+			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+		}
+	} 
+
+	function abstractAltContent(obj) {
+		var ac = createElement("div");
+		if (ua.win && ua.ie) {
+			ac.innerHTML = obj.innerHTML;
+		}
+		else {
+			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+			if (nestedObj) {
+				var c = nestedObj.childNodes;
+				if (c) {
+					var cl = c.length;
+					for (var i = 0; i < cl; i++) {
+						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+							ac.appendChild(c[i].cloneNode(true));
+						}
+					}
+				}
+			}
+		}
+		return ac;
+	}
+	
+	/* Cross-browser dynamic SWF creation
+	*/
+	function createSWF(attObj, parObj, id) {
+		var r, el = getElementById(id);
+		if (ua.wk && ua.wk < 312) { return r; }
+		if (el) {
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+				attObj.id = id;
+			}
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+				var att = "";
+				for (var i in attObj) {
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+						if (i.toLowerCase() == "data") {
+							parObj.movie = attObj[i];
+						}
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							att += ' class="' + attObj[i] + '"';
+						}
+						else if (i.toLowerCase() != "classid") {
+							att += ' ' + i + '="' + attObj[i] + '"';
+						}
+					}
+				}
+				var par = "";
+				for (var j in parObj) {
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+					}
+				}
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+				r = getElementById(attObj.id);	
+			}
+			else { // well-behaving browsers
+				var o = createElement(OBJECT);
+				o.setAttribute("type", FLASH_MIME_TYPE);
+				for (var m in attObj) {
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							o.setAttribute("class", attObj[m]);
+						}
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+							o.setAttribute(m, attObj[m]);
+						}
+					}
+				}
+				for (var n in parObj) {
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+						createObjParam(o, n, parObj[n]);
+					}
+				}
+				el.parentNode.replaceChild(o, el);
+				r = o;
+			}
+		}
+		return r;
+	}
+	
+	function createObjParam(el, pName, pValue) {
+		var p = createElement("param");
+		p.setAttribute("name", pName);	
+		p.setAttribute("value", pValue);
+		el.appendChild(p);
+	}
+	
+	/* Cross-browser SWF removal
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
+	*/
+	function removeSWF(id) {
+		var obj = getElementById(id);
+		if (obj && obj.nodeName == "OBJECT") {
+			if (ua.ie && ua.win) {
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						removeObjectInIE(id);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			else {
+				obj.parentNode.removeChild(obj);
+			}
+		}
+	}
+	
+	function removeObjectInIE(id) {
+		var obj = getElementById(id);
+		if (obj) {
+			for (var i in obj) {
+				if (typeof obj[i] == "function") {
+					obj[i] = null;
+				}
+			}
+			obj.parentNode.removeChild(obj);
+		}
+	}
+	
+	/* Functions to optimize JavaScript compression
+	*/
+	function getElementById(id) {
+		var el = null;
+		try {
+			el = doc.getElementById(id);
+		}
+		catch (e) {}
+		return el;
+	}
+	
+	function createElement(el) {
+		return doc.createElement(el);
+	}
+	
+	/* Updated attachEvent function for Internet Explorer
+		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+	*/	
+	function addListener(target, eventType, fn) {
+		target.attachEvent(eventType, fn);
+		listenersArr[listenersArr.length] = [target, eventType, fn];
+	}
+	
+	/* Flash Player and SWF content version matching
+	*/
+	function hasPlayerVersion(rv) {
+		var pv = ua.pv, v = rv.split(".");
+		v[0] = parseInt(v[0], 10);
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+		v[2] = parseInt(v[2], 10) || 0;
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+	}
+	
+	/* Cross-browser dynamic CSS creation
+		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+	*/	
+	function createCSS(sel, decl, media, newStyle) {
+		if (ua.ie && ua.mac) { return; }
+		var h = doc.getElementsByTagName("head")[0];
+		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+		var m = (media && typeof media == "string") ? media : "screen";
+		if (newStyle) {
+			dynamicStylesheet = null;
+			dynamicStylesheetMedia = null;
+		}
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+			// create dynamic stylesheet + get a global reference to it
+			var s = createElement("style");
+			s.setAttribute("type", "text/css");
+			s.setAttribute("media", m);
+			dynamicStylesheet = h.appendChild(s);
+			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+			}
+			dynamicStylesheetMedia = m;
+		}
+		// add style rule
+		if (ua.ie && ua.win) {
+			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+				dynamicStylesheet.addRule(sel, decl);
+			}
+		}
+		else {
+			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+			}
+		}
+	}
+	
+	function setVisibility(id, isVisible) {
+		if (!autoHideShow) { return; }
+		var v = isVisible ? "visible" : "hidden";
+		if (isDomLoaded && getElementById(id)) {
+			getElementById(id).style.visibility = v;
+		}
+		else {
+			createCSS("#" + id, "visibility:" + v);
+		}
+	}
+
+	/* Filter to avoid XSS attacks
+	*/
+	function urlEncodeIfNecessary(s) {
+		var regex = /[\\\"<>\.;]/;
+		var hasBadChars = regex.exec(s) != null;
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+	}
+	
+	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+	*/
+	var cleanup = function() {
+		if (ua.ie && ua.win) {
+			window.attachEvent("onunload", function() {
+				// remove listeners to avoid memory leaks
+				var ll = listenersArr.length;
+				for (var i = 0; i < ll; i++) {
+					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+				}
+				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+				var il = objIdArr.length;
+				for (var j = 0; j < il; j++) {
+					removeSWF(objIdArr[j]);
+				}
+				// cleanup library's main closures to avoid memory leaks
+				for (var k in ua) {
+					ua[k] = null;
+				}
+				ua = null;
+				for (var l in swfobject) {
+					swfobject[l] = null;
+				}
+				swfobject = null;
+			});
+		}
+	}();
+	
+	return {
+		/* Public API
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
+		*/ 
+		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+			if (ua.w3 && objectIdStr && swfVersionStr) {
+				var regObj = {};
+				regObj.id = objectIdStr;
+				regObj.swfVersion = swfVersionStr;
+				regObj.expressInstall = xiSwfUrlStr;
+				regObj.callbackFn = callbackFn;
+				regObjArr[regObjArr.length] = regObj;
+				setVisibility(objectIdStr, false);
+			}
+			else if (callbackFn) {
+				callbackFn({success:false, id:objectIdStr});
+			}
+		},
+		
+		getObjectById: function(objectIdStr) {
+			if (ua.w3) {
+				return getObjectById(objectIdStr);
+			}
+		},
+		
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+			var callbackObj = {success:false, id:replaceElemIdStr};
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+				setVisibility(replaceElemIdStr, false);
+				addDomLoadEvent(function() {
+					widthStr += ""; // auto-convert to string
+					heightStr += "";
+					var att = {};
+					if (attObj && typeof attObj === OBJECT) {
+						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+							att[i] = attObj[i];
+						}
+					}
+					att.data = swfUrlStr;
+					att.width = widthStr;
+					att.height = heightStr;
+					var par = {}; 
+					if (parObj && typeof parObj === OBJECT) {
+						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+							par[j] = parObj[j];
+						}
+					}
+					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+							if (typeof par.flashvars != UNDEF) {
+								par.flashvars += "&" + k + "=" + flashvarsObj[k];
+							}
+							else {
+								par.flashvars = k + "=" + flashvarsObj[k];
+							}
+						}
+					}
+					if (hasPlayerVersion(swfVersionStr)) { // create SWF
+						var obj = createSWF(att, par, replaceElemIdStr);
+						if (att.id == replaceElemIdStr) {
+							setVisibility(replaceElemIdStr, true);
+						}
+						callbackObj.success = true;
+						callbackObj.ref = obj;
+					}
+					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+						att.data = xiSwfUrlStr;
+						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+						return;
+					}
+					else { // show alternative content
+						setVisibility(replaceElemIdStr, true);
+					}
+					if (callbackFn) { callbackFn(callbackObj); }
+				});
+			}
+			else if (callbackFn) { callbackFn(callbackObj);	}
+		},
+		
+		switchOffAutoHideShow: function() {
+			autoHideShow = false;
+		},
+		
+		ua: ua,
+		
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		},
+		
+		hasFlashPlayerVersion: hasPlayerVersion,
+		
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
+			if (ua.w3) {
+				return createSWF(attObj, parObj, replaceElemIdStr);
+			}
+			else {
+				return undefined;
+			}
+		},
+		
+		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+			if (ua.w3 && canExpressInstall()) {
+				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+			}
+		},
+		
+		removeSWF: function(objElemIdStr) {
+			if (ua.w3) {
+				removeSWF(objElemIdStr);
+			}
+		},
+		
+		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+			if (ua.w3) {
+				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+			}
+		},
+		
+		addDomLoadEvent: addDomLoadEvent,
+		
+		addLoadEvent: addLoadEvent,
+		
+		getQueryParamValue: function(param) {
+			var q = doc.location.search || doc.location.hash;
+			if (q) {
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+				if (param == null) {
+					return urlEncodeIfNecessary(q);
+				}
+				var pairs = q.split("&");
+				for (var i = 0; i < pairs.length; i++) {
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+					}
+				}
+			}
+			return "";
+		},
+		
+		// For internal usage only
+		expressInstallCallback: function() {
+			if (isExpressInstallActive) {
+				var obj = getElementById(EXPRESS_INSTALL_ID);
+				if (obj && storedAltContent) {
+					obj.parentNode.replaceChild(storedAltContent, obj);
+					if (storedAltContentId) {
+						setVisibility(storedAltContentId, true);
+						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+					}
+					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+				}
+				isExpressInstallActive = false;
+			} 
+		}
+	};
+}();

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync02/src/insync02.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync02/src/insync02.mxml b/apps/samples-spring/WEB-INF/flex-src/insync02/src/insync02.mxml
new file mode 100755
index 0000000..7ad34d0
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync02/src/insync02.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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
+	
+	<fx:Script>
+		<![CDATA[
+
+			import mx.rpc.events.ResultEvent;
+			import mx.rpc.events.FaultEvent;
+			import mx.controls.Alert;
+			import mx.collections.ArrayCollection;
+			
+			[Bindable] private var contacts:ArrayCollection;
+			
+			private function resultHandler(event:ResultEvent):void
+			{
+				contacts = event.result as ArrayCollection
+			}
+			
+			private function faultHandler(event:FaultEvent):void
+			{
+				Alert.show(event.fault.faultDetail);
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<s:RemoteObject id="ro" destination="contactService" fault="faultHandler(event)" endpoint="{&apos;http://{server.name}:{server.port}/samples-spring/messagebroker/amf&apos;}">
+			<s:method name="findByName" result="resultHandler(event)"/>
+		</s:RemoteObject>
+	</fx:Declarations>
+	
+	<s:controlBarContent>
+		<s:TextInput id="searchStr"/>
+		<s:Button label="Search" click="ro.findByName(searchStr.text)"/>
+	</s:controlBarContent>
+	
+	<mx:DataGrid id="dg" dataProvider="{contacts}" top="8" left="8" right="8" bottom="8"/>
+
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync03/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync03/.actionScriptProperties b/apps/samples-spring/WEB-INF/flex-src/insync03/.actionScriptProperties
new file mode 100755
index 0000000..11b2763
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync03/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="insync03.mxml" projectUUID="b050a102-5b00-4469-ab6f-b791693123f9" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="insync03.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync03/.flexProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync03/.flexProperties b/apps/samples-spring/WEB-INF/flex-src/insync03/.flexProperties
new file mode 100755
index 0000000..1d99468
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync03/.flexProperties
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync03/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync03/.project b/apps/samples-spring/WEB-INF/flex-src/insync03/.project
new file mode 100755
index 0000000..815b7a5
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync03/.project
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>insync03</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync03/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync03/build.xml b/apps/samples-spring/WEB-INF/flex-src/insync03/build.xml
new file mode 100755
index 0000000..80c5e37
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync03/build.xml
@@ -0,0 +1,76 @@
+<?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-spring.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="context.root" value="samples-spring" />
+    <property name="application.name" value="insync03" />
+    <property name="application.file" value="insync03" />
+    <property name="application.bin.dir" value="${samples-spring.war}/insync03" />
+    <property name="application.src.dir" value="${samples-spring.war}/WEB-INF/flex-src/insync03/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-spring.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"
+            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-spring/WEB-INF/flex-src/insync03/html-template/history/history.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/history/history.css b/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/history/history.css
new file mode 100755
index 0000000..4a7f791
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/history/history.css
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }


[07/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/MessageBroker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/MessageBroker.java b/modules/core/src/flex/messaging/MessageBroker.java
new file mode 100755
index 0000000..ebe628a
--- /dev/null
+++ b/modules/core/src/flex/messaging/MessageBroker.java
@@ -0,0 +1,2237 @@
+/*
+ * 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.messaging;
+
+import flex.management.ManageableComponent;
+import flex.management.runtime.messaging.MessageBrokerControl;
+import flex.management.runtime.messaging.log.LogManager;
+import flex.messaging.client.FlexClient;
+import flex.messaging.client.FlexClientManager;
+import flex.messaging.cluster.ClusterManager;
+import flex.messaging.config.ChannelSettings;
+import flex.messaging.config.ConfigMap;
+import flex.messaging.config.ConfigurationConstants;
+import flex.messaging.config.ConfigurationException;
+import flex.messaging.config.ConfigurationManager;
+import flex.messaging.config.FlexClientSettings;
+import flex.messaging.config.SecurityConstraint;
+import flex.messaging.config.SecuritySettings;
+import flex.messaging.config.SystemSettings;
+import flex.messaging.endpoints.AbstractEndpoint;
+import flex.messaging.endpoints.Endpoint;
+import flex.messaging.endpoints.Endpoint2;
+import flex.messaging.factories.JavaFactory;
+import flex.messaging.io.BeanProxy;
+import flex.messaging.io.PropertyProxyRegistry;
+import flex.messaging.log.Log;
+import flex.messaging.log.LogCategories;
+import flex.messaging.messages.AbstractMessage;
+import flex.messaging.messages.AcknowledgeMessage;
+import flex.messaging.messages.AsyncMessage;
+import flex.messaging.messages.CommandMessage;
+import flex.messaging.messages.Message;
+import flex.messaging.security.LoginManager;
+import flex.messaging.security.SecurityException;
+import flex.messaging.services.AbstractService;
+import flex.messaging.services.Service;
+import flex.messaging.services.ServiceException;
+import flex.messaging.services.messaging.ThrottleManager;
+import flex.messaging.util.Base64;
+import flex.messaging.util.ClassUtil;
+import flex.messaging.util.ExceptionUtil;
+import flex.messaging.util.RedeployManager;
+import flex.messaging.util.StringUtils;
+import flex.messaging.util.UUIDGenerator;
+import flex.messaging.util.UUIDUtils;
+import flex.messaging.validators.DeserializationValidator;
+
+import javax.servlet.ServletContext;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * The MessageBroker is the hub of message traffic. It has a number of endpoints which send and
+ * receive messages over the network, and it has a number of
+ * services that are message destinations. The broker routes
+ * decoded messages received by endpoints to services based
+ * on the service destination specified in each message.
+ * The broker also has a means of pushing messages back through
+ * endpoints to clients.
+ */
+public class MessageBroker extends ManageableComponent
+{
+    //--------------------------------------------------------------------------
+    //
+    // Public Static Constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Id that the AuthenticationService uses to register itself with the broker.
+     */
+    public static final String AUTHENTICATION_SERVICE_ID = "authentication-service";
+
+    /**
+     * Localized error messages for <code>MessageBroker</code>.
+     */
+    public static final int ERR_MSG_NO_SERVICE_FOR_DEST = 10004;
+    public static final int ERR_MSG_DESTINATION_UNACCESSIBLE = 10005;
+    public static final int ERR_MSG_UNKNOWN_REMOTE_CREDENTIALS_FORMAT = 10020;
+    public static final int ERR_MSG_NULL_MESSAGE_ID = 10029;
+    public static final int ERR_MSG_CANNOT_SERVICE_STOPPED = 10038;
+    public static final int ERR_MSG_NULL_ENDPOINT_URL = 10128;
+    public static final int ERR_MSG_SERVICE_CMD_NOT_SUPPORTED = 10451;
+    public static final int ERR_MSG_URI_ALREADY_REGISTERED = 11109;
+
+    /**
+     * Log category for <code>MessageBroker</code>.
+     */
+    public static final String LOG_CATEGORY = LogCategories.MESSAGE_GENERAL;
+
+    /**
+     * Log category that captures startup information for broker's destinations.
+     */
+    public static final String LOG_CATEGORY_STARTUP_SERVICE = LogCategories.STARTUP_SERVICE;
+
+    /** @exclude */
+    public static final String TYPE = "MessageBroker";
+
+    //--------------------------------------------------------------------------
+    //
+    // Package Protected Static Constants
+    //
+    //--------------------------------------------------------------------------
+    /** The default message broker id when one is not specified in web.xml. */
+    public static final String DEFAULT_BROKER_ID = "__default__";
+
+    /** A map of currently available message brokers indexed by message broker id. */
+    static final Map<String, MessageBroker> messageBrokers = new HashMap<String, MessageBroker>();
+
+    //--------------------------------------------------------------------------
+    //
+    // Private Static Constants
+    //
+    //--------------------------------------------------------------------------
+
+    private static final String LOG_MANAGER_ID = "log";
+    private static final Integer INTEGER_ONE = 1;
+    private static final String MESSAGEBROKER = "MessageBroker";
+    private static final String ENDPOINT = "Endpoint";
+    private static final String SERVICE = "Service";
+
+    //--------------------------------------------------------------------------
+    //
+    // Constructors
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @exclude
+     * Create a MessageBroker. This constructor will
+     * establish collections for routers, endpoints,
+     * and services.
+     */
+    public MessageBroker()
+    {
+        this(true, null);
+    }
+
+    /** @exclude */
+    public MessageBroker(boolean enableManagement)
+    {
+        this(enableManagement, null);
+    }
+
+    /** @exclude */
+    public MessageBroker(boolean enableManagement, String mbid)
+    {
+        this(enableManagement, mbid, MessageBroker.class.getClassLoader());
+    }
+
+    /** @exclude */
+    public MessageBroker(boolean enableManagement, String mbid, ClassLoader loader)
+    {
+        super(enableManagement);
+        classLoader = loader;
+        attributes = new ConcurrentHashMap<String, Object>();
+        destinationToService = new ConcurrentHashMap<String, String>();
+        endpoints = new LinkedHashMap<String, Endpoint>();
+        services = new LinkedHashMap<String, Service>();
+        servers = new LinkedHashMap<String, Server>();
+        factories = new HashMap<String, FlexFactory>();
+        registeredEndpoints = new HashMap<String, String>();
+
+        // Add the built-in java factory
+        addFactory("java", new JavaFactory());
+
+        setId(mbid);
+
+        log = Log.createLog();
+
+        clusterManager = new ClusterManager(this);
+        systemSettings = new SystemSettings();
+
+        if (isManaged())
+        {
+            controller = new MessageBrokerControl(this);
+            controller.register();
+            setControl(controller);
+
+           logManager = new LogManager();
+           logManager.setLog(log);
+           logManager.setParent(this);
+           logManager.setupLogControl();
+           logManager.initialize(LOG_MANAGER_ID, null);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    private Map<String, Object> attributes;
+    /**
+     * Map of attribute ids of Application or Session level scoped destination assemblers
+     * to the number of active destinations referring to.
+     */
+    private final Map<String, Integer> attributeIdRefCounts = new HashMap<String, Integer>();
+    private Map<String, ChannelSettings> channelSettings;
+    private ClassLoader classLoader;
+    private ClusterManager clusterManager;
+    private MessageBrokerControl controller;
+    private List<String> defaultChannels;
+    private DeserializationValidator deserializationValidator;
+    private Map<String, String> destinationToService; // destiantionId to serviceId map.
+    private Map<String, Endpoint> endpoints;
+    private boolean enforceEndpointValidation;
+    private Map<String, FlexFactory> factories;
+    private FlexClientManager flexClientManager;
+    private FlexClientSettings flexClientSettings;
+    private FlexSessionManager flexSessionManager;
+    private PathResolver externalPathResolver;
+    private InternalPathResolver internalPathResolver;
+    private Log log;
+    private LogManager logManager;
+    private LoginManager loginManager;
+    private RedeployManager redeployManager;
+    private Map<String, String> registeredEndpoints;
+    private SecuritySettings securitySettings;
+    private Map<String, Service> services;
+    private Map<String, Server> servers;
+    private final ConcurrentHashMap<String, ServiceValidationListener> serviceValidationListeners = new ConcurrentHashMap<String, ServiceValidationListener>();
+    private ServletContext servletContext;
+    private SystemSettings systemSettings;
+    private Class<? extends ThrottleManager> throttleManagerClass = ThrottleManager.class; // The default ThrottleManager class.
+    private UUIDGenerator uuidGenerator;
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Sets the id of the <code>MessageBroker</code>. If id is null, uses the
+     * default broker id.
+     *
+     * @exclude
+     */
+    @Override public void setId(String id)
+    {
+        if (id == null)
+            id = DEFAULT_BROKER_ID;
+
+        super.setId(id);
+    }
+
+    /**
+     * Retrieves a message broker with the supplied id.  This is defined via
+     * the servlet init parameter messageBrokerId.  If no messageBrokerId is supplied, pass
+     * in a null value for the id parameter.
+     *
+     * In case null is passed, the method tries to lookup the broker from current FlexContext.
+     * If not available, it uses default ID to lookup the message broker.
+     *
+     * @param id The id of the message broker to retrieve.
+     * @return The <code>MessageBroker</code> for the supplied id.
+     */
+    public static MessageBroker getMessageBroker(String id)
+    {
+        if (id == null)
+        {
+            // If available, return the broker from FlexContext
+            MessageBroker broker = FlexContext.getMessageBroker();
+            if (broker != null)
+            {
+                return broker;
+            }
+
+            id = DEFAULT_BROKER_ID;
+        }
+
+        return messageBrokers.get(id);
+    }
+
+    /**
+     * Start the message broker's endpoints and services.
+     * @exclude
+     */
+    @Override public void start()
+    {
+        if (isStarted())
+            return;
+
+        /*
+         * J2EE can be a real pain in terms of getting the right class loader so dump out
+         * some detailed info about what is going on.
+         */
+        if (Log.isDebug())
+        {
+            StringBuffer sb = new StringBuffer(100);
+            if (classLoader == MessageBroker.class.getClassLoader())
+                sb.append(" the MessageBroker's class loader");
+            if (classLoader == Thread.currentThread().getContextClassLoader())
+            {
+                if (sb.length() > 0) sb.append(" and");
+                sb.append(" the context class loader");
+            }
+            if (sb.length() == 0)
+                sb.append(" not the context or the message broker's class loader");
+            Log.getLogger(LogCategories.CONFIGURATION).debug(
+                    "MessageBroker id: " + getId() + " classLoader is:" +
+                    sb.toString() + " (" + "classLoader " + ClassUtil.classLoaderToString(classLoader));
+        }
+
+        // Catch any startup errors and log using our log machinery, then rethrow to trigger shutdown.
+        try
+        {
+            // MessageBroker doesn't call super.start() because it doesn't need the
+            // usual validation that other components need
+            setStarted(true);
+
+            registerMessageBroker();
+            if (flexClientManager == null)
+            {
+                flexClientManager = new FlexClientManager(isManaged(), this);
+            }
+            flexClientManager.start();
+            flexSessionManager = new FlexSessionManager(isManaged(), this);
+            flexSessionManager.start();
+            if (systemSettings == null)
+            {
+                systemSettings = new SystemSettings();
+            }
+            startServices();
+            loginManager.start();
+            startEndpoints();
+            startServers();
+            redeployManager.start();
+        }
+        catch (Exception e)
+        {
+            if (Log.isError())
+                Log.getLogger(LogCategories.CONFIGURATION).error("MessageBroker failed to start: " + ExceptionUtil.exceptionFollowedByRootCausesToString(e));
+
+            // Rethrow.
+            throw new RuntimeException(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * Stop the broker's endpoints, clusters, and services.
+     * @exclude
+     */
+    @Override public void stop()
+    {
+        if (!isStarted())
+            return;
+
+        if (Log.isDebug())
+            Log.getLogger(LogCategories.CONFIGURATION).debug("MessageBroker stopping: " + getId());
+
+        serviceValidationListeners.clear();
+
+        flexSessionManager.stop();
+        flexClientManager.stop();
+        stopServers();
+        stopEndpoints();
+
+        // set this MB in FlexContext as it is needed for reference counts in destination stopping
+        FlexContext.setThreadLocalMessageBroker(this);
+        stopServices();
+        FlexContext.setThreadLocalMessageBroker(null);
+
+        if (loginManager != null)
+            loginManager.stop();
+        try
+        {
+            if (redeployManager != null)
+                redeployManager.stop();
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+        }
+        clusterManager.destroyClusters();
+
+        super.stop();
+        unRegisterMessageBroker();
+
+        // clear static proxy caches
+        BeanProxy.clear();
+        PropertyProxyRegistry.release();
+
+        // clear system settings
+        systemSettings.clear();
+        systemSettings = null;
+
+        if (Log.isDebug())
+            Log.getLogger(LogCategories.CONFIGURATION).debug("MessageBroker stopped: " + getId());
+    }
+
+    /**
+     * Returns an <tt>Iterator</tt> containing the current names that attributes have been bound
+     * to the <tt>MessageBroker</tt> under.
+     * Use {@link #getAttribute(String)} to retrieve an attribute value.
+     *
+     * @return An iterator containing the current names of the attributes.
+     */
+    public Iterator<String> getAttributeNames()
+    {
+        return attributes.keySet().iterator();
+    }
+
+    /**
+     * Returns the attribute value bound to the <tt>MessageBroker</tt> under the provided name.
+     *
+     * @param name The attribute name.
+     * @return Object the attribute object
+     */
+    public Object getAttribute(String name)
+    {
+        return attributes.get(name);
+    }
+
+    /**
+     * Binds an attribute value to the <tt>MessageBroker</tt> under the provided name.
+     *
+     * @param name The attribute name.
+     * @param value The attribute value.
+     */
+    public void setAttribute(String name, Object value)
+    {
+        if (value == null)
+            removeAttribute(name);
+        else
+            attributes.put(name, value);
+    }
+
+    /**
+     * Removes the attribute with the given name from the <tt>MessageBroker</tt>.
+     *
+     * @param name The attribute name.
+     */
+    public void removeAttribute(String name)
+    {
+        attributes.remove(name);
+    }
+
+    /**
+     * Returns the deserialization validator of the <tt>MessageBroker</tt> or null
+     * if none exists.
+     *
+     * @return The deserialization validator of the <tt>MessageBroker</tt> or null
+     * if none exists.
+     */
+    public DeserializationValidator getDeserializationValidator()
+    {
+        return deserializationValidator;
+    }
+
+    /**
+     * Sets the deserialization validator of the <tt>MessageBroker</tt>.
+     *
+     * @param deserializationValidator The deserialization validator.
+     */
+    public void setDeserializationValidator(DeserializationValidator deserializationValidator)
+    {
+        this.deserializationValidator = deserializationValidator;
+    }
+
+    public void setExternalPathResolver(PathResolver externalPathResolver)
+    {
+        this.externalPathResolver = externalPathResolver;
+    }
+
+    /** @exclude */
+    public void setInternalPathResolver(InternalPathResolver internalPathResolver)
+    {
+        this.internalPathResolver = internalPathResolver;
+    }
+
+    /** @exclude */
+    public InputStream resolveExternalPath(String filename) throws IOException
+    {
+        return externalPathResolver.resolve(filename);
+    }
+
+    /** @exclude */
+    public InputStream resolveInternalPath(String filename) throws IOException
+    {
+        return internalPathResolver.resolve(filename);
+    }
+
+    /** @exclude */
+    public interface PathResolver
+    {
+        InputStream resolve(String filename) throws IOException;
+    }
+
+    /**
+     * This interface is being kept for backwards compatibility.
+     * @exclude
+     */
+    public interface InternalPathResolver extends PathResolver
+    {
+        // No-op.
+    }
+
+    /** @exclude */
+    public ClusterManager getClusterManager()
+    {
+        return clusterManager;
+    }
+
+    /**
+     * @exclude
+     * Add a <code>Server</code> to the broker's collection.
+     *
+     * @param server <code>Server</code> to be added.
+     */
+    public void addServer(Server server)
+    {
+        if (server == null)
+        {
+            // Cannot add null ''{0}'' to the ''{1}''
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(ConfigurationConstants.NULL_COMPONENT, new Object[]{"Server", MESSAGEBROKER});
+            throw ex;
+        }
+
+        String id = server.getId();
+
+        if (id == null)
+        {
+            // Cannot add ''{0}'' with null id to the ''{1}''
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(ConfigurationConstants.NULL_COMPONENT_ID, new Object[]{"Server", MESSAGEBROKER});
+            throw ex;
+        }
+
+        // No need to add if server is already added
+        Server currentServer = getServer(id);
+        if (currentServer == server)
+            return;
+
+        // Do not allow servers with the same id
+        if (currentServer != null)
+        {
+            // Cannot add a ''{0}'' with the id ''{1}'' that is already registered with the ''{2}''
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(ConfigurationConstants.DUPLICATE_COMPONENT_ID, new Object[]{"Server", id, MESSAGEBROKER});
+            throw ex;
+        }
+
+        servers.put(id, server);
+    }
+
+    /**
+     * @exclude
+     * Returns the <code>Server</code> with the specified id.
+     *
+     * @param id The id of the <code>Server</code>/
+     * @return The <code>Server</code> with the specified id or null if no
+     * <code>Server</code> with the id exists.
+     */
+    public Server getServer(String id)
+    {
+        return servers.get(id);
+    }
+
+    /**
+     * @exclude
+     * Stops and removes the <code>Server</code> from the set of shared servers managed by the <code>MessageBroker</code>.
+     *
+     * @param id The id of the <code>Server</code> to remove.
+     * @return <code>Server</code> that has been removed or <code>null</code> if it doesn't exist.
+     */
+    public Server removeServer(String id)
+    {
+        Server server = servers.get(id);
+        if (server != null)
+        {
+            server.stop();
+            servers.remove(id);
+        }
+        return server;
+    }
+
+    /**
+     * @exclude
+     * Creates an <code>Endpoint</code> instance, sets its id and url.
+     * It further sets the endpoint manageable if the <code>MessageBroker</code>
+     * is manageable, and assigns its <code>MessageBroker</code> to the
+     * <code>MessageBroker</code> that created it.
+     *
+     * @param id The id of the endpoint.
+     * @param url The url of the endpoint.
+     * @param className The class name of the endpoint.
+     *
+     * @return The created <code>Endpoint</code> instance.
+     */
+    public Endpoint createEndpoint(String id, String url, String className)
+    {
+        Class endpointClass = ClassUtil.createClass(className, getClassLoader());
+
+        Endpoint endpoint = (Endpoint)ClassUtil.createDefaultInstance(endpointClass, Endpoint.class);
+        endpoint.setId(id);
+        endpoint.setUrl(url);
+        endpoint.setManaged(isManaged());
+        endpoint.setMessageBroker(this);
+
+        return endpoint;
+    }
+
+    /**
+     * @exclude
+     * Add an endpoint to the broker's collection. Broker will accept the endpoint
+     * to be added only if the endpoint is not null, it does not have null id or
+     * url, and it does not have the same id or url as another endpoint.
+     *
+     * @param endpoint Endpoint to be added.
+     */
+    public void addEndpoint(Endpoint endpoint)
+    {
+        if (endpoint == null)
+        {
+            // Cannot add null ''{0}'' to the ''{1}''
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(ConfigurationConstants.NULL_COMPONENT, new Object[]{ENDPOINT, MESSAGEBROKER});
+            throw ex;
+        }
+
+        String id = endpoint.getId();
+
+        if (id == null)
+        {
+            // Cannot add ''{0}'' with null id to the ''{1}''
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(ConfigurationConstants.NULL_COMPONENT_ID, new Object[]{ENDPOINT, MESSAGEBROKER});
+            throw ex;
+        }
+
+        // No need to add if endpoint is already added
+        if (getEndpoint(id) == endpoint)
+            return;
+
+        // Do not allow endpoints with the same id
+        if (getEndpoint(id) != null)
+        {
+            // Cannot add a ''{0}'' with the id ''{1}'' that is already registered with the ''{2}''
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(ConfigurationConstants.DUPLICATE_COMPONENT_ID, new Object[]{ENDPOINT, id, MESSAGEBROKER});
+            throw ex;
+        }
+
+        // Add the endpoint only if its url is not null and it is not registered
+        // by another channel
+        checkEndpointUrl(id, endpoint.getUrl());
+
+        // Finally add the endpoint to endpoints map
+        endpoints.put(id, endpoint);
+    }
+
+    /**
+     * @exclude
+     * Returns the <code>Endpoint</code> with the specified id.
+     *
+     * @param id The id of the <code>Endpoint</code>/
+     * @return The <code>Endpoint</code> with the specified id or null if no
+     * <code>Endpoint</code> with the id exists.
+     */
+    public Endpoint getEndpoint(String id)
+    {
+        return endpoints.get(id);
+    }
+
+    /**
+     * @exclude
+     * Retrieve the map of all endpoints in this broker.
+     */
+    public Map<String, Endpoint> getEndpoints()
+    {
+        return endpoints;
+    }
+
+    /**
+     * @exclude
+     * Retrieve an endpoint based on a requested URL path. Two endpoints should not be
+     * registered to the same path.
+     */
+    public Endpoint getEndpoint(String path, String contextPath)
+    {
+        for (String id : endpoints.keySet())
+        {
+            Endpoint e = endpoints.get(id);
+
+            if (matchEndpoint(path, contextPath, e))
+            {
+                return e;
+            }
+        }
+        MessageException lme = new MessageException();
+        lme.setMessage(10003, new Object[] {path});
+        throw lme;
+    }
+
+    /**
+     * @exclude
+     * Removes an endpoint from the <code>MessageBroker</code>.
+     *
+     * @param id The id of the endpoint.
+     * @return The removed endpoint.
+     */
+    public Endpoint removeEndpoint(String id)
+    {
+        Endpoint endpoint = getEndpoint(id);
+        if (endpoint != null)
+        {
+            endpoint.stop();
+            endpoints.remove(id);
+        }
+        return endpoint;
+    }
+
+    /**
+     * Returns whether the endpoint validation is enforced on the server, regardless
+     * of whether client requested endpoint validation or not.
+     *
+     * @return True if the endpoint validation is enforced on the server, regardless
+     * of whether client requested endpoint validation or not.
+     */
+    public boolean isEnforceEndpointValidation()
+    {
+        return enforceEndpointValidation;
+    }
+
+    /**
+     * Sets whether the endpoint validation is enforced on the server, regardless
+     * of whether client requested endpoint validation or not.
+     *
+     * @param enforceEndpointValidation The endpoint validation flag.
+     */
+    public void setEnforceEndpointValidation(boolean enforceEndpointValidation)
+    {
+        this.enforceEndpointValidation = enforceEndpointValidation;
+    }
+
+    /**
+     * Returns the <code>FlexFactory</code> with the specified id.
+     *
+     * @param id The id of the <code>FlexFactory</code>.
+     * @return The <code>FlexFactory</code> with the specified id or null if no
+     * factory with the id exists.
+     */
+    public FlexFactory getFactory(String id)
+    {
+        return factories.get(id);
+    }
+
+    /**
+     * Returns the map of <code>FlexFactory</code> instances.
+     *
+     * @return The map of <code>FlexFactory</code> instances.
+     */
+    public Map<String, FlexFactory> getFactories()
+    {
+       return factories;
+    }
+
+    /**
+     * Registers a factory with the <code>MessageBroker</code>.
+     *
+     * @param id The id of the factory.
+     * @param factory <code>FlexFactory</code> instance.
+     */
+    public void addFactory(String id, FlexFactory factory)
+    {
+        if (id == null)
+        {
+            // Cannot add ''{0}'' with null id to the ''{1}''
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(ConfigurationConstants.NULL_COMPONENT_ID, new Object[]{"FlexFactory", MESSAGEBROKER});
+            throw ex;
+        }
+        // No need to add if factory is already added
+        if (getFactory(id) == factory)
+        {
+            return;
+        }
+        // Do not allow multiple factories with the same id
+        if (getFactory(id) != null)
+        {
+            // Cannot add a ''{0}'' with the id ''{1}'' that is already registered with the ''{2}''
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(ConfigurationConstants.DUPLICATE_COMPONENT_ID, new Object[]{"FlexFactory", id, MESSAGEBROKER});
+            throw ex;
+        }
+        factories.put(id, factory);
+    }
+
+    /**
+     * Removes the <code>FlexFactory</code> from the list of factories known
+     * by the <code>MessageBroker</code>.
+     *
+     * @param id The id of the <code>FlexFactory</code>.
+     * @return <code>FlexFactory</code> that has been removed.
+     */
+    public FlexFactory removeFactory(String id)
+    {
+        FlexFactory factory = getFactory(id);
+        if (factory != null)
+        {
+            factories.remove(id);
+        }
+        return factory;
+    }
+
+    /**
+     * Returns the <code>Service</code> with the specified id.
+     *
+     * @param id The id of the <code>Service</code>/
+     * @return The <code>Service</code> with the specified id or null if no
+     * <code>Service</code> with the id exists.
+     */
+    public Service getService(String id)
+    {
+        return services.get(id);
+    }
+
+    /**
+     * Return a service of the specific type.
+     * The current list of services is searched for the specified class name.
+     * If there is no service of the specified type, null is  returned.
+     * If there is more than one service of the same type it is undefined which instance is returned.
+     * If more than one service of a specific type is configured,
+     * callers should use {@link #getService(String)} and provide the service id of the specific service,
+     * or {@link #getServices()} to get access to the map of all registered services.
+     *
+     * @param type the fully qualified class name of the service implementation.
+     * @return a service or null if not found.
+     */
+    public Service getServiceByType(String type)
+    {
+        for (Service svc : services.values())
+        {
+            if (svc.getClass().getName().equals(type))
+            {
+                return svc;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Returns the Map of <code>Service</code> instances.
+     *
+     * @return The Map of <code>Service</code> instances.
+     */
+    public Map<String, Service> getServices()
+    {
+        return services;
+    }
+
+    /**
+     * Returns a <tt>ConfigMap</tt> of service and channel properties that the client
+     * needs.
+     *
+     * @param endpoint Endpoint used to filter the destinations of the service;
+     * no filtering is done if the endpoint is null.
+     * @return ConfigMap of server properties.
+     */
+    public ConfigMap describeServices(Endpoint endpoint)
+    {
+       return describeServices(endpoint, true);
+    }
+
+    /**
+     * @exclude
+     * Returns a <tt>ConfigMap</tt> of service and channel properties that the client
+     * needs.
+     * The <tt>allDestinations</tt> flag controls whether configuration for all
+     * destinations or only reliable client destinations is returned.
+     *
+     * @param endpoint Endpoint used to filter the destinations of the service.
+     * No filtering is done if the endpoint is null.
+     * @param onlyReliable When false, configuration for all destinations is
+     * returned instead of only reliable destinations.
+     * @return ConfigMap of service properties.
+     */
+    public ConfigMap describeServices(Endpoint endpoint, boolean onlyReliable)
+    {
+        // Let the service validation listeners know about the configuration change.
+        if (!serviceValidationListeners.isEmpty())
+        {
+            for (Enumeration<ServiceValidationListener> iter = serviceValidationListeners.elements(); iter.hasMoreElements();)
+                iter.nextElement().validateServices();
+        }
+
+        ConfigMap servicesConfig = new ConfigMap();
+
+        // Keep track of channel ids as we encounter them so we can generate
+        // the channel properties that might be needed by the client.
+        ArrayList<String> channelIds = new ArrayList<String>();
+        if (endpoint == null)
+        {
+            for (Endpoint endpointToAdd: getEndpoints().values())
+                channelIds.add(endpointToAdd.getId());
+        }
+        else
+        {
+            channelIds.add(endpoint.getId());
+        }
+
+        if (defaultChannels != null)
+        {
+            ConfigMap defaultChannelsMap = new ConfigMap();
+            for (Object defaultChannel : defaultChannels)
+            {
+                String id = (String) defaultChannel;
+                ConfigMap channelConfig = new ConfigMap();
+                channelConfig.addProperty(ConfigurationConstants.REF_ATTR, id);
+                defaultChannelsMap.addProperty(ConfigurationConstants.CHANNEL_ELEMENT, channelConfig);
+                if (!channelIds.contains(id))
+                    channelIds.add(id);
+            }
+            if (defaultChannelsMap.size() > 0)
+                servicesConfig.addProperty(ConfigurationConstants.DEFAULT_CHANNELS_ELEMENT, defaultChannelsMap);
+        }
+
+        for (Service service : services.values())
+        {
+            ConfigMap serviceConfig = service instanceof AbstractService?
+                    ((AbstractService)service).describeService(endpoint, onlyReliable) : service.describeService(endpoint);
+            if (serviceConfig != null && serviceConfig.size() > 0)
+                servicesConfig.addProperty(ConfigurationConstants.SERVICE_ELEMENT, serviceConfig);
+        }
+
+        // Need to send channel properties again in case the client didn't
+        // compile in services-config.xml and hence doesn't have channels section
+        // of the configuration - but only if channel/endpoint is not tagged as "remote"!
+        ConfigMap channels = new ConfigMap();
+        for (String id : channelIds)
+        {
+            Endpoint currentEndpoint = getEndpoint(id);
+            if (currentEndpoint instanceof AbstractEndpoint && ((AbstractEndpoint)currentEndpoint).isRemote())
+            {
+                continue; // Client already has configuration for "remote" endpoint by other means.
+            }
+
+            ConfigMap channel = currentEndpoint.describeEndpoint();
+            if (channel != null && channel.size() > 0)
+                channels.addProperty(ConfigurationConstants.CHANNEL_ELEMENT, channel);
+        }
+        if (channels.size() > 0)
+            servicesConfig.addProperty(ConfigurationConstants.CHANNELS_ELEMENT, channels);
+
+        if (Log.isDebug())
+            Log.getLogger(ConfigurationManager.LOG_CATEGORY).debug(
+                    "Returning service description for endpoint: " +
+                    (endpoint == null? "all" : endpoint.getId()) + " config: " + servicesConfig);
+
+        return servicesConfig;
+    }
+
+    /**
+     * Add a listener for the describeServices callback.  The describeServices listener
+     * is called before any execution of the describeServices method.
+     *
+     * @param id Identifier of the listener to add
+     * @param listener The listener callback
+     */
+    public void addServiceValidationListener(String id, ServiceValidationListener listener)
+    {
+        if (listener != null)
+        {
+            serviceValidationListeners.putIfAbsent(id, listener);
+        }
+    }
+
+    /**
+     * Returns an <tt>Iterator</tt> for all <tt>ServiceValidationListeners</tt> currently
+     * registered with the broker.
+     *
+     * @return An <tt>Iterator</tt> for all registered <tt>ServiceValidationListeners</tt>.
+     */
+    public Iterator<ServiceValidationListener> getServiceValidationListenerIterator()
+    {
+        return serviceValidationListeners.values().iterator();
+    }
+
+    /**
+     * Remove a listener from the describeServices callback.
+     *
+     * @param id Identifier of the listener to remove
+     */
+    public void removeServiceValidationListener(String id)
+    {
+        if (serviceValidationListeners.containsKey(id))
+        {
+            serviceValidationListeners.remove(id);
+        }
+    }
+
+    /**
+     * Creates a <code>Service</code> instance, sets its id, sets it manageable
+     * if the <code>MessageBroker</code> that created it is manageable,
+     * and sets its <code>MessageBroker</code> to the <code>MessageBroker</code> that
+     * created it.
+     *
+     * @param id The id of the <code>Service</code>.
+     * @param className The class name of the <code>Service</code>.
+     *
+     * @return The <code>Service</code> instanced created.
+     */
+    public Service createService(String id, String className)
+    {
+        Class svcClass = ClassUtil.createClass(className, getClassLoader());
+
+        Service service = (Service)ClassUtil.createDefaultInstance(svcClass, Service.class);
+        service.setId(id);
+        service.setManaged(isManaged());
+        service.setMessageBroker(this);
+
+        return service;
+    }
+
+    /**
+     * Add a message type -to- service mapping to the broker's collection.
+     * When the broker attempts to route a message to a service, it finds the first
+     * service capable of handling the message type.
+     *
+     * Note that <code>Service</code> cannot be null, it cannot have a null
+     * id, and it cannot have the same id or type of a <code>Service</code>
+     * already registered with the <code>MessageBroker</code>.
+     *
+     * <code>Service</code> needs to be started if the <code>MessageBroker</code>
+     * is already running.
+     *
+     * @param service The service instance used to handle the messages
+     *
+     */
+    public void addService(Service service)
+    {
+        if (service == null)
+        {
+            // Cannot add null ''{0}'' to the ''{1}''
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(ConfigurationConstants.NULL_COMPONENT, new Object[]{SERVICE, MESSAGEBROKER});
+            throw ex;
+        }
+
+        String id = service.getId();
+
+        if (id == null)
+        {
+            // Cannot add ''{0}'' with null id to the ''{1}''
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(ConfigurationConstants.NULL_COMPONENT_ID, new Object[]{SERVICE, MESSAGEBROKER});
+            throw ex;
+        }
+        // No need to add if service is already added
+        if (getService(id) == service)
+        {
+            return;
+        }
+        // Do not allow multiple services with the same id
+        if (getService(id) != null)
+        {
+            // Cannot add a ''{0}'' with the id ''{1}'' that is already registered with the ''{2}''
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(ConfigurationConstants.DUPLICATE_COMPONENT_ID, new Object[]{SERVICE, id, MESSAGEBROKER});
+            throw ex;
+        }
+        // Not supposed to have multiple services of the same type; warn about it
+        // but still allow it.
+        String type = service.getClass().getName();
+        if (getServiceByType(type) != null && Log.isWarn())
+            Log.getLogger(LOG_CATEGORY).warn("Adding a service type '{0}' that is already registered with the MessageBroker",
+                    new Object[]{type});
+
+
+        services.put(id, service);
+
+        if (service.getMessageBroker() == null || service.getMessageBroker() != this)
+        {
+            service.setMessageBroker(this);
+        }
+    }
+
+    /**
+     * Removes the <code>Service</code> from the list of services known
+     * by the <code>MessageBroker</code>.
+     *
+     * @param id The id of the <code>Service</code>.
+     * @return Previous <code>Service</code> associated with the id.
+     */
+    public Service removeService(String id)
+    {
+        Service service = getService(id);
+        if (service != null)
+        {
+            service.stop();
+            services.remove(id);
+        }
+        return service;
+    }
+
+    /**
+     * Returns the logger of the <code>MessageBroker</code>.
+     *
+     * @return Logger of the <code>MessageBroker</code>.
+     */
+    public Log getLog()
+    {
+        return log;
+    }
+
+    /** @exclude */
+    public LogManager getLogManager()
+    {
+        return logManager;
+    }
+
+    /** @exclude */
+    public LoginManager getLoginManager()
+    {
+        return loginManager;
+    }
+
+    /** @exclude */
+    public void setLoginManager(LoginManager loginManager)
+    {
+        if (this.loginManager != null && this.loginManager.isStarted())
+            this.loginManager.stop();
+
+        this.loginManager = loginManager;
+
+        if (isStarted())
+            loginManager.start();
+    }
+
+    /** @exclude */
+    public FlexClientManager getFlexClientManager()
+    {
+        return flexClientManager;
+    }
+
+    /** @exclude */
+    public void setFlexClientManager(FlexClientManager value)
+    {
+        flexClientManager = value;
+    }
+
+    /** @exclude */
+    public FlexSessionManager getFlexSessionManager()
+    {
+        return flexSessionManager;
+    }
+
+    /** @exclude */
+    public void setFlexSessionManager(FlexSessionManager value)
+    {
+        flexSessionManager = value;
+    }
+
+    /** @exclude **/
+    public RedeployManager getRedeployManager()
+    {
+        return redeployManager;
+    }
+
+    /** @exclude */
+    public void setRedeployManager(RedeployManager redeployManager)
+    {
+        if (this.redeployManager != null && this.redeployManager.isStarted())
+            this.redeployManager.stop();
+
+        this.redeployManager = redeployManager;
+
+        if (isStarted())
+            redeployManager.start();
+    }
+
+    /** @exclude */
+    public Class<? extends ThrottleManager> getThrottleManagerClass()
+    {
+        return throttleManagerClass;
+    }
+
+    /** @exclude */
+    public void setThrottleManagerClass(Class<? extends ThrottleManager> throttleManagerClass)
+    {
+        this.throttleManagerClass = throttleManagerClass;
+    }
+
+    /**
+     * Returns a UUID either from the UUID generator assigned to <tt>MessageBroker</tt>,
+     * or from the <tt>UUIDUtils#createUUID</tt> if there is no assigned UUID generator.
+     *
+     * @return String the UUID.
+     */
+    public String createUUID()
+    {
+        return uuidGenerator != null? uuidGenerator.createUUID() : UUIDUtils.createUUID();
+    }
+
+    /**
+     * Returns the custom <tt>UUIDGenerator</tt> used by the <tt>MessageBroker</tt>
+     * for NIO-HTTP session cookie value and <tt>FlexClient</tt> id generation or null if
+     *  the default UUID generator, <tt>UUIDUtils</tt>, is being used.
+     *
+     * @return The custom <tt>UUIDGenerator</tt> used by <tt>MessageBroker</tt> or null.
+     */
+    public UUIDGenerator getUUIDGenerator()
+    {
+        return uuidGenerator;
+    }
+
+
+    /**
+     * Sets the custom <tt>UUIDGenerator</tt> used by the <tt>MessageBroker</tt>
+     * for NIO-HTTP session cookie value and <tt>FlexClient</tt> id generation.
+     *
+     * @param value The custom <tt>UUIDGenerator</tt>.
+     */
+    public void setUUIDGenerator(UUIDGenerator value)
+    {
+        uuidGenerator = value;
+    }
+
+    /**
+     * Returns the list of channel ids known to the <code>MessageBroker</code>.
+     *
+     * @return The list of channel ids.
+     */
+    public List<String> getChannelIds()
+    {
+        return (endpoints != null && endpoints.size() != 0)? new ArrayList<String>(endpoints.keySet()) : null;
+    }
+
+    /** @exclude */
+    public ChannelSettings getChannelSettings(String ref)
+    {
+        return channelSettings.get(ref);
+    }
+
+    /** @exclude */
+    public Map<String, ChannelSettings> getAllChannelSettings()
+    {
+        return channelSettings;
+    }
+
+    /** @exclude */
+    public void setChannelSettings(Map<String, ChannelSettings> channelSettings)
+    {
+        this.channelSettings = channelSettings;
+    }
+
+    /**
+     * Returns the default channel ids of the MessageBroker. If a service
+     * specifies its own list of channels it overrides these defaults.
+     *
+     * @return Default channel ids of the MessageBroker.
+     */
+    public List<String> getDefaultChannels()
+    {
+        return defaultChannels;
+    }
+
+    /**
+     * Adds the channel id to the list of default channel ids.
+     *
+     * @param id The id of the channel to add to the list of default channel ids.
+     */
+    public void addDefaultChannel(String id)
+    {
+        if (defaultChannels == null)
+            defaultChannels = new ArrayList<String>();
+        else if (defaultChannels.contains(id))
+            return;
+
+        List<String> channelIds = getChannelIds();
+        if (channelIds == null || !channelIds.contains(id))
+        {
+            // No channel with id ''{0}'' is known by the MessageBroker.
+            if (Log.isWarn())
+            {
+                Log.getLogger(LOG_CATEGORY).warn("No channel with id '{0}' is known by the MessageBroker." +
+                        " Not adding the channel.",
+                        new Object[]{id});
+            }
+            return;
+        }
+        defaultChannels.add(id);
+    }
+
+    /**
+     * Sets the default channel ids of the MessageBroker.
+     *
+     * @param ids Default channel ids of the MessageBroker.
+     */
+    public void setDefaultChannels(List<String> ids)
+    {
+        if (ids != null)
+        {
+            List<String> channelIds = getChannelIds();
+            for (Iterator<String> iter = ids.iterator(); iter.hasNext();)
+            {
+                String id = iter.next();
+                if (channelIds == null || !channelIds.contains(id))
+                {
+                    iter.remove();
+                    if (Log.isWarn())
+                    {
+                        Log.getLogger(LOG_CATEGORY).warn("No channel with id '{0}' is known by the MessageBroker." +
+                                " Not adding the channel.",
+                                new Object[]{id});
+                    }
+                }
+            }
+        }
+        defaultChannels = ids;
+    }
+
+    /**
+     * Removes the channel id from the list of default channel ids.
+     *
+     * @param id The id of the channel to remove from the list of default channel ids.
+     * @return <code>true</code> if the list contained the channel id.
+     */
+    public boolean removeDefaultChannel(String id)
+    {
+        return defaultChannels != null && defaultChannels.remove(id);
+    }
+
+    /**
+     * Returns the <code>SecurityConstraint</code> with the indicated
+     * reference id.
+     *
+     * @param ref The reference of the <code>SecurityConstraint</code>
+     * @return The <code>SecurityConstraint</code> with the indicated reference id.
+     */
+    public SecurityConstraint getSecurityConstraint(String ref)
+    {
+        return getSecuritySettings().getConstraint(ref);
+    }
+
+    /** @exclude */
+    public ServletContext getServletContext()
+    {
+        return servletContext;
+    }
+
+    /** @exclude */
+    public SecuritySettings getSecuritySettings()
+    {
+        return securitySettings;
+    }
+
+    /** @exclude */
+    public void setSecuritySettings(SecuritySettings securitySettings)
+    {
+        this.securitySettings = securitySettings;
+    }
+
+    /** @exclude */
+    public SystemSettings getSystemSettings()
+    {
+        return systemSettings;
+    }
+
+    /** @exclude */
+    public void setSystemSettings(SystemSettings l)
+    {
+        systemSettings = l;
+    }
+
+    /** @exclude */
+    public FlexClientSettings getFlexClientSettings()
+    {
+        return flexClientSettings;
+    }
+
+    /** @exclude */
+    public void setFlexClientSettings(FlexClientSettings value)
+    {
+        flexClientSettings = value;
+    }
+
+    /** @exclude */
+    public void initThreadLocals()
+    {
+        // No thread-locals anymore, so no-op.
+    }
+
+    /**
+     * You can call this method in order to send a message from your code into
+     * the message routing system.  The message is routed to a service that
+     * is defined to handle messages of this type.  Once the service is identified,
+     * the destination property of the message is used to find a destination
+     * configured for that service.  The adapter defined for that destination
+     * is used to handle the message.
+     *
+     * @param message  The message to be routed to a service
+     * @param endpoint This can identify the endpoint that is sending the message
+     * but it is currently not used so you may pass in null.
+     * @return <code>AcknowledgeMessage</code> with result.
+     */
+    public AcknowledgeMessage routeMessageToService(Message message, Endpoint endpoint)
+    {
+        // Make sure message has a messageId
+        checkMessageId(message);
+
+        Object serviceResult = null;
+        boolean serviced = false;
+        Service service = null;
+        String destId = message.getDestination();
+        try
+        {
+            String serviceId = destId != null ? destinationToService.get(destId) : null;
+
+            if ((serviceId == null) && (destId != null) && (!serviceValidationListeners.isEmpty()))
+            {
+                for (Enumeration<ServiceValidationListener> iter = serviceValidationListeners.elements(); iter.hasMoreElements();)
+                {
+                    iter.nextElement().validateDestination(destId);
+                }
+                serviceId = destinationToService.get(destId);
+            }
+
+            if (serviceId != null)
+            {
+                service = services.get(serviceId);
+                serviced = true;
+                Destination destination = service.getDestination(destId);
+                inspectOperation(message, destination);
+                // Remove the validate endpoint header if it was set.
+                if (message.headerExists(Message.VALIDATE_ENDPOINT_HEADER))
+                    message.getHeaders().remove(Message.VALIDATE_ENDPOINT_HEADER);
+
+                if (Log.isDebug())
+                    Log.getLogger(getLogCategory(message)).debug(
+                            "Before invoke service: " + service.getId() + StringUtils.NEWLINE +
+                            "  incomingMessage: " + message + StringUtils.NEWLINE);
+
+                extractRemoteCredentials(service, message);
+                serviceResult = service.serviceMessage(message);
+            }
+
+            if (!serviced)
+            {
+                MessageException lme = new MessageException();
+                // The supplied destination id is not registered with any service.
+                lme.setMessage(ERR_MSG_NO_SERVICE_FOR_DEST);
+                throw lme;
+            }
+
+            if (Log.isDebug())
+            {
+                String debugServiceResult = Log.getPrettyPrinter().prettify(serviceResult);
+                Log.getLogger(getLogCategory(message)).debug(
+                     "After invoke service: " + service.getId() + StringUtils.NEWLINE +
+                     "  reply: " + debugServiceResult + StringUtils.NEWLINE);
+            }
+
+            AcknowledgeMessage ack;
+            if (serviceResult instanceof AcknowledgeMessage)
+            {
+                // service will return an ack if they need to transform it in some
+                // service-specific way (paging is an example)
+                ack = (AcknowledgeMessage)serviceResult;
+            }
+            else
+            {
+                // most services will return a result of some sort, possibly null,
+                // and expect the broker to compose a message to deliver it
+                ack = new AcknowledgeMessage();
+                ack.setBody(serviceResult);
+            }
+            ack.setCorrelationId(message.getMessageId());
+            ack.setClientId(message.getClientId());
+            return ack;
+        }
+        catch (MessageException exc)
+        {
+            exc.logAtHingePoint(message,
+                                null, /* No outbound error message at this point. */
+                                "Exception when invoking service '" + (service == null ? "(none)" : service.getId()) + "': ");
+
+            throw exc;
+        }
+        catch (RuntimeException exc)
+        {
+            Log.getLogger(LogCategories.MESSAGE_GENERAL).error(
+                 "Exception when invoking service: " +
+                 (service == null ? "(none)" : service.getId()) +
+                 StringUtils.NEWLINE +
+                 "  with message: " + message + StringUtils.NEWLINE +
+                 ExceptionUtil.exceptionFollowedByRootCausesToString(exc) + StringUtils.NEWLINE);
+
+            throw exc;
+        }
+        catch (Error exc)
+        {
+            Log.getLogger(LogCategories.MESSAGE_GENERAL).error(
+                 "Error when invoking service: " +
+                 (service == null ? "(none)" : service.getId()) +
+                 StringUtils.NEWLINE +
+                 "  with message: " + message + StringUtils.NEWLINE +
+                 ExceptionUtil.exceptionFollowedByRootCausesToString(exc) + StringUtils.NEWLINE);
+
+            throw exc;
+        }
+
+    }
+
+    /** @exclude */
+    public AsyncMessage routeCommandToService(CommandMessage command, Endpoint endpoint)
+    {
+        // Make sure command has a messageId
+        checkMessageId(command);
+
+        String destId = command.getDestination();
+
+        AsyncMessage replyMessage;
+        Service service;
+        String serviceId;
+        Object commandResult = null;
+        boolean serviced = false;
+        boolean recreateHttpFlexSessionAfterLogin = false;
+
+        // Forward login and logout commands to AuthenticationService
+        int operation = command.getOperation();
+        if (operation == CommandMessage.LOGIN_OPERATION || operation == CommandMessage.LOGOUT_OPERATION)
+        {
+            serviceId = AUTHENTICATION_SERVICE_ID;
+            recreateHttpFlexSessionAfterLogin = securitySettings.isRecreateHttpSessionAfterLogin()
+                &&  operation == CommandMessage.LOGIN_OPERATION && FlexContext.getFlexSession() instanceof HttpFlexSession;
+        }
+        else
+        {
+            serviceId = destId != null? destinationToService.get(destId) : null;
+        }
+
+        service = serviceId != null? services.get(serviceId) : null;
+        if (service != null)
+        {
+            // Before passing the message to the service, need to check
+            // the security constraints.
+            Destination destination = service.getDestination(destId);
+            if (destination != null)
+                inspectOperation(command, destination);
+
+            try
+            {
+                extractRemoteCredentials(service, command);
+                commandResult = service.serviceCommand(command);
+                serviced = true;
+            }
+            catch (UnsupportedOperationException e)
+            {
+                ServiceException se = new ServiceException();
+                se.setMessage(ERR_MSG_SERVICE_CMD_NOT_SUPPORTED, new Object[] {service.getClass().getName()});
+                throw se;
+            }
+            catch (SecurityException se)
+            {
+                // when a LOGIN message causes a security exception, we want to continue processing here
+                // to allow metadata to be sent to clients communicating with runtime destinations.
+                // The result will be an error message with a login fault message as well as the metadata
+                if (AUTHENTICATION_SERVICE_ID.equals(serviceId))
+                {
+                    commandResult = se.createErrorMessage();
+                    if (Log.isDebug())
+                        Log.getLogger(LOG_CATEGORY).debug("Security error for message: " +
+                                se.toString() + StringUtils.NEWLINE +
+                             "  incomingMessage: " + command + StringUtils.NEWLINE +
+                             "  errorReply: " + commandResult);
+                    serviced = true;
+                }
+                else
+                {
+                    throw se;
+                }
+            }
+        }
+
+        if (recreateHttpFlexSessionAfterLogin)
+            recreateHttpFlexSessionAfterLogin();
+
+        if (commandResult == null)
+        {
+            replyMessage = new AcknowledgeMessage();
+        }
+        else if (commandResult instanceof AsyncMessage)
+        {
+            replyMessage = (AsyncMessage)commandResult;
+        }
+        else
+        {
+            replyMessage = new AcknowledgeMessage();
+            replyMessage.setBody(commandResult);
+        }
+
+        // Update the replyMessage body with server configuration if the
+        // operation is ping or login and make sure to return the FlexClient Id value.
+        if (command.getOperation() == CommandMessage.CLIENT_PING_OPERATION
+                || command.getOperation() == CommandMessage.LOGIN_OPERATION)
+        {
+            boolean needsConfig = false;
+            if (command.getHeader(CommandMessage.NEEDS_CONFIG_HEADER) != null)
+                needsConfig = ((Boolean)(command.getHeader(CommandMessage.NEEDS_CONFIG_HEADER)));
+
+            // Send configuration information only if the client requested.
+            if (needsConfig)
+            {
+                ConfigMap serverConfig = describeServices(endpoint);
+                if (serverConfig.size() > 0)
+                    replyMessage.setBody(serverConfig);
+            }
+
+            // Record the features available over this endpoint
+            double msgVersion = endpoint.getMessagingVersion();
+            if (msgVersion > 0)
+                replyMessage.setHeader(CommandMessage.MESSAGING_VERSION, new Double(msgVersion));
+
+            // Record the flex client ID
+            FlexClient flexClient = FlexContext.getFlexClient();
+            if (flexClient != null)
+                replyMessage.setHeader(Message.FLEX_CLIENT_ID_HEADER, flexClient.getId());
+        }
+        else if (!serviced)
+        {
+            MessageException lme = new MessageException();
+            // The supplied destination id is not registered with any service..
+            lme.setMessage(ERR_MSG_NO_SERVICE_FOR_DEST);
+            throw lme;
+        }
+
+        replyMessage.setCorrelationId(command.getMessageId());
+        replyMessage.setClientId(command.getClientId());
+        if (replyMessage.getBody() instanceof java.util.List)
+        {
+            replyMessage.setBody(((List) replyMessage.getBody()).toArray());
+        }
+
+        if (Log.isDebug())
+            Log.getLogger(getLogCategory(command)).debug(
+                 "Executed command: " +
+                 (service == null ? "(default service)" : "service=" +
+                                                          service.getId()) + StringUtils.NEWLINE +
+                                                                           "  commandMessage: " + command + StringUtils.NEWLINE +
+                                                                           "  replyMessage: " + replyMessage + StringUtils.NEWLINE);
+
+        return replyMessage;
+    }
+
+    /**
+     * Services call this method in order to send a message
+     * to a FlexClient.
+     *
+     * @exclude
+     */
+    public void routeMessageToMessageClient(Message message, MessageClient messageClient)
+    {
+        // Make sure message has a messageId
+        checkMessageId(message);
+
+        // Route the message and the MessageClient (subscription) to the FlexClient to
+        // queue the message for delivery to the remote client.
+        // Reset the thread local FlexClient and FlexSession to be specific to the client
+        // we're pushing to, and then reset the context back to its original request handling state.
+        FlexClient requestFlexClient = FlexContext.getFlexClient();
+        FlexSession requestFlexSession = FlexContext.getFlexSession();
+
+        FlexClient pushFlexClient = messageClient.getFlexClient();
+        FlexContext.setThreadLocalFlexClient(pushFlexClient);
+        FlexContext.setThreadLocalSession(null); // Null because we don't have a currently active endpoint for the push client.
+        try
+        {
+            pushFlexClient.push(message, messageClient);
+        }
+        finally // Reset thread locals.
+        {
+            FlexContext.setThreadLocalFlexClient(requestFlexClient);
+            FlexContext.setThreadLocalSession(requestFlexSession);
+        }
+    }
+
+    /**
+     * @exclude
+     * Check that the destination permits access over the endpoint, the security
+     * constraint of the destination permits the operation, and the service and
+     * the destination the message is targeting are running,
+     *
+     * @param message The incoming message.
+     * @param destination The destination to check against.
+     */
+    public void inspectOperation(Message message, Destination destination)
+    {
+        inspectChannel(message, destination);
+        loginManager.checkConstraint(destination.getSecurityConstraint());
+
+        Service service = destination.getService();
+        if (!service.isStarted())
+        {
+            // {0} ''{1}'' cannot service message ''{2}'' in stopped state.
+            MessageException me = new MessageException();
+            me.setMessage(ERR_MSG_CANNOT_SERVICE_STOPPED, new Object[]{SERVICE, service.getId(), message.getMessageId()});
+            throw me;
+        }
+
+        if (!destination.isStarted())
+        {
+            // {0} ''{1}'' cannot service message ''{2}'' in stopped state.
+            MessageException me = new MessageException();
+            me.setMessage(ERR_MSG_CANNOT_SERVICE_STOPPED, new Object[]{"Destination", destination.getId(), message.getMessageId()});
+            throw me;
+        }
+    }
+
+    /**
+     * @exclude
+     * Verify that this destination permits access over this endpoint.
+     *
+     * @param message The incoming message.
+     * @param destination The destination to check against.
+     */
+    public void inspectChannel(Message message, Destination destination)
+    {
+        if (!enforceEndpointValidation && message.getHeader(Message.VALIDATE_ENDPOINT_HEADER) == null)
+            return;
+
+        String messageChannel = (String)message.getHeader(Message.ENDPOINT_HEADER);
+        for (String channelId : destination.getChannels())
+        {
+            if (channelId.equals(messageChannel))
+                return;
+        }
+        MessageException lme = new MessageException();
+        lme.setMessage(ERR_MSG_DESTINATION_UNACCESSIBLE, new Object[] {destination.getId(), messageChannel});
+        throw lme;
+    }
+
+    /**
+     * @exclude
+     * Returns the logging category to use for a given message.
+     */
+    public String getLogCategory(Message message)
+    {
+        if (message instanceof AbstractMessage)
+            return ((AbstractMessage) message).logCategory();
+        return LogCategories.MESSAGE_GENERAL;
+    }
+
+    /**
+     * This is the class loader used by the system to load user defined classes.
+     *
+     * @return <code>ClassLoader</code> the system should use to load user defined classes.
+     */
+    public ClassLoader getClassLoader()
+    {
+        return classLoader;
+    }
+
+    /**
+     * @exclude
+     * Sets the class loader used by the system to load user defined classes.
+     *
+     * @param classLoader The class loader used by the system to loader user defiend classes.
+     */
+    public void setClassLoader(ClassLoader classLoader)
+    {
+        this.classLoader = classLoader;
+    }
+
+    /**
+     * @exclude
+     * Used internally by AbstractService to check existence of destination and service id
+     * mapping in the destinationToService map.
+     *
+     * @return True if the destination is already registered.
+     */
+    public boolean isDestinationRegistered(String destId, String svcId, boolean throwException)
+    {
+        // Do not allow multiple destinations with the same id across services
+        if (destinationToService.containsKey(destId))
+        {
+            if (throwException)
+            {
+                // Cannot add destination with id ''{0}'' to service with id ''{1}'' because another service with id ''{2}'' already has a destination with the same id.
+                ConfigurationException ex = new ConfigurationException();
+                ex.setMessage(ConfigurationConstants.DUPLICATE_DEST_ID, new Object[]{destId, svcId, destinationToService.get(destId)});
+                throw ex;
+            }
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * @exclude
+     * Used internally by AbstractService to add destination and service id
+     * mapping to destinationToService map.
+     *
+     * @param destId Destination id.
+     * @param svcId Service id.
+     */
+    public void registerDestination(String destId, String svcId)
+    {
+        // Do not allow multiple destinations with the same id across services
+        if (destinationToService.containsKey(destId))
+        {
+            // Cannot add destination with id ''{0}'' to service with id ''{1}'' because another service with id ''{2}'' already has a destination with the same id.
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(ConfigurationConstants.DUPLICATE_DEST_ID, new Object[]{destId, svcId, destinationToService.get(destId)});
+            throw ex;
+        }
+        destinationToService.put(destId, svcId);
+    }
+
+    /**
+     * @exclude
+     * Used internally by AbstractService to remove destination and service id
+     * mapping from destinationToService map.
+     *
+     * @param destId Destination id.
+     */
+    public void unregisterDestination(String destId)
+    {
+        destinationToService.remove(destId);
+    }
+
+    /**
+     * @exclude
+     * Looks up and returns a destination by id; removing the need to know which service
+     * a destination is registered for.
+     *
+     * @param destId Destination id.
+     */
+    public Destination getRegisteredDestination(String destId)
+    {
+        String serviceId = destId != null? destinationToService.get(destId) : null;
+        return serviceId != null? getService(serviceId).getDestination(destId) : null;
+    }
+
+    /**
+     * Increments the count of destinations actively using an Application or Session
+     * level scoped assembler identified by the passed in attributeId.
+     *
+     * @param attributeId Attribute id for the session or application-scoped object.
+     */
+    public void incrementAttributeIdRefCount(String attributeId)
+    {
+        synchronized (attributeIdRefCounts)
+        {
+            Integer currentCount = attributeIdRefCounts.get(attributeId);
+            if (currentCount == null)
+                attributeIdRefCounts.put(attributeId, INTEGER_ONE);
+            else
+                attributeIdRefCounts.put(attributeId, currentCount + 1);
+        }
+    }
+
+    /**
+     * Decrements the count of destinations actively using an Application or Session
+     * level scoped assembler identified by the passed in attributeId.
+     *
+     * @param attributeId Attribute id for the session or application-scoped object.
+     * @return in the attribute ID ref count after decrement
+     */
+    public int decrementAttributeIdRefCount(String attributeId)
+    {
+        synchronized (attributeIdRefCounts)
+        {
+            Integer currentCount = attributeIdRefCounts.get(attributeId);
+            if (currentCount == null)
+                return 0;
+
+            int newValue = currentCount -1 ;
+            attributeIdRefCounts.put(attributeId, newValue);
+            return newValue;
+        }
+    }
+
+
+    //--------------------------------------------------------------------------
+    //
+    // Protected Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @exclude
+     * Utility method to make sure that message has an assigned messageId.
+     */
+    protected void checkMessageId(Message message)
+    {
+        if (message.getMessageId() == null)
+        {
+            MessageException lme = new MessageException();
+            lme.setMessage(ERR_MSG_NULL_MESSAGE_ID);
+            throw lme;
+        }
+    }
+
+    /**
+     * @exclude
+     * Check the headers for the message for the RemoteCredentials.
+     *
+     * @param service
+     * @param message
+     */
+    protected void extractRemoteCredentials(Service service, Message message)
+    {
+        if (!message.headerExists(Message.REMOTE_CREDENTIALS_HEADER))
+            return;
+
+        boolean setting = false;
+        String username = null;
+        String credentials = null;
+        if (message.getHeader(Message.REMOTE_CREDENTIALS_HEADER) instanceof String)
+        {
+            String encoded = (String)message.getHeader(Message.REMOTE_CREDENTIALS_HEADER);
+            if (encoded.length() > 0) //empty string is clearing the credentials
+            {
+                setting = true;
+                Base64.Decoder decoder = new Base64.Decoder();
+                decoder.decode(encoded);
+                byte[] decodedBytes = decoder.drain();
+                String decoded;
+
+                String charset = (String)message.getHeader(Message.REMOTE_CREDENTIALS_CHARSET_HEADER);
+                if (charset != null)
+                {
+                    try
+                    {
+                        decoded = new String(decodedBytes, charset);
+                    }
+                    catch (UnsupportedEncodingException ex)
+                    {
+                        MessageException lme = new MessageException();
+                        lme.setMessage(ERR_MSG_UNKNOWN_REMOTE_CREDENTIALS_FORMAT);
+                        throw lme;
+                    }
+                }
+                else
+                {
+                    decoded = new String(decodedBytes);
+                }
+
+                int colon = decoded.indexOf(':');
+                if (colon > 0 && colon < decoded.length() - 1)
+                {
+                    username = decoded.substring(0, colon);
+                    credentials = decoded.substring(colon + 1);
+                }
+            }
+        }
+        else
+        {
+            MessageException lme = new MessageException();
+            lme.setMessage(ERR_MSG_UNKNOWN_REMOTE_CREDENTIALS_FORMAT);
+            throw lme;
+        }
+
+        if (setting)
+        {
+            FlexContext.getFlexSession().putRemoteCredentials(
+                    new FlexRemoteCredentials(service.getId(),
+                            message.getDestination(), username, credentials));
+        }
+        else
+        {
+            FlexContext.getFlexSession().clearRemoteCredentials(service.getId(),
+                    message.getDestination());
+        }
+    }
+
+    @Override
+    protected String getLogCategory()
+    {
+        return LOG_CATEGORY;
+    }
+
+    /** @exclude */
+    public void setServletContext(ServletContext servletContext)
+    {
+        this.servletContext = servletContext;
+    }
+
+    /**
+     * @exclude
+     * This method was added so that Spring-BlazeDS Integration 1.0.2 works with latest BlazeDS binaries
+     * Internally, this method simply invokes the setServletContext(...) method
+     */
+    protected void setInitServletContext(ServletContext servletContext)
+    {
+        setServletContext(servletContext);
+    }
+
+    protected void recreateHttpFlexSessionAfterLogin()
+    {
+        FlexSession currentHttpFlexSession = FlexContext.getFlexSession();
+        Principal principal = currentHttpFlexSession.getUserPrincipal();
+        currentHttpFlexSession.invalidate(); // This will recreate a new session.
+
+        FlexSession newHttpFlexSession = FlexContext.getFlexSession();
+        newHttpFlexSession.setUserPrincipal(principal);
+    }
+
+    /**
+     * Start all of the broker's endpoints.
+     *
+     * @exclude
+     */
+    protected void startEndpoints()
+    {
+        for (Endpoint endpoint : endpoints.values())
+        {
+            if (endpoint instanceof AbstractEndpoint && ((AbstractEndpoint)endpoint).isRemote())
+                continue; // Local representation of remote endpoints are not started.
+            endpoint.start();
+        }
+    }
+
+    /**
+     * Stop all of the broker's endpoints.
+     *
+     * @exclude
+     */
+    protected void stopEndpoints()
+    {
+        for (Endpoint endpoint : endpoints.values())
+        {
+            if (endpoint instanceof AbstractEndpoint && ((AbstractEndpoint)endpoint).isRemote())
+                continue; // Local representation of remote endpoints are not stopped.
+            endpoint.stop();
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @exclude
+     */
+    private void checkEndpointUrl(String id, String endpointUrl)
+    {
+        // Do not allow endpoints with null url property.
+        if (endpointUrl == null)
+        {
+            // Cannot add ''{0}'' with null url to the ''{1}''
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(ERR_MSG_NULL_ENDPOINT_URL, new Object[]{ENDPOINT, MESSAGEBROKER});
+            throw ex;
+        }
+
+        String parsedEndpointURI = ChannelSettings.removeTokens(endpointUrl);
+
+        // first check the original URI
+        if (registeredEndpoints.containsKey(parsedEndpointURI))
+        {
+          ConfigurationException ce = new ConfigurationException();
+          ce.setMessage(ERR_MSG_URI_ALREADY_REGISTERED, new Object[] {id, parsedEndpointURI,
+                        registeredEndpoints.get(parsedEndpointURI)});
+          throw ce;
+        }
+
+        // add the original URI to the registered endpoints map
+        registeredEndpoints.put(parsedEndpointURI, id);
+
+        // also need to check the URI without the context root
+        int nextSlash = parsedEndpointURI.indexOf('/', 1);
+        if (nextSlash > 0)
+        {
+            String parsedEndpointURI2 = parsedEndpointURI.substring(nextSlash);
+            if (registeredEndpoints.containsKey(parsedEndpointURI2))
+            {
+                ConfigurationException ce = new ConfigurationException();
+                ce.setMessage(ERR_MSG_URI_ALREADY_REGISTERED, new Object[] {
+                        parsedEndpointURI2, id,
+                        registeredEndpoints.get(parsedEndpointURI2) });
+                throw ce;
+            }
+            registeredEndpoints.put(parsedEndpointURI2, id);
+        }
+    }
+
+    /**
+     * @exclude
+     * Matches the current &quot;servlet + pathinfo&quot; to a list of channels registered
+     * in the services configuration file, independent of context root.
+     *
+     * @param path        The Servlet mapping and PathInfo of the current request
+     * @param contextPath The web application context root (or empty string for default root)
+     * @param endpoint    The endpoint to be matched
+     * @return whether the current request matches a registered endpoint URI
+     *
+     */
+    private boolean matchEndpoint(String path, String contextPath, Endpoint endpoint)
+    {
+        boolean match = false;
+        String channelEndpoint = endpoint.getParsedUrl(contextPath);
+
+        if (path.endsWith("/"))
+        {
+            path = path.substring(0, path.length() - 1);
+        }
+
+        if (path.equalsIgnoreCase(channelEndpoint))
+        {
+            match = true;
+        }
+
+        return match;
+    }
+
+    private void registerMessageBroker()
+    {
+        String mbid = getId();
+
+        synchronized (messageBrokers)
+        {
+            if (messageBrokers.get(mbid) != null)
+            {
+                ConfigurationException ce = new ConfigurationException();
+                ce.setMessage(10137, new Object[] {getId() == null ? "(no value supplied)" : mbid});
+                throw ce;
+            }
+            messageBrokers.put(mbid, this);
+        }
+    }
+
+    private void unRegisterMessageBroker()
+    {
+        String mbid = getId();
+
+        synchronized (messageBrokers)
+        {
+            messageBrokers.remove(mbid);
+        }
+    }
+
+    /**
+     * Start all of the broker's shared servers.
+     */
+    private void startServers()
+    {
+        for (Server server : servers.values())
+        {
+            // Validate that the server is actually referenced by an endpoint; if not, warn.
+            boolean serverIsReferenced = false;
+            for (Endpoint endpoint : endpoints.values())
+            {
+                if (endpoint instanceof Endpoint2 && server.equals(((Endpoint2)endpoint).getServer()))
+                {
+                    serverIsReferenced = true;
+                    break;
+                }
+            }
+
+            if (!serverIsReferenced && Log.isWarn())
+                Log.getLogger(LogCategories.CONFIGURATION).warn("Server '" + server.getId() + "' is not referenced by any endpoints.");
+
+            server.start();
+        }
+    }
+
+    /**
+     * Stop all the broker's shared servers.
+     */
+    private void stopServers()
+    {
+        for (Server server : servers.values())
+            server.stop();
+    }
+
+    /**
+     * Start all of the broker's services.
+     *
+     * @exclude
+     */
+    private void startServices()
+    {
+        for (Service svc : services.values() )
+        {
+            long timeBeforeStartup = 0;
+            if (Log.isDebug())
+            {
+                timeBeforeStartup = System.currentTimeMillis();
+                Log.getLogger(LOG_CATEGORY_STARTUP_SERVICE).debug("Service with id '{0}' is starting.",
+                        new Object[]{svc.getId()});
+            }
+
+            svc.start();
+
+            if (Log.isDebug())
+            {
+                long timeAfterStartup = System.currentTimeMillis();
+                Long diffMillis = timeAfterStartup - timeBeforeStartup;
+                Log.getLogger(LOG_CATEGORY_STARTUP_SERVICE).debug("Service with id '{0}' is ready (startup time: '{1}' ms)",
+                        new Object[]{svc.getId(), diffMillis});
+            }
+        }
+    }
+
+    /**
+     * Stop all of the broker's services.
+     *
+     * @exclude
+     */
+    private void stopServices()
+    {
+        for (Service svc : services.values())
+            svc.stop();
+    }
+}


[11/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/log/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/log/package-info.java b/modules/core/src/flex/management/runtime/messaging/log/package-info.java
new file mode 100755
index 0000000..37d55e8
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/log/package-info.java
@@ -0,0 +1,18 @@
+/*
+ * 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.management.runtime.messaging.log;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/package-info.java b/modules/core/src/flex/management/runtime/messaging/package-info.java
new file mode 100755
index 0000000..8331825
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * 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.management.runtime.messaging;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/MessageServiceControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/MessageServiceControl.java b/modules/core/src/flex/management/runtime/messaging/services/MessageServiceControl.java
new file mode 100755
index 0000000..ad89011
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/MessageServiceControl.java
@@ -0,0 +1,51 @@
+/*
+ * 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.management.runtime.messaging.services;
+
+import flex.management.BaseControl;
+import flex.messaging.services.MessageService;
+
+/**
+ * The <code>MessageServiceControl</code> class is the MBean implemenation
+ * for monitoring and managing a <code>MessageService</code> at runtime.
+ *
+ * @author shodgson
+ */
+public class MessageServiceControl extends ServiceControl implements
+        MessageServiceControlMBean
+{
+    private static final String TYPE = "MessageService";
+
+    /**
+     * Constructs a <code>MessageServiceControl</code>, assigning its id, managed
+     * message service and parent MBean.
+     *
+     * @param service The <code>MessageService</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public MessageServiceControl(MessageService service, BaseControl parent)
+    {
+        super(service, parent);
+    }
+
+    /** {@inheritDoc} */
+    public String getType()
+    {
+        return TYPE;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/MessageServiceControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/MessageServiceControlMBean.java b/modules/core/src/flex/management/runtime/messaging/services/MessageServiceControlMBean.java
new file mode 100755
index 0000000..8e7916d
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/MessageServiceControlMBean.java
@@ -0,0 +1,28 @@
+/*
+ * 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.management.runtime.messaging.services;
+
+
+/**
+ * Defines the runtime monitoring and management interface for managed message services.
+ * 
+ * @author shodgson
+ */
+public interface MessageServiceControlMBean extends ServiceControlMBean
+{
+    // Empty for now.
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/ServiceAdapterControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/ServiceAdapterControl.java b/modules/core/src/flex/management/runtime/messaging/services/ServiceAdapterControl.java
new file mode 100755
index 0000000..2870c96
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/ServiceAdapterControl.java
@@ -0,0 +1,87 @@
+/*
+ * 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.management.runtime.messaging.services;
+
+import java.util.Date;
+
+import flex.management.BaseControl;
+import flex.management.runtime.messaging.DestinationControl;
+import flex.messaging.services.ServiceAdapter;
+
+/**
+ * The <code>ServiceAdapterControl</code> class is the base MBean implementation 
+ * for monitoring and managing a <code>ServiceAdapter</code> at runtime.
+ * 
+ * @author shodgson
+ */
+public abstract class ServiceAdapterControl extends BaseControl implements
+        ServiceAdapterControlMBean
+{
+    protected ServiceAdapter serviceAdapter;  
+
+    /**
+     * Constructs a <code>ServiceAdapterControl</code>, assigning its id, managed service 
+     * adapter and parent MBean.
+     * 
+     * @param serviceAdapter The <code>ServiceAdapter</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public ServiceAdapterControl(ServiceAdapter serviceAdapter, BaseControl parent)
+    {
+        super(parent);    
+        this.serviceAdapter = serviceAdapter;  
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.BaseControlMBean#getId()
+     */
+    public String getId()
+    {
+        return serviceAdapter.getId();
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ServiceAdapterControlMBean#isRunning()
+     */
+    public Boolean isRunning()
+    {
+        return Boolean.valueOf(serviceAdapter.isStarted());
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ServiceAdapterControlMBean#getStartTimestamp()
+     */
+    public Date getStartTimestamp()
+    {
+        return startTimestamp;
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see javax.management.MBeanRegistration#preDeregister()
+     */
+    public void preDeregister() throws Exception
+    {
+        DestinationControl parent = (DestinationControl)getParentControl();
+        parent.setAdapter(null);
+       
+        super.preDeregister();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/ServiceAdapterControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/ServiceAdapterControlMBean.java b/modules/core/src/flex/management/runtime/messaging/services/ServiceAdapterControlMBean.java
new file mode 100755
index 0000000..eb21b65
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/ServiceAdapterControlMBean.java
@@ -0,0 +1,47 @@
+/*
+ * 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.management.runtime.messaging.services;
+
+import java.io.IOException;
+import java.util.Date;
+
+import flex.management.BaseControlMBean;
+
+/**
+ * Defines the runtime monitoring and management interface for service adapters.
+ *
+ * @author shodgson
+ */
+public interface ServiceAdapterControlMBean extends BaseControlMBean
+{
+    /**
+     * Returns <code>true</code> if the <code>ServiceAdapter</code> is running.
+     *
+     * @return <code>true</code> if the <code>ServiceAdapter</code> is running.
+     * @throws IOException Throws IOException.
+     */
+    Boolean isRunning() throws IOException;
+
+    /**
+     * Returns the start timestamp for the <code>ServiceAdapter</code>.
+     *
+     * @return The start timestamp for the <code>ServiceAdapter</code>.
+     * @throws IOException Throws IOException.
+     */
+    Date getStartTimestamp() throws IOException;
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/ServiceControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/ServiceControl.java b/modules/core/src/flex/management/runtime/messaging/services/ServiceControl.java
new file mode 100755
index 0000000..b804728
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/ServiceControl.java
@@ -0,0 +1,145 @@
+/*
+ * 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.management.runtime.messaging.services;
+
+import flex.management.BaseControl;
+import flex.management.runtime.messaging.MessageBrokerControl;
+import flex.messaging.Destination;
+import flex.messaging.services.Service;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.management.ObjectName;
+
+/**
+ * The <code>ServiceControl</code> class is the MBean implementation for
+ * monitoring and managing a <code>Service</code> at runtime.
+ * 
+ * @author shodgson
+ */
+public abstract class ServiceControl extends BaseControl implements ServiceControlMBean
+{
+    protected Service service;
+    private List destinations;
+    
+    /**
+     * Constructs a <code>ServiceControl</code>, assigning its id, managed service and
+     * parent MBean.
+     * 
+     * @param service The <code>Service</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public ServiceControl(Service service, BaseControl parent)
+    {
+        super(parent);
+        this.service = service;
+        destinations = new ArrayList(); 
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.BaseControlMBean#getId()
+     */
+    public String getId()
+    {
+        return service.getId();
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ServiceControlMBean#isRunning()
+     */
+    public Boolean isRunning()
+    {
+        return Boolean.valueOf(service.isStarted());
+    }
+    
+    
+    /**
+     * Adds the <code>ObjectName</code> of a destination registered with the managed service.
+     * 
+     * @param value The <code>ObjectName</code> of a destination registered with the managed service.
+     */
+    public void addDestination(ObjectName value)
+    {
+        destinations.add(value);
+    }
+    
+    /**
+     * Removes the <code>ObjectName</code> of a destination registered with the managed service.
+     * 
+     * @param value The <code>ObjectName</code> of a destination registered with the managed service.
+     */
+    public void removeDestination(ObjectName value)
+    {
+        destinations.remove(value);
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ServiceControlMBean#getDestinations()
+     */
+    public ObjectName[] getDestinations()
+    {
+        int size = destinations.size();
+        ObjectName[] destinationNames = new ObjectName[size];
+        for (int i = 0; i < size; ++i)
+        {
+            destinationNames[i] = (ObjectName)destinations.get(i);
+        }
+        return destinationNames;
+    }
+    
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ServiceControlMBean#getStartTimestamp()
+     */
+    public Date getStartTimestamp()
+    {
+        return startTimestamp;
+    }
+    
+    
+    /*
+     *  (non-Javadoc)
+     * @see javax.management.MBeanRegistration#preDeregister()
+     */
+    public void preDeregister() throws Exception
+    {
+        MessageBrokerControl parent = (MessageBrokerControl)getParentControl();
+        parent.removeService(getObjectName());
+        
+        // Unregister destinations of the service
+        for (Iterator iter = service.getDestinations().values().iterator(); iter.hasNext();) {
+            Destination child = (Destination) iter.next();
+            if (child.getControl() != null)
+            {
+                child.getControl().unregister();
+                child.setControl(null);
+                child.setManaged(false);
+            }
+            
+        }
+        
+        super.preDeregister();
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/ServiceControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/ServiceControlMBean.java b/modules/core/src/flex/management/runtime/messaging/services/ServiceControlMBean.java
new file mode 100755
index 0000000..370c08f
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/ServiceControlMBean.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.management.runtime.messaging.services;
+
+import flex.management.BaseControlMBean;
+
+import java.io.IOException;
+import java.util.Date;
+import javax.management.ObjectName;
+
+/**
+ * Defines the runtime monitoring and management interface for managed services.
+ *
+ * @author shodgson
+ */
+public interface ServiceControlMBean extends BaseControlMBean
+{
+
+    /**
+     * Returns <code>true</code> if the <code>Service</code> is running.
+     *
+     * @return <code>true</code> if the <code>Service</code> is running.
+     * @throws IOException Throws IOException.
+     */
+    Boolean isRunning() throws IOException;
+
+
+    /**
+     * Returns the start timestamp for the <code>Service</code>.
+     *
+     * @return The start timestamp for the <code>Service</code>.
+     * @throws IOException Throws IOException.
+     */
+    Date getStartTimestamp() throws IOException;
+
+    /**
+     * Returns the <code>ObjectName</code>s of all destinations registered with the
+     * managed service.
+     *
+     * @return The <code>ObjectName</code>s of all destinations registered with the
+     * managed service.
+     * @throws IOException Throws IOException.
+     */
+    ObjectName[] getDestinations() throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/messaging/SubscriptionManagerControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/messaging/SubscriptionManagerControl.java b/modules/core/src/flex/management/runtime/messaging/services/messaging/SubscriptionManagerControl.java
new file mode 100755
index 0000000..598732b
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/messaging/SubscriptionManagerControl.java
@@ -0,0 +1,129 @@
+/*
+ * 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.management.runtime.messaging.services.messaging;
+
+import flex.management.BaseControl;
+import flex.messaging.MessageClient;
+import flex.messaging.services.messaging.SubscriptionManager;
+
+import java.util.Set;
+
+/**
+ * The <code>SubscriptionManagerControl</code> class is the MBean implementation for
+ * monitoring and managing a <code>SubscriptionManager</code> at runtime.
+ * 
+ * @author shodgson
+ */
+public class SubscriptionManagerControl extends BaseControl implements
+        SubscriptionManagerControlMBean
+{
+    private SubscriptionManager subscriptionManager;
+    
+    /**
+     * Constructs a new <code>SubscriptionManagerControl</code> instance, assigning its
+     * backing <code>SubscriptionManager</code>.
+     * 
+     * @param subscriptionManager The <code>SubscriptionManager</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public SubscriptionManagerControl(SubscriptionManager subscriptionManager, BaseControl parent)
+    {
+        super(parent);
+        this.subscriptionManager = subscriptionManager;
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.BaseControlMBean#getId()
+     */
+    public String getId()
+    {
+        return subscriptionManager.getId();
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.BaseControlMBean#getType()
+     */
+    public String getType()
+    {
+        return SubscriptionManager.TYPE;
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.SubscriptionManagerControlMBean#getSubscriberCount()
+     */
+    public Integer getSubscriberCount()
+    {
+        Set subscriberIds = subscriptionManager.getSubscriberIds();
+        if (subscriberIds != null)
+        {
+            return new Integer(subscriberIds.size());            
+        }
+        else
+        {
+            return new Integer(0);
+        }
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.SubscriptionManagerControlMBean#getSubscriberIds()
+     */
+    public String[] getSubscriberIds()
+    {
+        Set subscriberIds = subscriptionManager.getSubscriberIds();
+        if (subscriberIds != null)
+        {
+            String[] ids = new String[subscriberIds.size()];
+            return (String[])subscriberIds.toArray(ids);
+        }
+        else
+        {
+            return new String[0];
+        }                
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.SubscriptionManagerControlMBean#removeSubscriber(java.lang.String)
+     */
+    public void removeSubscriber(String subscriberId)
+    {
+        MessageClient subscriber = subscriptionManager.getSubscriber(subscriberId);
+        if (subscriber != null)
+        {
+            subscriptionManager.removeSubscriber(subscriber);
+        }
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.SubscriptionManagerControlMBean#removeAllSubscribers()
+     */
+    public void removeAllSubscribers()
+    {
+        String[] subscriberIds = getSubscriberIds();
+        int length = subscriberIds.length;
+        for (int i = 0; i < length; ++i)
+        {
+            removeSubscriber(subscriberIds[i]);
+        }
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/messaging/SubscriptionManagerControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/messaging/SubscriptionManagerControlMBean.java b/modules/core/src/flex/management/runtime/messaging/services/messaging/SubscriptionManagerControlMBean.java
new file mode 100755
index 0000000..f0b7f5f
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/messaging/SubscriptionManagerControlMBean.java
@@ -0,0 +1,61 @@
+/*
+ * 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.management.runtime.messaging.services.messaging;
+
+import java.io.IOException;
+
+import flex.management.BaseControlMBean;
+
+/**
+ * Defines the runtime monitoring and management interface for
+ * <code>SubscriptionManager</code>s.
+ *
+ * @author shodgson
+ */
+public interface SubscriptionManagerControlMBean extends BaseControlMBean
+{
+    /**
+     * Returns the count of active subscribers.
+     *
+     * @return The count of active subscribers.
+     * @throws IOException Throws IOException.
+     */
+    Integer getSubscriberCount() throws IOException;
+
+    /**
+     * Returns the ids for all active subscribers.
+     *
+     * @return The ids for all active subscribers.
+     * @throws IOException Throws IOException.
+     */
+    String[] getSubscriberIds() throws IOException;
+
+    /**
+     * Unsubscribes the target subscriber.
+     *
+     * @param subscriberId The id for the subscriber to unsubscribe.
+     * @throws IOException Throws IOException.
+     */
+    void removeSubscriber(String subscriberId) throws IOException;
+
+    /**
+     * Unsubscribes all active subscribers.
+     *
+     * @throws IOException Throws IOException.
+     */
+    void removeAllSubscribers() throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/messaging/ThrottleManagerControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/messaging/ThrottleManagerControl.java b/modules/core/src/flex/management/runtime/messaging/services/messaging/ThrottleManagerControl.java
new file mode 100755
index 0000000..485e780
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/messaging/ThrottleManagerControl.java
@@ -0,0 +1,304 @@
+/*
+ * 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.management.runtime.messaging.services.messaging;
+
+import flex.management.BaseControl;
+import flex.management.runtime.AdminConsoleTypes;
+import flex.messaging.services.messaging.ThrottleManager;
+
+import java.util.Date;
+
+/**
+ * The <code>ThrottleManagerControl</code> class is the MBean implementation for
+ * monitoring and managing a <code>ThrottleManager</code> at runtime.
+ *
+ * @author shodgson
+ */
+public class ThrottleManagerControl extends BaseControl implements
+        ThrottleManagerControlMBean
+{
+    private ThrottleManager throttleManager;
+    private long clientIncomingMessageThrottleStart;
+    private int clientIncomingMessageThrottleCount;
+    private Date lastClientIncomingMessageThrottleTimestamp;
+    private long clientOutgoingMessageThrottleStart;
+    private int clientOutgoingMessageThrottleCount;
+    private Date lastClientOutgoingMessageThrottleTimestamp;
+    private long destinationIncomingMessageThrottleStart;
+    private int destinationIncomingMessageThrottleCount;
+    private Date lastDestinationIncomingMessageThrottleTimestamp;
+    private long destinationOutgoingMessageThrottleStart;
+    private int destinationOutgoingMessageThrottleCount;
+    private Date lastDestinationOutgoingMessageThrottleTimestamp;
+
+    /**
+     * Constructs a new <code>ThrottleManagerControl</code> instance, assigning its
+     * backing <code>ThrottleManager</code>.
+     *
+     * @param throttleManager The <code>ThrottleManager</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public ThrottleManagerControl(ThrottleManager throttleManager, BaseControl parent)
+    {
+        super(parent);
+        this.throttleManager = throttleManager;
+        clientIncomingMessageThrottleStart = System.currentTimeMillis();
+        clientOutgoingMessageThrottleStart = clientIncomingMessageThrottleStart;
+        destinationIncomingMessageThrottleStart = clientIncomingMessageThrottleStart;
+        destinationOutgoingMessageThrottleStart = clientIncomingMessageThrottleStart;
+    }
+
+    @Override
+    protected void onRegistrationComplete()
+    {
+        String name = this.getObjectName().getCanonicalName();
+        String[] attributes = {
+                "ClientIncomingMessageThrottleCount", "ClientIncomingMessageThrottleFrequency",
+                "ClientOutgoingMessageThrottleCount", "ClientOutgoingMessageThrottleFrequency",
+                "DestinationIncomingMessageThrottleCount", "DestinationIncomingMessageThrottleFrequency",
+                "DestinationOutgoingMessageThrottleCount", "DestinationOutgoingMessageThrottleFrequency",
+                "LastClientIncomingMessageThrottleTimestamp", "LastClientOutgoingMessageThrottleTimestamp",
+                "LastDestinationIncomingMessageThrottleTimestamp", "LastDestinationOutgoingMessageThrottleTimestamp"
+        };
+
+        getRegistrar().registerObjects(AdminConsoleTypes.DESTINATION_POLLABLE, name, attributes);
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.BaseControlMBean#getId()
+     */
+    @Override
+    public String getId()
+    {
+        return throttleManager.getId();
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.BaseControlMBean#getType()
+     */
+    @Override
+    public String getType()
+    {
+        return ThrottleManager.TYPE;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#getClientIncomingMessageThrottleCount()
+     */
+    public Integer getClientIncomingMessageThrottleCount()
+    {
+        return Integer.valueOf(clientIncomingMessageThrottleCount);
+    }
+
+    /**
+     * Increments the count of throttled incoming client messages.
+     */
+    public void incrementClientIncomingMessageThrottleCount()
+    {
+        ++clientIncomingMessageThrottleCount;
+        lastClientIncomingMessageThrottleTimestamp = new Date();
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#resetClientIncomingMessageThrottleCount()
+     */
+    public void resetClientIncomingMessageThrottleCount()
+    {
+        clientIncomingMessageThrottleStart = System.currentTimeMillis();
+        clientIncomingMessageThrottleCount = 0;
+        lastClientIncomingMessageThrottleTimestamp = null;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#getLastClientIncomingMessageThrottleTimestamp()
+     */
+    public Date getLastClientIncomingMessageThrottleTimestamp()
+    {
+        return lastClientIncomingMessageThrottleTimestamp;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#getClientIncomingMessageThrottleFrequency()
+     */
+    public Double getClientIncomingMessageThrottleFrequency()
+    {
+        if (clientIncomingMessageThrottleCount > 0)
+        {
+            double runtime = differenceInMinutes(clientIncomingMessageThrottleStart, System.currentTimeMillis());
+            return new Double(clientIncomingMessageThrottleCount/runtime);
+        }
+        return new Double(0);
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#getClientOutgoingMessageThrottleCount()
+     */
+    public Integer getClientOutgoingMessageThrottleCount()
+    {
+        return Integer.valueOf(clientOutgoingMessageThrottleCount);
+    }
+
+    /**
+     * Increments the count of throttled outgoing client messages.
+     */
+    public void incrementClientOutgoingMessageThrottleCount()
+    {
+        ++clientOutgoingMessageThrottleCount;
+        lastClientOutgoingMessageThrottleTimestamp = new Date();
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#resetClientOutgoingMessageThrottleCount()
+     */
+    public void resetClientOutgoingMessageThrottleCount()
+    {
+        clientOutgoingMessageThrottleStart = System.currentTimeMillis();
+        clientOutgoingMessageThrottleCount = 0;
+        lastClientOutgoingMessageThrottleTimestamp = null;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#getLastClientOutgoingMessageThrottleTimestamp()
+     */
+    public Date getLastClientOutgoingMessageThrottleTimestamp()
+    {
+        return lastClientOutgoingMessageThrottleTimestamp;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#getClientOutgoingMessageThrottleFrequency()
+     */
+    public Double getClientOutgoingMessageThrottleFrequency()
+    {
+        if (clientOutgoingMessageThrottleCount > 0)
+        {
+            double runtime = differenceInMinutes(clientOutgoingMessageThrottleStart, System.currentTimeMillis());
+            return new Double(clientOutgoingMessageThrottleCount/runtime);
+        }
+        return new Double(0);
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#getDestinationIncomingMessageThrottleCount()
+     */
+    public Integer getDestinationIncomingMessageThrottleCount()
+    {
+        return Integer.valueOf(destinationIncomingMessageThrottleCount);
+    }
+
+    /**
+     * Increments the count of throttled incoming destination messages.
+     */
+    public void incrementDestinationIncomingMessageThrottleCount()
+    {
+        ++destinationIncomingMessageThrottleCount;
+        lastDestinationIncomingMessageThrottleTimestamp = new Date();
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#resetDestinationIncomingMessageThrottleCount()
+     */
+    public void resetDestinationIncomingMessageThrottleCount()
+    {
+        destinationIncomingMessageThrottleStart = System.currentTimeMillis();
+        destinationIncomingMessageThrottleCount = 0;
+        lastDestinationIncomingMessageThrottleTimestamp = null;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#getLastDestinationIncomingMessageThrottleTimestamp()
+     */
+    public Date getLastDestinationIncomingMessageThrottleTimestamp()
+    {
+        return lastDestinationIncomingMessageThrottleTimestamp;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#getDestinationIncomingMessageThrottleFrequency()
+     */
+    public Double getDestinationIncomingMessageThrottleFrequency()
+    {
+        if (destinationIncomingMessageThrottleCount > 0)
+        {
+            double runtime = differenceInMinutes(destinationIncomingMessageThrottleStart, System.currentTimeMillis());
+            return new Double(destinationIncomingMessageThrottleCount/runtime);
+        }
+        return new Double(0);
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#getDestinationOutgoingMessageThrottleCount()
+     */
+    public Integer getDestinationOutgoingMessageThrottleCount()
+    {
+        return Integer.valueOf(destinationOutgoingMessageThrottleCount);
+    }
+
+    /**
+     * Increments the count of throttled outgoing destination messages.
+     */
+    public void incrementDestinationOutgoingMessageThrottleCount()
+    {
+        ++destinationOutgoingMessageThrottleCount;
+        lastDestinationOutgoingMessageThrottleTimestamp = new Date();
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#resetDestinationOutgoingMessageThrottleCount()
+     */
+    public void resetDestinationOutgoingMessageThrottleCount()
+    {
+        destinationOutgoingMessageThrottleStart = System.currentTimeMillis();
+        destinationOutgoingMessageThrottleCount = 0;
+        lastDestinationOutgoingMessageThrottleTimestamp = null;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.ThrottleManagerControlMBean#getLastDestinationOutgoingMessageThrottleTimestamp()
+     */
+    public Date getLastDestinationOutgoingMessageThrottleTimestamp()
+    {
+        return lastDestinationOutgoingMessageThrottleTimestamp;
+    }
+
+    public Double getDestinationOutgoingMessageThrottleFrequency()
+    {
+        if (destinationOutgoingMessageThrottleCount > 0)
+        {
+            double runtime = differenceInMinutes(destinationOutgoingMessageThrottleStart, System.currentTimeMillis());
+            return new Double(destinationOutgoingMessageThrottleCount/runtime);
+        }
+        return new Double(0);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/messaging/ThrottleManagerControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/messaging/ThrottleManagerControlMBean.java b/modules/core/src/flex/management/runtime/messaging/services/messaging/ThrottleManagerControlMBean.java
new file mode 100755
index 0000000..d28337c
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/messaging/ThrottleManagerControlMBean.java
@@ -0,0 +1,179 @@
+/*
+ * 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.management.runtime.messaging.services.messaging;
+
+import flex.management.BaseControlMBean;
+
+import java.io.IOException;
+import java.util.Date;
+
+/**
+ * Defines the runtime monitoring and management interface for
+ * <code>ThrottleManager</code>s.
+ *
+ * @author shodgson
+ */
+public interface ThrottleManagerControlMBean extends BaseControlMBean
+{
+    /**
+     * Returns the number of incoming client messages that have been
+     * throttled.
+     *
+     * @return The number of incoming client messages that have been
+     * throttled.
+     * @throws IOException Throws IOException.
+     */
+    Integer getClientIncomingMessageThrottleCount() throws IOException;
+
+    /**
+     * Resets the number of throttled incoming client messages to 0.
+     *
+     * @throws IOException Throws IOException.
+     */
+    void resetClientIncomingMessageThrottleCount() throws IOException;
+
+    /**
+     * Returns the timestamp when an incoming client message was
+     * most recently throttled.
+     *
+     * @return The timestamp when an incoming client message was
+     * most recently throttled.
+     * @throws IOException Throws IOException.
+     */
+    Date getLastClientIncomingMessageThrottleTimestamp() throws IOException;
+
+    /**
+     * Returns the number of incoming client messages that have been
+     * throttled per minute.
+     *
+     * @return The number of incoming client messages that have been
+     * throttled per minute.
+     * @throws IOException Throws IOException.
+     */
+    Double getClientIncomingMessageThrottleFrequency() throws IOException;
+
+    /**
+     * Returns the number of outgoing client messages that have been
+     * throttled.
+     *
+     * @return The number of outgoing client messages that have been
+     * throttled.
+     * @throws IOException Throws IOException.
+     */
+    Integer getClientOutgoingMessageThrottleCount() throws IOException;
+
+    /**
+     * Resets the number of throttled outgoing client messages to 0.
+     *
+     * @throws IOException Throws IOException.
+     */
+    void resetClientOutgoingMessageThrottleCount() throws IOException;
+
+    /**
+     * Returns the timestamp when an outgoing client message was most
+     * recently throttled.
+     *
+     * @return The timestamp when an outgoing client message was most
+     * recently throttled.
+     * @throws IOException Throws IOException.
+     */
+    Date getLastClientOutgoingMessageThrottleTimestamp() throws IOException;
+
+    /**
+     * Returns the number of outgoing client messages that have been
+     * throttled per minute.
+     *
+     * @return The number of outgoing client messages that have been
+     * throttled per minute.
+     * @throws IOException Throws IOException.
+     */
+    Double getClientOutgoingMessageThrottleFrequency() throws IOException;
+
+    /**
+     * Returns the number of incoming destination messages that have
+     * been throttled.
+     *
+     * @return The number of incoming destination messages that have
+     * been throttled.
+     * @throws IOException Throws IOException.
+     */
+    Integer getDestinationIncomingMessageThrottleCount() throws IOException;
+
+    /**
+     * Resets the number of throttled incoming destination messages to 0.
+     *
+     * @throws IOException Throws IOException.
+     */
+    void resetDestinationIncomingMessageThrottleCount() throws IOException;
+
+    /**
+     * Returns the timestamp when an incoming destination message was
+     * most recently throttled.
+     *
+     * @return The timestamp when an incoming destination message was
+     * most recently throttled.
+     * @throws IOException Throws IOException.
+     */
+    Date getLastDestinationIncomingMessageThrottleTimestamp() throws IOException;
+
+    /**
+     * Returns the number of incoming destination messages that have
+     * been throttled per minute.
+     *
+     * @return The number of incoming destination messages that have
+     * been throttled per minute.
+     * @throws IOException Throws IOException.
+     */
+    Double getDestinationIncomingMessageThrottleFrequency() throws IOException;
+
+    /**
+     * Returns the number of outgoing destination messages that have
+     * been throttled.
+     *
+     * @return The number of outgoing destination messages that have
+     * been throttled.
+     * @throws IOException Throws IOException.
+     */
+    Integer getDestinationOutgoingMessageThrottleCount() throws IOException;
+
+    /**
+     * Resets the number of throttled outgoing destination messages to 0.
+     *
+     * @throws IOException Throws IOException.
+     */
+    void resetDestinationOutgoingMessageThrottleCount() throws IOException;
+
+    /**
+     * Returns the timestamp when an outgoing destination message was
+     * most recently throttled.
+     *
+     * @return The timestamp when an outgoing destination message was
+     * most recently throttled.
+     * @throws IOException Throws IOException.
+     */
+    Date getLastDestinationOutgoingMessageThrottleTimestamp() throws IOException;
+
+    /**
+     * Returns the number of outgoing destination messages that have been
+     * throttled per minute.
+     *
+     * @return The number of outgoing destination messages that have been
+     * throttled per minute.
+     * @throws IOException Throws IOException.
+     */
+    Double getDestinationOutgoingMessageThrottleFrequency() throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/ActionScriptAdapterControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/ActionScriptAdapterControl.java b/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/ActionScriptAdapterControl.java
new file mode 100755
index 0000000..b1342c8
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/ActionScriptAdapterControl.java
@@ -0,0 +1,50 @@
+/*
+ * 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.management.runtime.messaging.services.messaging.adapters;
+
+import flex.messaging.services.messaging.adapters.ActionScriptAdapter;
+import flex.management.BaseControl;
+import flex.management.runtime.messaging.services.ServiceAdapterControl;
+
+/**
+ * The <code>ActionScriptAdapterControl</code> class is the MBean implemenation
+ * for monitoring and managing <code>ActionScriptAdapter</code>s at runtime.
+ */
+public class ActionScriptAdapterControl extends ServiceAdapterControl implements ActionScriptAdapterControlMBean
+{
+    private static final String TYPE = "ActionScriptAdapter";
+
+    /**
+     * Constructs a <code>ActionScriptAdapterControl</code>, assigning its id, managed
+     * <code>ActionScriptAdapter</code> and parent MBean.
+     *
+     * @param serviceAdapter The <code>ActionScriptAdapter</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public ActionScriptAdapterControl(ActionScriptAdapter serviceAdapter, BaseControl parent)
+    {
+        super(serviceAdapter, parent);
+    }
+
+    /** {@inheritDoc} */
+    public String getType()
+    {
+        return TYPE;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/ActionScriptAdapterControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/ActionScriptAdapterControlMBean.java b/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/ActionScriptAdapterControlMBean.java
new file mode 100755
index 0000000..9f7dd9a
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/ActionScriptAdapterControlMBean.java
@@ -0,0 +1,28 @@
+/*
+ * 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.management.runtime.messaging.services.messaging.adapters;
+
+import flex.management.runtime.messaging.services.ServiceAdapterControlMBean;
+
+/**
+ * Defines the runtime monitoring and management interface for managed
+ * ActionScript messaging adapters.
+ */
+public interface ActionScriptAdapterControlMBean extends ServiceAdapterControlMBean
+{
+    // empty for now
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/JMSAdapterControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/JMSAdapterControl.java b/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/JMSAdapterControl.java
new file mode 100755
index 0000000..5776d87
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/JMSAdapterControl.java
@@ -0,0 +1,119 @@
+/*
+ * 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.management.runtime.messaging.services.messaging.adapters;
+
+import flex.management.BaseControl;
+import flex.management.runtime.messaging.services.ServiceAdapterControl;
+import flex.messaging.services.messaging.adapters.JMSAdapter;
+
+/**
+ * The <code>JMSAdapterControl</code> class is the MBean implemenation
+ * for monitoring and managing <code>JMSAdapter</code>s at runtime.
+ * 
+ * @author shodgson
+ */
+public class JMSAdapterControl extends ServiceAdapterControl implements
+        JMSAdapterControlMBean
+{
+    private static final String TYPE = "JMSAdapter";
+    private JMSAdapter jmsAdapter;
+    
+    /**
+     * Constructs a <code>JMSAdapterControl</code>, assigning its id, managed
+     * <code>JMSAdapter</code> and parent MBean.
+     * 
+     * @param serviceAdapter The <code>JMSAdapter</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public JMSAdapterControl(JMSAdapter serviceAdapter, BaseControl parent)
+    {
+        super(serviceAdapter, parent);
+        jmsAdapter = serviceAdapter;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.BaseControlMBean#getType()
+     */
+    public String getType()
+    {
+        return TYPE;
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.JMSAdapterControlMBean#getTopicProducerCount()
+     */
+    public Integer getTopicProducerCount()
+    {
+        return new Integer(jmsAdapter.getTopicProducerCount());
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.JMSAdapterControlMBean#getTopicConsumerCount()
+     */
+    public Integer getTopicConsumerCount()
+    {
+        return new Integer(jmsAdapter.getTopicConsumerCount());
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.JMSAdapterControlMBean#getTopicConsumerIds()
+     */
+    public String[] getTopicConsumerIds()
+    {
+        return jmsAdapter.getTopicConsumerIds();
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.JMSAdapterControlMBean#getQueueProducerCount()
+     */
+    public Integer getQueueProducerCount()
+    {
+        return new Integer(jmsAdapter.getQueueProducerCount());
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.JMSAdapterControlMBean#getQueueConsumerCount()
+     */
+    public Integer getQueueConsumerCount()
+    {        
+        return new Integer(jmsAdapter.getQueueConsumerCount());
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.JMSAdapterControlMBean#getQueueConsumerIds()
+     */
+    public String[] getQueueConsumerIds()
+    {
+        return jmsAdapter.getQueueConsumerIds();
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.JMSAdapterControlMBean#removeConsumer(java.lang.String)
+     */
+    public void removeConsumer(String consumerId)
+    {
+        jmsAdapter.removeConsumer(consumerId);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/JMSAdapterControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/JMSAdapterControlMBean.java b/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/JMSAdapterControlMBean.java
new file mode 100755
index 0000000..33b4fc2
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/JMSAdapterControlMBean.java
@@ -0,0 +1,85 @@
+/*
+ * 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.management.runtime.messaging.services.messaging.adapters;
+
+import java.io.IOException;
+
+import flex.management.runtime.messaging.services.ServiceAdapterControlMBean;
+
+/**
+ * Defines the runtime monitoring and management interface for managed JMS adapters.
+ *
+ * @author shodgson
+ */
+public interface JMSAdapterControlMBean extends ServiceAdapterControlMBean
+{
+    /**
+     * Returns the number of topic producers for the adapter.
+     *
+     * @return The number of topic producers for the adapter.
+     * @throws IOException Throws IOException.
+     */
+    Integer getTopicProducerCount() throws IOException;
+
+    /**
+     * Returns the number of topic consumers for the adapter.
+     *
+     * @return The number of topic consumers for the adapter.
+     * @throws IOException Throws IOException.
+     */
+    Integer getTopicConsumerCount() throws IOException;
+
+    /**
+     * Returns the ids of all topic consumers.
+     *
+     * @return The ids of all topic consumers.
+     * @throws IOException Throws IOException.
+     */
+    String[] getTopicConsumerIds() throws IOException;
+
+    /**
+     * Returns the number of queue producers for the adapter.
+     *
+     * @return The number of queue producers for the adapter.
+     * @throws IOException Throws IOException.
+     */
+    Integer getQueueProducerCount() throws IOException;
+
+    /**
+     * Returns the number of queue consumers for the adapter.
+     *
+     * @return The number of queue consumers for the adapter.
+     * @throws IOException Throws IOException.
+     */
+    Integer getQueueConsumerCount() throws IOException;
+
+    /**
+     * Returns the ids of all queue consumers.
+     *
+     * @return The ids of all queue consumers.
+     * @throws IOException Throws IOException.
+     */
+    String[] getQueueConsumerIds() throws IOException;
+
+    /**
+     * Unsubscribes the consumer (for either a topic or queue).
+     *
+     * @param consumerId The id of the consumer to unsubscribe.
+     * @throws IOException Throws IOException.
+     */
+    void removeConsumer(String consumerId) throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/package-info.java b/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/package-info.java
new file mode 100755
index 0000000..dbfa228
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/messaging/adapters/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * 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.management.runtime.messaging.services.messaging.adapters;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/messaging/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/messaging/package-info.java b/modules/core/src/flex/management/runtime/messaging/services/messaging/package-info.java
new file mode 100755
index 0000000..e96d8dd
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/messaging/package-info.java
@@ -0,0 +1,18 @@
+/*
+ * 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.management.runtime.messaging.services.messaging;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/services/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/services/package-info.java b/modules/core/src/flex/management/runtime/messaging/services/package-info.java
new file mode 100755
index 0000000..bc0bad4
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/services/package-info.java
@@ -0,0 +1,18 @@
+/*
+ * 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.management.runtime.messaging.services;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/package-info.java b/modules/core/src/flex/management/runtime/package-info.java
new file mode 100755
index 0000000..e3a8bc7
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * 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.management.runtime;

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/AbstractConnectionAwareSession.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/AbstractConnectionAwareSession.java b/modules/core/src/flex/messaging/AbstractConnectionAwareSession.java
new file mode 100755
index 0000000..ad48501
--- /dev/null
+++ b/modules/core/src/flex/messaging/AbstractConnectionAwareSession.java
@@ -0,0 +1,171 @@
+/*
+ * 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.messaging;
+
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * @exclude
+ * Abstract base class for <tt>ConnectionAwareSession</tt> implementations.
+ * Provides support for registering <tt>FlexSessionConnectivityListener</tt>s
+ * along with protected methods to notify registered listeners of <tt>FlexSessionConnectivityEvent</tt>s.
+ */
+public abstract class AbstractConnectionAwareSession extends FlexSession implements ConnectionAwareSession
+{
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @exclude
+     * Constructs a new instance.
+     *
+     * @param sessionProvider The provider that instantiated this instance.
+     */
+    public AbstractConnectionAwareSession(AbstractFlexSessionProvider sessionProvider)
+    {
+        super(sessionProvider);
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  connected
+    //----------------------------------
+    
+    /**
+     * Connected flag for the session.
+     */
+    private boolean connected;
+
+    /**
+     * Returns whether the session is connected.
+     * 
+     * @return true if the session is connected; otherwise false.
+     */
+    public boolean isConnected()
+    {
+        synchronized (lock)
+        {
+            return connected;
+        }
+    }
+    
+    /**
+     * Sets the connected state for the session.
+     * 
+     * @param value true for a connected session; false for a disconnected session.
+     */
+    public void setConnected(boolean value)
+    {
+        boolean notify = false;
+        synchronized (lock)
+        {
+            if (connected != value)
+            {
+                connected = value;
+                notify = true;
+            }
+        }
+        if (notify)
+        {
+            if (!value)
+                notifySessionDisconnected();
+            else
+                notifySessionConnected();
+        }
+    }
+    
+    //----------------------------------
+    //  connectivityListeners
+    //----------------------------------
+    
+    /**
+     * The list of connectivity listeners for the session.
+     */
+    private volatile CopyOnWriteArrayList<FlexSessionConnectivityListener> connectivityListeners;
+    
+    /**
+     * (non-JavaDoc)
+     * @see flex.messaging.ConnectionAwareSession#addConnectivityListener(FlexSessionConnectivityListener)
+     */
+    public void addConnectivityListener(FlexSessionConnectivityListener listener)
+    {
+        if (connectivityListeners == null)
+        {
+            synchronized (lock)
+            {
+                if (connectivityListeners == null)
+                    connectivityListeners = new CopyOnWriteArrayList<FlexSessionConnectivityListener>(); 
+            }
+        }
+        if (connectivityListeners.addIfAbsent(listener) && isConnected())
+        {
+            // If the listener is added when the session has already connected, notify it at add time.
+            FlexSessionConnectivityEvent event = new FlexSessionConnectivityEvent(this);
+            listener.sessionConnected(event);
+        }
+    }
+
+    /**
+     * (non-JavaDoc)
+     * @see flex.messaging.ConnectionAwareSession#removeConnectivityListener(FlexSessionConnectivityListener)
+     */
+    public void removeConnectivityListener(FlexSessionConnectivityListener listener)
+    {
+        if (connectivityListeners == null) return;
+        connectivityListeners.remove(listener);
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    // Protected Methods
+    //
+    //--------------------------------------------------------------------------    
+    
+    /**
+     * Notifies registered <tt>FlexSessionConnectivityListener</tt>s that the session has connected.
+     */
+    protected void notifySessionConnected()
+    {
+        if (connectivityListeners != null)
+        {
+            FlexSessionConnectivityEvent event = new FlexSessionConnectivityEvent(this);
+            for (FlexSessionConnectivityListener listener : connectivityListeners)
+                listener.sessionDisconnected(event);
+        }
+    }
+    
+    /**
+     * Notifies registered <tt>FlexSessionConnectivityListener</tt>s that the session has disconnected.
+     */
+    protected void notifySessionDisconnected()
+    {
+        if (connectivityListeners != null)
+        {
+            FlexSessionConnectivityEvent event = new FlexSessionConnectivityEvent(this);
+            for (FlexSessionConnectivityListener listener : connectivityListeners)
+                listener.sessionDisconnected(event);            
+        }
+    }    
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/AbstractFlexSessionProvider.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/AbstractFlexSessionProvider.java b/modules/core/src/flex/messaging/AbstractFlexSessionProvider.java
new file mode 100755
index 0000000..3dfdc12
--- /dev/null
+++ b/modules/core/src/flex/messaging/AbstractFlexSessionProvider.java
@@ -0,0 +1,146 @@
+/*
+ * 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.messaging;
+
+import flex.messaging.config.ConfigMap;
+
+/**
+ * @exclude
+ * Base for FlexSessionProvider implementations.
+ * Providers are protocol-specific factories for concrete FlexSession implementations.
+ * They are registered with a FlexSessionManager, which acts as the central point of control
+ * for tracking all active FlexSessions and for dispatching creation events to FlexSessionListeners.
+ */
+public abstract class AbstractFlexSessionProvider implements FlexComponent
+{
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Instance lock.
+     */
+    protected final Object lock = new Object();
+    
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  flexSessionManager
+    //----------------------------------
+
+    private volatile FlexSessionManager flexSessionManager;
+    
+    /**
+     * Returns the <tt>FlexSessionManager</tt> this provider is currently registered to.
+     * 
+     * @return The <tt>FlexSessionManager</tt> this provider is currently registered to.
+     */
+    public FlexSessionManager getFlexSessionManager()
+    {
+        return flexSessionManager;
+    }
+    
+    /**
+     * Sets the <tt>FlexSessionManager</tt> this provider is registered to.
+     * 
+     * @param value The <tt>FlexSessionManager</tt> this provider is registered to.
+     */
+    public void setFlexSessionManager(final FlexSessionManager value)
+    {
+        flexSessionManager = value;
+    }
+    
+    //----------------------------------
+    //  logCategory
+    //----------------------------------
+
+    private boolean started;    
+    
+    /**
+     * Indicates whether the component is started and running.
+     * 
+     * @return <code>true</code> if the component has started; 
+     *         otherwise <code>false</code>.
+     */
+    public boolean isStarted()
+    {
+        synchronized (lock)
+        {
+            return started;
+        }
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Initializes the component with configuration information.
+     *
+     * @param id The id of the component.
+     * @param configMap The properties for configuring component.
+     */
+    public void initialize(final String id, final ConfigMap configMap)
+    {
+        // No-op.
+    }
+    
+    /**
+     * Removes a <tt>FlexSession</tt> created by this provider.
+     * This callback is invoked by <tt>FlexSession</tt>s when they are invalidated.
+     *
+     * @param session The <tt>FlexSession</tt> being invalidated.
+     */
+    public void removeFlexSession(final FlexSession session)
+    {
+        FlexSessionManager manager = getFlexSessionManager();
+        if (manager != null)
+            manager.unregisterFlexSession(session);
+    }
+    
+    /**
+     * Invoked to start the component.
+     * This base implementation changes the components state such that {@link #isStarted()} returns true.
+     */
+    public void start()
+    {
+        synchronized (lock)
+        {
+            started = true;
+        }
+    }
+    
+    /**
+     * Invoked to stop the component.
+     * This base implementation changes the components state such that {@link #isStarted()} returns false.
+     */
+    public void stop()
+    {
+        synchronized (lock)
+        {
+            started = false;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/ConnectionAwareSession.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/ConnectionAwareSession.java b/modules/core/src/flex/messaging/ConnectionAwareSession.java
new file mode 100755
index 0000000..573b506
--- /dev/null
+++ b/modules/core/src/flex/messaging/ConnectionAwareSession.java
@@ -0,0 +1,63 @@
+/*
+ * 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.messaging;
+
+/**
+ * Sessions that directly track their connection state support notifying interested
+ * listeners of connectivity changes.
+ */
+public interface ConnectionAwareSession
+{
+    //----------------------------------
+    //  connected
+    //----------------------------------
+
+    /**
+     * Returns true if the session is connected; otherwise false.
+     * 
+     * @return true if the session is connected; otherwise false.
+     */
+    boolean isConnected();
+    
+    /**
+     * Sets the connected state for the session.
+     * 
+     * @param value true if the session is connected; false if disconnected.
+     */
+    void setConnected(boolean value);
+    
+    //----------------------------------
+    //  connectivityListeners
+    //----------------------------------
+    
+    /**
+     * Registers a session connectivity listener with the session.
+     * This listener will be notified when the session acquires or looses connectivity
+     * to the remote host.
+     * 
+     * @param listener The <tt>FlexSessionConnectivityListener</tt> to register with the session.
+     */
+    void addConnectivityListener(FlexSessionConnectivityListener listener);
+    
+    /**
+     * Unregisters a session connectivity listener from the session.
+     * The unregistered listener will no longer be notified of session connectivity changes.
+     * 
+     * @param listener The <tt>FlexSessionConnectivityListener</tt> to unregister from the session.
+     */
+    void removeConnectivityListener(FlexSessionConnectivityListener listener);
+}


[31/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/dashboard/src/dashboard.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/dashboard/src/dashboard.mxml b/apps/samples/WEB-INF/flex-src/dashboard/src/dashboard.mxml
new file mode 100755
index 0000000..1be8190
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/dashboard/src/dashboard.mxml
@@ -0,0 +1,209 @@
+<?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:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns="*"
+    pageTitle="Collaborative Dashboard"
+    creationComplete="initApp()">
+
+
+    <fx:Style source="main.css"/>
+
+	<fx:Script>
+        <![CDATA[
+
+    	import mx.messaging.messages.AsyncMessage;
+    	import mx.messaging.messages.IMessage;
+    	import mx.collections.ArrayCollection;
+    	import mx.messaging.events.MessageEvent;
+    	import mx.rpc.events.ResultEvent;
+
+		[Bindable]
+        public var slicedMonthData:ArrayCollection;
+
+		[Bindable]
+        public var slicedRegionData:ArrayCollection;
+        
+        private var monthData:Array;
+        private var regionData:Array;
+
+        private function initApp():void
+        {
+            consumer.subscribe();
+           	srv.send();
+            slicedMonthData = new ArrayCollection();
+            slicedRegionData = new ArrayCollection();   
+        }
+
+        private function resultHandler(event:ResultEvent):void
+        {
+            monthData = event.result.list.month.source as Array;
+			slider.maximum = monthData.length - 1;
+			slider.values = [0, monthData.length - 1];
+            slicedMonthData.source = monthData;
+            regionBreakdown.month = monthData[0];
+            
+            regionData = new Array(monthData.length);
+            var monthTotal:Number;
+            
+            for (var i:Number = 0; i < monthData.length; i++) 
+        	{
+                regionData[i] = {name: monthData[i].name, average: 0, revenue: 0};
+                var regions:Array = monthData[i].region.source;
+                monthTotal = 0;
+                for (var j:Number = 0; j < regions.length; j++)
+                {
+                    monthTotal += regions[j].revenue;
+                }
+                regionData[i].average = monthTotal/monthData[i].region.length
+            }
+            slicedRegionData.source = regionData.slice(slider.values[0], slider.values[1]);
+        }
+        
+        private function getSliderLabel(value:String):String 
+    	{
+            return monthData[parseInt(value)].name;
+        }
+        
+   	    // Send messages when user's selection changes
+        private function monthChange():void
+    	{
+            var message:IMessage = new AsyncMessage();
+            message.body = {month: timeline.selectedMonth};
+            producer.send(message);
+        }
+
+        private function rangeChange():void
+    	{
+            var message:IMessage = new AsyncMessage();
+            message.body = {min: slider.values[0], max: slider.values[1]+1};
+            producer.send(message);
+        }
+
+        private function regionChange():void
+    	{
+            var message: IMessage = new AsyncMessage();
+            message.body = {region: regionBreakdown.selectedRegion};
+            producer.send(message);
+       	}
+
+        // Handle incoming messages
+        private function messageHandler(event:MessageEvent):void
+    	{
+            var body:Object = event.message.body;
+
+            if (body.min != null) //range
+        	{
+                slider.values = [body.min, body.max - 1];
+
+                if (monthData != null)
+                   slicedMonthData.source = monthData.slice(body.min, body.max);
+                if (regionData != null)
+                   slicedRegionData.source = regionData.slice(body.min, body.max);
+
+            } 
+            else if (body.month != null) //month in timeline
+        	{
+                regionBreakdown.month = body.month;
+            } 
+            else if (body.region != null) //region from breakdown
+        	{
+                regionBreakdown.selectedRegion = body.region;
+                regionDetail.region = body.region.name;
+
+                for (var i: Number = 0; i < monthData.length; i++) 
+            	{
+                    var regions: Array = monthData[i].region.source;
+                    for (var j: Number = 0; j < regions.length; j++) 
+                	{
+                        if (regions[j].name == body.region.name)
+                    	{
+                            regionData[i].revenue = regions[j].revenue;
+                            break;
+                        }
+                    }
+                }
+                slicedRegionData.source = regionData.slice(slider.values[0], slider.values[1] + 1);
+            }
+        }
+        
+        private function toggleSeries():void
+		{
+            var message: IMessage = new AsyncMessage();
+			if (currentState=="series")
+			{
+				currentState = "";
+	            message.body.series = false;
+			} 
+			else
+			{
+				currentState = "series";
+	            message.body.series = true;
+			}
+            producer.send(message);
+		}
+
+        private function dataGridCurrencyFormat(item:Object, column:Object):String
+        {
+            return cf.format(item[column.dataField]);
+        }
+
+        ]]>
+    </fx:Script>
+
+    <fx:Declarations>
+    	<mx:Producer id="producer" destination="dashboard"/>
+    	<mx:Consumer id="consumer" destination="dashboard" message="messageHandler(event)"/>
+
+    	<mx:HTTPService id="srv" url="results.xml" useProxy="false" result="resultHandler(event)"/>
+
+    	<mx:CurrencyFormatter id="cf"/>
+    </fx:Declarations>
+
+    <mx:HBox width="100%" verticalAlign="middle" horizontalAlign="right" paddingRight="40">
+        <mx:Label text="Welcome, Guest |"/>
+        <mx:ComboBox id="cb">
+        	<mx:dataProvider>
+        		<fx:String>Revenue Timeline</fx:String>
+        	</mx:dataProvider>
+        </mx:ComboBox>
+    </mx:HBox>
+
+	<mx:HDividedBox width="100%" height="100%">
+
+		<mx:Panel id="timelinePanel" title="Revenue Timeline" width="100%" height="100%">
+	        <RevenueTimeline id="timeline" revenueData="{slicedMonthData.source}"
+	        	monthChange="monthChange()"/>
+		    <mx:ControlBar horizontalGap="4">
+		        <mx:ToggleButtonBar dataProvider="{timeline}"/>
+		        <mx:Spacer width="10"/>
+		        <mx:Label text="Range:"/>
+		        <mx:HSlider id="slider" width="150" thumbCount="2" snapInterval="1" minimum="0"
+		            dataTipFormatFunction="getSliderLabel"
+		            change="rangeChange()"/>
+		    </mx:ControlBar>
+		</mx:Panel>
+	
+	    <mx:VDividedBox width="100%" height="100%">
+	        <RegionBreakdown id="regionBreakdown" regionChange="regionChange()" width="100%" height="50%" />
+	        <RegionDetail id="regionDetail" revenueData="{slicedRegionData.source}" width="100%" height="50%" />
+	    </mx:VDividedBox>
+		
+	</mx:HDividedBox>
+
+</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/dashboard/src/icon_chart.png
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/dashboard/src/icon_chart.png b/apps/samples/WEB-INF/flex-src/dashboard/src/icon_chart.png
new file mode 100755
index 0000000..7abe2f1
Binary files /dev/null and b/apps/samples/WEB-INF/flex-src/dashboard/src/icon_chart.png differ

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/dashboard/src/icon_grid.png
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/dashboard/src/icon_grid.png b/apps/samples/WEB-INF/flex-src/dashboard/src/icon_grid.png
new file mode 100755
index 0000000..a44f0bc
Binary files /dev/null and b/apps/samples/WEB-INF/flex-src/dashboard/src/icon_grid.png differ

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/dashboard/src/main.css
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/dashboard/src/main.css b/apps/samples/WEB-INF/flex-src/dashboard/src/main.css
new file mode 100755
index 0000000..1c3d051
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/dashboard/src/main.css
@@ -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.
+ */
+@namespace mx "library://ns.adobe.com/flex/mx";
+
+mx|Application {
+    paddingTop: 12;
+    verticalGap: 12;
+}
+
+mx|Panel {
+    cornerRadius: 6;
+    panelBorderStyle: "roundCorners";
+}
+
+mx|Button {
+	cornerRadius: 4;	
+}
+
+mx|HSlider {
+	showTrackHighlight: true;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/dashboard/src/results.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/dashboard/src/results.xml b/apps/samples/WEB-INF/flex-src/dashboard/src/results.xml
new file mode 100755
index 0000000..6a96b33
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/dashboard/src/results.xml
@@ -0,0 +1,213 @@
+<!--
+
+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.
+
+-->
+<list>
+
+    <month name="Jan-04" revenue="400263" average="80052">
+        <region name="APAC" revenue="46130"/>
+        <region name="Europe" revenue="106976"/>
+        <region name="Japan" revenue="79554"/>
+        <region name="Latin America" revenue="39252"/>
+        <region name="North America" revenue="128351"/>
+    </month>
+
+    <month name="Feb-04" revenue="379145" average="75829">
+        <region name="APAC" revenue="70324"/>
+        <region name="Europe" revenue="88912"/>
+        <region name="Japan" revenue="69677"/>
+        <region name="Latin America" revenue="59428"/>
+        <region name="North America" revenue="90804"/>
+    </month>
+
+    <month name="Mar-04" revenue="389687" average="77937">
+        <region name="APAC" revenue="60431"/>
+        <region name="Europe" revenue="140982"/>
+        <region name="Japan" revenue="58196"/>
+        <region name="Latin America" revenue="33373"/>
+        <region name="North America" revenue="96705"/>
+    </month>
+
+    <month name="Apr-04" revenue="460329" average="92065">
+        <region name="APAC" revenue="78969"/>
+        <region name="Europe" revenue="85885"/>
+        <region name="Japan" revenue="78107"/>
+        <region name="Latin America" revenue="65796"/>
+        <region name="North America" revenue="151572"/>
+    </month>
+
+    <month name="May-04" revenue="351014" average="70202">
+        <region name="APAC" revenue="64069"/>
+        <region name="Europe" revenue="82415"/>
+        <region name="Japan" revenue="96397"/>
+        <region name="Latin America" revenue="44627"/>
+        <region name="North America" revenue="63506"/>
+    </month>
+
+    <month name="Jun-04" revenue="384855" average="76971">
+        <region name="APAC" revenue="55331"/>
+        <region name="Europe" revenue="113196"/>
+        <region name="Japan" revenue="55371"/>
+        <region name="Latin America" revenue="58323"/>
+        <region name="North America" revenue="102634"/>
+    </month>
+
+    <month name="Jul-04" revenue="335192" average="67038">
+        <region name="APAC" revenue="39445"/>
+        <region name="Europe" revenue="110750"/>
+        <region name="Japan" revenue="73722"/>
+        <region name="Latin America" revenue="50595"/>
+        <region name="North America" revenue="60680"/>
+    </month>
+
+    <month name="Aug-04" revenue="393654" average="78730">
+        <region name="APAC" revenue="44801"/>
+        <region name="Europe" revenue="98806"/>
+        <region name="Japan" revenue="93673"/>
+        <region name="Latin America" revenue="50636"/>
+        <region name="North America" revenue="105738"/>
+    </month>
+
+    <month name="Sep-04" revenue="472554" average="94510">
+        <region name="APAC" revenue="61134"/>
+        <region name="Europe" revenue="136467"/>
+        <region name="Japan" revenue="93624"/>
+        <region name="Latin America" revenue="32293"/>
+        <region name="North America" revenue="149036"/>
+    </month>
+
+    <month name="Oct-04" revenue="324299" average="64859">
+        <region name="APAC" revenue="32078"/>
+        <region name="Europe" revenue="85420"/>
+        <region name="Japan" revenue="80483"/>
+        <region name="Latin America" revenue="64390"/>
+        <region name="North America" revenue="61928"/>
+    </month>
+
+    <month name="Nov-04" revenue="415403" average="83080">
+        <region name="APAC" revenue="58832"/>
+        <region name="Europe" revenue="143128"/>
+        <region name="Japan" revenue="64295"/>
+        <region name="Latin America" revenue="58261"/>
+        <region name="North America" revenue="90887"/>
+    </month>
+
+    <month name="Dec-04" revenue="386089" average="77217">
+        <region name="APAC" revenue="80555"/>
+        <region name="Europe" revenue="118981"/>
+        <region name="Japan" revenue="87520"/>
+        <region name="Latin America" revenue="27154"/>
+        <region name="North America" revenue="71879"/>
+    </month>
+
+    <month name="Jan-05" revenue="400263" average="80052">
+        <region name="APAC" revenue="46130"/>
+        <region name="Europe" revenue="106976"/>
+        <region name="Japan" revenue="79554"/>
+        <region name="Latin America" revenue="39252"/>
+        <region name="North America" revenue="128351"/>
+    </month>
+
+    <month name="Feb-05" revenue="379145" average="75829">
+        <region name="APAC" revenue="70324"/>
+        <region name="Europe" revenue="88912"/>
+        <region name="Japan" revenue="69677"/>
+        <region name="Latin America" revenue="59428"/>
+        <region name="North America" revenue="90804"/>
+    </month>
+
+    <month name="Mar-05" revenue="389687" average="77937">
+        <region name="APAC" revenue="60431"/>
+        <region name="Europe" revenue="140982"/>
+        <region name="Japan" revenue="58196"/>
+        <region name="Latin America" revenue="33373"/>
+        <region name="North America" revenue="96705"/>
+    </month>
+
+    <month name="Apr-05" revenue="460329" average="92065">
+        <region name="APAC" revenue="78969"/>
+        <region name="Europe" revenue="85885"/>
+        <region name="Japan" revenue="78107"/>
+        <region name="Latin America" revenue="65796"/>
+        <region name="North America" revenue="151572"/>
+    </month>
+
+    <month name="May-05" revenue="351014" average="70202">
+        <region name="APAC" revenue="64069"/>
+        <region name="Europe" revenue="82415"/>
+        <region name="Japan" revenue="96397"/>
+        <region name="Latin America" revenue="44627"/>
+        <region name="North America" revenue="63506"/>
+    </month>
+
+    <month name="Jun-05" revenue="384855" average="76971">
+        <region name="APAC" revenue="55331"/>
+        <region name="Europe" revenue="113196"/>
+        <region name="Japan" revenue="55371"/>
+        <region name="Latin America" revenue="58323"/>
+        <region name="North America" revenue="102634"/>
+    </month>
+
+    <month name="Jul-05" revenue="335192" average="67038">
+        <region name="APAC" revenue="39445"/>
+        <region name="Europe" revenue="110750"/>
+        <region name="Japan" revenue="73722"/>
+        <region name="Latin America" revenue="50595"/>
+        <region name="North America" revenue="60680"/>
+    </month>
+
+    <month name="Aug-05" revenue="393654" average="78730">
+        <region name="APAC" revenue="44801"/>
+        <region name="Europe" revenue="98806"/>
+        <region name="Japan" revenue="93673"/>
+        <region name="Latin America" revenue="50636"/>
+        <region name="North America" revenue="105738"/>
+    </month>
+
+    <month name="Sep-05" revenue="472554" average="94510">
+        <region name="APAC" revenue="61134"/>
+        <region name="Europe" revenue="136467"/>
+        <region name="Japan" revenue="93624"/>
+        <region name="Latin America" revenue="32293"/>
+        <region name="North America" revenue="149036"/>
+    </month>
+
+    <month name="Oct-05" revenue="324299" average="64859">
+        <region name="APAC" revenue="32078"/>
+        <region name="Europe" revenue="85420"/>
+        <region name="Japan" revenue="80483"/>
+        <region name="Latin America" revenue="64390"/>
+        <region name="North America" revenue="61928"/>
+    </month>
+
+    <month name="Nov-05" revenue="415403" average="83080">
+        <region name="APAC" revenue="58832"/>
+        <region name="Europe" revenue="143128"/>
+        <region name="Japan" revenue="64295"/>
+        <region name="Latin America" revenue="58261"/>
+        <region name="North America" revenue="90887"/>
+    </month>
+
+    <month name="Dec-05" revenue="386089" average="77217">
+        <region name="APAC" revenue="80555"/>
+        <region name="Europe" revenue="118981"/>
+        <region name="Japan" revenue="87520"/>
+        <region name="Latin America" revenue="27154"/>
+        <region name="North America" revenue="71879"/>
+    </month>
+
+</list>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/inventory/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/build.xml b/apps/samples/WEB-INF/flex-src/inventory/build.xml
new file mode 100755
index 0000000..b1e0787
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/inventory/build.xml
@@ -0,0 +1,82 @@
+<?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="Inventory Management" />
+    <property name="application.file" value="inventory" />
+    <property name="application.bin.dir" value="${samples.war}/inventory" />
+    <property name="application.src.dir" value="${samples.war}/WEB-INF/flex-src/inventory/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"
+            history="true"
+            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/inventory/src/Product.as
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/Product.as b/apps/samples/WEB-INF/flex-src/inventory/src/Product.as
new file mode 100755
index 0000000..2f91ccb
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/inventory/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 category:String;
+
+		public var price:Number = 0;
+
+		public var image:String;
+
+		public var description:String;
+		
+		public var qtyInStock:int = 0;
+
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/inventory/src/ProductForm.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/ProductForm.mxml b/apps/samples/WEB-INF/flex-src/inventory/src/ProductForm.mxml
new file mode 100755
index 0000000..d9977fa
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/inventory/src/ProductForm.mxml
@@ -0,0 +1,106 @@
+<?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:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
+	label="{product.productId > 0 ? product.name : 'New Product'}" width="100%" height="100%">
+	
+	<mx:Script>
+		<![CDATA[
+			import mx.events.ValidationResultEvent;
+			import mx.rpc.events.ResultEvent;
+			
+			[Bindable]
+			public var product:Product;
+			
+			private function save():void
+			{
+				if (nameValidator.validate().type == ValidationResultEvent.INVALID) return;
+				product.name = productName.text;
+				product.category = category.text;
+				product.price = Number(price.text);
+				product.qtyInStock = parseInt(qtyInStock.text);
+				product.image = image.text;
+				product.description = description.text;
+				if (product.productId > 0)
+					srv.update(product);
+				else
+					srv.create(product);
+			}
+			
+			private function createResult(event:ResultEvent):void
+			{
+				product = event.result as Product;
+				label = product.name;
+			}
+
+			private function removeResult(event:ResultEvent):void
+			{
+				parent.removeChild(this);
+			}
+
+			
+		]]>
+	</mx:Script>
+	
+	<mx:StringValidator id="nameValidator" source="{productName}" property="text" minLength="1"/>
+	
+	<mx:RemoteObject id="srv" destination="product">
+		<mx:method name="create" result="createResult(event)"/>
+		<mx:method name="remove" result="removeResult(event)"/>
+	</mx:RemoteObject>
+
+	<mx:Image source="../images/{product.image}" top="0" right="20" brokenImageSkin="@Embed('assets/blank.png')"/>
+
+	<mx:Form width="100%" verticalGap="8">
+	
+		<mx:FormItem label="Id">
+			<mx:TextInput id="productId" text="{product.productId}" enabled="false"/>
+		</mx:FormItem>
+
+		<mx:FormItem label="Name" required="true">
+			<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="In Stock">
+			<mx:TextInput id="qtyInStock" text="{product.qtyInStock}"/>
+		</mx:FormItem>
+	
+		<mx:FormItem label="Description" width="100%">
+			<mx:TextArea id="description" text="{product.description}" width="100%" height="100"/>
+		</mx:FormItem>
+		
+	</mx:Form>
+
+	<mx:Button label="Save" click="save()" bottom="10" left="10" height="36" width="63"/>
+	<mx:Button label="Delete" click="srv.remove(product)" left="75" bottom="10" height="36" width="72"/> 
+	<mx:Button label="Close Tab" click="parent.removeChild(this)" right="10" bottom="10" height="36" width="88"/> 
+
+</mx:Canvas>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/inventory/src/SearchPopup.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/SearchPopup.mxml b/apps/samples/WEB-INF/flex-src/inventory/src/SearchPopup.mxml
new file mode 100755
index 0000000..89333d2
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/inventory/src/SearchPopup.mxml
@@ -0,0 +1,96 @@
+<?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:List xmlns:mx="http://www.adobe.com/2006/mxml"
+	dropShadowEnabled="true"
+	currentState="hidden"
+	labelField="name"
+	keyDown="searchKeyDownHandler(event)"
+	click="openSelectedItem()">
+
+	<mx:Metadata>
+		[Event(name="select")]
+	</mx:Metadata>	
+	
+	<mx:Script>
+		<![CDATA[
+			import mx.rpc.events.ResultEvent;
+
+			import mx.collections.ArrayCollection;
+
+			public function search(searchStr:String):void
+			{
+				dataProvider = null;
+				srv.getProductsByName(searchStr);
+				if (currentState == "hidden") currentState = "";
+			}
+			
+			protected function searchKeyDownHandler(event:KeyboardEvent):void
+			{
+				switch (event.keyCode) 
+				{
+					case Keyboard.ENTER:
+						openSelectedItem();
+	    				break;
+					case Keyboard.ESCAPE:
+						currentState = "hidden";
+	    				break;
+				}
+			}
+		
+			public function openSelectedItem():void
+			{
+				if (selectedItem)
+				{
+					dispatchEvent(new Event("select"));	
+					currentState="hidden";
+				}
+			}
+
+			public function selectNext():void
+			{
+				selectedIndex++;
+			}		
+			
+			public function selectPrevious():void
+			{
+				if (selectedIndex > 0) selectedIndex--;
+			}		
+
+			private function resultHandler(event:ResultEvent):void
+			{
+				dataProvider = event.result as ArrayCollection;
+				if (dataProvider && dataProvider.length > 0)
+				{
+					selectedIndex = 0;
+				}
+			}
+			
+		]]>
+	</mx:Script>
+
+	<mx:RemoteObject id="srv" destination="product" result="resultHandler(event)"/>
+
+	<mx:states>
+		<mx:State name="hidden">
+			<mx:SetProperty name="visible" value="false"/>
+		</mx:State>
+	</mx:states>
+	
+</mx:List>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/inventory/src/assets/Thumbs.db
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/assets/Thumbs.db b/apps/samples/WEB-INF/flex-src/inventory/src/assets/Thumbs.db
new file mode 100755
index 0000000..ad2bbe5
Binary files /dev/null and b/apps/samples/WEB-INF/flex-src/inventory/src/assets/Thumbs.db differ

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/inventory/src/assets/app_skin.png
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/assets/app_skin.png b/apps/samples/WEB-INF/flex-src/inventory/src/assets/app_skin.png
new file mode 100755
index 0000000..48d919b
Binary files /dev/null and b/apps/samples/WEB-INF/flex-src/inventory/src/assets/app_skin.png differ

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/inventory/src/assets/blank.png
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/assets/blank.png b/apps/samples/WEB-INF/flex-src/inventory/src/assets/blank.png
new file mode 100755
index 0000000..02f2d4b
Binary files /dev/null and b/apps/samples/WEB-INF/flex-src/inventory/src/assets/blank.png differ

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/inventory/src/assets/button_over_skin.png
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/assets/button_over_skin.png b/apps/samples/WEB-INF/flex-src/inventory/src/assets/button_over_skin.png
new file mode 100755
index 0000000..a489605
Binary files /dev/null and b/apps/samples/WEB-INF/flex-src/inventory/src/assets/button_over_skin.png differ

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/inventory/src/assets/button_skin.png
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/assets/button_skin.png b/apps/samples/WEB-INF/flex-src/inventory/src/assets/button_skin.png
new file mode 100755
index 0000000..5ac3c63
Binary files /dev/null and b/apps/samples/WEB-INF/flex-src/inventory/src/assets/button_skin.png differ

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/inventory/src/assets/icon_close.png
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/assets/icon_close.png b/apps/samples/WEB-INF/flex-src/inventory/src/assets/icon_close.png
new file mode 100755
index 0000000..ccb86db
Binary files /dev/null and b/apps/samples/WEB-INF/flex-src/inventory/src/assets/icon_close.png differ

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/inventory/src/assets/icon_plus.png
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/assets/icon_plus.png b/apps/samples/WEB-INF/flex-src/inventory/src/assets/icon_plus.png
new file mode 100755
index 0000000..b4ecdba
Binary files /dev/null and b/apps/samples/WEB-INF/flex-src/inventory/src/assets/icon_plus.png differ

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/inventory/src/assets/icon_search.png
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/assets/icon_search.png b/apps/samples/WEB-INF/flex-src/inventory/src/assets/icon_search.png
new file mode 100755
index 0000000..4f62019
Binary files /dev/null and b/apps/samples/WEB-INF/flex-src/inventory/src/assets/icon_search.png differ

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/inventory/src/assets/search.png
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/assets/search.png b/apps/samples/WEB-INF/flex-src/inventory/src/assets/search.png
new file mode 100755
index 0000000..5f0e375
Binary files /dev/null and b/apps/samples/WEB-INF/flex-src/inventory/src/assets/search.png differ

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/inventory/src/assets/top_separator.png
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/assets/top_separator.png b/apps/samples/WEB-INF/flex-src/inventory/src/assets/top_separator.png
new file mode 100755
index 0000000..f3848f6
Binary files /dev/null and b/apps/samples/WEB-INF/flex-src/inventory/src/assets/top_separator.png differ

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/inventory/src/inventory.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/inventory.mxml b/apps/samples/WEB-INF/flex-src/inventory/src/inventory.mxml
new file mode 100755
index 0000000..72c8911
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/inventory/src/inventory.mxml
@@ -0,0 +1,116 @@
+<?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="absolute">
+	
+	<mx:Script>
+		<![CDATA[
+			
+			private function addItem():void
+			{
+				openTab(new Product())
+			}
+			
+			public function openTab(product:Product):void
+			{
+				if (product.productId > 0)
+				{
+					// Check if product is already opened in an existing tab
+					var children:Array = tn.getChildren();
+					var length:int = children.length;
+					for (var i:int = 0; i<length; i++)
+					{
+						if (children[i].product.productId == product.productId)
+						{
+							tn.selectedIndex = i;
+							return;
+						}
+					}
+				}
+				var form:ProductForm = new ProductForm();
+				tn.addChild(form);
+				form.product = product;
+				tn.selectedChild = form;
+			}
+			
+			private function search():void
+			{
+				searchPopup.search(searchStr.text);
+			}
+	
+			// Handles keys pressed in the search TextInput field
+			protected function searchKeyDownHandler(event:KeyboardEvent):void
+			{
+				if (searchPopup.currentState == "hidden" && event.keyCode != Keyboard.DOWN)
+				{
+					return
+				}
+				
+				switch (event.keyCode) 
+				{
+					case Keyboard.DOWN:
+						if (searchPopup.currentState == "hidden") search();
+						searchPopup.selectNext();
+	    				break;
+					case Keyboard.UP:
+						searchPopup.selectPrevious();
+						searchStr.setSelection(searchStr.text.length, searchStr.text.length);
+	    				break;
+					case Keyboard.ENTER:
+						searchPopup.openSelectedItem();
+	    				break;
+					case Keyboard.ESCAPE:
+						searchPopup.currentState = "hidden";
+	    				break;
+				}
+			}
+
+		]]>
+	</mx:Script>
+	
+	<mx:Style source="styles.css"/>
+	
+	<mx:Canvas styleName="appContainer" width="100%" height="100%"/>
+		
+	<mx:Label text="Inventory Management" styleName="appTitle" left="22" top="10"/>
+		
+	<mx:Button icon="@Embed('assets/icon_plus.png')" click="addItem()" toolTip="Add Product" width="31" height="29" right="243" top="10"/>
+
+	<mx:Image source="@Embed('assets/top_separator.png')" right="223" top="-4"/>
+	
+	<mx:Image source="@Embed('assets/search.png')" right="69" top="16"/>
+	<mx:TextInput id="searchStr" borderStyle="none" backgroundAlpha="0" top="16" width="110" right="88" focusThickness="0" change="search()"
+		borderSkin="@Embed('assets/blank.png')"
+		keyDown="searchKeyDownHandler(event)"/>
+	<mx:Image source="@Embed('assets/icon_close.png')" visible="{searchPopup.currentState == ''}" right="78" top="21"
+		click="searchPopup.currentState = 'hidden'"/>
+		
+		
+	<mx:TabNavigator id="tn" right="10" top="60" bottom="10" left="10" />
+	<mx:Text width="480" verticalCenter="0" horizontalCenter="0" visible="{!tn.getChildren().length>0}" textAlign="center">
+		<mx:text>
+		Type a few characters in the Search box in the upper right corner to search for products. 
+		For example type "no". You can also click the + button to add a new product.
+		</mx:text>
+	</mx:Text>
+
+	<SearchPopup id="searchPopup" top="52" right="50" width="180" height="250" select="openTab(searchPopup.selectedItem as Product)"/>
+
+</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/inventory/src/styles.css
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/inventory/src/styles.css b/apps/samples/WEB-INF/flex-src/inventory/src/styles.css
new file mode 100755
index 0000000..b674cc4
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/inventory/src/styles.css
@@ -0,0 +1,74 @@
+/*
+ * 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";
+
+@font-face
+{
+    src: url("assets/fonts/MyriadWebPro.ttf");
+    font-family: main;
+    font-style: normal;
+    font-weight: normal;
+}
+
+@font-face
+{
+    src: url("assets/fonts/MyriadWebPro-Bold.ttf");
+    font-family: main;
+    font-style: normal;
+    font-weight: bold;
+}
+
+mx|Application {
+    font-family: main; 
+    font-size: 12;
+}
+
+.appContainer {
+	borderSkin: Embed(source="assets/app_skin.png",
+		scaleGridTop="55",
+		scaleGridLeft="5",
+		scaleGridRight="293",
+		scaleGridBottom="66");
+}
+
+mx|TabNavigator {
+	border-style:solid;	
+}
+
+mx|Button {
+	skin: Embed("assets/button_skin.png",
+			scaleGridLeft="8",
+			scaleGridRight="23",
+			scaleGridTop="8",
+			scaleGridBottom="21");
+	over-skin: Embed("assets/button_over_skin.png",
+			scaleGridLeft="8",
+			scaleGridRight="23",
+			scaleGridTop="8",
+			scaleGridBottom="21");
+	open-duration: 0;
+	close-duration: 0;
+	corner-radius: 2;
+}
+
+
+.appTitle
+{
+	color:#222222;	
+    font-family: main; 
+    font-size: 20pt;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/runtimeconfig-messaging/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/runtimeconfig-messaging/build.xml b/apps/samples/WEB-INF/flex-src/runtimeconfig-messaging/build.xml
new file mode 100755
index 0000000..0555bf5
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/runtimeconfig-messaging/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="Runtime Configuration - Messaging" />
+    <property name="application.file" value="main" />
+    <property name="application.bin.dir" value="${samples.war}/runtimeconfig-messaging" />
+    <property name="application.src.dir" value="${samples.war}/WEB-INF/flex-src/runtimeconfig-messaging/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/runtimeconfig-messaging/src/ChatPanel.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/runtimeconfig-messaging/src/ChatPanel.mxml b/apps/samples/WEB-INF/flex-src/runtimeconfig-messaging/src/ChatPanel.mxml
new file mode 100755
index 0000000..d0dbba5
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/runtimeconfig-messaging/src/ChatPanel.mxml
@@ -0,0 +1,87 @@
+<?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" width="100%" height="100%"
+	creationComplete="initComp()">
+
+	<mx:Script>
+		<![CDATA[
+			import mx.messaging.channels.StreamingAMFChannel;
+			import mx.messaging.ChannelSet;
+			import mx.messaging.channels.AMFChannel;
+			import mx.messaging.events.MessageEvent;
+			import mx.messaging.messages.AsyncMessage;
+			import mx.messaging.messages.IMessage;
+
+
+			private function initComp():void
+			{
+				var myStreamingAMF:AMFChannel = new StreamingAMFChannel("my-streaming-amf", "../messagebroker/streamingamf");
+				var myPollingAMF:AMFChannel = new AMFChannel("my-polling-amf", "../messagebroker/amfpolling");
+				myPollingAMF.pollingEnabled = true;
+				myPollingAMF.pollingInterval = 2000;
+				var channelSet:ChannelSet = new ChannelSet();
+				channelSet.addChannel(myStreamingAMF);
+				channelSet.addChannel(myPollingAMF);
+				consumer.channelSet = channelSet;				
+				producer.channelSet = channelSet;
+			}
+
+			public function set room(name:String):void
+			{
+				if (!name) return;
+				
+				if (consumer && consumer.subscribed) 
+				{
+					log.text += "Leaving room " + consumer.destination + "\n";	
+					consumer.unsubscribe();
+				}
+				consumer.destination = name;
+				producer.destination = name;
+				consumer.subscribe();
+				log.text += "Entering room " + name + "\n";	
+			}
+			
+			private function send():void
+			{
+				var message:IMessage = new AsyncMessage();
+				message.body = msg.text;
+				producer.send(message);
+				msg.text = "";
+			}
+							
+			private function messageHandler(event:MessageEvent):void
+			{
+				log.text += event.message.body + "\n";	
+			}
+			
+		]]>
+	</mx:Script>
+
+	<mx:Producer id="producer"/>
+	<mx:Consumer id="consumer" message="messageHandler(event)"/>
+
+	<mx:TextArea id="log" width="100%" height="100%"/>
+	
+	<mx:ControlBar>
+		<mx:TextInput id="msg" width="100%" enter="send()" enabled="{consumer.subscribed}"/>
+		<mx:Button label="Send" click="send()" enabled="{consumer.subscribed}"/>
+	</mx:ControlBar>
+	
+</mx:Panel>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/runtimeconfig-messaging/src/main.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/runtimeconfig-messaging/src/main.mxml b/apps/samples/WEB-INF/flex-src/runtimeconfig-messaging/src/main.mxml
new file mode 100755
index 0000000..f9d9421
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/runtimeconfig-messaging/src/main.mxml
@@ -0,0 +1,54 @@
+<?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.getRoomList()">
+
+	<mx:RemoteObject id="srv" destination="chat-room-service" 
+		fault="Alert.show(event.fault.rootCause.message, 'Error')"/>
+
+	<mx:Panel title="Room List" width="100%" height="100%" paddingTop="4" paddingLeft="4" paddingBottom="4" paddingRight="4">
+
+		<mx:Label text="Select a room and start chatting in the right panel:"/>
+		<mx:List id="list" dataProvider="{srv.getRoomList.lastResult}" width="100%" height="100%"/>
+
+		<mx:ControlBar>
+			<mx:VBox width="100%">
+				<mx:Button label="Refresh" click="srv.getRoomList()"/>
+				<mx:Spacer height="2"/>
+				<mx:HRule width="100%" height="1"/>
+				<mx:Label text="Create a room:"/>
+				<mx:HBox>
+					<mx:TextInput id="room"/>
+					<mx:Button label="Create" click="srv.createRoom(room.text)" enabled="{room.text.length>0}"/>
+				</mx:HBox>
+			</mx:VBox>
+		</mx:ControlBar>		
+		
+	</mx:Panel>
+	
+	<ChatPanel title="Chat" room="{list.selectedItem}"/>
+
+	<mx:Script>
+		<![CDATA[
+			import mx.controls.Alert;
+		]]>
+	</mx:Script>
+	
+</mx:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/runtimeconfig-remoting/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/runtimeconfig-remoting/build.xml b/apps/samples/WEB-INF/flex-src/runtimeconfig-remoting/build.xml
new file mode 100755
index 0000000..6a2edf8
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/runtimeconfig-remoting/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="Runtime Configuration - Remoting" />
+    <property name="application.file" value="main" />
+    <property name="application.bin.dir" value="${samples.war}/runtimeconfig-remoting" />
+    <property name="application.src.dir" value="${samples.war}/WEB-INF/flex-src/runtimeconfig-remoting/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/runtimeconfig-remoting/src/main.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/runtimeconfig-remoting/src/main.mxml b/apps/samples/WEB-INF/flex-src/runtimeconfig-remoting/src/main.mxml
new file mode 100755
index 0000000..f225124
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/runtimeconfig-remoting/src/main.mxml
@@ -0,0 +1,64 @@
+<?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"
+	creationComplete="initApp()">
+
+	<!-- 
+		Simple client to demonstrate runtime configuration of destinations.
+		The "runtime-employee" destination is configured in 
+		EmployeeRuntimeRemotingDestination.java. 
+	-->
+
+	<mx:Script>
+		<![CDATA[
+			import mx.rpc.remoting.mxml.RemoteObject;
+			import mx.messaging.ChannelSet;
+			import mx.messaging.channels.AMFChannel;
+			
+			[Bindable]
+			private var srv:RemoteObject;
+			
+			private function initApp():void
+			{
+				var channel:AMFChannel = new AMFChannel("my-amf", "../messagebroker/amf");
+				var channelSet:ChannelSet = new ChannelSet();
+				channelSet.addChannel(channel);
+				srv = new RemoteObject();
+				srv.destination="runtime-employee-ro";	
+				srv.channelSet = channelSet;
+				srv.getEmployees();
+			}
+			
+		]]>
+	</mx:Script>
+
+	<mx:Panel title="Employee List" width="100%" height="100%">
+		<mx:DataGrid width="100%" height="100%" dataProvider="{srv.getEmployees.lastResult}">
+			<mx:columns>
+				<mx:DataGridColumn headerText="First Name" dataField="firstName"/>
+				<mx:DataGridColumn headerText="Last Name" dataField="lastName"/>
+				<mx:DataGridColumn headerText="Title" dataField="title"/>
+				<mx:DataGridColumn headerText="Phone" dataField="phone"/>
+				<mx:DataGridColumn headerText="Email" dataField="email"/>
+			</mx:columns>
+		</mx:DataGrid>
+	</mx:Panel>
+	
+</mx:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/testdrive-101/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-101/build.xml b/apps/samples/WEB-INF/flex-src/testdrive-101/build.xml
new file mode 100755
index 0000000..d711d68
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-101/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="Flex Programming Model 101" />
+    <property name="application.file" value="main" />
+    <property name="application.bin.dir" value="${samples.war}/testdrive-101" />
+    <property name="application.src.dir" value="${samples.war}/WEB-INF/flex-src/testdrive-101/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-101/src/ProductView.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-101/src/ProductView.mxml b/apps/samples/WEB-INF/flex-src/testdrive-101/src/ProductView.mxml
new file mode 100755
index 0000000..6d25118
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-101/src/ProductView.mxml
@@ -0,0 +1,35 @@
+<?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" layout="horizontal" width="100%" height="100%"
+	title="Product Details" paddingLeft="12" paddingRight="12" paddingTop="12" paddingBottom="12">
+	
+	<mx:Object id="product"/>
+	
+	<mx:CurrencyFormatter id="cf"/>
+	
+	<mx:Image source="../images/{product.image}"/>
+
+	<mx:VBox width="100%" height="100%">
+		<mx:Label text="{product.name}" fontWeight="bold"/>
+		<mx:Label text="Price: {cf.format(product.price)}" styleName="price"/>
+		<mx:Text text="{product.description}" width="100%" height="100%"/>
+	</mx:VBox>
+			
+</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-101/src/Thumb.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-101/src/Thumb.mxml b/apps/samples/WEB-INF/flex-src/testdrive-101/src/Thumb.mxml
new file mode 100755
index 0000000..71cbb7d
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-101/src/Thumb.mxml
@@ -0,0 +1,29 @@
+<?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:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="120" height="120" 
+	horizontalAlign="center" verticalGap="0" verticalScrollPolicy="off" horizontalScrollPolicy="off">
+	
+	<mx:CurrencyFormatter id="cf"/>
+	
+	<mx:Label text="{data.name}" fontWeight="bold"/>
+	<mx:Image source="../images/{data.image}" width="40" height="80"/>
+	<mx:Label text="{cf.format(data.price)}" styleName="price"/>
+
+</mx:VBox>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/testdrive-101/src/main.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-101/src/main.mxml b/apps/samples/WEB-INF/flex-src/testdrive-101/src/main.mxml
new file mode 100755
index 0000000..e0d18c1
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-101/src/main.mxml
@@ -0,0 +1,52 @@
+<?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:Style source="testdrive.css"/>
+
+	<mx:Script>
+		<![CDATA[
+		
+			import mx.collections.ArrayCollection;
+			import mx.rpc.events.ResultEvent;
+		
+			[Bindable]
+			private var products:ArrayCollection;
+			
+			private function resultHandler(event:ResultEvent):void
+			{
+				products = event.result as ArrayCollection;	
+			}			
+			
+		]]>
+	</mx:Script>
+
+	<mx:RemoteObject id="srv" destination="product">
+		<mx:method name="getProducts" result="resultHandler(event)"/>
+	</mx:RemoteObject>
+	
+	<mx:Panel title="Catalog" width="100%" height="100%">
+		<mx:TileList id="list" dataProvider="{products}" itemRenderer="Thumb" width="100%" height="100%"/> 
+	</mx:Panel>
+	
+	<ProductView 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-101/src/testdrive.css
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-101/src/testdrive.css b/apps/samples/WEB-INF/flex-src/testdrive-101/src/testdrive.css
new file mode 100755
index 0000000..1c65407
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-101/src/testdrive.css
@@ -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.
+ */
+@namespace mx "library://ns.adobe.com/flex/mx";
+
+mx|Application {
+	background-color: #E57000;
+	themeColor: #E57000;
+}
+
+mx|TileList {
+	selection-color: #FFCC33;
+	roll-over-color: #FFCC99;
+}
+
+mx|Panel {
+	roundedBottomCorners: true;
+}
+
+.price {
+	color: #E57000;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/testdrive-chat/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-chat/build.xml b/apps/samples/WEB-INF/flex-src/testdrive-chat/build.xml
new file mode 100755
index 0000000..1e74b02
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-chat/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="Chat" />
+    <property name="application.file" value="main" />
+    <property name="application.bin.dir" value="${samples.war}/testdrive-chat" />
+    <property name="application.src.dir" value="${samples.war}/WEB-INF/flex-src/testdrive-chat/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-chat/src/main.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-chat/src/main.mxml b/apps/samples/WEB-INF/flex-src/testdrive-chat/src/main.mxml
new file mode 100755
index 0000000..a949346
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-chat/src/main.mxml
@@ -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.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
+	creationComplete="consumer.subscribe()">
+	
+	<mx:Script>
+		<![CDATA[
+		
+			import mx.messaging.messages.AsyncMessage;
+			import mx.messaging.messages.IMessage;
+			
+			private function send():void
+			{
+				var message:IMessage = new AsyncMessage();
+				message.body.chatMessage = msg.text;
+				producer.send(message);
+				msg.text = "";
+			}
+							
+			private function messageHandler(message:IMessage):void
+			{
+				log.text += message.body.chatMessage + "\n";	
+			}
+			
+		]]>
+	</mx:Script>
+	
+	<mx:Producer id="producer" destination="chat"/>
+	<mx:Consumer id="consumer" destination="chat" message="messageHandler(event.message)"/>
+	
+	<mx:Panel title="Chat" width="100%" height="100%">
+		<mx:TextArea id="log" width="100%" height="100%"/>
+		<mx:ControlBar>
+			 <mx:TextInput id="msg" width="100%" enter="send()"/>
+			 <mx:Button label="Send" click="send()"/> 
+		</mx:ControlBar>
+	</mx:Panel>
+	
+</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-datapush/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-datapush/build.xml b/apps/samples/WEB-INF/flex-src/testdrive-datapush/build.xml
new file mode 100755
index 0000000..3b30fb5
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-datapush/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="Data Push" />
+    <property name="application.file" value="main" />
+    <property name="application.bin.dir" value="${samples.war}/testdrive-datapush" />
+    <property name="application.src.dir" value="${samples.war}/WEB-INF/flex-src/testdrive-datapush/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-datapush/src/main.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-datapush/src/main.mxml b/apps/samples/WEB-INF/flex-src/testdrive-datapush/src/main.mxml
new file mode 100755
index 0000000..ed803d5
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-datapush/src/main.mxml
@@ -0,0 +1,42 @@
+<?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:Script>
+		<![CDATA[
+		
+			import mx.messaging.messages.IMessage;
+			
+			private function messageHandler(message:IMessage):void
+			{
+				pushedValue.text = ""+ message.body;	
+			}
+			
+		]]>
+	</mx:Script>
+	
+	<mx:Consumer id="consumer" destination="feed" message="messageHandler(event.message)"/>
+
+	<mx:Button label="Subscribe to 'feed' destination" click="consumer.subscribe()" enabled="{!consumer.subscribed}"/>
+	<mx:Button label="Unsubscribe from 'feed' destination" click="consumer.unsubscribe()" enabled="{consumer.subscribed}"/>
+
+	<mx:TextInput id="pushedValue"/>
+		
+</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-datapush/src/startfeed.jsp
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-datapush/src/startfeed.jsp b/apps/samples/WEB-INF/flex-src/testdrive-datapush/src/startfeed.jsp
new file mode 100755
index 0000000..49640ae
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-datapush/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.feed.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/testdrive-datapush/src/stopfeed.jsp
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/testdrive-datapush/src/stopfeed.jsp b/apps/samples/WEB-INF/flex-src/testdrive-datapush/src/stopfeed.jsp
new file mode 100755
index 0000000..a035b17
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/testdrive-datapush/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.feed.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


[18/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/ClientConfigurationParser.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/ClientConfigurationParser.java b/modules/common/src/flex/messaging/config/ClientConfigurationParser.java
new file mode 100755
index 0000000..75950ca
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/ClientConfigurationParser.java
@@ -0,0 +1,952 @@
+/*
+ * 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.messaging.config;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * A special mxmlc compiler specific implentation of the configuration
+ * parser for JDK 1.4. Only a small subset of the configuration is
+ * processed to generate the information that the client needs at runtime,
+ * such as channel definitions and service destination properties.
+ *
+ * @author Peter Farland
+ * @exclude
+ */
+public abstract class ClientConfigurationParser extends AbstractConfigurationParser
+{
+    protected void parseTopLevelConfig(Document doc)
+    {
+        Node root = selectSingleNode(doc, "/" + SERVICES_CONFIG_ELEMENT);
+
+        if (root != null)
+        {
+            // Validation
+            allowedChildElements(root, SERVICES_CONFIG_CHILDREN);
+
+            // Channels (parse before services)
+            channelsSection(root);
+
+            // Services
+            services(root);
+
+            // Clustering
+            clusters(root);
+
+            // FlexClient
+            flexClient(root);
+        }
+    }
+
+    private void channelsSection(Node root)
+    {
+        Node channelsNode = selectSingleNode(root, CHANNELS_ELEMENT);
+        if (channelsNode != null)
+        {
+            // Validation
+            allowedAttributesOrElements(channelsNode, CHANNELS_CHILDREN);
+
+            NodeList channels = selectNodeList(channelsNode, CHANNEL_DEFINITION_ELEMENT);
+            for (int i = 0; i < channels.getLength(); i++)
+            {
+                Node channel = channels.item(i);
+                channelDefinition(channel);
+            }
+            NodeList includes = selectNodeList(channelsNode, CHANNEL_INCLUDE_ELEMENT);
+            for (int i = 0; i < includes.getLength(); i++)
+            {
+                Node include = includes.item(i);
+                channelInclude(include);
+            }
+        }
+    }
+
+    private void channelDefinition(Node channel)
+    {
+        // Validation
+        requiredAttributesOrElements(channel, CHANNEL_DEFINITION_REQ_CHILDREN);
+        allowedAttributesOrElements(channel, CHANNEL_DEFINITION_CHILDREN);
+
+        String id = getAttributeOrChildElement(channel, ID_ATTR).trim();
+        if (isValidID(id))
+        {
+            // Don't allow multiple channels with the same id
+            if (config.getChannelSettings(id) != null)
+            {
+                // Cannot have multiple channels with the same id ''{0}''.
+                ConfigurationException e = new ConfigurationException();
+                e.setMessage(DUPLICATE_CHANNEL_ERROR, new Object[]{id});
+                throw e;
+            }
+
+            ChannelSettings channelSettings = new ChannelSettings(id);
+
+            // Endpoint
+            Node endpoint = selectSingleNode(channel, ENDPOINT_ELEMENT);
+            if (endpoint != null)
+            {
+                // Endpoint Validation
+                allowedAttributesOrElements(endpoint, ENDPOINT_CHILDREN);
+
+                // The url attribute may also be specified by the deprecated uri attribute
+                String uri = getAttributeOrChildElement(endpoint, URL_ATTR);
+                if (uri == null || EMPTY_STRING.equals(uri))
+                    uri = getAttributeOrChildElement(endpoint, URI_ATTR);
+                channelSettings.setUri(uri);
+
+                config.addChannelSettings(id, channelSettings);
+            }
+
+            channelServerOnlyAttribute(channel, channelSettings);
+
+            // Add the channel properties that the client needs namely polling-enabled,
+            // polling-interval-millis, piggybacking-enabled, login-after-disconnect,
+            // record-message-sizes, record-message-times, connect-timeout-seconds,
+            // polling-interval-seconds (deprecated), and client-load-balancing.
+            addProperty(channel, channelSettings, POLLING_ENABLED_ELEMENT);
+            addProperty(channel, channelSettings, POLLING_INTERVAL_MILLIS_ELEMENT);
+            addProperty(channel, channelSettings, PIGGYBACKING_ENABLED_ELEMENT);
+            addProperty(channel, channelSettings, LOGIN_AFTER_DISCONNECT_ELEMENT);
+            addProperty(channel, channelSettings, RECORD_MESSAGE_SIZES_ELEMENT);
+            addProperty(channel, channelSettings, RECORD_MESSAGE_TIMES_ELEMENT);
+            addProperty(channel, channelSettings, CONNECT_TIMEOUT_SECONDS_ELEMENT);
+            addProperty(channel, channelSettings, POLLING_INTERVAL_SECONDS_ELEMENT); // deprecated.
+            addProperty(channel, channelSettings, CLIENT_LOAD_BALANCING_ELEMENT);
+            addProperty(channel, channelSettings, REQUEST_TIMEOUT_SECONDS_ELEMENT);
+
+            // enable-small-messages.
+            NodeList properties = selectNodeList(channel, PROPERTIES_ELEMENT + "/" + SERIALIZATION_ELEMENT);
+            if (properties.getLength() > 0)
+            {
+                ConfigMap map = properties(properties, getSourceFileOf(channel));
+                ConfigMap serialization = map.getPropertyAsMap(SERIALIZATION_ELEMENT, null);
+                if (serialization != null)
+                {
+                    // enable-small-messages.
+                    String enableSmallMessages = serialization.getProperty(ENABLE_SMALL_MESSAGES_ELEMENT);
+                    if (enableSmallMessages != null)
+                    {
+                        ConfigMap clientMap = new ConfigMap();
+                        clientMap.addProperty(ENABLE_SMALL_MESSAGES_ELEMENT, enableSmallMessages);
+                        channelSettings.addProperty(SERIALIZATION_ELEMENT, clientMap);
+                    }
+                }
+            }
+        }
+        else
+        {
+            // Invalid {CHANNEL_DEFINITION_ELEMENT} id '{id}'.
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(INVALID_ID, new Object[]{CHANNEL_DEFINITION_ELEMENT, id});
+            String details = "An id must be non-empty and not contain any list delimiter characters, i.e. commas, semi-colons or colons.";
+            ex.setDetails(details);
+            throw ex;
+        }
+    }
+
+    private void channelServerOnlyAttribute(Node channel, ChannelSettings channelSettings)
+    {
+        String clientType = getAttributeOrChildElement(channel, CLASS_ATTR);
+        clientType = clientType.length() > 0? clientType : null;
+
+        String serverOnlyString = getAttributeOrChildElement(channel, SERVER_ONLY_ATTR);
+        boolean serverOnly = serverOnlyString.length() > 0 && Boolean.valueOf(serverOnlyString).booleanValue();
+
+        if (clientType == null && !serverOnly) // None set.
+        {
+            String url = channelSettings.getUri();
+            boolean serverOnlyProtocol = (url.startsWith("samfsocket") || url.startsWith("amfsocket") || url.startsWith("ws"));
+            if (!serverOnlyProtocol)
+            {
+                // Endpoint ''{0}'' needs to have either class or server-only attribute defined.
+                ConfigurationException ce = new ConfigurationException();
+                ce.setMessage(CLASS_OR_SERVER_ONLY_ERROR, new Object[]{channelSettings.getId()});
+                throw ce;
+            }
+            channelSettings.setServerOnly(true);
+        }
+        else if (clientType != null && serverOnly) // Both set.
+        {
+            // Endpoint ''{0}'' cannot have both class and server-only attribute defined.
+            ConfigurationException ce = new ConfigurationException();
+            ce.setMessage(CLASS_AND_SERVER_ONLY_ERROR, new Object[]{channelSettings.getId()});
+            throw ce;
+        }
+        else // One of them set.
+        {
+            if (serverOnly)
+                channelSettings.setServerOnly(true);
+            else
+                channelSettings.setClientType(clientType);
+        }
+    }
+
+    private void addProperty(Node channel, ChannelSettings channelSettings, String property)
+    {
+        NodeList properties = selectNodeList(channel, PROPERTIES_ELEMENT + "/" + property);
+        if (properties.getLength() > 0)
+        {
+            ConfigMap map = properties(properties, getSourceFileOf(channel));
+            if (CLIENT_LOAD_BALANCING_ELEMENT.equals(property))
+            {
+                ConfigMap clientLoadBalancingMap = map.getPropertyAsMap(CLIENT_LOAD_BALANCING_ELEMENT, null);
+                if (clientLoadBalancingMap == null)
+                {
+                    // Invalid {0} configuration for endpoint ''{1}''; no urls defined.
+                    ConfigurationException ce = new ConfigurationException();
+                    ce.setMessage(ERR_MSG_EMPTY_CLIENT_LOAD_BALANCING_ELEMENT, new Object[]{CLIENT_LOAD_BALANCING_ELEMENT, channelSettings.getId()});
+                    throw ce;
+                }
+                List urls = clientLoadBalancingMap.getPropertyAsList(URL_ATTR, null);
+                addClientLoadBalancingUrls(urls, channelSettings.getId());
+            }
+            channelSettings.addProperties(map);
+        }
+    }
+
+    // Add client load balancing urls after necessary validation checks.
+    private void addClientLoadBalancingUrls(List urls, String endpointId)
+    {
+        if (urls == null || urls.isEmpty())
+        {
+            // Invalid {0} configuration for endpoint ''{1}''; no urls defined.
+            ConfigurationException ce = new ConfigurationException();
+            ce.setMessage(ERR_MSG_EMPTY_CLIENT_LOAD_BALANCING_ELEMENT, new Object[]{CLIENT_LOAD_BALANCING_ELEMENT, endpointId});
+            throw ce;
+        }
+
+        Set clientLoadBalancingUrls = new HashSet();
+        for (Iterator iterator = urls.iterator(); iterator.hasNext();)
+        {
+            String url = (String) iterator.next();
+            if (url == null || url.length() == 0)
+            {
+                // Invalid {0} configuration for endpoint ''{1}''; cannot add empty url.
+                ConfigurationException  ce = new ConfigurationException();
+                ce.setMessage(ERR_MSG_EMTPY_CLIENT_LOAD_BALACNING_URL, new Object[]{CLIENT_LOAD_BALANCING_ELEMENT, endpointId});
+                throw ce;
+            }
+
+            if (TokenReplacer.containsTokens(url))
+            {
+                // Invalid {0} configuration for endpoint ''{1}''; cannot add url with tokens.
+                ConfigurationException  ce = new ConfigurationException();
+                ce.setMessage(ERR_MSG_CLIENT_LOAD_BALANCING_URL_WITH_TOKEN, new Object[]{CLIENT_LOAD_BALANCING_ELEMENT, endpointId});
+                throw ce;
+            }
+
+            if (clientLoadBalancingUrls.contains(url))
+                iterator.remove();
+            else
+                clientLoadBalancingUrls.add(url);
+        }
+
+    }
+
+    private void channelInclude(Node channelInclude)
+    {
+        // Validation
+        allowedAttributesOrElements(channelInclude, CHANNEL_INCLUDE_CHILDREN);
+
+        String src = getAttributeOrChildElement(channelInclude, SRC_ATTR);
+        String dir = getAttributeOrChildElement(channelInclude, DIRECTORY_ATTR);
+        if (src.length() > 0)
+        {
+            channelIncludeFile(src);
+        }
+        else if (dir.length() > 0)
+        {
+            channelIncludeDirectory(dir);
+        }
+        else
+        {
+            // The include element ''{0}'' must specify either the ''{1}'' or ''{2}'' attribute.
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(MISSING_INCLUDE_ATTRIBUTES, new Object[]{channelInclude.getNodeName(), SRC_ATTR, DIRECTORY_ATTR});
+            throw ex;
+        }
+    }
+
+    private void channelIncludeFile(String src)
+    {
+        Document doc = loadDocument(src, fileResolver.getIncludedFile(src));
+        if (fileResolver instanceof LocalFileResolver)
+        {
+            LocalFileResolver local = (LocalFileResolver)fileResolver;
+            ((ClientConfiguration)config).addConfigPath(local.getIncludedPath(src), local.getIncludedLastModified(src));
+        }
+
+        doc.getDocumentElement().normalize();
+
+        // Check for multiple channels in a single file.
+        Node channelsNode = selectSingleNode(doc, CHANNELS_ELEMENT);
+        if (channelsNode != null)
+        {
+            allowedChildElements(channelsNode, CHANNELS_CHILDREN);
+            NodeList channels = selectNodeList(channelsNode, CHANNEL_DEFINITION_ELEMENT);
+            for (int a = 0; a < channels.getLength(); a++)
+            {
+                Node service = channels.item(a);
+                channelDefinition(service);
+            }
+            fileResolver.popIncludedFile();
+        }
+        else // Check for single channel in the file.
+        {
+            Node channel = selectSingleNode(doc, "/" + CHANNEL_DEFINITION_ELEMENT);
+            if (channel != null)
+            {
+                channelDefinition(channel);
+                fileResolver.popIncludedFile();
+            }
+            else
+            {
+                // The {0} root element in file {1} must be '{CHANNELS_ELEMENT}' or '{CHANNEL_ELEMENT}'.
+                ConfigurationException ex = new ConfigurationException();
+                ex.setMessage(INVALID_INCLUDE_ROOT, new Object[]{CHANNEL_INCLUDE_ELEMENT, src, CHANNELS_ELEMENT, CHANNEL_DEFINITION_ELEMENT});
+                throw ex;
+            }
+        }
+    }
+
+    private void channelIncludeDirectory(String dir)
+    {
+        List files = fileResolver.getFiles(dir);
+        for (int i = 0; i < files.size(); i++)
+        {
+            String src = (String) files.get(i);
+            channelIncludeFile(src);
+        }
+    }
+
+    private void services(Node root)
+    {
+        Node servicesNode = selectSingleNode(root, SERVICES_ELEMENT);
+        if (servicesNode != null)
+        {
+            // Validation
+            allowedChildElements(servicesNode, SERVICES_CHILDREN);
+
+            // Default Channels for the application
+            Node defaultChannels = selectSingleNode(servicesNode, DEFAULT_CHANNELS_ELEMENT);
+            if (defaultChannels != null)
+            {
+                allowedChildElements(defaultChannels, DEFAULT_CHANNELS_CHILDREN);
+                NodeList channels = selectNodeList(defaultChannels, CHANNEL_ELEMENT);
+                for (int c = 0; c < channels.getLength(); c++)
+                {
+                    Node chan = channels.item(c);
+                    allowedAttributes(chan, new String[] {REF_ATTR});
+                    defaultChannel(chan);
+                }
+            }
+
+            // Service Includes
+            NodeList services = selectNodeList(servicesNode, SERVICE_INCLUDE_ELEMENT);
+            for (int i = 0; i < services.getLength(); i++)
+            {
+                Node service = services.item(i);
+                serviceInclude(service);
+            }
+
+            // Service
+            services = selectNodeList(servicesNode, SERVICE_ELEMENT);
+            for (int i = 0; i < services.getLength(); i++)
+            {
+                Node service = services.item(i);
+                service(service);
+            }
+        }
+    }
+
+    private void clusters(Node root)
+    {
+        Node clusteringNode = selectSingleNode(root, CLUSTERS_ELEMENT);
+        if (clusteringNode != null)
+        {
+            allowedAttributesOrElements(clusteringNode, CLUSTERING_CHILDREN);
+
+            NodeList clusters = selectNodeList(clusteringNode, CLUSTER_DEFINITION_ELEMENT);
+            for (int i = 0; i < clusters.getLength(); i++)
+            {
+                Node cluster = clusters.item(i);
+                requiredAttributesOrElements(cluster, CLUSTER_DEFINITION_CHILDREN);
+                String clusterName = getAttributeOrChildElement(cluster, ID_ATTR);
+                if (isValidID(clusterName))
+                {
+                    String propsFileName = getAttributeOrChildElement(cluster, CLUSTER_PROPERTIES_ATTR);
+                    ClusterSettings clusterSettings = new ClusterSettings();
+                    clusterSettings.setClusterName(clusterName);
+                    clusterSettings.setPropsFileName(propsFileName);
+                    String defaultValue = getAttributeOrChildElement(cluster, ClusterSettings.DEFAULT_ELEMENT);
+                    if (defaultValue != null && defaultValue.length() > 0)
+                    {
+                        if (defaultValue.equalsIgnoreCase("true"))
+                            clusterSettings.setDefault(true);
+                        else if (!defaultValue.equalsIgnoreCase("false"))
+                        {
+                            ConfigurationException e = new ConfigurationException();
+                            e.setMessage(10215, new Object[] {clusterName, defaultValue});
+                            throw e;
+                        }
+                    }
+                    String ulb = getAttributeOrChildElement(cluster, ClusterSettings.URL_LOAD_BALANCING);
+                    if (ulb != null && ulb.length() > 0)
+                    {
+                        if (ulb.equalsIgnoreCase("false"))
+                            clusterSettings.setURLLoadBalancing(false);
+                        else if (!ulb.equalsIgnoreCase("true"))
+                        {
+                            ConfigurationException e = new ConfigurationException();
+                            e.setMessage(10216, new Object[] {clusterName, ulb});
+                            throw e;
+                        }
+                    }
+                    ((ClientConfiguration)config).addClusterSettings(clusterSettings);
+                }
+            }
+        }
+    }
+
+    private void serviceInclude(Node serviceInclude)
+    {
+        // Validation
+        allowedAttributesOrElements(serviceInclude, SERVICE_INCLUDE_CHILDREN);
+
+        String src = getAttributeOrChildElement(serviceInclude, SRC_ATTR);
+        String dir = getAttributeOrChildElement(serviceInclude, DIRECTORY_ATTR);
+        if (src.length() > 0)
+        {
+            serviceIncludeFile(src);
+        }
+        else if (dir.length() > 0)
+        {
+            serviceIncludeDirectory(dir);
+        }
+        else
+        {
+            // The include element ''{0}'' must specify either the ''{1}'' or ''{2}'' attribute.
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(MISSING_INCLUDE_ATTRIBUTES, new Object[]{serviceInclude.getNodeName(), SRC_ATTR, DIRECTORY_ATTR});
+            throw ex;
+        }
+    }
+
+    private void serviceIncludeFile(String src)
+    {
+        Document doc = loadDocument(src, fileResolver.getIncludedFile(src));
+        if (fileResolver instanceof LocalFileResolver)
+        {
+            LocalFileResolver local = (LocalFileResolver)fileResolver;
+            ((ClientConfiguration)config).addConfigPath(local.getIncludedPath(src), local.getIncludedLastModified(src));
+        }
+
+        doc.getDocumentElement().normalize();
+
+        // Check for multiple services defined in file.
+        Node servicesNode = selectSingleNode(doc, SERVICES_ELEMENT);
+        if (servicesNode != null)
+        {
+            allowedChildElements(servicesNode, SERVICES_CHILDREN);
+            NodeList services = selectNodeList(servicesNode, SERVICES_ELEMENT);
+            for (int a = 0; a < services.getLength(); a++)
+            {
+                Node service = services.item(a);
+                service(service);
+            }
+            fileResolver.popIncludedFile();
+        }
+        else // Check for single service in file.
+        {
+            Node service = selectSingleNode(doc, "/" + SERVICE_ELEMENT);
+            if (service != null)
+            {
+                service(service);
+                fileResolver.popIncludedFile();
+            }
+            else
+            {
+                // The {0} root element in file {1} must be ''{2}'' or ''{3}''.
+                ConfigurationException ex = new ConfigurationException();
+                ex.setMessage(INVALID_INCLUDE_ROOT, new Object[]{SERVICE_INCLUDE_ELEMENT, src, SERVICES_ELEMENT, SERVICE_ELEMENT});
+                throw ex;
+            }
+        }
+    }
+
+    private void serviceIncludeDirectory(String dir)
+    {
+        List files = fileResolver.getFiles(dir);
+        for (int i = 0; i < files.size(); i++)
+        {
+            String src = (String) files.get(i);
+            serviceIncludeFile(src);
+        }
+    }
+
+    private void service(Node service)
+    {
+        // Validation
+        requiredAttributesOrElements(service, SERVICE_REQ_CHILDREN);
+        allowedAttributesOrElements(service, SERVICE_CHILDREN);
+
+        String id = getAttributeOrChildElement(service, ID_ATTR);
+        if (isValidID(id))
+        {
+            ServiceSettings serviceSettings = config.getServiceSettings(id);
+            if (serviceSettings == null)
+            {
+                serviceSettings = new ServiceSettings(id);
+                // Service Properties
+                NodeList properties = selectNodeList(service, PROPERTIES_ELEMENT + "/*");
+                if (properties.getLength() > 0)
+                {
+                    ConfigMap map = properties(properties, getSourceFileOf(service));
+                    serviceSettings.addProperties(map);
+                }
+                config.addServiceSettings(serviceSettings);
+            }
+            else
+            {
+                // Duplicate service definition '{0}'.
+                ConfigurationException e = new ConfigurationException();
+                e.setMessage(DUPLICATE_SERVICE_ERROR, new Object[]{id});
+                throw e;
+            }
+
+            // Service Class Name
+            String className = getAttributeOrChildElement(service, CLASS_ATTR);
+            if (className.length() > 0)
+            {
+                serviceSettings.setClassName(className);
+            }
+            else
+            {
+                // Class not specified for {SERVICE_ELEMENT} '{id}'.
+                ConfigurationException ex = new ConfigurationException();
+                ex.setMessage(CLASS_NOT_SPECIFIED, new Object[]{SERVICE_ELEMENT, id});
+                throw ex;
+            }
+
+            //Service Message Types - deprecated
+
+            // Default Channels
+            Node defaultChannels = selectSingleNode(service, DEFAULT_CHANNELS_ELEMENT);
+            if (defaultChannels != null)
+            {
+                allowedChildElements(defaultChannels, DEFAULT_CHANNELS_CHILDREN);
+                NodeList channels = selectNodeList(defaultChannels, CHANNEL_ELEMENT);
+                for (int c = 0; c < channels.getLength(); c++)
+                {
+                    Node chan = channels.item(c);
+                    allowedAttributes(chan, new String[] {REF_ATTR});
+                    defaultChannel(chan, serviceSettings);
+                }
+            }
+            // Fall back on application's default channels
+            else if (config.getDefaultChannels().size() > 0)
+            {
+                for (Iterator iter = config.getDefaultChannels().iterator(); iter.hasNext();)
+                {
+                    String channelId = (String)iter.next();
+                    ChannelSettings channel = config.getChannelSettings(channelId);
+                    serviceSettings.addDefaultChannel(channel);
+                }
+            }
+
+            // Destinations
+            NodeList list = selectNodeList(service, DESTINATION_ELEMENT);
+            for (int i = 0; i < list.getLength(); i++)
+            {
+                Node dest = list.item(i);
+                destination(dest, serviceSettings);
+            }
+
+            // Destination Includes
+            list = selectNodeList(service, DESTINATION_INCLUDE_ELEMENT);
+            for (int i = 0; i < list.getLength(); i++)
+            {
+                Node dest = list.item(i);
+                destinationInclude(dest, serviceSettings);
+            }
+        }
+        else
+        {
+            //Invalid {SERVICE_ELEMENT} id '{id}'.
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(INVALID_ID, new Object[]{SERVICE_ELEMENT, id});
+            throw ex;
+        }
+    }
+
+    /**
+     * Flex application can declare default channels for its services. If a
+     * service specifies its own list of channels it overrides these defaults.
+     * <p>
+     * &lt;default-channels&gt;<br />
+     * ;&lt;channel ref="channel-id" /&gt;<br />
+     * &lt;default-channels&gt;
+     * </p>
+     * @param chan the channel node
+     */
+    private void defaultChannel(Node chan)
+    {
+        String ref = getAttributeOrChildElement(chan, REF_ATTR);
+
+        if (ref.length() > 0)
+        {
+            ChannelSettings channel = config.getChannelSettings(ref);
+            if (channel != null)
+            {
+                config.addDefaultChannel(channel.getId());
+            }
+            else
+            {
+                // {0} not found for reference '{1}'
+                ConfigurationException e = new ConfigurationException();
+                e.setMessage(REF_NOT_FOUND, new Object[]{CHANNEL_ELEMENT, ref});
+                throw e;
+            }
+        }
+        else
+        {
+            //A default channel was specified without a reference for service '{0}'.
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(INVALID_DEFAULT_CHANNEL, new Object[]{"MessageBroker"});
+            throw ex;
+        }
+    }
+
+    /**
+     * A service can declare default channels for its destinations. If a destination
+     * specifies its own list of channels it overrides these defaults.
+     * <p>
+     * &lt;default-channels&gt;<br />
+     * &lt;channel ref="channel-id" /&gt;<br />
+     * &lt;default-channels&gt;
+     * </p>
+     * @param chan the channel node
+     * @param serviceSettings service settings
+     */
+    private void defaultChannel(Node chan, ServiceSettings serviceSettings)
+    {
+        String ref = getAttributeOrChildElement(chan, REF_ATTR).trim();
+
+        if (ref.length() > 0)
+        {
+            ChannelSettings channel = config.getChannelSettings(ref);
+            if (channel != null)
+            {
+                serviceSettings.addDefaultChannel(channel);
+            }
+            else
+            {
+                // {0} not found for reference '{1}'
+                ConfigurationException e = new ConfigurationException();
+                e.setMessage(REF_NOT_FOUND, new Object[]{CHANNEL_ELEMENT, ref});
+                throw e;
+            }
+        }
+        else
+        {
+            //A default channel was specified without a reference for service '{0}'.
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(INVALID_DEFAULT_CHANNEL, new Object[]{serviceSettings.getId()});
+            throw ex;
+        }
+    }
+
+    private void destinationInclude(Node destInclude, ServiceSettings serviceSettings)
+    {
+        // Validation
+        allowedAttributesOrElements(destInclude, DESTINATION_INCLUDE_CHILDREN);
+
+        String src = getAttributeOrChildElement(destInclude, SRC_ATTR);
+        String dir = getAttributeOrChildElement(destInclude, DIRECTORY_ATTR);
+        if (src.length() > 0)
+        {
+            destinationIncludeFile(serviceSettings, src);
+        }
+        else if (dir.length() > 0)
+        {
+            destinationIncludeDirectory(serviceSettings, dir);
+        }
+        else
+        {
+            // The include element ''{0}'' must specify either the ''{1}'' or ''{2}'' attribute.
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(MISSING_INCLUDE_ATTRIBUTES, new Object[]{destInclude.getNodeName(), SRC_ATTR, DIRECTORY_ATTR});
+            throw ex;
+        }
+    }
+
+    private void destinationIncludeDirectory(ServiceSettings serviceSettings, String dir)
+    {
+        List files = fileResolver.getFiles(dir);
+        for (int i = 0; i < files.size(); i++)
+        {
+            String src = (String) files.get(i);
+            destinationIncludeFile(serviceSettings, src);
+        }
+    }
+
+    private void destinationIncludeFile(ServiceSettings serviceSettings, String src)
+    {
+        Document doc = loadDocument(src, fileResolver.getIncludedFile(src));
+        if (fileResolver instanceof LocalFileResolver)
+        {
+            LocalFileResolver local = (LocalFileResolver)fileResolver;
+            ((ClientConfiguration)config).addConfigPath(local.getIncludedPath(src), local.getIncludedLastModified(src));
+        }
+
+        doc.getDocumentElement().normalize();
+
+        // Check for multiple destination defined in file.
+        Node destinationsNode = selectSingleNode(doc, DESTINATIONS_ELEMENT);
+        if (destinationsNode != null)
+        {
+            allowedChildElements(destinationsNode, DESTINATIONS_CHILDREN);
+            NodeList destinations = selectNodeList(destinationsNode, DESTINATION_ELEMENT);
+            for (int a = 0; a < destinations.getLength(); a++)
+            {
+                Node dest = destinations.item(a);
+                destination(dest, serviceSettings);
+            }
+            fileResolver.popIncludedFile();
+        }
+        else // Check for single destination definition.
+        {
+            Node dest = selectSingleNode(doc, "/" + DESTINATION_ELEMENT);
+            if (dest != null)
+            {
+                destination(dest, serviceSettings);
+                fileResolver.popIncludedFile();
+            }
+            else
+            {
+                // The {0} root element in file {1} must be ''{2}'' or ''{3}''.
+                ConfigurationException ex = new ConfigurationException();
+                ex.setMessage(INVALID_INCLUDE_ROOT, new Object[]{DESTINATION_INCLUDE_ELEMENT, src, DESTINATIONS_ELEMENT, DESTINATION_ELEMENT});
+                throw ex;
+            }
+        }
+    }
+
+    private void destination(Node dest, ServiceSettings serviceSettings)
+    {
+        // Validation
+        requiredAttributesOrElements(dest, DESTINATION_REQ_CHILDREN);
+        allowedAttributes(dest, DESTINATION_ATTR);
+        allowedChildElements(dest, DESTINATION_CHILDREN);
+
+        String serviceId = serviceSettings.getId();
+
+        DestinationSettings destinationSettings;
+        String id = getAttributeOrChildElement(dest, ID_ATTR);
+        if (isValidID(id))
+        {
+            destinationSettings = (DestinationSettings)serviceSettings.getDestinationSettings().get(id);
+            if (destinationSettings != null)
+            {
+                // Duplicate destination definition '{id}' in service '{serviceId}'.
+                ConfigurationException e = new ConfigurationException();
+                e.setMessage(DUPLICATE_DESTINATION_ERROR, new Object[]{id, serviceId});
+                throw e;
+            }
+
+            destinationSettings = new DestinationSettings(id);
+            serviceSettings.addDestinationSettings(destinationSettings);
+        }
+        else
+        {
+            //Invalid {DESTINATION_ELEMENT} id '{id}' for service '{serviceId}'.
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(INVALID_ID_IN_SERVICE, new Object[]{DESTINATION_ELEMENT, id, serviceId});
+            throw ex;
+        }
+
+        // Destination Properties
+        NodeList properties = selectNodeList(dest, PROPERTIES_ELEMENT + "/*");
+        if (properties.getLength() > 0)
+        {
+            ConfigMap map = properties(properties, getSourceFileOf(dest));
+            destinationSettings.addProperties(map);
+        }
+
+        // Channels
+        destinationChannels(dest, destinationSettings, serviceSettings);
+
+    }
+
+    private void destinationChannels(Node dest, DestinationSettings destinationSettings, ServiceSettings serviceSettings)
+    {
+        String destId = destinationSettings.getId();
+
+        // Channels attribute
+        String channelsList = evaluateExpression(dest, "@" + CHANNELS_ATTR).toString().trim();
+        if (channelsList.length() > 0)
+        {
+            StringTokenizer st = new StringTokenizer(channelsList, LIST_DELIMITERS);
+            while (st.hasMoreTokens())
+            {
+                String ref = st.nextToken().trim();
+                ChannelSettings channel = config.getChannelSettings(ref);
+                if (channel != null)
+                {
+                    destinationSettings.addChannelSettings(channel);
+                }
+                else
+                {
+                    // {CHANNEL_ELEMENT} not found for reference '{ref}' in destination '{destId}'.
+                    ConfigurationException ex = new ConfigurationException();
+                    ex.setMessage(REF_NOT_FOUND_IN_DEST, new Object[]{CHANNEL_ELEMENT, ref, destId});
+                    throw ex;
+                }
+            }
+        }
+        else
+        {
+            // Channels element
+            Node channelsNode = selectSingleNode(dest, CHANNELS_ELEMENT);
+            if (channelsNode != null)
+            {
+                allowedChildElements
+                    (channelsNode, DESTINATION_CHANNELS_CHILDREN);
+                NodeList channels = selectNodeList(channelsNode, CHANNEL_ELEMENT);
+                if (channels.getLength() > 0)
+                {
+                    for (int c = 0; c < channels.getLength(); c++)
+                    {
+                        Node chan = channels.item(c);
+
+                        // Validation
+                        requiredAttributesOrElements(chan, DESTINATION_CHANNEL_REQ_CHILDREN);
+
+                        String ref = getAttributeOrChildElement(chan, REF_ATTR).trim();
+                        if (ref.length() > 0)
+                        {
+                            ChannelSettings channel = config.getChannelSettings(ref);
+                            if (channel != null)
+                            {
+                                destinationSettings.addChannelSettings(channel);
+                            }
+                            else
+                            {
+                                // {CHANNEL_ELEMENT} not found for reference '{ref}' in destination '{destId}'.
+                                ConfigurationException ex = new ConfigurationException();
+                                ex.setMessage(REF_NOT_FOUND_IN_DEST, new Object[]{CHANNEL_ELEMENT, ref, destId});
+                                throw ex;
+                            }
+                        }
+                        else
+                        {
+                            //Invalid {0} ref '{1}' in destination '{2}'.
+                            ConfigurationException ex = new ConfigurationException();
+                            ex.setMessage(INVALID_REF_IN_DEST, new Object[]{CHANNEL_ELEMENT, ref, destId});
+                            throw ex;
+                        }
+                    }
+                }
+            }
+            else
+            {
+                // Finally, we fall back to the service's default channels
+                List defaultChannels = serviceSettings.getDefaultChannels();
+                Iterator it = defaultChannels.iterator();
+                while (it.hasNext())
+                {
+                    ChannelSettings channel = (ChannelSettings)it.next();
+                    destinationSettings.addChannelSettings(channel);
+                }
+            }
+        }
+
+        if (destinationSettings.getChannelSettings().size() <= 0)
+        {
+            // Destination '{id}' must specify at least one channel.
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(DEST_NEEDS_CHANNEL, new Object[]{destId});
+            throw ex;
+        }
+    }
+
+    private void flexClient(Node root)
+    {
+        Node flexClient = selectSingleNode(root, FLEX_CLIENT_ELEMENT);
+        if (flexClient != null)
+        {
+            FlexClientSettings flexClientSettings = new FlexClientSettings();
+            // Reliable reconnect duration millis
+            String reliableReconnectDurationMillis = getAttributeOrChildElement(flexClient, FLEX_CLIENT_RELIABLE_RECONNECT_DURATION_MILLIS);
+            if (reliableReconnectDurationMillis.length() > 0)
+            {
+                try
+                {
+                    int millis = Integer.parseInt(reliableReconnectDurationMillis);
+                    if (millis < 0)
+                    {
+                        ConfigurationException e = new ConfigurationException();
+                        e.setMessage(INVALID_FLEX_CLIENT_RELIABLE_RECONNECT_DURATION_MILLIS, new Object[]{reliableReconnectDurationMillis});
+                        throw e;
+                    }
+                    flexClientSettings.setReliableReconnectDurationMillis(millis);
+                }
+                catch (NumberFormatException nfe)
+                {
+                    ConfigurationException e = new ConfigurationException();
+                    e.setMessage(INVALID_FLEX_CLIENT_RELIABLE_RECONNECT_DURATION_MILLIS, new Object[]{reliableReconnectDurationMillis});
+                    throw e;
+                }
+            }
+            else
+            {
+                flexClientSettings.setReliableReconnectDurationMillis(0); // Default is 0.
+            }
+            // heartbeat interval millis
+            String heartbeatIntervalMillis = getAttributeOrChildElement(flexClient, FLEX_CLIENT_HEARTBEAT_INTERVAL_MILLIS);
+            if (heartbeatIntervalMillis.length() > 0)
+            {
+                try
+                {
+                    int millis = Integer.parseInt(heartbeatIntervalMillis);
+                    if (millis < 0)
+                    {
+                        ConfigurationException e = new ConfigurationException();
+                        e.setMessage(INVALID_FLEX_CLIENT_HEARTBEAT_INTERVAL_MILLIS, new Object[] {heartbeatIntervalMillis});
+                        throw e;
+                    }
+                    flexClientSettings.setHeartbeatIntervalMillis(millis);
+                }
+                catch (NumberFormatException nfe)
+                {
+                    ConfigurationException e = new ConfigurationException();
+                    e.setMessage(INVALID_FLEX_CLIENT_HEARTBEAT_INTERVAL_MILLIS, new Object[] {heartbeatIntervalMillis});
+                    throw e;
+                }
+            }
+            ((ClientConfiguration)config).setFlexClientSettings(flexClientSettings);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/ClusterSettings.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/ClusterSettings.java b/modules/common/src/flex/messaging/config/ClusterSettings.java
new file mode 100755
index 0000000..6505bbe
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/ClusterSettings.java
@@ -0,0 +1,152 @@
+/*
+ * 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.messaging.config;
+
+/**
+ * @exclude
+ */
+public class ClusterSettings extends PropertiesSettings
+{
+    public static final String CLUSTER_ELEMENT = "cluster";
+    public static final String REF_ATTR = "ref";
+    public static final String SHARED_BACKEND_ATTR = "shared-backend";
+    public static final String DEFAULT_ELEMENT = "default";
+    public static final String URL_LOAD_BALANCING = "url-load-balancing";
+    public static final String IMPLEMENTATION_CLASS = "class";
+
+    public static final String JGROUPS_CLUSTER = "flex.messaging.cluster.JGroupsCluster";
+
+    private String clusterName;
+    private String propsFileName;
+    private String implementationClass;
+    private boolean def;
+    private boolean urlLoadBalancing;
+
+    /**
+     * Creates a new <code>ClusterSettings</code> with default settings.
+     */
+    public ClusterSettings()
+    {
+        def = false;
+        urlLoadBalancing = true;
+        implementationClass = JGROUPS_CLUSTER;
+    }
+
+    /**
+     * Returns the name of the cluster.
+     *
+     * @return The name of the cluster.
+     */
+    public String getClusterName()
+    {
+        return clusterName;
+    }
+
+    /**
+     * Sets the name of the cluster.
+     *
+     * @param clusterName The name of the cluster.
+     */
+    public void setClusterName(String clusterName)
+    {
+        this.clusterName = clusterName;
+    }
+
+    /**
+     * Returns whether the cluster is default or not.
+     *
+     * @return <code>true</code> is the cluster is default; otherwise <code>false</code>.
+     */
+    public boolean isDefault()
+    {
+        return def;
+    }
+
+    /**
+     * Sets whether the cluster is default or not.
+     *
+     * @param def <code>true</code> is the cluster is default; otherwise <code>false</code>.
+     */
+    public void setDefault(boolean def)
+    {
+        this.def = def;
+    }
+
+    /**
+     * Returns the properties file of the cluster.
+     *
+     * @return The properties file of the cluster.
+     */
+    public String getPropsFileName()
+    {
+        return propsFileName;
+    }
+
+    /**
+     * Sets the properties file of the cluster.
+     *
+     * @param propsFileName The properties file of the cluster.
+     */
+    public void setPropsFileName(String propsFileName)
+    {
+        this.propsFileName = propsFileName;
+    }
+
+    /**
+     * Returns whether url load balancing is enabled or not.
+     *
+     * @return <code>true</code> if the url load balancing is enabled; otherwise <code>false</code>.
+     */
+    public boolean getURLLoadBalancing()
+    {
+        return urlLoadBalancing;
+    }
+
+    /**
+     * Sets whether url load balancing is enabled or not.
+     *
+     * @param ulb <code>true</code> if the url load balancing is enabled; otherwise <code>false</code>.
+     */
+    public void setURLLoadBalancing(boolean ulb)
+    {
+        urlLoadBalancing = ulb;
+    }
+
+    /**
+     * Sets the name of the cluster implementation class.
+     * The default is 'flex.messaging.cluster.JGroupsCluster'.
+     *
+     * @param className
+     * @exclude
+     */
+    public void setImplementationClass(String className)
+    {
+        this.implementationClass = className;
+    }
+
+    /**
+     * Get the name of the cluster implementation class.
+     * The class must support the flex.messaging.cluster.Cluster interface.
+     *
+     * @return The implementation class name.
+     * @exclude
+     */
+    public String getImplementationClass()
+    {
+        return implementationClass;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/ConfigMap.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/ConfigMap.java b/modules/common/src/flex/messaging/config/ConfigMap.java
new file mode 100755
index 0000000..ae76667
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/ConfigMap.java
@@ -0,0 +1,471 @@
+/*
+ * 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.messaging.config;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * The ConfigMap class is a helper implementation of Map that makes it easier
+ * to handle properties that can appear one or more times. If a property is set
+ * more than once, it is converted to a List and added as another property
+ * rather than replacing the existing property. It also provides utility APIs
+ * for getting properties from the Map, cast to a certain type and allows a
+ * default to be specified in the event that the property is missing.
+ *
+ * @author Peter Farland
+ */
+public class ConfigMap extends LinkedHashMap
+{
+    /**
+     * This number was generated using the 'serialver' command line tool.
+     * This number should remain consistent with the version used by
+     * ColdFusion to communicate with the message broker over RMI.
+     */
+    private static final long serialVersionUID = 8913604659150919550L;
+
+    /**
+     * This error is thrown when a property unexpectedly contains multiple values.
+     */
+    private static final int UNEXPECTED_MULTIPLE_VALUES = 10169;
+
+    /**
+     * An *undocumented* system property can be used to revert to legacy config property handling:
+     *   Legacy behavior - config property values were not trimmed, retaining leading/trailing whitespace which
+     *                     proved problematic for customers.
+     *   New default behavior - config property values are trimmed.
+     */
+    private static final String SYSPROPNAME_TRIM_CONFIG_PROPERTY_VALUES = "flex.trim-config-property-values";    
+    private static final boolean TRIM_CONFIG_PROPERTY_VALUES = Boolean.valueOf(System.getProperty(SYSPROPNAME_TRIM_CONFIG_PROPERTY_VALUES, "true")).booleanValue();
+    
+    /**
+     * Map to keep track of accessed properties.
+     */
+    private HashSet accessedKeys = new HashSet();
+
+    /**
+     * Constructs an empty <code>ConfigMap</code> with the default initial
+     * capacity of 10.
+     */
+    public ConfigMap()
+    {
+        super();
+    }
+
+    /**
+     * Constructs a new <code>ConfigMap</code> with the initial
+     * capacity specified.
+     *
+     * @param  initialCapacity the initial capacity.
+     */
+    public ConfigMap(int initialCapacity)
+    {
+        super(initialCapacity);
+    }
+
+    /**
+     * Constructs a new <code>ConfigMap</code> and copies the values
+     * from the supplied map to this map.
+     *
+     * @param m a <code>ConfigMap</code> whose properties are to be added to
+     * this <code>ConfigMap</code>.
+     */
+    public ConfigMap(ConfigMap m)
+    {
+        this();
+        addProperties(m);
+    }
+
+    /**
+     * Adds all properties from a map to this map.
+     *
+     * @param p a <code>ConfigMap</code> whose properties are to be added to
+     * this <code>ConfigMap</code>.
+     */
+    public void addProperties(ConfigMap p)
+    {
+        Iterator it = p.entrySet().iterator();
+        while (it.hasNext())
+        {
+            Map.Entry entry = (Map.Entry) it.next();
+            Object key = entry.getKey();
+            Object value = entry.getValue();
+            if (value instanceof ValueList)
+            {
+                addProperties(key, (ValueList) value);
+            }
+            else
+            {
+                addPropertyLogic(key, value);
+            }
+        }
+    }
+
+    /**
+     * Helper method to add a list of values under a key.
+     *
+     * @param key The key to add the values under.
+     * @param values The list of values to add.
+     */
+    private void addProperties(Object key, ValueList values)
+    {
+        ValueList list = getValueList(key);
+        if (list == null)
+        {
+            put(key, values.clone());
+        }
+        else
+        {
+            list.addAll(values);
+        }
+    }
+
+    /**
+     * Helper method to add a value under a key.
+     *
+     * @param key The key to add the value under.
+     * @param value The value to add.
+     */
+    private void addPropertyLogic(Object key, Object value)
+    {
+        ValueList list = getValueList(key);
+        if (list == null)
+        {
+            put(key, value);
+        }
+        else
+        {
+            list.add(value);
+        }
+    }
+
+    private static class ValueList extends ArrayList
+    {
+        /**
+         * Serial version id.
+         */
+        static final long serialVersionUID = -5637755312744414675L;
+    }
+
+    /**
+     * Given a key, returns a list of values associated with that key.
+     *
+     * @param key The key.
+     * @return A list of values associated with the key.
+     */
+    private ValueList getValueList(Object key)
+    {
+        ValueList list;
+        Object old = super.get(key);
+        if (old instanceof ValueList)
+        {
+            list = (ValueList) old;
+        }
+        else if (old != null)
+        {
+            list = new ValueList();
+            list.add(old);
+            put(key, list);
+        }
+        else
+        {
+            list = null;
+        }
+        return list;
+    }
+
+    /**
+     * Adds a <code>String</code> value to this map for the given property
+     * name.
+     *
+     * @param name  the property name
+     * @param value the property value
+     */
+    public void addProperty(String name, String value)
+    {
+        addPropertyLogic(name, TRIM_CONFIG_PROPERTY_VALUES && value != null ? value.trim() : value);
+    }
+
+    /**
+     * Adds a <code>ConfigMap</code> value to this map for the given property
+     * name.
+     *
+     * @param name  the property name
+     * @param value the property value
+     */
+    public void addProperty(String name, ConfigMap value)
+    {
+        addPropertyLogic(name, value);
+    }
+
+    /**
+     * Gets the set of property names contained in this map.
+     *
+     * @return a <code>Set</code> of property name <code>String</code>s.
+     */
+    public Set propertyNames()
+    {
+        return keySet();
+    }
+
+    /**
+     * Sets a property name as allowed without needing to access the property
+     * value. This marks a property as allowed for validation purposes.
+     *
+     * @param name  the property name to allow
+     */
+    public void allowProperty(String name)
+    {
+        accessedKeys.add(name);
+    }
+
+    /**
+     * Gets the value for the given property name. Also records that this
+     * property was accessed.
+     *
+     * @param name  the property name
+     * @return the value for the property, or null if property does not exist
+     * in this map.
+     */
+    public Object get(Object name)
+    {
+        accessedKeys.add(name);
+        return super.get(name);
+    }
+
+    /**
+     * Helper method to get the property with the specified name as a string if possible.
+     *
+     * @param name The property name.
+     * @return The property object.
+     */
+    private Object getSinglePropertyOrFail(Object name)
+    {
+        Object result = get(name);
+        if (result instanceof ValueList)
+        {
+            ConfigurationException exception = new ConfigurationException();
+            exception.setMessage
+                (UNEXPECTED_MULTIPLE_VALUES, new Object[] {name});
+            throw exception;
+        }
+        return result;
+    }
+
+    /**
+     * Gets the property with the specified name as a string if possible.
+     *
+     * @param name The property name.
+     * @return The property name.
+     */
+    public String getProperty(String name)
+    {
+        return getPropertyAsString(name, null);
+    }
+
+    /**
+     * Gets the property with the specified name as a ConfigMap if possible,
+     * or returns the default value if the property is undefined.
+     * <p/>
+     * @param name the property name
+     * @param defaultValue the default value
+     * @return ConfigMap the ConfigMap object of the property
+     */
+    public ConfigMap getPropertyAsMap(String name, ConfigMap defaultValue)
+    {
+        Object prop = getSinglePropertyOrFail(name);
+        if (prop instanceof ConfigMap)
+        {
+            return (ConfigMap)prop;
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Gets the property with the specified name as a String if possible,
+     * or returns the default value if the property is undefined.
+     * <p/>
+     * @param name the property name
+     * @param defaultValue the default value
+     * @return String the String value of the property
+     */
+    public String getPropertyAsString(String name, String defaultValue)
+    {
+        Object prop = getSinglePropertyOrFail(name);
+        if (prop instanceof String)
+        {
+            return (String)prop;
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Gets a property (or set of properties) as a List. If only one
+     * property exists it is added as the only entry to a new List.
+     *
+     * @param name  the property name
+     * @param defaultValue  the value to return if the property is not found
+     * @return the value for the property as a List if it exists in this map,
+     * otherwise the defaultValue is returned.
+     */
+    public List getPropertyAsList(String name, List defaultValue)
+    {
+        Object prop = get(name);
+        if (prop != null)
+        {
+            if (prop instanceof List)
+            {
+                return (List) prop;
+            }
+            else
+            {
+                List list = new ArrayList();
+                list.add(prop);
+                return list;
+            }
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Gets the property with the specified name as a boolean if possible,
+     * or returns the default value if the property is undefined.
+     * <p/>
+     * @param name the property name
+     * @param defaultValue the default value
+     * @return boolean the boolean value of the property
+     */
+    public boolean getPropertyAsBoolean(String name, boolean defaultValue)
+    {
+        Object prop = getSinglePropertyOrFail(name);
+        if (prop instanceof String)
+        {
+            return Boolean.valueOf((String)prop).booleanValue();
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Gets the property with the specified name as an int if possible,
+     * or returns the default value if the property is undefined.
+     * <p/>
+     * @param name the property name
+     * @param defaultValue the default value
+     * @return int the int value of the property
+     */
+    public int getPropertyAsInt(String name, int defaultValue)
+    {
+        Object prop = getSinglePropertyOrFail(name);
+        if (prop instanceof String)
+        {
+            try
+            {
+                return Integer.parseInt((String)prop);
+            }
+            catch (NumberFormatException ex)
+            {
+            }
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Gets the property with the specified name as a long if possible,
+     * or returns the default value if the property is undefined.
+     * <p/>
+     * @param name the property name
+     * @param defaultValue the default value
+     * @return long the long value of the property
+     */
+    public long getPropertyAsLong(String name, long defaultValue)
+    {
+        Object prop = getSinglePropertyOrFail(name);
+        if (prop instanceof String)
+        {
+            try
+            {
+                return Long.parseLong((String)prop);
+            }
+            catch (NumberFormatException ex)
+            {
+            }
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Returns a list of qualified property names that have not been accessed
+     * by one of the get*() methods.
+     * <p/>
+     * @return List a list of unused properties
+     */
+    public List findAllUnusedProperties()
+    {
+        List result = new ArrayList();
+        findUnusedProperties("", true, result);
+        return result;
+    }
+
+    /**
+     * Gathers a collection of properties that exist in the map but have not
+     * been explicitly accessed nor marked as allowed. This list is helpful
+     * in validating a set of properties as one can detect those that are
+     * unknown or unexpected.
+     *
+     * @param parentPath Used to track the depth of property in a potential
+     * hierarchy of <code>ConfigMap</code>s.
+     * @param recurse Whether sub maps should be recursively searched.
+     * @param result the collection of unused properties in this map.
+     */
+    public void findUnusedProperties
+        (String parentPath, boolean recurse, Collection result)
+    {
+        Iterator itr = entrySet().iterator();
+        while (itr.hasNext())
+        {
+            Map.Entry entry = (Map.Entry) itr.next();
+            Object key = entry.getKey();
+            String currentPath = parentPath + '/' + String.valueOf(key);
+            if (!accessedKeys.contains(key))
+            {
+                result.add(currentPath);
+            }
+            else if (recurse)
+            {
+                Object value = entry.getValue();
+                List values = value instanceof List ?
+                              (List) value : Collections.singletonList(value);
+                for (int i = 0; i < values.size(); i++)
+                {
+                    Object child = values.get(i);
+                    if (child instanceof ConfigMap)
+                    {
+                        ((ConfigMap) child).findUnusedProperties
+                            (currentPath, recurse, result);
+                    }
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/ConfigurationConstants.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/ConfigurationConstants.java b/modules/common/src/flex/messaging/config/ConfigurationConstants.java
new file mode 100755
index 0000000..d2357dd
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/ConfigurationConstants.java
@@ -0,0 +1,467 @@
+/*
+ * 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.messaging.config;
+
+/**
+ * @exclude
+ */
+public interface ConfigurationConstants
+{
+    String CONTEXT_PATH_TOKEN = "{context.root}";
+    String CONTEXT_PATH_ALT_TOKEN = "{context-root}";
+    String SLASH_CONTEXT_PATH_TOKEN = "/{context.root}";
+    String EMPTY_STRING = "";
+    String TRUE_STRING = "true";
+    String FALSE_STRING = "false";
+    String SERVER_NAME_TOKEN = "{server.name}";
+    String SERVER_PORT_TOKEN = "{server.port}";
+
+    // ELEMENTS
+
+    // Top Level
+    String SERVICES_CONFIG_ELEMENT = "services-config";
+
+    // Services
+    String SERVICES_ELEMENT = "services";
+    String SERVICE_ELEMENT = "service";
+    String SERVICE_INCLUDE_ELEMENT = "service-include";
+
+    String SRC_ATTR = "file-path";
+    String DIRECTORY_ATTR = "directory-path";
+    String ID_ATTR = "id";
+    String CLASS_ATTR = "class";
+    String PER_CLIENT_AUTH="per-client-authentication";
+    String MESSAGE_TYPES_ATTR = "messageTypes";
+
+    String PROPERTIES_ELEMENT = "properties";
+
+    String METADATA_ELEMENT = "metadata";
+
+    String ADAPTERS_ELEMENT = "adapters";
+    String ADAPTER_DEFINITION_ELEMENT = "adapter-definition";
+    String ADAPTER_INCLUDE_ELEMENT = "adapter-include";
+    String DEFAULT_ATTR = "default";
+
+    String DEFAULT_CHANNELS_ELEMENT = "default-channels";
+    String CHANNEL_ELEMENT = "channel";
+    String REF_ATTR = "ref";
+
+    String DEFAULT_SECURITY_CONSTRAINT_ELEMENT = "default-security-constraint";
+
+    String DESTINATION_ELEMENT = "destination";
+    String DESTINATIONS_ELEMENT = "destinations";
+    String DESTINATION_INCLUDE_ELEMENT = "destination-include";
+    String ADAPTER_ELEMENT = "adapter";
+    String ADAPTER_ATTR = "adapter";
+    String CHANNELS_ATTR = "channels";
+    String SECURITY_CONSTRAINT_ELEMENT = "security-constraint";
+    String SECURITY_CONSTRAINT_ATTR = "security-constraint";
+    String SECURITY_CONSTRAINTS_ELEMENT = "security-constraints";  // for includes only
+
+    // Security
+    String SECURITY_ELEMENT = "security";
+    String SECURITY_CONSTRAINT_DEFINITION_ELEMENT = "security-constraint";
+    String CONSTRAINT_INCLUDE_ELEMENT = "constraint-include";
+    String AUTH_METHOD_ELEMENT = "auth-method";
+    String ROLES_ELEMENT = "roles";
+    String ROLE_ELEMENT = "role";
+    String LOGIN_COMMAND_ELEMENT = "login-command";
+    String SERVER_ATTR = "server";
+    String RECREATE_HTTPSESSION_AFTER_LOGIN_ELEMENT = "recreate-httpsession-after-login";
+
+    // SocketServers
+    String SERVERS_ELEMENT = "servers";
+    String SERVER_ELEMENT = "server";
+    String IP_ADDRESS_PATTERN = "ip-address-pattern";
+
+    // Channels
+    String CHANNELS_ELEMENT = "channels";
+    String CHANNEL_DEFINITION_ELEMENT = "channel-definition";
+    String CHANNEL_INCLUDE_ELEMENT = "channel-include";
+    String REMOTE_ATTR = "remote";
+    String SERVER_ONLY_ATTR = "server-only";
+    String ENDPOINT_ELEMENT = "endpoint";
+    // Deprecated, use URL_ATTR instead.
+    String URI_ATTR = "uri";
+    String URL_ATTR = "url";
+    String POLLING_ENABLED_ELEMENT = "polling-enabled";
+    String POLLING_INTERVAL_MILLIS_ELEMENT = "polling-interval-millis";
+    String PIGGYBACKING_ENABLED_ELEMENT = "piggybacking-enabled";
+    String LOGIN_AFTER_DISCONNECT_ELEMENT = "login-after-disconnect";
+    String RECORD_MESSAGE_SIZES_ELEMENT = "record-message-sizes";
+    String RECORD_MESSAGE_TIMES_ELEMENT = "record-message-times";
+    String SERIALIZATION_ELEMENT = "serialization";
+    String ENABLE_SMALL_MESSAGES_ELEMENT = "enable-small-messages";
+    // Deprecated, use POLLING_INTERVAL_MILLIS_ELEMENT instead.
+    String POLLING_INTERVAL_SECONDS_ELEMENT = "polling-interval-seconds";
+    String CONNECT_TIMEOUT_SECONDS_ELEMENT = "connect-timeout-seconds";
+    String CLIENT_LOAD_BALANCING_ELEMENT = "client-load-balancing";
+    String REQUEST_TIMEOUT_SECONDS_ELEMENT = "request-timeout-seconds";
+
+    // Clusters
+    String CLUSTERS_ELEMENT = "clusters";
+    String CLUSTER_DEFINITION_ELEMENT = "cluster";
+    String CLUSTER_PROPERTIES_ATTR = "properties";
+
+    // Logging
+    String LOGGING_ELEMENT = "logging";
+    String TARGET_ELEMENT = "target";
+    String FILTERS_ELEMENT = "filters";
+    String PATTERN_ELEMENT = "pattern";
+    String LEVEL_ATTR = "level";
+
+    // System
+    String SYSTEM_ELEMENT = "system";
+    String ENFORCE_ENDOINT_VALIDATION ="enforce-endpoint-validation";
+    String LOCALE_ELEMENT = "locale";
+    String MANAGEABLE_ELEMENT = "manageable";
+    String DEFAULT_LOCALE_ELEMENT = "default-locale";
+    String REDEPLOY_ELEMENT = "redeploy";
+    String ENABLED_ELEMENT = "enabled";
+    String WATCH_INTERVAL_ELEMENT = "watch-interval";
+    String WATCH_FILE_ELEMENT = "watch-file";
+    String TOUCH_FILE_ELEMENT = "touch-file";
+    String FACTORIES_ELEMENT = "factories";
+    String FACTORY_ELEMENT = "factory";
+    String UUID_GENERATOR_ELEMENT = "uuid-generator";
+    String DOTNET_FRAMEWORK_VERSION = "dotnet-framework-version";
+
+    // FlexClient
+    String FLEX_CLIENT_ELEMENT = "flex-client";
+    String FLEX_CLIENT_TIMEOUT_MINUTES_ELEMENT = "timeout-minutes";
+    String FLEX_CLIENT_OUTBOUND_QUEUE_PROCESSOR_ELEMENT = "flex-client-outbound-queue-processor";
+    String ADAPTIVE_FREQUENCY = "adaptive-frequency";
+    String FLEX_CLIENT_RELIABLE_RECONNECT_DURATION_MILLIS = "reliable-reconnect-duration-millis";
+    String FLEX_CLIENT_HEARTBEAT_INTERVAL_MILLIS = "heartbeat-interval-millis";
+
+    // Message filters
+    String ASYNC_MESSAGE_FILTERS_ELEMENT = "async-message-filters";
+    String SYNC_MESSAGE_FILTERS_ELEMENT = "sync-message-filters";
+    String FILTER_ELEMENT = "filter";
+
+    // Validators
+    String VALIDATORS_ELEMENT = "validators";
+    String VALIDATOR_ELEMENT = "validator";
+    String TYPE_ATTR = "type";
+
+    // CHILD ELEMENTS
+
+    // Top Level
+    String[] SERVICES_CONFIG_CHILDREN = {
+        SERVICES_ELEMENT, SECURITY_ELEMENT, SERVERS_ELEMENT, CHANNELS_ELEMENT, LOGGING_ELEMENT,
+        SYSTEM_ELEMENT, CLUSTERS_ELEMENT, FACTORIES_ELEMENT, FLEX_CLIENT_ELEMENT,
+        ASYNC_MESSAGE_FILTERS_ELEMENT, SYNC_MESSAGE_FILTERS_ELEMENT, VALIDATORS_ELEMENT
+    };
+
+    // Services
+    String[] SERVICES_CHILDREN = {
+        SERVICE_ELEMENT, SERVICE_INCLUDE_ELEMENT, DEFAULT_CHANNELS_ELEMENT
+    };
+
+    String[] SERVICE_INCLUDE_CHILDREN = {
+        SRC_ATTR, DIRECTORY_ATTR
+    };
+
+    String[] SERVICE_CHILDREN = {
+        ID_ATTR, CLASS_ATTR, MESSAGE_TYPES_ATTR, PROPERTIES_ELEMENT,
+        ADAPTERS_ELEMENT, DEFAULT_CHANNELS_ELEMENT, DEFAULT_SECURITY_CONSTRAINT_ELEMENT,
+        DESTINATION_INCLUDE_ELEMENT, DESTINATION_ELEMENT
+    };
+
+    String[] SERVICE_REQ_CHILDREN = {
+        ID_ATTR, CLASS_ATTR
+    };
+
+    String[] ADAPTER_DEFINITION_CHILDREN = {
+        ID_ATTR, CLASS_ATTR, DEFAULT_ATTR, PROPERTIES_ELEMENT
+    };
+
+    String[] ADAPTER_DEFINITION_REQ_CHILDREN = {
+        ID_ATTR, CLASS_ATTR
+    };
+
+    String[] DESTINATION_INCLUDE_CHILDREN = {
+        SRC_ATTR, DIRECTORY_ATTR
+    };
+
+    String[] ADAPTERS_CHILDREN = {
+        ADAPTER_DEFINITION_ELEMENT, ADAPTER_INCLUDE_ELEMENT
+    };
+
+    String[] ADAPTER_INCLUDE_CHILDREN = {
+        SRC_ATTR, DIRECTORY_ATTR
+    };
+
+    String[] DEFAULT_CHANNELS_CHILDREN = {
+        CHANNEL_ELEMENT
+    };
+
+    String[] FLEX_CLIENT_CHILDREN = {
+        FLEX_CLIENT_TIMEOUT_MINUTES_ELEMENT, FLEX_CLIENT_OUTBOUND_QUEUE_PROCESSOR_ELEMENT,
+        ADAPTIVE_FREQUENCY, FLEX_CLIENT_RELIABLE_RECONNECT_DURATION_MILLIS, FLEX_CLIENT_HEARTBEAT_INTERVAL_MILLIS
+    };
+
+    String[] FLEX_CLIENT_OUTBOUND_QUEUE_PROCESSOR_REQ_CHILDREN = {
+        CLASS_ATTR
+    };
+
+    // Security
+    String[] SECURITY_CHILDREN = {
+        SECURITY_CONSTRAINT_DEFINITION_ELEMENT, LOGIN_COMMAND_ELEMENT, RECREATE_HTTPSESSION_AFTER_LOGIN_ELEMENT,
+        CONSTRAINT_INCLUDE_ELEMENT
+    };
+
+    String[] EMBEDDED_SECURITY_CHILDREN = {
+        SECURITY_CONSTRAINT_DEFINITION_ELEMENT
+    };
+
+    String[] SECURITY_CONSTRAINT_DEFINITION_CHILDREN = {
+        REF_ATTR, ID_ATTR, AUTH_METHOD_ELEMENT, ROLES_ELEMENT
+    };
+
+    String[] ROLES_CHILDREN = {
+        ROLE_ELEMENT
+    };
+
+    String[] LOGIN_COMMAND_CHILDREN = {
+        SERVER_ATTR, CLASS_ATTR, PER_CLIENT_AUTH
+    };
+
+    String[] LOGIN_COMMAND_REQ_CHILDREN = {
+        SERVER_ATTR, CLASS_ATTR
+    };
+
+    String[] SECURITY_CONSTRAINTS_CHILDREN = {
+        SECURITY_CONSTRAINT_ELEMENT
+    };
+
+    String[] CONSTRAINT_INCLUDE_CHILDREN = {
+        SRC_ATTR, DIRECTORY_ATTR
+    };
+
+    // Servers
+    String[] SERVERS_CHILDREN = {SERVER_ELEMENT};
+
+    String[] SERVER_REQ_CHILDREN = {
+        ID_ATTR, CLASS_ATTR
+    };
+
+    String [] SERVER_CHILDREN = {
+        ID_ATTR, CLASS_ATTR, PROPERTIES_ELEMENT
+    };
+
+    // Channels
+    String[] CHANNELS_CHILDREN = {
+        CHANNEL_DEFINITION_ELEMENT, CHANNEL_INCLUDE_ELEMENT
+    };
+
+    String[] CHANNEL_DEFINITION_REQ_CHILDREN = {
+        ENDPOINT_ELEMENT, ID_ATTR
+    };
+
+    String[] CHANNEL_DEFINITION_CHILDREN = {
+        ENDPOINT_ELEMENT, PROPERTIES_ELEMENT, SECURITY_ELEMENT, SERVER_ELEMENT,
+        SECURITY_CONSTRAINT_ATTR, CLASS_ATTR, ID_ATTR, REMOTE_ATTR, SERVER_ONLY_ATTR
+    };
+
+    String[] CHANNEL_DEFINITION_SERVER_REQ_CHILDREN = {
+        REF_ATTR
+    };
+
+    String[] CHANNEL_INCLUDE_CHILDREN = {
+        SRC_ATTR, DIRECTORY_ATTR
+    };
+
+    String[] ENDPOINT_CHILDREN = {
+        URI_ATTR, URL_ATTR, CLASS_ATTR
+    };
+
+    String[] DESTINATION_REQ_CHILDREN = {
+        ID_ATTR
+    };
+
+    String[] DESTINATION_CHILDREN = {
+        ID_ATTR, PROPERTIES_ELEMENT, CHANNELS_ELEMENT, SECURITY_ELEMENT, ADAPTER_ELEMENT,
+        CHANNELS_ATTR, ADAPTER_ATTR, SECURITY_CONSTRAINT_ATTR
+    };
+
+    String[] DESTINATIONS_CHILDREN = {
+        DESTINATION_ELEMENT
+    };
+
+    String[] DESTINATION_ATTR = {
+            ID_ATTR, PROPERTIES_ELEMENT, CHANNELS_ELEMENT, ADAPTER_ELEMENT,
+            CHANNELS_ATTR, ADAPTER_ATTR, SECURITY_CONSTRAINT_ATTR
+    };
+
+    String[] DESTINATION_CHANNEL_REQ_CHILDREN = {
+        REF_ATTR
+    };
+
+    String[] DESTINATION_CHANNELS_CHILDREN = {
+        CHANNEL_ELEMENT
+    };
+
+    String[] DESTINATION_ADAPTER_CHILDREN = {
+        REF_ATTR
+    };
+
+    // Clustering
+    String[] CLUSTERING_CHILDREN = {
+        CLUSTER_DEFINITION_ELEMENT
+    };
+
+    String[] CLUSTER_DEFINITION_CHILDREN = {
+        ID_ATTR, CLUSTER_PROPERTIES_ATTR
+    };
+
+    // Logging
+
+    String[] LOGGING_CHILDREN = {
+        PROPERTIES_ELEMENT, LEVEL_ATTR, TARGET_ELEMENT,
+    };
+
+    String[] TARGET_CHILDREN = {
+        CLASS_ATTR, LEVEL_ATTR, PROPERTIES_ELEMENT, FILTERS_ELEMENT
+    };
+
+    String[] TARGET_REQ_CHILDREN = {
+        CLASS_ATTR
+    };
+
+    String[] FILTERS_CHILDREN = {
+        PATTERN_ELEMENT
+    };
+
+    // System
+
+    String[] SYSTEM_CHILDREN = {
+        LOCALE_ELEMENT, ENFORCE_ENDOINT_VALIDATION, REDEPLOY_ELEMENT, MANAGEABLE_ELEMENT, UUID_GENERATOR_ELEMENT, DOTNET_FRAMEWORK_VERSION
+    };
+
+    String[] REDEPLOY_CHILDREN = {
+        ENABLED_ELEMENT, WATCH_INTERVAL_ELEMENT, WATCH_FILE_ELEMENT, TOUCH_FILE_ELEMENT
+    };
+
+    String[] LOCALE_CHILDREN = {
+        DEFAULT_LOCALE_ELEMENT
+    };
+
+    // Factories
+    String[] FACTORIES_CHILDREN = {
+        FACTORY_ELEMENT
+    };
+
+    String[] FACTORY_REQ_CHILDREN = {
+        ID_ATTR, CLASS_ATTR
+    };
+
+    // Message filters
+    String[] ASYNC_MESSAGE_FILTERS_ELEMENT_CHILDREN = {
+        FILTER_ELEMENT
+    };
+
+    String[] SYNC_MESSAGE_FILTERS_ELEMENT_CHILDREN = {
+        FILTER_ELEMENT
+    };
+
+    String[] FILTER_CHILDREN = {
+        ID_ATTR, CLASS_ATTR, PROPERTIES_ELEMENT
+    };
+
+    String[] FILTER_REQ_CHILDREN = {
+        ID_ATTR, CLASS_ATTR
+    };
+
+    // UUID Generator
+    String[] UUID_GENERATOR_REQ_CHILDREN = {
+            CLASS_ATTR
+         };
+
+    // Validators
+    String[] VALIDATORS_CHILDREN = {
+        VALIDATOR_ELEMENT
+    };
+
+    String[] VALIDATOR_CHILDREN = {
+        CLASS_ATTR, TYPE_ATTR, PROPERTIES_ELEMENT
+    };
+
+    String[] VALIDATOR_REQ_CHILDREN = {
+        CLASS_ATTR
+     };
+
+    // UTILS
+    String LIST_DELIMITERS = ",;:";
+
+    // TOKEN REPLACEMENT
+    String UNKNOWN_SOURCE_FILE = "uknown file";
+
+
+    // EXCEPTION MESSAGES
+
+    int PARSER_INIT_ERROR = 10100;
+    int PARSER_INTERNAL_ERROR = 10101;
+    int XML_PARSER_ERROR = 10102;
+    int INVALID_SERVICES_ROOT = 10103;
+    int MISSING_ELEMENT = 10104;
+    int MISSING_ATTRIBUTE = 10105;
+    int UNEXPECTED_ELEMENT = 10106;
+    int UNEXPECTED_ATTRIBUTE = 10107;
+    int TOO_MANY_OCCURRENCES = 10108;
+    int REF_NOT_FOUND = 10109;
+    int INVALID_ID = 10110;
+    int INVALID_ENDPOINT_PORT = 10111;
+    int INVALID_INCLUDE_ROOT = 10112;
+    int DUPLICATE_SERVICE_ERROR = 10113;
+    int CLASS_NOT_SPECIFIED = 10114;
+    int INVALID_DEFAULT_CHANNEL = 10116;
+    int DUPLICATE_DEFAULT_ADAPTER = 10117;
+    int MISSING_INCLUDE_ATTRIBUTES = 10118;
+    int INVALID_ID_IN_SERVICE = 10119;
+    int REF_NOT_FOUND_IN_DEST = 10120;
+    int INVALID_REF_IN_DEST = 10121;
+    int DUPLICATE_DESTINATION_ERROR = 10122;
+    int DEST_NEEDS_CHANNEL = 10123;
+    int DEST_NEEDS_ADAPTER = 10127;
+    int REF_NOT_FOUND_IN_CHANNEL = 10132;
+    int UNEXPECTED_TEXT = 11104;
+
+    int NULL_COMPONENT = 11110;
+    int NULL_COMPONENT_ID = 11111;
+    int DUPLICATE_COMPONENT_ID = 11112;
+    int UNREGISTERED_ADAPTER = 11114;
+    int DUPLICATE_DEST_ID = 11119;
+
+    int UNDEFINED_CONTEXT_ROOT = 11120;
+    int INVALID_FLEX_CLIENT_TIMEOUT = 11123;
+    int INVALID_SECURITY_CONSTRAINT_REF = 11124;
+    int IRREPLACABLE_TOKEN = 11125;
+    int INVALID_VALUE_FOR_PROPERTY_OF_COMPONENT_WITH_ID = 11126;
+    int DUPLICATE_CHANNEL_ERROR = 11127;
+    int INVALID_FLEX_CLIENT_RELIABLE_RECONNECT_DURATION_MILLIS = 11137;
+    int INVALID_FLEX_CLIENT_HEARTBEAT_INTERVAL_MILLIS = 11146;
+
+    int REQUIRE_ADVANCED_MESSAGING_SUPPORT = 11129;
+    int CLASS_OR_SERVER_ONLY_ERROR = 11139;
+    int CLASS_AND_SERVER_ONLY_ERROR = 11140;
+    int ERR_MSG_EMPTY_CLIENT_LOAD_BALANCING_ELEMENT = 11141;
+    int ERR_MSG_EMTPY_CLIENT_LOAD_BALACNING_URL = 11142;
+    int ERR_MSG_CLIENT_LOAD_BALANCING_URL_WITH_TOKEN = 11147;
+
+    int EXTERNAL_ENTITY_NOT_ALLOW = 11149;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/ConfigurationException.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/ConfigurationException.java b/modules/common/src/flex/messaging/config/ConfigurationException.java
new file mode 100755
index 0000000..beb154f
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/ConfigurationException.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.messaging.config;
+
+import flex.messaging.LocalizedException;
+
+/**
+ * The server throws this exception type on encountering
+ * errors while parsing the configuration. Other classes
+ * may also throw this exception type during initialization
+ * in the event that the configuration settings used to
+ * initialize the component was invalid.
+ *
+ * @author Peter Farland
+ */
+public class ConfigurationException extends LocalizedException
+{
+    /**
+     * This number was generated using the 'serialver' command line tool.
+     * This number should remain consistent with the version used by
+     * ColdFusion to communicate with the message broker over RMI.
+     */
+    private static final long serialVersionUID = -6999307106348525358L;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/ConfigurationFileResolver.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/ConfigurationFileResolver.java b/modules/common/src/flex/messaging/config/ConfigurationFileResolver.java
new file mode 100755
index 0000000..09ef098
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/ConfigurationFileResolver.java
@@ -0,0 +1,32 @@
+/*
+ * 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.messaging.config;
+
+import java.io.InputStream;
+import java.util.List;
+
+/**
+ * @exclude
+ */
+public interface ConfigurationFileResolver
+{
+    InputStream getConfigurationFile(String path);
+    InputStream getIncludedFile(String path);
+    void popIncludedFile();
+
+    List getFiles(String dir);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/ConfigurationParser.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/ConfigurationParser.java b/modules/common/src/flex/messaging/config/ConfigurationParser.java
new file mode 100755
index 0000000..90ae9c6
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/ConfigurationParser.java
@@ -0,0 +1,31 @@
+/*
+ * 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.messaging.config;
+
+/**
+ * Configuration parser for Flex Data Services. The parser reads in
+ * a configuration file and populates a ServicesConfiguration instance.
+ *
+ * @author pfarland
+ * @exclude
+ */
+public interface ConfigurationParser
+{
+    void parse(String path, ConfigurationFileResolver fileResolver, ServicesConfiguration config);
+
+    void reportTokens();
+}


[32/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/util/DatabaseInitializer.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/util/DatabaseInitializer.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/util/DatabaseInitializer.java
new file mode 100755
index 0000000..2d3dc82
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/util/DatabaseInitializer.java
@@ -0,0 +1,304 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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.
+ */
+
+ /*
+  * This file has been modified by Adobe (Adobe Systems Incorporated).
+  * Date: Apr 10, 2010
+  * Reason: Migrated the DB used for samples-spring web app to HSQL
+  * 
+  * Date: Oct 7, 2010
+  * Reason(s): Fixed the following issues:
+  * BLZ-573: Cannot create a new company in Company Manager Sample in Spring BlazeDS Integration Test Drive
+  * BLZ-574: Error in creating new contact in insync05 sample in Spring BlazeDS Integration test drive
+  */
+ 
+package org.springframework.flex.samples.util;
+
+import javax.sql.DataSource;
+
+import org.springframework.jdbc.core.JdbcTemplate;
+
+/**
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public class DatabaseInitializer {
+
+    private final JdbcTemplate template;
+
+    public DatabaseInitializer(DataSource ds) {
+        this.template = new JdbcTemplate(ds);
+        createTableProduct();
+        insertProducts();
+        createTableContact();
+        insertContacts();
+        createTableIndustry();
+        insertIndustries();
+        createTableCompany();
+        insertCompanies();
+        createTableAccount();
+        insertAccounts();
+    }
+
+    public void createTableContact() {
+        String sql = "CREATE TABLE CONTACT (" + "ID INT IDENTITY PRIMARY KEY, " + "FIRST_NAME VARCHAR(50), "
+            + "LAST_NAME VARCHAR(50), " + "ADDRESS VARCHAR(50), " + "CITY VARCHAR(50), " + "STATE VARCHAR(20), " + "ZIP VARCHAR(20), "
+            + "PHONE VARCHAR(50), " + "EMAIL VARCHAR(50), " + "DOB DATE)";
+        this.template.execute(sql);
+    }
+
+    public void createTableCompany() {
+        String sql = "CREATE TABLE COMPANY (" + "ID INT IDENTITY PRIMARY KEY, " + "NAME VARCHAR(50), " + "ADDRESS VARCHAR(50), "
+            + "CITY VARCHAR(50), " + "STATE VARCHAR(20), " + "ZIP VARCHAR(20), " + "PHONE VARCHAR(50), " + "INDUSTRY_ID INT)";
+        this.template.execute(sql);
+    }
+
+    public void createTableIndustry() {
+        String sql = "CREATE TABLE INDUSTRY (" + "ID INT IDENTITY PRIMARY KEY, " + "NAME VARCHAR(50))";
+        this.template.execute(sql);
+    }
+
+    public void createTableProduct() {
+        String sql = "CREATE TABLE PRODUCT (" + "ID INT IDENTITY PRIMARY KEY, " + "NAME VARCHAR(50), " + "CATEGORY VARCHAR(50), "
+            + "DESCRIPTION LONGVARCHAR, " + "IMAGE VARCHAR(255), " + "PRICE DOUBLE, " + "QTY INT)";
+        this.template.execute(sql);
+    }
+
+    public void createTableAccount() {
+        String sql = "CREATE TABLE ACCOUNT (" + "ID INT IDENTITY PRIMARY KEY, " + "NAME VARCHAR(50)," + "TYPE INT,"
+            + "INDUSTRY INT," + "OWNER INT," + "PHONE VARCHAR(30)," + "FAX VARCHAR(30)," + "TICKER VARCHAR(10)," + "OWNERSHIP VARCHAR(20),"
+            + "NUMBER_EMPLOYEES INT," + "ANNUAL_REVENUE DOUBLE," + "PRIORITY INT," + "RATING INT," + "ADDRESS1 VARCHAR(50),"
+            + "ADDRESS2 VARCHAR(50)," + "CITY VARCHAR(50)," + "STATE VARCHAR(50)," + "ZIP VARCHAR(20)," + "URL VARCHAR(50)," + "NOTES LONGVARCHAR,"
+            + "CURRENT_YEAR_RESULTS DOUBLE," + "LAST_YEAR_RESULTS DOUBLE)";
+        this.template.execute(sql);
+    }
+
+    public void insertContacts() {
+        int rowCount = this.template.queryForInt("SELECT COUNT(*) FROM CONTACT");
+        if (rowCount > 0) {
+            return;
+        }
+        String sql = "INSERT INTO CONTACT (FIRST_NAME, LAST_NAME, ADDRESS, CITY, STATE, ZIP, PHONE, EMAIL) VALUES (?,?,?,?,?,?,?,?)";
+        this.template.update(sql, new Object[] { "Christophe", "Coenraets", "275 Grove St", "Newton", "MA", "02476", "617-219-2000",
+            "ccoenrae@adobe.com" });
+        this.template.update(sql, new Object[] { "John", "Smith", "1 Main st", "Boston", "MA", "01744", "617-219-2001", "jsmith@mail.com" });
+        this.template.update(sql, new Object[] { "Lisa", "Taylor", "501 Townsend st", "San Francisco", "CA", "", "415-534-7865", "ltaylor@mail.com" });
+        this.template.update(sql, new Object[] { "Noah", "Jones", "1200 5th Avenue ", "New York", "NY", "", "212-764-2345", "njones@mail.com" });
+        this.template.update(sql, new Object[] { "Bill", "Johnson", "1345 6th street", "Chicago", "IL", "", "", "bjohnson@mail.com" });
+        this.template.update(sql, new Object[] { "Chloe", "Rodriguez", "34 Elm street", "Dallas", "TX", "", "415-534-7865", "crodriguez@mail.com" });
+        this.template.update(sql, new Object[] { "Jorge", "Espinosa", "23 Putnam Avenue", "Seattle", "WA", "", "", "jespinosa@mail.com" });
+        this.template.update(sql, new Object[] { "Amy", "King", "11 Summer st", "Miami", "FL", "", "", "aking@mail.com" });
+        this.template.update(sql, new Object[] { "Boris", "Jefferson", "222 Spring st", "Denver", "CO", "", "415-534-7865", "bjefferson@mail.com" });
+        this.template.update(sql, new Object[] { "Linda", "Madison", "564 Winter st", "Washington", "DC", "", "", "lmadison@mail.com" });
+    }
+
+    public void insertCompanies() {
+        int rowCount = this.template.queryForInt("SELECT COUNT(*) FROM COMPANY");
+        if (rowCount > 0) {
+            return;
+        }
+        String sql = "INSERT INTO COMPANY (NAME, ADDRESS, CITY, STATE, ZIP, PHONE, INDUSTRY_ID) VALUES (?,?,?,?,?,?,?)";
+        this.template.update(sql, new Object[] { "Adobe", "", "San Jose", "CA", "", "408", 1 });
+        this.template.update(sql, new Object[] { "SpringSource", "", "New York", "NY", "", "212", 2 });
+        this.template.update(sql, new Object[] { "Allaire", "", "Cambridge", "MA", "", "212", 3 });
+        this.template.update(sql, new Object[] { "Acme", "", "Denver", "CO", "", "212", 4 });
+        this.template.update(sql, new Object[] { "Macromedia", "", "San Francisco", "CA", "", "212", 1 });
+        this.template.update(sql, new Object[] { "Alpha Corp", "", "Chicago", "IL", "", "", 1 });
+    }
+
+    public void insertIndustries() {
+        int rowCount = this.template.queryForInt("SELECT COUNT(*) FROM INDUSTRY");
+        if (rowCount > 0) {
+            return;
+        }
+        String sql = "INSERT INTO INDUSTRY (NAME) VALUES (?)";
+        this.template.update(sql, new Object[] { "Telecommunication" });
+        this.template.update(sql, new Object[] { "Government" });
+        this.template.update(sql, new Object[] { "Financial Services" });
+        this.template.update(sql, new Object[] { "Life Sciences" });
+        this.template.update(sql, new Object[] { "Manufacturing" });
+        this.template.update(sql, new Object[] { "Education" });
+    }
+
+    public void insertProducts() {
+        int rowCount = this.template.queryForInt("SELECT COUNT(*) FROM PRODUCT");
+        if (rowCount > 0) {
+            return;
+        }
+        String sql = "INSERT INTO PRODUCT (NAME, CATEGORY, IMAGE, PRICE, DESCRIPTION, QTY) VALUES (?,?,?,?,?,?)";
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 6010",
+                "6000",
+                "Nokia_6010.gif",
+                99.0E0,
+                "Easy to use without sacrificing style, the Nokia 6010 phone offers functional voice communication supported by text messaging, multimedia messaging, mobile internet, games and more.",
+                21 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 3100 Blue",
+                "9000",
+                "Nokia_3100_blue.gif",
+                109.0E0,
+                "Light up the night with a glow-in-the-dark cover - when it is charged with light you can easily find your phone in the dark. When you get a call, the Nokia 3100 phone flashes in tune with your ringing tone. And when you snap on a Nokia Xpress-on gaming cover, you will get luminescent light effects in time to the gaming action.",
+                99 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 3100 Pink",
+                "3000",
+                "Nokia_3100_pink.gif",
+                139.0E0,
+                "Light up the night with a glow-in-the-dark cover - when it is charged with light you can easily find your phone in the dark. When you get a call, the Nokia 3100 phone flashes in tune with your ringing tone. And when you snap on a Nokia Xpress-on gaming cover, you will get luminescent light effects in time to the gaming action.",
+                30 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 3120",
+                "3000",
+                "Nokia_3120.gif",
+                159.99E0,
+                "Designed for both business and pleasure, the elegant Nokia 3120 phone offers a pleasing mix of features. Enclosed within its chic, compact body, you will discover the benefits of tri-band compatibility, a color screen, MMS, XHTML browsing, cheerful screensavers, and much more.",
+                10 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 3220",
+                "3000",
+                "Nokia_3220.gif",
+                199.0E0,
+                "The Nokia 3220 phone is a fresh new cut on some familiar ideas - animate your MMS messages with cute characters, see the music with lights that flash in time with your ringing tone, download wallpapers and screensavers with matching color schemes for the interface.",
+                20 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 3650",
+                "3000",
+                "Nokia_3650.gif",
+                200.0E0,
+                "Messaging is more personal, versatile and fun with the Nokia 3650 camera phone.  Capture experiences as soon as you see them and send the photos you take to you friends and family.",
+                11 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 6820",
+                "6000",
+                "Nokia_6820.gif",
+                299.99E0,
+                "Messaging just got a whole lot smarter. The Nokia 6820 messaging device puts the tools you need for rich communication - full messaging keyboard, digital camera, mobile email, MMS, SMS, and Instant Messaging - right at your fingertips, in a small, sleek device.",
+                8 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 6670",
+                "6000",
+                "Nokia_6670.gif",
+                319.99E0,
+                "Classic business tools meet your creative streak in the Nokia 6670 imaging smartphone. It has a Netfront Web browser with PDF support, document viewer applications for email attachments, a direct printing application, and a megapixel still camera that also shoots up to 10 minutes of video.",
+                2 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 6620",
+                "6000",
+                "Nokia_6620.gif",
+                329.99E0,
+                "Shoot a basket. Shoot a movie. Video phones from Nokia... the perfect way to save and share life\u2019s playful moments. Feel connected.",
+                10 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 3230 Silver",
+                "3000",
+                "Nokia_3230_black.gif",
+                500.0E0,
+                "Get creative with the Nokia 3230 smartphone. Create your own ringing tones, print your mobile images, play multiplayer games over a wireless Bluetooth connection, and browse HTML and xHTML Web pages. ",
+                10 });
+        this.template.update(sql,
+            new Object[] { "Nokia 6680", "6000", "Nokia_6680.gif", 222.0E0, "The Nokia 6680 is an imaging smartphone that", 36 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 6630",
+                "6000",
+                "Nokia_6630.gif",
+                379.0E0,
+                "The Nokia 6630 imaging smartphone is a 1.3 megapixel digital imaging device (1.3 megapixel camera sensor, effective resolution 1.23 megapixels for image capture, image size 1280 x 960 pixels});.",
+                8 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 7610 Black",
+                "7000",
+                "Nokia_7610_black.gif",
+                450.0E0,
+                "The Nokia 7610 imaging phone with its sleek, compact design stands out in any crowd. Cut a cleaner profile with a megapixel camera and 4x digital zoom. Quality prints are all the proof you need of your cutting edge savvy.",
+                20 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 7610 White",
+                "7000",
+                "Nokia_7610_white.gif",
+                399.99E0,
+                "The Nokia 7610 imaging phone with its sleek, compact design stands out in any crowd. Cut a cleaner profile with a megapixel camera and 4x digital zoom. Quality prints are all the proof you need of your cutting edge savvy.",
+                7 });
+        this.template.update(sql, new Object[] { "Nokia 6680", "6000", "Nokia_6680.gif", 219.0E0, "The Nokia 6680 is an imaging smartphone.", 15 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 9300",
+                "9000",
+                "Nokia_9300_close.gif",
+                599.0E0,
+                "The Nokia 9300 combines popular voice communication features with important productivity applications in one well-appointed device. Now the tools you need to stay in touch and on top of schedules, email, news, and messages are conveniently at your fingertips.",
+                26 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia 9500",
+                "9000",
+                "Nokia_9500_close.gif",
+                799.99E0,
+                "Fast data connectivity with Wireless LAN. Browse the Internet in full color, on a wide, easy-to-view screen. Work with office documents not just email with attachments and memos, but presentations and databases too.",
+                54 });
+        this.template.update(
+            sql,
+            new Object[] {
+                "Nokia N90",
+                "9000",
+                "Nokia_N90.gif",
+                499.0E0,
+                "Twist and shoot. It is a pro-photo taker. A personal video-maker. Complete with Carl Zeiss Optics for crisp, bright images you can view, edit, print and share. Meet the Nokia N90.",
+                12 });
+    }
+
+    public void insertAccounts() {
+        int rowCount = this.template.queryForInt("SELECT COUNT(*) FROM ACCOUNT");
+        if (rowCount > 0) {
+            return;
+        }
+        String sql = "INSERT INTO ACCOUNT (NAME, ADDRESS1, CITY, STATE, ZIP, PHONE) VALUES (?,?,?,?,?,?)";
+        this.template.update(sql, new Object[] { "Adobe", "", "San Jose", "CA", "", "408" });
+        this.template.update(sql, new Object[] { "SpringSource", "", "New York", "NY", "", "212" });
+        this.template.update(sql, new Object[] { "Allaire", "", "Cambridge", "MA", "", "212" });
+        this.template.update(sql, new Object[] { "Acme", "", "Denver", "CO", "", "212" });
+        this.template.update(sql, new Object[] { "Macromedia", "", "San Francisco", "CA", "", "212" });
+        this.template.update(sql, new Object[] { "Alpha Corp", "", "Chicago", "IL", "", "" });
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/web.xml b/apps/samples-spring/WEB-INF/web.xml
new file mode 100755
index 0000000..5d32f39
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/web.xml
@@ -0,0 +1,87 @@
+<?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.
+
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
+
+    <display-name>Spring BlazeDS Integration Samples</display-name>
+
+    <context-param>
+        <param-name>contextConfigLocation</param-name>
+        <param-value>
+                /WEB-INF/spring/*-config.xml
+        </param-value>
+    </context-param>
+	
+    <filter>
+        <filter-name>springSecurityFilterChain</filter-name>
+        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>springSecurityFilterChain</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <listener>
+        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+    </listener>
+	
+    <listener>
+        <listener-class>flex.messaging.HttpFlexSession</listener-class>
+    </listener>
+
+    <servlet>
+        <servlet-name>flex</servlet-name>
+        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <!-- Add RDS servlets
+    <servlet>
+        <servlet-name>RDSDispatchServlet</servlet-name>
+        <display-name>RDSDispatchServlet</display-name>
+        <servlet-class>flex.rds.server.servlet.FrontEndServlet</servlet-class>
+        <init-param>
+            <param-name>useAppserverSecurity</param-name>
+            <param-value>true</param-value>
+        </init-param>
+        <init-param>
+            <param-name>messageBrokerId</param-name>
+            <param-value>_messageBroker</param-value>
+        </init-param>
+        <load-on-startup>10</load-on-startup>
+    </servlet>
+
+    <servlet-mapping id="RDS_DISPATCH_MAPPING">
+        <servlet-name>RDSDispatchServlet</servlet-name>
+        <url-pattern>/CFIDE/main/ide.cfm</url-pattern>
+    </servlet-mapping> 
+    End Add RDS servlets -->
+
+    <servlet-mapping>
+        <servlet-name>flex</servlet-name>
+        <url-pattern>/messagebroker/*</url-pattern>
+    </servlet-mapping>
+
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+    </welcome-file-list>
+</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/build.xml b/apps/samples-spring/build.xml
new file mode 100755
index 0000000..926dfb8
--- /dev/null
+++ b/apps/samples-spring/build.xml
@@ -0,0 +1,168 @@
+<?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-spring.war/build.xml" default="main" basedir="../..">
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="dist.dir" value="${basedir}/dist"/>
+    <property name="src.dir" value="${samples-spring.war}/WEB-INF/src"/>
+    <property name="classes.dir" value="${samples-spring.war}/WEB-INF/classes"/>
+    <property name="context.root" value="samples-spring" />
+    
+    <path id="classpath">
+        <fileset dir="${samples-spring.war}/WEB-INF/lib" includes="**/*.jar"/>        
+        <pathelement location="${servlet.jar}"/>
+    </path>
+
+    <target name="main" depends="clean,samples"/>
+    <target name="samples" depends="prepare,copy-resources,compile"/>
+
+    <target name="prepare">
+        <mkdir dir="${samples-spring.war}/WEB-INF/lib"/>
+        <mkdir dir="${samples-spring.war}/WEB-INF/classes"/>
+    </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 to the lib directory -->
+        <copy todir="${samples-spring.war}/WEB-INF/lib">
+            <fileset dir="${basedir}/lib" includes="${webapp.lib}" />
+            <fileset dir="${basedir}/lib/spring" includes="**/*" />
+            <fileset dir="${basedir}/lib/aspectj" includes="**/*" />
+            <fileset file="${hsqldb.jar}" />
+        </copy>
+
+        <!-- copy to sampledb directory -->
+        <copy todir="${basedir}/sampledb">
+            <fileset file="${hsqldb.jar}" />
+        </copy>
+
+        <!-- copy to the classes directory -->
+        <copy todir="${samples-spring.war}/WEB-INF/classes">
+            <fileset dir="${samples-spring.war}/WEB-INF/src">
+                <include name="**/*.xml"/>
+            </fileset>
+            <fileset dir="${basedir}/lib" includes="${webapp.classes}"/>
+        </copy>
+        
+        <!-- create version.properties -->
+        <propertyfile file="${samples-spring.war}/WEB-INF/flex/version.properties">
+            <entry key="build" value="${manifest.Implementation-Version}.${build.number}"/>
+            <entry key="minimumSDKVersion" value="${min.sdk.version}"/>
+        </propertyfile>
+
+    </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="compile-swfs">
+        <property name="samples.src.dir" value="${samples-spring.war}/WEB-INF/flex-src" />
+        <ant antfile="${samples.src.dir}/chat/build.xml" />
+        <ant antfile="${samples.src.dir}/collaboration/build.xml" />
+        <ant antfile="${samples.src.dir}/companymgr/build.xml" />
+        <ant antfile="${samples.src.dir}/feedstarter/build.xml" />
+        <ant antfile="${samples.src.dir}/insync01/build.xml" />
+        <ant antfile="${samples.src.dir}/insync02/build.xml" />
+        <ant antfile="${samples.src.dir}/insync03/build.xml" />
+        <ant antfile="${samples.src.dir}/insync04/build.xml" />
+        <ant antfile="${samples.src.dir}/insync05/build.xml" />
+        <ant antfile="${samples.src.dir}/insync06/build.xml" />
+        <ant antfile="${samples.src.dir}/simplepush/build.xml" />
+        <ant antfile="${samples.src.dir}/spring-blazeds-101/build.xml" />
+        <ant antfile="${samples.src.dir}/spring-blazeds-security-101/build.xml" />
+        <ant antfile="${samples.src.dir}/traderdesktop/build.xml" />
+    </target>
+
+    <target name="package" depends="compile-swfs" description=" Creates distribution war file">
+
+        <mkdir dir="${dist.dir}"/>
+
+        <!-- 
+        we don't want flex source naked in WEB-INF as that would lead to overlapping eclipse projects
+        instead, zip it up and then put it in the war
+         -->
+        <zip destfile="${samples-spring.war}/WEB-INF/flex-src/flex-src.zip"  
+            comment="${manifest.Implementation-Title} ${manifest.Implementation-Version}.${label} Spring Integration Samples Flex Source Code">
+            <fileset dir="${samples-spring.war}/WEB-INF/flex-src" 
+                excludes="**/build*.xml,flex-src.zip"/>
+        </zip>
+
+        <war file="${dist.dir}/samples-spring.war"
+            webxml="${samples-spring.war}/WEB-INF/web.xml">
+            <manifest>
+                <attribute name="Sealed" value="${manifest.sealed}"/>
+                <attribute name="Implementation-Title" value="${manifest.Implementation-Title} - Spring Integration Samples Application"/>
+                <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}"/>
+                <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/>
+            </manifest> 
+            <fileset dir="${samples-spring.war}" >
+                <exclude name="**/**/build*.xml" />
+                <exclude name="**/generated/**/*"/>
+                <exclude name="WEB-INF/jsp/**/*" />
+                <exclude name="WEB-INF/sessions/**/*" />
+                <exclude name="WEB-INF/flex-src/**/*" />
+                <!-- This is included in the war task already -->
+                <exclude name="WEB-INF/web.xml" />
+             </fileset>
+             <fileset dir="${samples-spring.war}" includes="WEB-INF/flex-src/flex-src.zip" />
+        </war>
+
+        <copy todir="${dist.dir}/sampledb">
+            <fileset dir="${basedir}/sampledb" />
+            <fileset file="${hsqldb.jar}" />
+        </copy>
+
+    </target>
+
+    <target name="clean" description="--> Removes jars and classes">
+        <delete quiet="true" includeEmptyDirs="true">
+            <fileset dir="${samples-spring.war}/WEB-INF/lib" includes="**/*"/>
+            <fileset dir="${samples-spring.war}/WEB-INF/flex/jars" includes="**/*"/>
+            <fileset dir="${samples-spring.war}/WEB-INF/flex/locale" includes="**/*"/>
+            <fileset dir="${samples-spring.war}/WEB-INF/flex/libs" includes="**/*"/>
+            <fileset dir="${classes.dir}" includes="**/*.class"/>
+            <fileset dir="${basedir}/sampledb" includes="${hsqldb.jar}"/>
+            <fileset file="${dist.dir}/samples-spring.war"/>
+            <fileset file="${samples-spring.war}/WEB-INF/flex-src/flex-src.zip"/>
+            <fileset dir="${samples-spring.war}/sqladmin"/>            
+            <fileset dir="${samples-spring.war}/jmschat"/>
+        </delete>
+    </target>
+
+    <target name="generated-clean">
+        <delete includeEmptyDirs="true" quiet="true">
+            <fileset dir="${samples-spring.war}" includes="**/generated/*" />
+        </delete>
+        <delete includeEmptyDirs="true" quiet="true">
+            <fileset dir="${samples-spring.war}" includes="**/generated" />
+        </delete>
+    </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/index.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/index.html b/apps/samples-spring/index.html
new file mode 100755
index 0000000..a86cafc
--- /dev/null
+++ b/apps/samples-spring/index.html
@@ -0,0 +1,330 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>Spring BlazeDS Integration Test Drive</title>
+<link href="main.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+
+<h1>Spring  BlazeDS Integration Test Drive</h1>
+<p>The Spring BlazeDS Integration Test Drive  is a set of samples  that gets you   up and running  Flex with BlazeDS and Spring in minutes.</p>
+<div class="highlight">
+  
+  <h2>Samples Index</h2>
+<h4>Remoting</h4>
+<ul>
+<li><a href="#inventory">Spring BlazeDS Integration 101</a>: Demonstrates the basics.</li>
+<li><a href="#insync">inSync Contact Management Application</a>: A simple CRUD application built in eight steps.</li>
+<li><a href="#company">Company Manager</a>: Similar to the inSync application, but uses <strong>annotation-based configuration</strong>. Also demonstrates object associations.</li>
+</ul>
+<h4>Messaging</h4>
+<ul>
+<li><a href="#chat">Chat</a>: Messaging basics</li>
+<li><a href="#simplepush">Simple Data Push</a>: A simple data push example</li>
+<li><a href="#traderdesktop">Traderdesktop</a>: A more sophisticated data push example showing how to use subtopics</li>
+<li><a href="#collaboration">Collaboration</a>: A simple example showing how to use messaging to remotely drive another client's application</li>
+</ul>
+<h4>Security</h4>
+<ul>
+<li><a href="#security">Security integration 101</a></li>
+</ul>
+
+
+
+<h2>Importing the Projects in Flash  Builder 4</h2>
+<p>This step is optional: All the samples in this Test Drive run out-of-the-box. However, if you want to look at/experiment with the source code in the Flash Builder IDE while running the samples, do the following:</p>
+<ol>
+  <li>Unzip the WEB-INF/flex-src/flex-src.zip to a folder, say {FlexSrc}</li>
+  <li>In Flash Builder 4, click <strong>File &gt; Import &gt; General &gt; Existing  Projects into Workspace. </strong></li>
+  <li>Specify the above folder <strong>{FlexSrc}</strong>,  as the root directory and click  finish.<strong></strong></li>
+  </ol>
+<h2>Configuration Walkthrough</h2>
+<p><strong>web.xml</strong></p>
+  <p>In web.xml, the DispatcherServlet is configured to bootstrap  the Spring WebApplicationContext as usual. In this simple configuration, all  the <strong>/messagebroker</strong> requests are mapped to the DispatcherServlet.<br />
+  <p><strong>flex-servlet.xml</strong></p>
+  <p>In flex-servlet.xml, the BlazeDS message broker is  configured as a Spring-managed bean using the simple message-broker tag. This   bootstraps the BlazeDS message broker. <br />
+  With the message-broker in place, the Spring beans are  configured as usual, and exposed for remote access using the remoting-destination  tag. <br />
+  In this Test Drive, we split the configuration into multiple  XML files:</p>
+<ol>
+  <li>The application-specific beans are configured in <strong>spring/app-config.xml</strong> and exposed as  remoting destinations in <strong>flex-servlet.xml.</strong></li>
+  <li>The beans that provide the basic infrastructure  for the application (Database access) are configured in <strong>spring/infrastructure-config.xml</strong>. </li>
+  <li>Security is configured in <strong>spring/security-config.xml</strong>. For the purpose of this introduction, we use a basic  authentication provider. </li>
+</ol>
+<p>In your own web application, you can use a different  configuration arrangement, including single-file configuration.</p>
+</div>
+
+<h2>Remoting Samples</h2>
+
+<a name="inventory"></a>
+<div class="item">
+  <h3>Spring BlazeDS Integration 101</h3>
+  <h4>Run the sample:</h4>
+<ol>
+
+  <li>Click <a href="spring-blazeds-101/index.html">here</a> to run the application.</li>
+  <li>Click &quot;Get Data&quot;:  The DataGrid is populated with  data returned by the findAll() method of the ProductDAO Java class. </li>
+  </ol>
+<h4>Code walkthrough:</h4>
+<p>Open Main.mxml in the spring-blazeds-101 project to look at the source code of the application.</p>
+<p>Open the following files in a text editor to look at the source code for the server side  of the application: </p>
+<ul>
+  <li>{context-root}/WEB-INF/flex-servlet.xml</li>
+  <li>{context-root}/WEB-INF/spring/app-config.xml</li>
+  <li>org/springframework/flex/samples/product/ProducDAO.java</li>
+</ul>
+<p>Note that this  application uses a simplistic DAO implementation with low level JDBC code and no real abstraction. This was done intentionally to provide a bare-bones example that focuses exclusively on the Spring/BlazeDS Integration plumbing. All the other examples of this Test Drive,  use the JdbcTemplate abstraction of the Spring framework to build the data access objects.</p>
+<p>Using RemoteObject, you can directly invoke methods of Java objects  deployed in your application server, and consume the return value. The return value can be a value of a primitive data type, an object, a  collection of objects, an object graph, etc.</p>
+<p>Using the Spring BlazeDS integration, Spring beans are exposed using the remoting-destination tag. The productService bean is defined in app-config.xml and is exposed as a remoting destination in flex-servlet.xml.</p>
+<p>Java objects returned by server-side methods are deserialized into  either dynamic or typed ActionScript objects. This application doesn't have an explicit ActionScript version of the Product Java class. Product objects are therefore deserialized into dynamic objects. In InSync03 below, we start working with strongly typed model objects. </p>
+</div>
+
+<br />
+
+<a name="insync"></a>
+<div class="item">
+  <h3>InSync01: Searching Contacts</h3>
+  <h4>Run the sample:</h4>
+<ol>
+  <li>Click <a href="insync01/index.html">here</a> to run the application.</li>
+  <li>Click the Search button to retrieve all the contacts in the database.</li>
+  <li>Enter a few characters in the Search input field before clicking the Search button in order to search by name.</li>
+  </ol>
+<h4>Code walkthrough:</h4>
+<p>Open insync01.mxml in the insync01 project  to look at the source code of the application.</p>
+<p>Open the following files to look at the source code for the server side  of the application: </p>
+<ul>
+  <li>flex-servlet.xml</li>
+  <li>app-config.xml</li>
+  <li>org/springframework/flex/samples/contact/ContactDAO.java</li>
+</ul>
+</div>
+<br />
+
+<div class="item">
+  <h3>InSync02: Using the RemoteObject Events</h3>
+  <h4>Run the sample:</h4>
+  <p>Click <a href="insync02/index.html">here</a> to run the application.</p>
+<h4>Code walkthrough:</h4>
+<p>Open insync02.mxml in the insync02 project  to look at the source code of the application.</p>
+<p>This version is similar to insync01, but demonstrates how to use the ResultEvent and FaultEvent to have a finer control over RemoteObject calls.<br />
+</p>
+</div>
+<br />
+
+<div class="item">
+  <h3>InSync03: Strong Typing</h3>
+  <h4>Run the sample:</h4>
+<ol>
+  <li>Click <a href="insync03/index.html">here</a> to run the application.</li>
+  <li>Click the Search button to retrieve all the contacts in the database.</li>
+  <li>Enter a few characters in the Search input field before clicking the Search button to search by name.</li>
+  <li>Select a contact in the DataGrid.</li>
+  <li>Edit the contact in the Contact form and click &quot;Save&quot; to persist your changes.</li>
+  </ol>
+<h4>Code walkthrough:</h4>
+<p>Open insync03.mxml, Contact.as, and ContactForm.mxml in the insync03 project to look at the source code of the application.</p>
+<p>In this version, we work with strongly typed contact objects. The Contact.as class is the ActionScript representation of org.springframework.flex.samples.contact.Contact.java. The [RemoteClass(alias=&quot;org.springframework.flex.spring.samples.contact.Contact&quot;)] annotation in Contact.as is used to indicate that instances of Contact.as sent to the server should be deserialized as instances of org.springframework.flex.spring.samples.contact.Contact at the server side, and that similarly, instances of org.springframework.flex.spring.samples.contact.Contact retrieved from the server should be deserialized as instances of Contact.as.<br />
+</p>
+</div>
+<br />
+
+<div class="item">
+  <h3>InSync04: Opening Multiple Contacts</h3>
+  <h4>Run the sample:</h4>
+<ol>
+  <li>Click <a href="insync04/index.html">here</a> to run the application.</li>
+  <li>Click the Search button to retrieve all the contacts in the database.</li>
+  <li>Enter a few characters in the Search input field before clicking the Search button to search by name.</li>
+  <li>Double-click a contact in the DataGrid to open it in a separate Tab.</li>
+  <li>Edit the contact in the Contact form and click &quot;Save&quot; to persist your changes.</li>
+  </ol>
+<h4>Code walkthrough:</h4>
+<p>Open insync04.mxml in the insync04 project  to look at the source code of the application.<br />
+</p>
+</div>
+<br />
+
+<div class="item">
+  <h3>InSync05: Adding New Contacts</h3>
+  <h4>Run the sample:</h4>
+<ol>
+  <li>Click <a href="insync05/index.html">here</a> to run the application.</li>
+  <li>Click the Search button to retrieve all the contacts in the database.</li>
+  <li>Click the New Contact button.</li>
+  <li>Edit the new contact in the Contact form and click &quot;Save&quot; to create the contact.</li>
+  </ol>
+<h4>Code walkthrough:</h4>
+<p>Open insync05.mxml and ContactForm.mxml in the insync05 project to look at the source code of the application.</p>
+<p>This version enables the user of the application to add contacts. In ContactForm, we remotely invoke the create() method of ContactDAO when dealing with a new contact, and the update() method when updating an existing contact.<br />
+</p>
+</div>
+<br />
+
+<div class="item">
+  <h3>InSync06: Adding Event Notification for &quot;Loosely Coupled&quot; UI Synchronization</h3>
+  <h4>Run the sample:</h4>
+<ol>
+  <li>Click <a href="insync06/index.html">here</a> to run the application.</li>
+  <li>Click the Search button to retrieve all the contacts in the database.</li>
+  <li>Enter a few characters in the Search input field before clicking the Search button to search by name.</li>
+  <li>Double-click a contact in the DataGrid to open it in a separate Tab.</li>
+  <li>Modify the first name or last name of the contact and click &quot;Save&quot;. Notice that the DataGrid is updated to reflect your changes.</li>
+  <li>Add a new contact and click &quot;Save&quot; to create the contact. Notice that the contact appears in the DataGrid.</li>
+  <li>Delete a contact and notice that the contact is removed from the DataGrid.</li>
+  </ol>
+<h4>Code walkthrough:</h4>
+<p>Open insync06.mxml, ContactForm.mxml, and ContactEvent.as in the insync06 project  to look at the source code of the application.</p>
+<p>In this version, ContactForm dispatches events when a contact has been created, updated, or deleted. Other components of the application can register as listeners to these events to perform a specific task when a contact is created, updated or deleted. In this case, the main application registers as a listener to these events and refreshes the contact DataGrid to make sure it reflects the changes made in ContactForm.<br />
+</p>
+</div>
+<br />
+
+<a name="company"></a>
+<div class="item">
+  <h3>Company Manager</h3>
+  <h4>Run the sample:</h4>
+<ol>
+  <li>Click <a href="companymgr/index.html">here</a> to run the application.</li>
+  <li>Click the Search button to retrieve all the contacts in the database.</li>
+  <li>Enter a few characters in the Search input field before clicking the Search button to search by name.</li>
+  </ol>
+<h4>Code walkthrough:</h4>
+<p>Open companymgr.mxml, Company.as, Industry.as, and CompanyForm.mxml in the companymgr project to look at the source code of the application.</p>
+<p>Open the following files to look at the source code for the server side  of the application: </p>
+<ul>
+  <li>org/springframework/flex/spring/samples/company/CompanyDAO.java</li>
+  <li>org/springframework/flex/spring/samples/company/IndustryDAO.java</li>
+</ul>
+<p>The CompanyDAO and IndustryDAO beans are not defined in app-config.xml nor exposed in flex-servlet.xml. They are configured using annotations (<code>@Service</code>, 
+  <code>@RemotingDestination</code>, <code>@Autowired</code>, <code>@RemotingInclude</code>, and <code>@RemotingExclude</code>) in the class definition. This application is similar to inSync, but demonstrates object associations: the Company class has a property of type Industry.<br />
+</p>
+</div>
+<br />
+
+<h2>Messaging Samples</h2>
+
+<a name="chat"></a>
+<div class="item">
+  <h3>Chat</h3>
+  <h4>Run the sample:</h4>
+<ol>
+  <li>Click <a href="chat/index.html">here</a> to run the application.</li>
+  <li>Access the same URL in another browser window to open a second instance of the chat application.</li>
+  <li>Type a message in one of the chat clients and click &quot;Send&quot;: the message appears in the two chat clients.</li>
+</ol>
+
+<h4>Code walkthrough:</h4>
+<p>Open chat.mxml in the chat project to look at the source code of the application. The Message Service manages a set of destinations that Flex clients can publish and subscribe to. Flex provides two components, Producer and Consumer, that you use to  publish and subscribe to a destination. To subscribe to a destination, you use the <code>subscribe()</code> method of the Consumer class. When a message is published to a destination that you subscribed to, the <code>message</code> event is triggered on the Consumer.</p>
+
+<p>Open flex-servlet.xml to look at the message service configuration. The message service is configured using  <code>&lt;flex:message-service /&gt;</code> inside <code>&lt;flex:message-broker /&gt;</code>. The &quot;chat&quot; destination is configured using <code>&lt;flex:message-destination id=&quot;chat&quot; /&gt;</code></p>
+</div>
+<br />
+
+<a name="simplepush"></a>
+<div class="item">
+  <h3>Simple Data Push</h3>
+  <h4>Run the sample</h4>
+  <p>This example demonstrates how to use the message service to push data from the server to the client. At the server-side, a Java component publishes simulated real time values to a message destination. The Flex client subscribes to that destination and displays the values in real time. </p>
+  <ol>
+
+  <li>To start the feed at the server-side, run the <a href="feedstarter/index.html">Feed Starter application</a> and start the "Simple Feed".</li>
+  <li>Click <a href="simplepush/index.html">here</a> to run the client application</a>.</li>
+  <li>Click the Subscribe button. Pushed values appear in the text field. You can click the Unsubscribe button to unsubscribe from the destination. </li>
+  <li>To stop the feed when you are done experimenting with the application, access the <a href="feedstarter/index.html">Feed Starter application</a> and stop the "Simple Feed".</li>
+  </ol>
+  <h4>Code walk through</h4>
+  <p>Open simplepush.mxml in the simplepush project to look at the source code of the application.</p>
+  <p>Open the following files to look at the source code for the server side  of the application: </p>
+  <ul>
+    <li>org/springframework/flex/spring/samples/simplefeed/SimpleFeed.Java</li>
+    <li>flex-servlet.xml</li>
+  </ul>
+  <p>In SimpleFeed.java, the MessageTemplate class is used to publish messages to the "simple-feed" destination.</p>
+In flex-servlet.xml, the &quot;simple-feed&quot; destination is configured using <code>&lt;flex:message-destination id=&quot;simple-feed&quot; /&gt;</code></div>
+<br />
+
+<a name="traderdesktop"></a>
+<div class="item">
+  <h3>Traderdesktop</h3>
+  <h4>Run the sample</h4>
+  <p>Traderdesktop is a more sophisticated data push example showing how to  use subtopics to selectively subscribe to specific messages. In this case, the user can subscribe to updates for specific stocks only. At the server side, a Java component publishes simulated market data to a messaging destination.</p>
+  <ol>
+
+  <li>To start the feed  at the server-side, run the <a href="feedstarter/index.html">Feed Starter application</a> and start the "Market Feed".</li>
+  <li>Click <a href="traderdesktop/index.html">here</a> to run the client application</a>.</li>
+  <li>To stop the feed when you are done experimenting with the application, access the <a href="feedstarter/index.html">Feed Starter application</a> and stop the "Market Feed".</li>
+  </ol>
+  <h4>Code walk through</h4>
+  <p>Open traderdesktop.mxml in the traderdesktop project to look at the source code of the application.</p>
+  <p>Open the following files to look at the source code for the server side  of the application: </p>
+  <ul>
+    <li>org/springframework/flex/spring/samples/marketfeed/MarketFeed.Java</li>
+    <li>flex-servlet.xml. The market-feed destination is configured using <code>&lt;flex:message-destination id=&quot;market-feed&quot; allow-subtopics=&quot;true&quot; subtopic-separator=&quot;.&quot; /&gt;</code></li>
+  </ul>
+</div>
+<br />
+
+<a name="collaboration"></a>
+<div class="item">
+  <h3>Collaboration</h3>
+  <h4>Run the sample:</h4>
+<ol>
+  <li>Click <a href="collaboration/index.html">here</a> to run the application.</li>
+  <li>Access the same URL in another browser window to open a second instance of the chat application.</li>
+  <li>Enter some data in one browser and notice that the data appears in the other browser as well.</li>
+  <li>Select another tab in the accordion in one broswer, and notice that the other client's user interface is synchronized accordingly.</li>
+</ol>
+
+<h4>Code walkthrough:</h4>
+<p>Open collaboration.mxml in the collaboration project to look at the source code of the application.</p>
+</div>
+<br />
+
+
+<h2>Security Samples</h2>
+
+<a name="security"></a>
+<div class="item">
+  <h3>Security Integration 101</h3>
+  <h4>Run the sample:</h4>
+<ol>
+  <li>Click <a href="spring-blazeds-security-101/index.html">here</a> to run the application.</li>
+  <li>Click &quot;Get Data&quot; without logging in first: you  get an &quot;Access Denied&quot; exception.</li>
+  <li>Log in (use UserId: john / Password: john), and click &quot;Get Data&quot; again: you should now get the data.</li>
+  <li>Click &quot;Logout&quot; and &quot;Get Data&quot; again: you get the &quot;Access Denied&quot; exception again.</li>
+  <li>If you are already authenticated, you don't have to use the ChannelSet login. For example, access <a href="login.jsp">login.jsp</a>, and logon using john / john. <a href="spring-blazeds-security-101/index.html">Come back to the application</a> and click Get Data without logging in inside the application: you should get the data.</li>
+</ol>
+
+<h4>Code walkthrough:</h4>
+<p>Open Main.mxml in the spring-blazeds-security-101 project to look at the source code of the application.</p>
+<p>Open the following files in a text editor to look at the the server side configuration: </p>
+<ul>
+  <li>app-config.xml</li>
+  <li>security-config.xml</li>  
+</ul>
+
+<p>In app-config.xml, note that the &quot;find*&quot; methods of securedProductService are protected: they can only be accessed by members of ROLE_USER. A basic authentication provider is defined in security-config.xml.<br />
+</p>
+</div>
+
+<br />
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/login.jsp
----------------------------------------------------------------------
diff --git a/apps/samples-spring/login.jsp b/apps/samples-spring/login.jsp
new file mode 100755
index 0000000..82f9fa8
--- /dev/null
+++ b/apps/samples-spring/login.jsp
@@ -0,0 +1,64 @@
+<!--
+  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.
+-->
+<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt' %>
+<%@ page import="org.springframework.security.web.authentication.AbstractProcessingFilter" %>
+<%@ page import="org.springframework.security.web.authentication.AuthenticationProcessingFilter" %>
+<%@ page import="org.springframework.security.core.AuthenticationException" %>
+
+
+
+
+<!-- Not used unless you declare a <form-login login-page="/login.jsp"/> element -->
+
+<html>
+  <head>
+    <title>CUSTOM SPRING SECURITY LOGIN</title>
+  </head>
+
+  <body onload="document.f.j_username.focus();">
+    <h1>CUSTOM SPRING SECURITY LOGIN</h1>
+
+	<P>Valid users:
+	<P>
+	<P>username <b>john</b>, password <b>john</b>
+	<br>username <b>guest</b>, password <b>guest</b>
+	<p>
+
+    <%-- this form-login-page form is also used as the
+         form-error-page to ask for a login again.
+         --%>
+    <c:if test="${not empty param.login_error}">
+      <font color="red">
+        Your login attempt was not successful, try again.<br/><br/>
+        Reason: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/>.
+      </font>
+    </c:if>
+
+    <form name="f" action="<c:url value='j_spring_security_check'/>" method="POST">
+      <table>
+        <tr><td>User:</td><td><input type='text' name='j_username' value='<c:if test="${not empty param.login_error}"><c:out value="${SPRING_SECURITY_LAST_USERNAME}"/></c:if>'/></td></tr>
+        <tr><td>Password:</td><td><input type='password' name='j_password'></td></tr>
+        <tr><td><input type="checkbox" name="_spring_security_remember_me"></td><td>Don't ask for my password for two weeks</td></tr>
+
+        <tr><td colspan='2'><input name="submit" type="submit"></td></tr>
+        <tr><td colspan='2'><input name="reset" type="reset"></td></tr>
+      </table>
+
+    </form>
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/main.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/main.css b/apps/samples-spring/main.css
new file mode 100755
index 0000000..7a5406f
--- /dev/null
+++ b/apps/samples-spring/main.css
@@ -0,0 +1,138 @@
+/*
+ * 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.
+ */
+body {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	margin-top: 30px;
+	margin-top: 30px;
+	margin-left: 8%;
+	margin-right: 8%;
+	font-size: 0.8em;
+	color:#444;
+	background-color:#FFFFFF;
+}
+
+h1, h2, h3 {
+	font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif;
+	font-weight: bold;
+}
+
+h1 {
+	font-weight: bold;
+	margin-top: 4px;
+	margin-bottom: 12px;
+	font-size: 2em;
+}
+
+h2 {
+	padding-top: 4px;
+	margin-bottom: 0px;
+	font-size: 1.4em;
+	color: #333333;
+	text-transform:uppercase;
+}
+
+h3 {
+	margin-top: 0px;
+	font-size: 1.3em;
+	color: #004477;
+}
+
+h4 {
+	margin-top: 20px;
+	margin-bottom: 8px;
+	font-size: 12px;
+	color: #333333;
+}
+
+.item {
+	border-bottom: 1px solid #CCCCCC;
+	padding-top: 12px;
+	padding-bottom: 12px;
+}
+
+.highlight {
+	border: 1px solid #CCCCCC;
+	padding-top:0px;
+	padding-left:10px;
+	padding-right:10px;
+	padding-bottom:20px;
+	margin-top:0px;
+	margin-bottom:20px;
+}
+
+.footer {
+	color: #666666;
+	margin-top: 20px;
+	font-size: 0.75em;
+}
+
+ul {
+	margin-top:8px;
+	margin-bottom:8px;
+}
+
+li {
+	padding-bottom:8px;
+}
+
+code {
+	color: #000099;
+	font-family: "Courier New", Courier, monospace;
+	font-size:1.1em;
+}
+
+img {
+	border: 0;
+}
+
+#col1{
+  	float:left;
+	width: 20%;
+	padding-right: 24px;
+}
+
+#col2{
+  float: left;
+  width: 55%;
+}
+
+#col3{
+	float: right;
+	width: 20%;
+	margin: 0px;
+	padding: 0px;
+}
+
+a:link {
+	color: #006699;
+	text-decoration: none;
+}
+
+a:visited {
+	text-decoration: none;
+	color: #006699;
+}
+
+a:hover {
+	text-decoration: underline;
+	color: #006699;
+}
+
+a:active {
+	text-decoration: none;
+	color: #006699;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/stocklist.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/stocklist.xml b/apps/samples-spring/stocklist.xml
new file mode 100755
index 0000000..b464290
--- /dev/null
+++ b/apps/samples-spring/stocklist.xml
@@ -0,0 +1,141 @@
+<!--
+
+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.
+
+-->
+<portfolio>
+
+	<stock>
+		<symbol>XOM</symbol>
+		<company>Exxon Mobile Corp</company>
+		<last>61.56</last>
+	</stock>
+
+	<stock>
+		<symbol>WMT</symbol>
+		<company>Wal-Mart Stores</company>
+		<last>45.62</last>
+	</stock>
+
+	<stock>
+		<symbol>GM</symbol>
+		<company>General Motors Corporation</company>
+		<last>19.8</last>
+	</stock>
+
+	<stock>
+		<symbol>CVX</symbol>
+		<company>Chevron Corp New</company>
+		<last>58.95</last>
+	</stock>
+
+	<stock>
+		<symbol>COP</symbol>
+		<company>Conocophillips</company>
+		<last>67.14</last>
+	</stock>
+
+	<stock>
+		<symbol>GE</symbol>
+		<company>General Electric Company</company>
+		<last>33.61</last>
+	</stock>
+
+	<stock>
+		<symbol>C</symbol>
+		<company>Citigroup Inc</company>
+		<last>48.18</last>
+	</stock>
+
+	<stock>
+		<symbol>AIG</symbol>
+		<company>American International Group Inc</company>
+		<last>62.92</last>
+	</stock>
+
+	<stock>
+		<symbol>GOOG</symbol>
+		<company>Google Inc</company>
+		<last>417.93</last>
+	</stock>
+
+	<stock>
+		<symbol>ADBE</symbol>
+		<company>Adobe Systems Incorporated</company>
+		<last>39.20</last>
+	</stock>
+
+	<stock>
+		<symbol>JBLU</symbol>
+		<company>JetBlue Airways Corporation</company>
+		<last>10.57</last>
+	</stock>
+
+	<stock>
+		<symbol>COKE</symbol>
+		<company>Coca-Cola Bottling Co. Consolidated</company>
+		<last>48.20</last>
+	</stock>
+
+	<stock>
+		<symbol>GENZ</symbol>
+		<company>Genzyme Corporation</company>
+		<last>61.16</last>
+	</stock>
+
+	<stock>
+		<symbol>YHOO</symbol>
+		<company>Yahoo Inc.</company>
+		<last>32.78</last>
+	</stock>
+
+	<stock>
+		<symbol>IBM</symbol>
+		<company>International Business Machines Corp.</company>
+		<last>82.34</last>
+	</stock>
+
+	<stock>
+		<symbol>BA</symbol>
+		<company>Boeing Company</company>
+		<last>83.45</last>
+	</stock>
+
+	<stock>
+		<symbol>SAP</symbol>
+		<company>SAP AG</company>
+		<last>54.63</last>
+	</stock>
+
+	<stock>
+		<symbol>MOT</symbol>
+		<company>Motorola, Inc.</company>
+		<last>21.35</last>
+	</stock>
+
+	<stock>
+		<symbol>VZ</symbol>
+		<company>Verizon Communications</company>
+		<last>33.03</last>
+	</stock>
+
+	<stock>
+		<symbol>MCD</symbol>
+		<company>McDonald's Corporation</company>
+		<last>34.57</last>
+	</stock>
+
+</portfolio>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/README.txt
----------------------------------------------------------------------
diff --git a/apps/samples/README.txt b/apps/samples/README.txt
new file mode 100755
index 0000000..16c2166
--- /dev/null
+++ b/apps/samples/README.txt
@@ -0,0 +1,5 @@
+All of the files contained in this directory and any subdirectories are 
+considered "Sample Code" under the terms of the end user license agreement 
+that accompanies this product. Please consult such end user license agreement 
+for details about your rights with respect to such files.
+

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/dashboard/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/dashboard/build.xml b/apps/samples/WEB-INF/flex-src/dashboard/build.xml
new file mode 100755
index 0000000..bdeff8c
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/dashboard/build.xml
@@ -0,0 +1,85 @@
+<?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="Collaborative Dashboard" />
+    <property name="application.file" value="dashboard" />
+    <property name="application.bin.dir" value="${samples.war}/${application.file}" />
+    <property name="application.src.dir" value="${samples.war}/WEB-INF/flex-src/${application.file}/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="results.xml"/>
+        </copy>
+        <copy todir="${application.src.dir}">
+            <fileset dir="${basedir}/frameworks/libs" includes="datavisualization.swc" />
+            <fileset dir="${basedir}/frameworks/locale/en_US" includes="datavisualization_rb.swc" />
+        </copy>
+    </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/" />
+            <fileset dir="${application.src.dir}" includes="datavisualization*.swc"/>
+        </delete>
+    </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/dashboard/src/RegionBreakdown.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/dashboard/src/RegionBreakdown.mxml b/apps/samples/WEB-INF/flex-src/dashboard/src/RegionBreakdown.mxml
new file mode 100755
index 0000000..b2f25a8
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/dashboard/src/RegionBreakdown.mxml
@@ -0,0 +1,176 @@
+<?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:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns="*">
+    <fx:Metadata>
+        [Event("regionChange")]
+    </fx:Metadata>
+    
+    <fx:Script>
+        <![CDATA[
+        import mx.charts.HitData;
+
+        public function set month(m:Object):void
+        {
+        	_month = m;
+        	this.title = "Regional Breakdown [" + _month.name + "]";
+    	}
+
+		[Bindable]
+		private var _month:Object;
+
+        private function getSliceLabel(item:Object, arg2:String, arg3:Number, arg4:Number):String
+        {
+            return item==null?"":item.name;
+        }
+
+		private var _selectedRegion:Object;
+		
+        public function get selectedRegion():Object
+        {
+            return _selectedRegion;
+        }
+        
+        public function set selectedRegion(item:Object):void
+        {
+            _selectedRegion = item;
+
+            var index:int = -1;
+            for (var i:int=0; i < _month.region.length && index == -1; i++)
+            {
+                if (_month.region[i].name == item.name)
+                    index = i;
+            }
+            //we only want to explode the selected region
+            var explodeData:Array = [];
+            explodeData[index] = 0.15;
+            pcRegion.series[0].perWedgeExplodeRadius = explodeData;
+        }
+        
+        private function regionChange(item:Object):void
+        {
+            selectedRegion = item;
+            dispatchEvent(new Event("regionChange"));
+        }
+
+        private function dataGridCurrencyFormat(item:Object, column:Object):String
+        {
+            return cf.format(item[column.dataField]);
+        }
+
+        private function formatDataTip(hitData:HitData):String
+        {
+            var name:String = hitData.item.name;
+            var revenue:Number = hitData.item.revenue;
+            return "<b>Region: "+name+"</b><br>Revenue: "+cf.format(revenue);
+        }
+
+        ]]>
+
+    </fx:Script>
+
+    <fx:Declarations>
+    	<mx:CurrencyFormatter id="cf"/>
+
+    	<mx:SeriesInterpolate id="interpolate" elementOffset="10"/>
+    </fx:Declarations>
+
+    <mx:ViewStack id="vs" width="100%" height="100%">
+    
+        <mx:VBox width="100%" height="100%"  icon="@Embed('icon_chart.png')" toolTip="View in Chart" 
+            hideEffect="Fade" showEffect="Fade">
+            <mx:PieChart id="pcRegion" dataProvider="{_month.region}" showDataTips="true" width="100%" height="100%"
+                itemClick="regionChange(event.hitData.item)"
+                dataTipFunction="formatDataTip">
+
+                <mx:series>
+                    <fx:Array>
+                        <mx:PieSeries field="revenue" nameField="name" labelPosition="callout"
+                                      labelFunction="getSliceLabel" showDataEffect="{interpolate}">
+                         <mx:fills>
+	                        <fx:Array>
+	                            <mx:RadialGradient>
+	                                <mx:entries>
+	                                    <fx:Array>
+	                                        <mx:GradientEntry color="#EF7651" ratio="0"/>
+	                                        <mx:GradientEntry color="#994C34" ratio="1"/>
+	                                    </fx:Array>
+	                                </mx:entries>
+	                            </mx:RadialGradient>
+	                            <mx:RadialGradient>
+	                                <mx:entries>
+	                                    <fx:Array>
+	                                        <mx:GradientEntry color="#E9C836" ratio="0"/>
+	                                        <mx:GradientEntry color="#AA9127" ratio="1"/>
+	                                    </fx:Array>
+	                                </mx:entries>
+	                            </mx:RadialGradient>
+	                            <mx:RadialGradient>
+	                                <mx:entries>
+	                                    <fx:Array>
+	                                        <mx:GradientEntry color="#6FB35F" ratio="0"/>
+	                                        <mx:GradientEntry color="#497B54" ratio="1"/>
+	                                    </fx:Array>
+	                                </mx:entries>
+	                            </mx:RadialGradient>
+	                            <mx:RadialGradient>
+	                                <mx:entries>
+	                                    <fx:Array>
+	                                        <mx:GradientEntry color="#A1AECF" ratio="0"/>
+	                                        <mx:GradientEntry color="#47447A" ratio="1"/>
+	                                    </fx:Array>
+	                                </mx:entries>
+	                            </mx:RadialGradient>
+	                            <mx:RadialGradient>
+	                                <mx:entries>
+	                                    <fx:Array>
+	                                        <mx:GradientEntry color="#BA9886" ratio="0"/>
+	                                        <mx:GradientEntry color="#AE775B" ratio="1"/>
+	                                    </fx:Array>
+	                                </mx:entries>
+	                            </mx:RadialGradient>
+	                        </fx:Array>
+	                    </mx:fills>
+	                    </mx:PieSeries>
+                    </fx:Array>
+                </mx:series>
+
+            </mx:PieChart>
+        </mx:VBox>
+
+        <mx:VBox width="100%" height="100%" icon="@Embed('icon_grid.png')" toolTip="View in Grid"
+            hideEffect="Fade" showEffect="Fade">
+            <mx:DataGrid dataProvider="{_month.region}" width="100%" height="100%"
+            	change="regionChange(DataGrid(event.target).selectedItem)">
+                <mx:columns>
+                    <fx:Array>
+                        <mx:DataGridColumn dataField="name" headerText="Region"/>
+                        <mx:DataGridColumn dataField="revenue" headerText="Revenue" labelFunction="dataGridCurrencyFormat" />
+                    </fx:Array>
+                </mx:columns>
+            </mx:DataGrid>
+        </mx:VBox>
+
+    </mx:ViewStack>
+
+    <mx:ControlBar>
+        <mx:ToggleButtonBar dataProvider="{vs}"/>
+    </mx:ControlBar>
+
+</mx:Panel>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/dashboard/src/RegionDetail.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/dashboard/src/RegionDetail.mxml b/apps/samples/WEB-INF/flex-src/dashboard/src/RegionDetail.mxml
new file mode 100755
index 0000000..2c01180
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/dashboard/src/RegionDetail.mxml
@@ -0,0 +1,175 @@
+<?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:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns="*"
+	title="Region Details">
+
+    <fx:Script>
+
+        <![CDATA[
+        import mx.charts.HitData;
+        import mx.controls.Alert;
+        import mx.charts.chartClasses.ChartBase;
+        
+        private var _region:String;
+
+        [Bindable]
+        public var revenueData:Array;
+
+        [Bindable]
+        public var selectedMonth:Object;
+
+        protected function monthChange(month:Object):void
+        {
+            selectedMonth = month;
+            dispatchEvent(new Event("monthChange"));
+        }
+
+        protected function currencyFormat(value:Object, arg2:Object, arg3:Object):String
+        {
+            return cf.format(value);
+        }
+
+        private function dataGridCurrencyFormat(item:Object, column:Object):String
+        {
+            return cf.format(item[column.dataField]);
+        }
+
+        private function sortByDates(obj1:Object, obj2:Object):Number
+		{
+			var n:Number = SortUtils.sortByDates(obj1, obj2, "name");
+			return n;
+		}
+
+		public function set region(r:String):void
+		{
+		    _region = r;
+			this.title = "Region Details [" + r + "]";
+		}
+		
+        private function formatDataTip(hitData:HitData):String
+        {
+            var month:String = hitData.item.name;
+            var revenue:Number = hitData.item.revenue;
+            var average:Number = hitData.item.average;
+            return "<b>Month: " + month + "</b><br>" + _region + ": " +
+              cf.format(revenue) + "<br>Average: " + cf.format(average);
+        }
+
+        ]]>
+
+    </fx:Script>
+    
+    <fx:Declarations>
+	<mx:SeriesInterpolate id="interpolate" elementOffset="10"/>
+
+    	<mx:CurrencyFormatter id="cf"/>
+    </fx:Declarations>
+
+    <mx:ViewStack id="vs" width="100%" height="100%">
+
+        <mx:VBox id="chartVBox" width="100%" height="100%" icon="@Embed('icon_chart.png')" toolTip="Chart View"
+            paddingLeft="4" paddingTop="4" paddingBottom="4" paddingRight="4">
+
+			<mx:ColumnChart dataProvider="{revenueData}" width="100%" height="100%" showDataTips="true" dataTipFunction="formatDataTip">
+	
+				<mx:horizontalAxis>
+					<mx:CategoryAxis dataProvider="{revenueData}" categoryField="name"/>
+				</mx:horizontalAxis>
+	
+				<mx:verticalAxis>
+					<mx:LinearAxis maximum="160000" labelFunction="currencyFormat"/>
+				</mx:verticalAxis>
+	
+				<mx:series>
+					<fx:Array>
+						<mx:ColumnSeries yField="revenue" showDataEffect="{interpolate}">
+							<mx:fill>
+								<mx:LinearGradient>
+									<mx:entries>
+										<fx:Array>
+											<mx:GradientEntry color="#C6D5DD" ratio="0" alpha="100"/>
+											<mx:GradientEntry color="#336699" ratio="0.1" alpha="100"/>
+											<mx:GradientEntry color="#24496D" ratio="0.9" alpha="100"/>
+											<mx:GradientEntry color="#000000" ratio="1" alpha="100"/>
+										</fx:Array>
+									</mx:entries>
+								</mx:LinearGradient>
+							</mx:fill>
+						</mx:ColumnSeries>
+	
+	
+						<mx:LineSeries yField="average" form="curve" showDataEffect="{interpolate}">
+							<mx:stroke>
+<!-- SDK4 -->
+							<mx:SolidColorStroke color="#708EA4" weight="1"/>
+<!-- SDK3							
+							<mx:Stroke color="#708EA4" weight="1"/>
+-->
+							</mx:stroke>
+
+						</mx:LineSeries>
+						
+					</fx:Array>
+				</mx:series>
+	
+				<mx:backgroundElements>
+					<fx:Array>
+<!-- SDK4 -->			
+                    <mx:GridLines gridDirection="both"> 
+<!-- SDK3 
+			        <mx:GridLines direction="both"> -->
+							<mx:verticalStroke>
+<!-- SDK4 -->
+								<mx:SolidColorStroke weight="1" color="#CCCCCC"/>
+<!-- SDK3
+								<mx:Stroke weight="1" color="#CCCCCC"/>
+-->
+							</mx:verticalStroke>
+						</mx:GridLines>
+					</fx:Array>
+				</mx:backgroundElements>
+	
+			</mx:ColumnChart>
+		</mx:VBox>
+
+        <mx:VBox width="100%" height="100%" icon="@Embed('icon_grid.png')" toolTip="Grid View" 
+            hideEffect="Fade" showEffect="Fade">
+            <mx:DataGrid dataProvider="{revenueData}" width="100%" height="100%"
+            	change="monthChange(DataGrid(event.target).selectedItem)">
+                <mx:columns>
+                    <fx:Array>
+                        <mx:DataGridColumn dataField="name" headerText="Month"
+                            sortCompareFunction="sortByDates" />
+                        <mx:DataGridColumn dataField="revenue" headerText="Total Revenue"
+                            labelFunction="dataGridCurrencyFormat" />
+                        <mx:DataGridColumn dataField="average" headerText="Average Across Regions"
+                            labelFunction="dataGridCurrencyFormat" />
+                    </fx:Array>
+                </mx:columns>
+            </mx:DataGrid>
+        </mx:VBox>
+
+	</mx:ViewStack>
+
+    <mx:ControlBar>
+        <mx:ToggleButtonBar dataProvider="{vs}"/>
+    </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/dashboard/src/RevenueTimeline.mxml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/dashboard/src/RevenueTimeline.mxml b/apps/samples/WEB-INF/flex-src/dashboard/src/RevenueTimeline.mxml
new file mode 100755
index 0000000..41e4619
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/dashboard/src/RevenueTimeline.mxml
@@ -0,0 +1,134 @@
+<?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:ViewStack xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns="*" width="100%" height="100%">
+
+    <fx:Script>
+
+        <![CDATA[
+        import mx.charts.HitData;
+        
+        [Bindable]
+        public var revenueData:Array;
+
+        [Bindable]
+        public var selectedMonth:Object;
+
+		private var colors:Array = [0xFF0000, 0x00FF00, 0x0000FF, 0xFFFF00, 0x00FFFF];
+
+        protected function monthChange(month:Object):void
+        {
+            selectedMonth = month;
+            dispatchEvent(new Event("monthChange"));
+        }
+
+        protected function currencyFormat(value:Object, arg2:Object, arg3:Object):String
+        {
+            return cf.format(value);
+        }
+
+        private function dataGridCurrencyFormat(item:Object, column:Object):String
+        {
+            return cf.format(item[column.dataField]);
+        }
+
+        private function sortByDates(obj1:Object, obj2:Object):Number
+		{
+			var n:Number = SortUtils.sortByDates(obj1, obj2, "name");
+			return n;
+		}
+
+        private function formatDataTip(hitData:HitData):String
+        {
+            var name:String = hitData.item.name;
+            var revenue:Number = hitData.item.revenue;
+            return "<b>Month: "+name+"</b><br>Revenue: "+cf.format(revenue);
+        }
+        
+        ]]>
+
+    </fx:Script>
+
+    <fx:Metadata>
+        [Event("monthChange")]
+    </fx:Metadata>
+
+    <fx:Declarations>
+	<mx:SeriesInterpolate id="interpolate" elementOffset="10"/>
+
+    	<mx:CurrencyFormatter id="cf"/>
+    </fx:Declarations>
+
+    <mx:VBox id="chartVBox" width="100%" height="100%" icon="@Embed('icon_chart.png')" toolTip="Chart View" 
+    	paddingLeft="4" paddingTop="4" paddingBottom="4" paddingRight="4">
+		<mx:LineChart id="lc" dataProvider="{revenueData}" showDataTips="true" width="100%" height="100%" dataTipFunction="formatDataTip"
+			itemClick="monthChange(event.hitData.item)">
+
+			<mx:horizontalAxis>
+				<mx:CategoryAxis dataProvider="{revenueData}" categoryField="name"/>
+			</mx:horizontalAxis>
+
+			<mx:verticalAxis>
+				<mx:LinearAxis labelFunction="currencyFormat"/>
+			</mx:verticalAxis>
+
+			<mx:series>
+				<mx:LineSeries yField="revenue"  showDataEffect="{interpolate}">
+					<mx:lineStroke>
+						<mx:SolidColorStroke color="#708EA4" weight="1"/>
+					</mx:lineStroke>
+				</mx:LineSeries>
+				<mx:LineSeries yField="license"  showDataEffect="{interpolate}">
+					<mx:lineStroke>
+						<mx:SolidColorStroke weight="1"/>
+					</mx:lineStroke>
+				</mx:LineSeries>
+			</mx:series>
+
+			<mx:backgroundElements>
+				<fx:Array>
+<!-- SDK4 -->		
+                    <mx:GridLines gridDirection="both"> 
+<!-- SDK3 
+			        <mx:GridLines direction="both"> -->
+						<mx:verticalStroke>
+							<mx:SolidColorStroke weight="1" color="#CCCCCC"/>
+						</mx:verticalStroke>
+					</mx:GridLines>
+				</fx:Array>
+			</mx:backgroundElements>
+
+		</mx:LineChart>
+	</mx:VBox>
+
+    <mx:VBox width="100%" height="100%" icon="@Embed('icon_grid.png')" toolTip="Grid View">
+        <mx:DataGrid dataProvider="{revenueData}" width="100%" height="100%"
+        	change="monthChange(DataGrid(event.target).selectedItem)">
+            <mx:columns>
+                <mx:DataGridColumn dataField="name" headerText="Month"
+                    sortCompareFunction="sortByDates" />
+                <mx:DataGridColumn dataField="revenue" headerText="Total Revenue"
+                    labelFunction="dataGridCurrencyFormat" />
+                <mx:DataGridColumn dataField="average" headerText="Region Average"
+                    labelFunction="dataGridCurrencyFormat" />
+            </mx:columns>
+        </mx:DataGrid>
+    </mx:VBox>
+
+</mx:ViewStack>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/flex-src/dashboard/src/SortUtils.as
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/flex-src/dashboard/src/SortUtils.as b/apps/samples/WEB-INF/flex-src/dashboard/src/SortUtils.as
new file mode 100755
index 0000000..a461df1
--- /dev/null
+++ b/apps/samples/WEB-INF/flex-src/dashboard/src/SortUtils.as
@@ -0,0 +1,62 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.utils.ObjectUtil;
+
+public class SortUtils
+{
+    //lookup the index based on month abbreviation
+    static public var monthMap:Object = {
+      Jan: 0,
+      Feb: 1,
+      Mar: 2,
+      Apr: 3,
+      May: 4,
+      Jun: 5,
+      Jul: 6,
+      Aug: 7,
+      Sep: 8,
+      Oct: 9,
+      Nov: 10,
+      Dec: 11
+    };
+
+    public function SortUtils()
+    {
+        super();
+    }
+
+     static public function sortByDates(obj1:Object, obj2:Object, prop:String):Number
+     {
+         var month:String = obj1[prop].substr(0,3);
+         var month1:Number = monthMap[month];
+         var year1:String = "20" + obj1[prop].substr(4,2);
+         month = obj2[prop].substr(0,3);
+         var month2:Number = monthMap[month];
+         var year2:String = "20" + obj2[prop].substr(4,2);
+         var date1:Date = new Date(Number(year1), month1, 01);
+         var date2:Date = new Date(Number(year2), month2, 01);
+
+         return ObjectUtil.dateCompare(date1, date2);
+    }
+
+}
+
+}


[29/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/src/flex/samples/crm/employee/Employee.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/crm/employee/Employee.java b/apps/samples/WEB-INF/src/flex/samples/crm/employee/Employee.java
new file mode 100755
index 0000000..df61b32
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/crm/employee/Employee.java
@@ -0,0 +1,106 @@
+/*
+ * 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.employee;
+
+import flex.samples.crm.company.Company;
+
+public class Employee
+{
+	private int employeeId;
+
+	private String firstName;
+
+	private String lastName;
+
+	private String title;
+
+	private String email;
+
+	private String phone;
+
+    private Company company;
+	
+	public String getEmail()
+	{
+		return email;
+	}
+
+	public void setEmail(String email)
+	{
+		this.email = email;
+	}
+
+	public int getEmployeeId()
+	{
+		return employeeId;
+	}
+
+	public void setEmployeeId(int employeeId)
+	{
+		this.employeeId = employeeId;
+	}
+
+	public String getFirstName()
+	{
+		return firstName;
+	}
+
+	public void setFirstName(String firstName)
+	{
+		this.firstName = firstName;
+	}
+
+	public String getLastName()
+	{
+		return lastName;
+	}
+
+	public void setLastName(String lastName)
+	{
+		this.lastName = lastName;
+	}
+
+	public String getPhone()
+	{
+		return phone;
+	}
+
+	public void setPhone(String phone)
+	{
+		this.phone = phone;
+	}
+
+	public String getTitle()
+	{
+		return title;
+	}
+
+	public void setTitle(String title)
+	{
+		this.title = title;
+	}
+
+    public Company getCompany()
+    {
+        return company;
+    }
+
+    public void setCompany(Company company)
+    {
+        this.company = company;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/src/flex/samples/crm/employee/EmployeeDAO.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/crm/employee/EmployeeDAO.java b/apps/samples/WEB-INF/src/flex/samples/crm/employee/EmployeeDAO.java
new file mode 100755
index 0000000..c165016
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/crm/employee/EmployeeDAO.java
@@ -0,0 +1,300 @@
+/*
+ * 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.employee;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.Statement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.List;
+
+import flex.samples.ConnectionHelper;
+import flex.samples.DAOException;
+import flex.samples.crm.ConcurrencyException;
+import flex.samples.crm.company.Company;
+
+public class EmployeeDAO
+{
+	public List getEmployees() throws DAOException
+	{
+		List list = new ArrayList();
+		Connection c = null;
+		try
+		{
+			c = ConnectionHelper.getConnection();
+			Statement s = c.createStatement();
+			ResultSet rs = s.executeQuery("SELECT * FROM employee ORDER BY last_name");
+			Employee employee;
+			while (rs.next())
+			{
+				employee = new Employee();
+				employee.setEmployeeId(rs.getInt("employee_id"));
+				employee.setFirstName(rs.getString("first_name"));
+				employee.setLastName(rs.getString("last_name"));
+				employee.setTitle(rs.getString("title"));
+				employee.setEmail(rs.getString("email"));
+				employee.setPhone(rs.getString("phone"));
+                Company company = new Company();
+                company.setCompanyId(rs.getInt("company_id"));
+                employee.setCompany(company);
+				list.add(employee);
+			}
+		}
+		catch (SQLException e)
+		{
+			e.printStackTrace();
+			throw new DAOException(e);
+		}
+		finally
+		{
+			ConnectionHelper.close(c);
+		}
+		return list;
+	}
+
+	public List findEmployeesByCompany(Integer companyId) throws DAOException
+	{
+		List list = new ArrayList();
+		Connection c = null;
+		try
+		{
+            Company company = new Company();
+            company.setCompanyId(companyId.intValue());
+			c = ConnectionHelper.getConnection();
+			PreparedStatement ps = c.prepareStatement("SELECT * FROM employee WHERE company_id = ? ORDER BY last_name");
+		    ps.setInt(1, companyId.intValue());
+            ResultSet rs = ps.executeQuery();
+			while (rs.next())
+			{
+				Employee employee = new Employee();
+				employee.setEmployeeId(rs.getInt("employee_id"));
+				employee.setFirstName(rs.getString("first_name"));
+				employee.setLastName(rs.getString("last_name"));
+				employee.setTitle(rs.getString("title"));
+				employee.setEmail(rs.getString("email"));
+				employee.setPhone(rs.getString("phone"));
+                employee.setCompany(company);
+				list.add(employee);
+			}
+		}
+		catch (SQLException e)
+		{
+			e.printStackTrace();
+			throw new DAOException(e);
+		}
+		finally
+		{
+			ConnectionHelper.close(c);
+		}
+		return list;
+	}
+
+    public List findEmployeesByName(String name) throws DAOException
+    {
+        List list = new ArrayList();
+        Connection c = null;
+        
+        try
+        {
+            c = ConnectionHelper.getConnection();
+            PreparedStatement ps = c.prepareStatement("SELECT * FROM employee WHERE first_name LIKE ? OR last_name LIKE ? ORDER BY last_name");
+            ps.setString(1, "%" + name + "%");
+            ps.setString(2, "%" + name + "%");
+            ResultSet rs = ps.executeQuery();
+
+            Employee employee;
+            while (rs.next())
+            {
+                employee = new Employee();
+                employee.setEmployeeId(rs.getInt("employee_id"));
+                employee.setFirstName(rs.getString("first_name"));
+                employee.setLastName(rs.getString("last_name"));
+                employee.setTitle(rs.getString("title"));
+                employee.setEmail(rs.getString("email"));
+                employee.setPhone(rs.getString("phone"));
+                Company company = new Company();
+                company.setCompanyId(rs.getInt("company_id"));
+
+                list.add(employee);
+            }
+        }
+        catch (SQLException e)
+        {
+            e.printStackTrace();
+            throw new DAOException(e);
+        }
+        finally
+        {
+            ConnectionHelper.close(c);
+        }
+        return list;
+    }
+
+	public Employee getEmployee(int employeeId) throws DAOException
+	{
+		Employee employee = null;
+		Connection c = null;
+        
+		try
+		{
+			c = ConnectionHelper.getConnection();
+            PreparedStatement ps = c.prepareStatement("SELECT * FROM employee WHERE employee_id= ?");
+            ps.setInt(1, employeeId);
+            ResultSet rs = ps.executeQuery();
+            
+			if (rs.next())
+			{
+				employee = new Employee();
+				employee.setEmployeeId(rs.getInt("employee_id"));
+				employee.setFirstName(rs.getString("first_name"));
+				employee.setLastName(rs.getString("last_name"));
+				employee.setTitle(rs.getString("title"));
+				employee.setEmail(rs.getString("email"));
+				employee.setPhone(rs.getString("phone"));
+			}
+		}
+		catch (SQLException e)
+		{
+			e.printStackTrace();
+			throw new DAOException(e.getMessage());
+		}
+		finally
+		{
+			ConnectionHelper.close(c);
+		}
+		return employee;
+	}
+
+	public Employee createEmployee(Employee employee) throws DAOException
+	{
+		Connection c = null;
+        PreparedStatement ps = null;
+		try
+		{
+			c = ConnectionHelper.getConnection();
+			ps = c.prepareStatement("INSERT INTO employee (first_name, last_name, title, email, phone, company_id) VALUES (?, ?, ?, ?, ?, ?)");
+			ps.setString(1, employee.getFirstName());
+			ps.setString(2, employee.getLastName());
+			ps.setString(3, employee.getTitle());
+			ps.setString(4, employee.getEmail());
+			ps.setString(5, employee.getPhone());
+            if (employee.getCompany() != null)
+                ps.setInt(6, employee.getCompany().getCompanyId());
+            else
+            	ps.setNull(6, Types.INTEGER);                
+			ps.execute();
+            ps.close();
+			Statement s = c.createStatement();
+			// HSQLDB Syntax to get the identity (employee_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.
+			employee.setEmployeeId(rs.getInt(1));
+		}
+		catch (SQLException e)
+		{
+			e.printStackTrace();
+			throw new DAOException(e);
+		}
+		finally
+		{
+			ConnectionHelper.close(c);
+		}
+		return employee;
+	}
+
+
+	public void updateEmployee(Employee newVersion, Employee previousVersion, List changes) throws DAOException, ConcurrencyException
+	{
+		Connection c = null;
+		try
+		{
+			c = ConnectionHelper.getConnection();
+            PreparedStatement ps = c.prepareStatement("UPDATE employee SET first_name=?, last_name=?, title=?, email=?, phone=?, company_id=? WHERE employee_id=? AND first_name=? AND last_name=? AND title=? AND email=? AND phone=? AND company_id=?");
+			ps.setString(1, newVersion.getFirstName());
+			ps.setString(2, newVersion.getLastName());
+			ps.setString(3, newVersion.getTitle());
+			ps.setString(4, newVersion.getEmail());
+			ps.setString(5, newVersion.getPhone());			
+            if (newVersion.getCompany() != null)
+                ps.setInt(6, newVersion.getCompany().getCompanyId());
+            else
+            	ps.setNull(6,Types.INTEGER);                
+            ps.setInt(7, newVersion.getEmployeeId());
+			ps.setString(8, previousVersion.getFirstName());
+			ps.setString(9, previousVersion.getLastName());
+			ps.setString(10, previousVersion.getTitle());
+			ps.setString(11, previousVersion.getEmail());
+			ps.setString(12, previousVersion.getPhone());
+            if (previousVersion.getCompany() != null)
+                ps.setInt(13, previousVersion.getCompany().getCompanyId());
+            else
+            	ps.setNull(13, Types.INTEGER);                
+			if (ps.executeUpdate() == 0)
+			{
+				throw new ConcurrencyException("Item not found");
+			}
+		}
+		catch (SQLException e)
+		{
+			e.printStackTrace();
+			throw new DAOException(e.getMessage());
+		}
+		finally
+		{
+			ConnectionHelper.close(c);
+		}
+	}
+
+	public void deleteEmployee(Employee employee) throws DAOException, ConcurrencyException
+	{
+		Connection c = null;
+		try
+		{
+			c = ConnectionHelper.getConnection();
+			PreparedStatement ps = c.prepareStatement("DELETE FROM employee WHERE employee_id=? AND first_name=? AND last_name=? AND title=? AND email=? AND phone=? AND company_id=?");
+			ps.setInt(1, employee.getEmployeeId());
+			ps.setString(2, employee.getFirstName());
+			ps.setString(3, employee.getLastName());
+			ps.setString(4, employee.getTitle());
+			ps.setString(5, employee.getEmail());
+			ps.setString(6, employee.getPhone());
+            if (employee.getCompany() != null)
+                ps.setInt(7, employee.getCompany().getCompanyId());
+            else
+            	ps.setNull(7, Types.INTEGER);                
+			if (ps.executeUpdate() == 0)
+			{
+				throw new ConcurrencyException("Item not found");
+			}
+		}
+		catch (SQLException e)
+		{
+			e.printStackTrace();
+			throw new DAOException(e.getMessage());
+		}
+		finally
+		{
+			ConnectionHelper.close(c);
+		}
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/src/flex/samples/dcd/product/Product.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/dcd/product/Product.java b/apps/samples/WEB-INF/src/flex/samples/dcd/product/Product.java
new file mode 100755
index 0000000..d46544e
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/dcd/product/Product.java
@@ -0,0 +1,89 @@
+/*
+ * 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.dcd.product;
+import java.io.Serializable;
+
+public class Product implements Serializable {
+
+    static final long serialVersionUID = 103844514947365244L;
+    
+    private int productId;
+    private String name;
+    private String description;
+    private String image;
+    private String category;
+    private double price;
+    private int qtyInStock;
+    
+    public Product() {
+    	
+    }
+    
+    public Product(int productId, String name, String description, String image, String category, double price, int qtyInStock) {
+		this.productId = productId;
+		this.name = name;
+		this.description = description;
+		this.image = image;
+		this.category = category;
+		this.price = price;
+		this.qtyInStock = qtyInStock;
+	}
+
+    public String getCategory() {
+		return category;
+	}
+	public void setCategory(String category) {
+		this.category = category;
+	}
+	public String getDescription() {
+		return description;
+	}
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	public String getImage() {
+		return image;
+	}
+	public void setImage(String image) {
+		this.image = image;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public double getPrice() {
+		return price;
+	}
+	public void setPrice(double price) {
+		this.price = price;
+	}
+	public int getProductId() {
+		return productId;
+	}
+	public void setProductId(int productId) {
+		this.productId = productId;
+	}
+	public int getQtyInStock() {
+		return qtyInStock;
+	}
+	public void setQtyInStock(int qtyInStock) {
+		this.qtyInStock = qtyInStock;
+	}
+
+}
\ 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/dcd/product/ProductService.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/dcd/product/ProductService.java b/apps/samples/WEB-INF/src/flex/samples/dcd/product/ProductService.java
new file mode 100755
index 0000000..dcf1ba9
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/dcd/product/ProductService.java
@@ -0,0 +1,197 @@
+/*
+ * 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.dcd.product;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.sql.*;
+import flex.samples.ConnectionHelper;
+import flex.samples.DAOException;
+import java.util.Iterator;
+
+public class ProductService {
+
+    public Product[] getProducts() throws DAOException {
+
+        List list = new ArrayList();
+        Connection c = null;
+
+        try {
+            c = ConnectionHelper.getConnection();
+            Statement s = c.createStatement();
+            ResultSet rs = s.executeQuery("SELECT * FROM product ORDER BY name");
+            while (rs.next()) {
+                list.add(new Product(rs.getInt("product_id"),
+                        rs.getString("name"),
+                        rs.getString("description"),
+                        rs.getString("image"), 
+                        rs.getString("category"), 
+                        rs.getDouble("price"),
+                        rs.getInt("qty_in_stock")));
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+            throw new DAOException(e);
+        } finally {
+            ConnectionHelper.close(c);
+        }
+        Product[] products = new Product[list.size()];
+        Iterator i = list.iterator(); 
+        int index = 0;
+        while(i.hasNext()) {
+            products[index] = (Product)i.next();
+            index++;
+        }
+        return products;
+    }
+
+    public List getProductsByName(String name) throws DAOException {
+        
+        List list = new ArrayList();
+        Connection c = null;
+        
+        try {
+            c = ConnectionHelper.getConnection();
+            PreparedStatement ps = c.prepareStatement("SELECT * FROM product WHERE UPPER(name) LIKE ? ORDER BY name");
+            ps.setString(1, "%" + name.toUpperCase() + "%");
+            ResultSet rs = ps.executeQuery();
+            while (rs.next()) {
+                list.add(new Product(rs.getInt("product_id"),
+                        rs.getString("name"),
+                        rs.getString("description"),
+                        rs.getString("image"), 
+                        rs.getString("category"), 
+                        rs.getDouble("price"),
+                        rs.getInt("qty_in_stock")));
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+            throw new DAOException(e);
+        } finally {
+            ConnectionHelper.close(c);
+        }
+        return list;
+        
+    }
+    
+    public Product getProduct(int productId) throws DAOException {
+
+        Product product = new Product();
+        Connection c = null;
+
+        try {
+            c = ConnectionHelper.getConnection();
+            PreparedStatement ps = c.prepareStatement("SELECT * FROM product WHERE product_id=?");
+            ps.setInt(1, productId);
+            ResultSet rs = ps.executeQuery();
+            if (rs.next()) {
+                product = new Product();
+                product.setProductId(rs.getInt("product_id"));
+                product.setName(rs.getString("name"));
+                product.setDescription(rs.getString("description"));
+                product.setImage(rs.getString("image")); 
+                product.setCategory(rs.getString("category")); 
+                product.setPrice(rs.getDouble("price"));
+                product.setQtyInStock(rs.getInt("qty_in_stock"));
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new DAOException(e);
+        } finally {
+            ConnectionHelper.close(c);
+        }
+        return product;
+    }
+
+    public Product createProduct(Product product) throws DAOException {
+        
+        Connection c = null;
+        PreparedStatement ps = null;
+        try {
+            c = ConnectionHelper.getConnection();
+            ps = c.prepareStatement("INSERT INTO product (name, description, image, category, price, qty_in_stock) VALUES (?, ?, ?, ?, ?, ?)");
+            ps.setString(1, product.getName());
+            ps.setString(2, product.getDescription());
+            ps.setString(3, product.getImage());
+            ps.setString(4, product.getCategory());
+            ps.setDouble(5, product.getPrice());
+            ps.setInt(6, product.getQtyInStock());
+            ps.executeUpdate();
+            Statement s = c.createStatement();
+            // HSQLDB Syntax to get the identity (company_id) of inserted row
+            ResultSet rs = s.executeQuery("CALL IDENTITY()");
+            // MySQL Syntax to get the identity (product_id) of inserted row
+            // ResultSet rs = s.executeQuery("SELECT LAST_INSERT_ID()");
+            rs.next();
+            // Update the id in the returned object. This is important as this value must get returned to the client.
+            product.setProductId(rs.getInt(1));
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new DAOException(e);
+        } finally {
+            ConnectionHelper.close(c);
+        }
+        return product;
+    }
+
+    public void updateProduct(Product product) throws DAOException {
+
+        Connection c = null;
+
+        try {
+            c = ConnectionHelper.getConnection();
+            PreparedStatement ps = c.prepareStatement("UPDATE product SET name=?, description=?, image=?, category=?, price=?, qty_in_stock=? WHERE product_id=?");
+            ps.setString(1, product.getName());
+            ps.setString(2, product.getDescription());
+            ps.setString(3, product.getImage());
+            ps.setString(4, product.getCategory());
+            ps.setDouble(5, product.getPrice());
+            ps.setInt(6, product.getQtyInStock());
+            ps.setInt(7, product.getProductId());
+            ps.executeUpdate();
+        } catch (SQLException e) {
+            e.printStackTrace();
+            throw new DAOException(e);
+        } finally {
+            ConnectionHelper.close(c);
+        }
+
+    }
+
+    private boolean remove(Product product) throws DAOException {
+        
+        Connection c = null;
+        
+        try {
+            c = ConnectionHelper.getConnection();
+            PreparedStatement ps = c.prepareStatement("DELETE FROM product WHERE product_id=?");
+            ps.setInt(1, product.getProductId());
+            int count = ps.executeUpdate();
+            return (count == 1);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new DAOException(e);
+        } finally {
+            ConnectionHelper.close(c);
+        }
+    }
+
+    public boolean deleteProduct(Product product) throws DAOException {
+        return remove(product);
+    }
+
+}
\ 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/feed/Feed.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/feed/Feed.java b/apps/samples/WEB-INF/src/flex/samples/feed/Feed.java
new file mode 100755
index 0000000..5f31a28
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/feed/Feed.java
@@ -0,0 +1,85 @@
+/*
+ * 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.feed;
+
+import java.util.*;
+import flex.messaging.MessageBroker;
+import flex.messaging.messages.AsyncMessage;
+import flex.messaging.util.UUIDUtils;
+
+public class Feed {
+	private static FeedThread thread;
+
+	public Feed() {
+	}
+
+	public void start() {
+		if (thread == null) {
+			thread = new FeedThread();
+			thread.start();
+		}
+	}
+
+	public void stop() {
+		thread.running = false;
+		thread = null;
+	}
+
+	public static class FeedThread extends Thread {
+
+		public boolean running = true;
+
+		public void run() {
+			MessageBroker msgBroker = MessageBroker.getMessageBroker(null);
+			String clientID = UUIDUtils.createUUID();
+
+			Random random = new Random();
+			double initialValue = 35;
+			double currentValue = 35;
+			double maxChange = initialValue * 0.005;
+
+			while (running) {
+				double change = maxChange - random.nextDouble() * maxChange * 2;
+				double newValue = currentValue + change;
+
+				if (currentValue < initialValue + initialValue * 0.15
+						&& currentValue > initialValue - initialValue * 0.15) {
+					currentValue = newValue;
+				} else {
+					currentValue -= change;
+				}
+
+				AsyncMessage msg = new AsyncMessage();
+				msg.setDestination("feed");
+				msg.setClientId(clientID);
+				msg.setMessageId(UUIDUtils.createUUID());
+				msg.setTimestamp(System.currentTimeMillis());
+				msg.setBody(new Double(currentValue));
+				msgBroker.routeMessageToService(msg, null);
+
+				System.out.println("" + currentValue);
+
+				try {
+					Thread.sleep(300);
+				} catch (InterruptedException e) {
+				}
+
+			}
+		}
+	}
+
+}
\ 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/marketdata/Feed.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/marketdata/Feed.java b/apps/samples/WEB-INF/src/flex/samples/marketdata/Feed.java
new file mode 100755
index 0000000..19e7247
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/marketdata/Feed.java
@@ -0,0 +1,121 @@
+/*
+ * 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.marketdata;
+
+import java.util.*;
+
+import flex.messaging.MessageBroker;
+import flex.messaging.messages.AsyncMessage;
+import flex.messaging.util.UUIDUtils;
+
+public class Feed {
+
+	public static void main(String args[]) {
+		Feed feed = new Feed();
+		feed.start();
+	}
+	
+	private static FeedThread thread;
+
+	public Feed() {
+	}
+
+	public void start() {
+		if (thread == null) {
+			thread = new FeedThread();
+			thread.start();
+		}
+	}
+
+	public void stop() {
+		thread.running = false;
+		thread = null;
+	}
+
+	public static class FeedThread extends Thread {
+
+		public boolean running = true;
+
+		private Random random;
+
+		public void run() {
+
+			MessageBroker msgBroker = MessageBroker.getMessageBroker(null);
+			String clientID = UUIDUtils.createUUID();
+
+			Portfolio portfolio = new Portfolio();
+			List stocks = portfolio.getStocks();
+			int size = stocks.size();
+			int index = 0;
+
+			random = new Random();
+			
+			Stock stock;
+
+			while (running) {
+
+				stock = (Stock) stocks.get(index);
+				simulateChange(stock);
+
+				index++;
+				if (index >= size) {
+					index = 0;
+				}
+
+				AsyncMessage msg = new AsyncMessage();
+				msg.setDestination("market-data-feed");
+				msg.setHeader("DSSubtopic", stock.getSymbol());
+				msg.setClientId(clientID);
+				msg.setMessageId(UUIDUtils.createUUID());
+				msg.setTimestamp(System.currentTimeMillis());
+				msg.setBody(stock);
+				msgBroker.routeMessageToService(msg, null);
+
+				try {
+					Thread.sleep(20);
+				} catch (InterruptedException e) {
+				}
+
+			}
+		}
+
+		private void simulateChange(Stock stock) {
+
+			double maxChange = stock.open * 0.005;
+			double change = maxChange - random.nextDouble() * maxChange * 2;
+			stock.change = change;
+			double last = stock.last + change;
+
+			if (last < stock.open + stock.open * 0.15
+					&& last > stock.open - stock.open * 0.15) {
+				stock.last = last;
+			} else {
+				stock.last = stock.last - change;
+			}
+
+			if (stock.last > stock.high) {
+				stock.high = stock.last;
+			} else if (stock.last < stock.low) {
+				stock.low = stock.last;
+			}
+			stock.date = new Date();
+
+		}
+
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/src/flex/samples/marketdata/Portfolio.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/marketdata/Portfolio.java b/apps/samples/WEB-INF/src/flex/samples/marketdata/Portfolio.java
new file mode 100755
index 0000000..250dc10
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/marketdata/Portfolio.java
@@ -0,0 +1,75 @@
+/*
+ * 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.marketdata;
+
+import java.io.*;
+import java.net.URLDecoder;
+
+import javax.xml.parsers.*;
+import org.w3c.dom.*;
+import java.util.List;
+import java.util.ArrayList;
+
+public class Portfolio {
+	
+	public static void main(String[] args) {
+		Portfolio stockFeed = new Portfolio(); 
+		stockFeed.getStocks();
+	}
+	
+	public List getStocks() {
+
+		List list = new ArrayList();
+		
+        try {
+            InputStream is = getClass().getClassLoader().getResourceAsStream("flex/samples/marketdata/portfolio.xml");
+            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+            factory.setValidating(false);
+            Document doc = factory.newDocumentBuilder().parse(is);
+            NodeList stockNodes = doc.getElementsByTagName("stock");
+            int length = stockNodes.getLength();
+            Stock stock;
+            Node stockNode;
+            for (int i=0; i<length; i++) {
+            	stockNode = stockNodes.item(i);
+            	stock = new Stock();
+            	stock.setSymbol( getStringValue(stockNode, "symbol") );
+            	stock.setName( getStringValue(stockNode, "company") );
+            	stock.setLast( getDoubleValue(stockNode, "last") );
+            	stock.setHigh( stock.getLast() );
+            	stock.setLow( stock.getLast() );
+            	stock.setOpen( stock.getLast() );
+            	stock.setChange( 0 );
+            	list.add(stock);
+            	System.out.println(stock.getSymbol());
+            }
+        } catch (Exception e) {
+        	e.printStackTrace();
+        }
+
+        return list;
+	}
+	
+	private String getStringValue(Node node, String name) {
+		return ((Element) node).getElementsByTagName(name).item(0).getFirstChild().getNodeValue();		
+	}
+
+	private double getDoubleValue(Node node, String name) {
+		return Double.parseDouble( getStringValue(node, name) );		
+	}
+
+}
\ 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/marketdata/Stock.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/marketdata/Stock.java b/apps/samples/WEB-INF/src/flex/samples/marketdata/Stock.java
new file mode 100755
index 0000000..6e4b9ee
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/marketdata/Stock.java
@@ -0,0 +1,84 @@
+/*
+ * 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.marketdata;
+
+import java.util.Date;
+import java.io.Serializable;
+
+public class Stock implements Serializable {
+
+	private static final long serialVersionUID = -8334804402463267285L;
+
+	protected String symbol;
+	protected String name;
+	protected double low;
+	protected double high;
+	protected double open;
+	protected double last;
+	protected double change;
+	protected Date date;
+
+	public double getChange() {
+		return change;
+	}
+	public void setChange(double change) {
+		this.change = change;
+	}
+	public double getHigh() {
+		return high;
+	}
+	public void setHigh(double high) {
+		this.high = high;
+	}
+	public double getLast() {
+		return last;
+	}
+	public void setLast(double last) {
+		this.last = last;
+	}
+	public double getLow() {
+		return low;
+	}
+	public void setLow(double low) {
+		this.low = low;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public double getOpen() {
+		return open;
+	}
+	public void setOpen(double open) {
+		this.open = open;
+	}
+	public String getSymbol() {
+		return symbol;
+	}
+	public void setSymbol(String symbol) {
+		this.symbol = symbol;
+	}
+	public Date getDate() {
+		return date;
+	}
+	public void setDate(Date date) {
+		this.date = date;
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/src/flex/samples/marketdata/portfolio.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/marketdata/portfolio.xml b/apps/samples/WEB-INF/src/flex/samples/marketdata/portfolio.xml
new file mode 100755
index 0000000..b464290
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/marketdata/portfolio.xml
@@ -0,0 +1,141 @@
+<!--
+
+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.
+
+-->
+<portfolio>
+
+	<stock>
+		<symbol>XOM</symbol>
+		<company>Exxon Mobile Corp</company>
+		<last>61.56</last>
+	</stock>
+
+	<stock>
+		<symbol>WMT</symbol>
+		<company>Wal-Mart Stores</company>
+		<last>45.62</last>
+	</stock>
+
+	<stock>
+		<symbol>GM</symbol>
+		<company>General Motors Corporation</company>
+		<last>19.8</last>
+	</stock>
+
+	<stock>
+		<symbol>CVX</symbol>
+		<company>Chevron Corp New</company>
+		<last>58.95</last>
+	</stock>
+
+	<stock>
+		<symbol>COP</symbol>
+		<company>Conocophillips</company>
+		<last>67.14</last>
+	</stock>
+
+	<stock>
+		<symbol>GE</symbol>
+		<company>General Electric Company</company>
+		<last>33.61</last>
+	</stock>
+
+	<stock>
+		<symbol>C</symbol>
+		<company>Citigroup Inc</company>
+		<last>48.18</last>
+	</stock>
+
+	<stock>
+		<symbol>AIG</symbol>
+		<company>American International Group Inc</company>
+		<last>62.92</last>
+	</stock>
+
+	<stock>
+		<symbol>GOOG</symbol>
+		<company>Google Inc</company>
+		<last>417.93</last>
+	</stock>
+
+	<stock>
+		<symbol>ADBE</symbol>
+		<company>Adobe Systems Incorporated</company>
+		<last>39.20</last>
+	</stock>
+
+	<stock>
+		<symbol>JBLU</symbol>
+		<company>JetBlue Airways Corporation</company>
+		<last>10.57</last>
+	</stock>
+
+	<stock>
+		<symbol>COKE</symbol>
+		<company>Coca-Cola Bottling Co. Consolidated</company>
+		<last>48.20</last>
+	</stock>
+
+	<stock>
+		<symbol>GENZ</symbol>
+		<company>Genzyme Corporation</company>
+		<last>61.16</last>
+	</stock>
+
+	<stock>
+		<symbol>YHOO</symbol>
+		<company>Yahoo Inc.</company>
+		<last>32.78</last>
+	</stock>
+
+	<stock>
+		<symbol>IBM</symbol>
+		<company>International Business Machines Corp.</company>
+		<last>82.34</last>
+	</stock>
+
+	<stock>
+		<symbol>BA</symbol>
+		<company>Boeing Company</company>
+		<last>83.45</last>
+	</stock>
+
+	<stock>
+		<symbol>SAP</symbol>
+		<company>SAP AG</company>
+		<last>54.63</last>
+	</stock>
+
+	<stock>
+		<symbol>MOT</symbol>
+		<company>Motorola, Inc.</company>
+		<last>21.35</last>
+	</stock>
+
+	<stock>
+		<symbol>VZ</symbol>
+		<company>Verizon Communications</company>
+		<last>33.03</last>
+	</stock>
+
+	<stock>
+		<symbol>MCD</symbol>
+		<company>McDonald's Corporation</company>
+		<last>34.57</last>
+	</stock>
+
+</portfolio>
\ 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/product/Product.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/product/Product.java b/apps/samples/WEB-INF/src/flex/samples/product/Product.java
new file mode 100755
index 0000000..7e3c87d
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/product/Product.java
@@ -0,0 +1,89 @@
+/*
+ * 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.product;
+import java.io.Serializable;
+
+public class Product implements Serializable {
+
+    static final long serialVersionUID = 103844514947365244L;
+    
+    private int productId;
+    private String name;
+    private String description;
+    private String image;
+    private String category;
+    private double price;
+    private int qtyInStock;
+    
+    public Product() {
+    	
+    }
+    
+    public Product(int productId, String name, String description, String image, String category, double price, int qtyInStock) {
+		this.productId = productId;
+		this.name = name;
+		this.description = description;
+		this.image = image;
+		this.category = category;
+		this.price = price;
+		this.qtyInStock = qtyInStock;
+	}
+
+    public String getCategory() {
+		return category;
+	}
+	public void setCategory(String category) {
+		this.category = category;
+	}
+	public String getDescription() {
+		return description;
+	}
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	public String getImage() {
+		return image;
+	}
+	public void setImage(String image) {
+		this.image = image;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public double getPrice() {
+		return price;
+	}
+	public void setPrice(double price) {
+		this.price = price;
+	}
+	public int getProductId() {
+		return productId;
+	}
+	public void setProductId(int productId) {
+		this.productId = productId;
+	}
+	public int getQtyInStock() {
+		return qtyInStock;
+	}
+	public void setQtyInStock(int qtyInStock) {
+		this.qtyInStock = qtyInStock;
+	}
+
+}
\ 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/product/ProductService.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/product/ProductService.java b/apps/samples/WEB-INF/src/flex/samples/product/ProductService.java
new file mode 100755
index 0000000..8e0a816
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/product/ProductService.java
@@ -0,0 +1,191 @@
+/*
+ * 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.product;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.sql.*;
+
+import flex.samples.ConnectionHelper;
+import flex.samples.DAOException;
+
+public class ProductService {
+
+	public List getProducts() throws DAOException {
+
+		List list = new ArrayList();
+		Connection c = null;
+
+		try {
+			c = ConnectionHelper.getConnection();
+			Statement s = c.createStatement();
+			ResultSet rs = s.executeQuery("SELECT * FROM product ORDER BY name");
+			while (rs.next()) {
+				list.add(new Product(rs.getInt("product_id"),
+						rs.getString("name"),
+						rs.getString("description"),
+						rs.getString("image"), 
+						rs.getString("category"), 
+						rs.getDouble("price"),
+						rs.getInt("qty_in_stock")));
+			}
+		} catch (SQLException e) {
+			e.printStackTrace();
+			throw new DAOException(e);
+		} finally {
+			ConnectionHelper.close(c);
+		}
+		return list;
+
+	}
+
+	public List getProductsByName(String name) throws DAOException {
+		
+		List list = new ArrayList();
+		Connection c = null;
+		
+		try {
+			c = ConnectionHelper.getConnection();
+			PreparedStatement ps = c.prepareStatement("SELECT * FROM product WHERE UPPER(name) LIKE ? ORDER BY name");
+			ps.setString(1, "%" + name.toUpperCase() + "%");
+			ResultSet rs = ps.executeQuery();
+			while (rs.next()) {
+				list.add(new Product(rs.getInt("product_id"),
+						rs.getString("name"),
+						rs.getString("description"),
+						rs.getString("image"), 
+						rs.getString("category"), 
+						rs.getDouble("price"),
+						rs.getInt("qty_in_stock")));
+			}
+		} catch (SQLException e) {
+			e.printStackTrace();
+			throw new DAOException(e);
+		} finally {
+			ConnectionHelper.close(c);
+		}
+		return list;
+		
+	}
+	
+	public Product getProduct(int productId) throws DAOException {
+
+		Product product = new Product();
+		Connection c = null;
+
+		try {
+			c = ConnectionHelper.getConnection();
+			PreparedStatement ps = c.prepareStatement("SELECT * FROM product WHERE product_id=?");
+			ps.setInt(1, productId);
+			ResultSet rs = ps.executeQuery();
+			if (rs.next()) {
+				product = new Product();
+				product.setProductId(rs.getInt("product_id"));
+				product.setName(rs.getString("name"));
+				product.setDescription(rs.getString("description"));
+				product.setImage(rs.getString("image")); 
+				product.setCategory(rs.getString("category")); 
+				product.setPrice(rs.getDouble("price"));
+				product.setQtyInStock(rs.getInt("qty_in_stock"));
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new DAOException(e);
+		} finally {
+			ConnectionHelper.close(c);
+		}
+		return product;
+	}
+
+	public Product create(Product product) throws DAOException {
+		
+		Connection c = null;
+		PreparedStatement ps = null;
+		try {
+			c = ConnectionHelper.getConnection();
+			ps = c.prepareStatement("INSERT INTO product (name, description, image, category, price, qty_in_stock) VALUES (?, ?, ?, ?, ?, ?)");
+			ps.setString(1, product.getName());
+			ps.setString(2, product.getDescription());
+			ps.setString(3, product.getImage());
+			ps.setString(4, product.getCategory());
+			ps.setDouble(5, product.getPrice());
+			ps.setInt(6, product.getQtyInStock());
+			ps.executeUpdate();
+			Statement s = c.createStatement();
+			// HSQLDB Syntax to get the identity (company_id) of inserted row
+			ResultSet rs = s.executeQuery("CALL IDENTITY()");
+			// MySQL Syntax to get the identity (product_id) of inserted row
+			// ResultSet rs = s.executeQuery("SELECT LAST_INSERT_ID()");
+			rs.next();
+            // Update the id in the returned object. This is important as this value must get returned to the client.
+			product.setProductId(rs.getInt(1));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new DAOException(e);
+		} finally {
+			ConnectionHelper.close(c);
+		}
+		return product;
+	}
+
+	public boolean update(Product product) throws DAOException {
+
+		Connection c = null;
+
+		try {
+			c = ConnectionHelper.getConnection();
+			PreparedStatement ps = c.prepareStatement("UPDATE product SET name=?, description=?, image=?, category=?, price=?, qty_in_stock=? WHERE product_id=?");
+			ps.setString(1, product.getName());
+			ps.setString(2, product.getDescription());
+			ps.setString(3, product.getImage());
+			ps.setString(4, product.getCategory());
+			ps.setDouble(5, product.getPrice());
+			ps.setInt(6, product.getQtyInStock());
+			ps.setInt(7, product.getProductId());
+			return (ps.executeUpdate() == 1);
+		} catch (SQLException e) {
+			e.printStackTrace();
+			throw new DAOException(e);
+		} finally {
+			ConnectionHelper.close(c);
+		}
+
+	}
+
+	public boolean remove(Product product) throws DAOException {
+		
+		Connection c = null;
+		
+		try {
+			c = ConnectionHelper.getConnection();
+			PreparedStatement ps = c.prepareStatement("DELETE FROM product WHERE product_id=?");
+			ps.setInt(1, product.getProductId());
+			int count = ps.executeUpdate();
+			return (count == 1);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new DAOException(e);
+		} finally {
+			ConnectionHelper.close(c);
+		}
+	}
+
+	public boolean delete(Product product) throws DAOException {
+		return remove(product);
+	}
+
+}
\ 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/qos/CustomDelayQueueProcessor.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/qos/CustomDelayQueueProcessor.java b/apps/samples/WEB-INF/src/flex/samples/qos/CustomDelayQueueProcessor.java
new file mode 100755
index 0000000..3841e2a
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/qos/CustomDelayQueueProcessor.java
@@ -0,0 +1,121 @@
+/*
+ * 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.qos;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import flex.messaging.client.FlexClient;
+import flex.messaging.client.FlexClientOutboundQueueProcessor;
+import flex.messaging.client.FlushResult;
+import flex.messaging.config.ConfigMap;
+import flex.messaging.MessageClient;
+
+/**
+ * Per client queue processor that applies custom quality of services parameters (in this case: delay).
+ * Custom quality of services parameters are read from the client FlexClient instance.
+ * In this sample, these parameters are set in the FlexClient instance by the client application 
+ * using the flex.samples.qos.FlexClientConfigService RemoteObject.  
+ * 
+ * This class is used in the channel definition (see services-config.xml)that the 'market-data-feed' 
+ * message destination (see messaging-config.xml) references.
+ * 
+ * Each client that connects to this channel's endpoint gets a unique instance of this class to manage
+ * its specific outbound queue of messages.
+ */
+public class CustomDelayQueueProcessor extends FlexClientOutboundQueueProcessor 
+{
+    /**
+     * Used to store the last time this queue was flushed.
+     * Starts off with an initial value of the construct time for the instance.
+     */
+    private long lastFlushTime = System.currentTimeMillis();
+
+    /**
+     * Driven by configuration, this is the configurable delay time between flushes.
+     */
+    private int delayTimeBetweenFlushes;
+
+    public CustomDelayQueueProcessor() {
+	}
+
+	/**
+     * Sets up the default delay time between flushes. This default is used if a client-specific
+     * value has not been set in the FlexClient instance.
+     * 
+     * @param properties A ConfigMap containing any custom initialization properties.
+     */
+    public void initialize(ConfigMap properties) 
+    {
+        delayTimeBetweenFlushes = properties.getPropertyAsInt("flush-delay", -1);
+        if (delayTimeBetweenFlushes < 0)
+            throw new RuntimeException("Flush delay time for DelayedDeliveryQueueProcessor must be a positive value.");
+    }
+
+    /**
+     * This flush implementation delays flushing messages from the queue until 3 seconds
+     * have passed since the last flush. 
+     * 
+     * @param outboundQueue The queue of outbound messages.
+     * @return An object containing the messages that have been removed from the outbound queue
+     *         to be written to the network and a wait time for the next flush of the outbound queue
+     *         that is the default for the underlying Channel/Endpoint.
+     */
+    public FlushResult flush(List outboundQueue)
+    {
+    	int delay = delayTimeBetweenFlushes;
+    	// Read custom delay from client's FlexClient instance
+    	FlexClient flexClient = getFlexClient();
+    	if (flexClient != null)
+    	{
+			Object obj = flexClient.getAttribute("market-data-delay");
+	    	if (obj != null)
+	    	{
+				try {
+					delay = Integer.parseInt((String) obj);
+				} catch (NumberFormatException ignore) {
+				}    		
+	    	}
+    	}
+    	
+        long currentTime = System.currentTimeMillis();
+    	if ((currentTime - lastFlushTime) < delay)
+        {
+            // Delaying flush. No messages will be returned at this point
+            FlushResult flushResult = new FlushResult();
+            // Don't return any messages to flush.
+            // And request that the next flush doesn't occur until 3 seconds since the previous.
+            flushResult.setNextFlushWaitTimeMillis((int)(delay - (currentTime - lastFlushTime)));
+            return flushResult;
+        }
+        else // OK to flush.
+        {
+            // Flushing. All queued messages will now be returned
+            lastFlushTime = currentTime;    
+            FlushResult flushResult = new FlushResult();
+            flushResult.setNextFlushWaitTimeMillis(delay);
+            flushResult.setMessages(new ArrayList(outboundQueue));
+            outboundQueue.clear();        
+            return flushResult;
+        }
+    }
+
+    public FlushResult flush(MessageClient client, List outboundQueue) {
+        return super.flush(client, outboundQueue);
+    }
+
+}
\ 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/qos/FlexClientConfigService.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/qos/FlexClientConfigService.java b/apps/samples/WEB-INF/src/flex/samples/qos/FlexClientConfigService.java
new file mode 100755
index 0000000..c66d46b
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/qos/FlexClientConfigService.java
@@ -0,0 +1,74 @@
+/*
+ * 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.qos;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+import flex.messaging.FlexContext;
+import flex.messaging.client.FlexClient;
+
+public class FlexClientConfigService 
+{
+
+	public void setAttribute(String name, Object value) 
+	{
+		FlexClient flexClient = FlexContext.getFlexClient();
+		flexClient.setAttribute(name, value);
+	}
+
+	public List getAttributes() 
+	{
+		FlexClient flexClient = FlexContext.getFlexClient();
+		List attributes = new ArrayList();
+		Enumeration attrNames = flexClient.getAttributeNames();
+		while (attrNames.hasMoreElements())
+		{
+			String attrName = (String) attrNames.nextElement();
+			attributes.add(new Attribute(attrName, flexClient.getAttribute(attrName)));
+		}
+
+		return attributes;
+		
+	}
+	
+	public class Attribute {
+		
+		private String name;
+		private Object value;
+
+		public Attribute(String name, Object value) {
+			this.name = name;
+			this.value = value;
+		}
+		public String getName() {
+			return name;
+		}
+		public void setName(String name) {
+			this.name = name;
+		}
+		public Object getValue() {
+			return value;
+		}
+		public void setValue(Object value) {
+			this.value = value;
+		}
+		
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/ChatRoomService.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/ChatRoomService.java b/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/ChatRoomService.java
new file mode 100755
index 0000000..9e83da5
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/ChatRoomService.java
@@ -0,0 +1,81 @@
+/*
+ * 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.runtimeconfig;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import flex.messaging.MessageBroker;
+import flex.messaging.MessageDestination;
+//import flex.messaging.config.ServerSettings;
+import flex.messaging.services.MessageService;
+
+/**
+ * Simplistic implementation of a chat room management service. Clients can add rooms,
+ * and obtain a list of rooms. The interesting part of this example is the "on-the-fly" 
+ * creation of a message destination. The same technique can be used to create DataService
+ * and Remoting destinations. 
+ */
+public class ChatRoomService {
+
+	private List rooms;
+	
+	public ChatRoomService()
+	{
+		rooms = Collections.synchronizedList(new ArrayList());
+	}
+
+	public List getRoomList()
+	{
+		return rooms;
+	}
+	
+	public void createRoom(String id) {
+
+		if (roomExists(id))
+		{
+			throw new RuntimeException("Room already exists");
+		}
+		
+		// Create a new Message destination dynamically
+		String serviceId = "message-service";
+		MessageBroker broker = MessageBroker.getMessageBroker(null);
+		MessageService service = (MessageService) broker.getService(serviceId);
+		MessageDestination destination = (MessageDestination) service.createDestination(id);
+
+		if (service.isStarted())
+		{
+			destination.start();
+		}
+
+		rooms.add(id);
+		
+	}
+	
+	public boolean roomExists(String id)
+	{
+		int size = rooms.size();
+		for (int i=0; i<size; i++)
+		{
+			if ( ((String)rooms.get(i)).equals(id) ) 
+			{
+				return true;
+			}
+		}
+		return false;
+	}
+}
\ 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/runtimeconfig/EmployeeRuntimeRemotingDestination.java
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/EmployeeRuntimeRemotingDestination.java b/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/EmployeeRuntimeRemotingDestination.java
new file mode 100755
index 0000000..4624eba
--- /dev/null
+++ b/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/EmployeeRuntimeRemotingDestination.java
@@ -0,0 +1,54 @@
+/*
+ * 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.runtimeconfig;
+
+import flex.messaging.config.ConfigMap;
+import flex.messaging.services.AbstractBootstrapService;
+import flex.messaging.services.RemotingService;
+import flex.messaging.services.remoting.RemotingDestination;
+
+public class EmployeeRuntimeRemotingDestination extends AbstractBootstrapService
+{
+	private RemotingService remotingService;
+
+    /**
+     * This method is called by FDS when FDS has been initialized but not started. 
+     */    
+    public void initialize(String id, ConfigMap properties)
+    {
+        remotingService = (RemotingService) getMessageBroker().getService("remoting-service");
+        RemotingDestination destination = (RemotingDestination) remotingService.createDestination(id);
+        destination.setSource("flex.samples.crm.employee.EmployeeDAO");
+    }
+    
+    /**
+     * This method is called by FDS as FDS starts up (after initialization). 
+     */
+    public void start()
+    {
+        // No-op
+    }
+
+    /**
+     * This method is called by FDS as FDS shuts down.
+     */
+    public void stop()
+    {
+        // No-op
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/apps/samples/WEB-INF/web.xml b/apps/samples/WEB-INF/web.xml
new file mode 100755
index 0000000..0a97d59
--- /dev/null
+++ b/apps/samples/WEB-INF/web.xml
@@ -0,0 +1,63 @@
+<?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.
+
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+    <display-name>BlazeDS Samples</display-name>
+    <description>BlazeDS Sample Application</description>
+
+    <!-- Http Flex Session attribute and binding listener support -->
+    <listener>
+        <listener-class>flex.messaging.HttpFlexSession</listener-class>
+    </listener>
+
+    <!-- MessageBroker Servlet -->
+    <servlet>
+        <servlet-name>MessageBrokerServlet</servlet-name>
+        <display-name>MessageBrokerServlet</display-name>
+        <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
+        <init-param>
+            <param-name>services.configuration.file</param-name>
+            <param-value>/WEB-INF/flex/services-config.xml</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>MessageBrokerServlet</servlet-name>
+        <url-pattern>/messagebroker/*</url-pattern>
+    </servlet-mapping>
+
+    <welcome-file-list>
+        <welcome-file>index.htm</welcome-file>
+    </welcome-file-list>
+
+    <!-- for WebSphere deployment, please uncomment -->
+    <!--
+    <resource-ref>
+       <description>Flex Messaging WorkManager</description>
+        <res-ref-name>wm/MessagingWorkManager</res-ref-name>
+        <res-type>com.ibm.websphere.asynchbeans.WorkManager</res-type>
+        <res-auth>Container</res-auth>
+        <res-sharing-scope>Shareable</res-sharing-scope>
+    </resource-ref>
+    -->
+
+</web-app>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples/build.xml b/apps/samples/build.xml
new file mode 100755
index 0000000..609d314
--- /dev/null
+++ b/apps/samples/build.xml
@@ -0,0 +1,168 @@
+<?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 file="${basedir}/build.properties"/>
+    <property name="samples.war" value="${basedir}/apps/samples"/>
+    <property name="dist.dir" value="${basedir}/dist"/>
+    <property name="src.dir" value="${samples.war}/WEB-INF/src"/>
+    <property name="classes.dir" value="${samples.war}/WEB-INF/classes"/>
+    <property name="context.root" value="samples" />
+    
+    <path id="classpath">
+        <fileset dir="${samples.war}/WEB-INF/lib" includes="**/*.jar"/>        
+        <pathelement location="${servlet.jar}"/>
+        <pathelement location="${jms.jar}"/>
+    </path>
+
+    <target name="main" depends="clean,samples"/>
+    <target name="samples" depends="prepare,copy-resources,compile"/>
+
+    <target name="prepare">
+        <mkdir dir="${samples.war}/WEB-INF/lib"/>
+        <mkdir dir="${samples.war}/WEB-INF/classes"/>
+    </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 to the lib directory -->
+        <copy todir="${samples.war}/WEB-INF/lib">
+            <fileset dir="${basedir}/lib" includes="${webapp.lib}" />
+            <fileset file="${hsqldb.jar}" />
+        </copy>
+
+        <!-- copy to sampledb directory -->
+        <copy todir="${basedir}/sampledb">
+            <fileset file="${hsqldb.jar}" />
+        </copy>
+
+        <!-- copy to the classes directory -->
+        <copy todir="${samples.war}/WEB-INF/classes">
+            <fileset dir="${samples.war}/WEB-INF/src">
+                <include name="**/*.xml"/>
+            </fileset>
+            <fileset dir="${basedir}/lib" includes="${webapp.classes}"/>
+        </copy>
+        
+        <!-- create version.properties -->
+        <propertyfile file="${samples.war}/WEB-INF/flex/version.properties">
+            <entry key="build" value="${manifest.Implementation-Version}.${build.number}"/>
+            <entry key="minimumSDKVersion" value="${min.sdk.version}"/>
+        </propertyfile>
+
+    </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.4" debug="${src.debug}" destdir="${classes.dir}" srcdir="${src.dir}" classpathref="classpath"/>
+    </target>
+
+    <target name="compile-swfs">
+        <property name="samples.src.dir" value="${samples.war}/WEB-INF/flex-src" />
+        
+        <ant antfile="${samples.src.dir}/dashboard/build.xml" />
+        <ant antfile="${samples.src.dir}/runtimeconfig-messaging/build.xml" />
+        <ant antfile="${samples.src.dir}/runtimeconfig-remoting/build.xml" />
+        <ant antfile="${samples.src.dir}/testdrive-101/build.xml" />
+        <ant antfile="${samples.src.dir}/testdrive-chat/build.xml" />
+        <ant antfile="${samples.src.dir}/testdrive-datapush/build.xml" />
+        <ant antfile="${samples.src.dir}/testdrive-httpservice/build.xml" />
+        <ant antfile="${samples.src.dir}/testdrive-remoteobject/build.xml" />
+        <ant antfile="${samples.src.dir}/testdrive-update/build.xml" />
+        <ant antfile="${samples.src.dir}/testdrive-webservice/build.xml" />
+        <ant antfile="${samples.src.dir}/traderdesktop/build.xml" />
+        <ant antfile="${samples.src.dir}/inventory/build.xml" />
+
+    </target>
+
+    <target name="package" depends="compile-swfs" description=" Creates distribution war file">
+
+        <mkdir dir="${dist.dir}"/>
+
+        <!-- 
+        we don't want flex source naked in WEB-INF as that would lead to overlapping eclipse projects
+        instead, zip it up and then put it in the war
+         -->
+        <zip destfile="${samples.war}/WEB-INF/flex-src/flex-src.zip"  
+            comment="${manifest.Implementation-Title} ${manifest.Implementation-Version}.${label} Samples Flex Source Code">
+            <fileset dir="${samples.war}/WEB-INF/flex-src" 
+                excludes="**/build*.xml,flex-src.zip"/>
+        </zip>
+
+        <war file="${dist.dir}/samples.war"
+            webxml="${samples.war}/WEB-INF/web.xml">
+            <manifest>
+                <attribute name="Sealed" value="${manifest.sealed}"/>
+                <attribute name="Implementation-Title" value="${manifest.Implementation-Title} - Samples Application"/>
+                <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}"/>
+                <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/>
+            </manifest> 
+            <fileset dir="${samples.war}" >
+                <exclude name="**/**/build*.xml" />
+                <exclude name="**/generated/**/*"/>
+                <exclude name="WEB-INF/jsp/**/*" />
+                <exclude name="WEB-INF/sessions/**/*" />
+                <exclude name="WEB-INF/flex-src/**/*" />
+                <!-- This is included in the war task already -->
+                <exclude name="WEB-INF/web.xml" />
+             </fileset>
+             <fileset dir="${samples.war}" includes="WEB-INF/flex-src/flex-src.zip" />
+        </war>
+
+        <copy todir="${dist.dir}/sampledb">
+            <fileset dir="${basedir}/sampledb" />
+            <fileset file="${hsqldb.jar}" />
+        </copy>
+
+    </target>
+
+    <target name="clean" description="--> Removes jars and classes">
+        <delete quiet="true" includeEmptyDirs="true">
+            <fileset dir="${samples.war}/WEB-INF/lib" includes="${webapp.lib},${webtier.lib},${hsqldb.jar}"/>
+            <fileset dir="${samples.war}/WEB-INF/flex/jars" includes="**/*"/>
+            <fileset dir="${samples.war}/WEB-INF/flex/locale" includes="**/*"/>
+            <fileset dir="${samples.war}/WEB-INF/flex/libs" includes="**/*"/>
+            <fileset dir="${samples.war}/WEB-INF/flex" includes="version.properties"/>
+            <fileset dir="${classes.dir}" includes="**/*.class"/>
+            <fileset dir="${basedir}/sampledb" includes="${hsqldb.jar}"/>
+            <fileset file="${dist.dir}/samples.war"/>
+            <fileset file="${samples.war}/WEB-INF/flex-src/flex-src.zip"/>
+            <fileset dir="${samples.war}/sqladmin"/>
+            <fileset dir="${classes.dir}"/>
+        </delete>
+    </target>
+
+    <target name="generated-clean">
+        <delete includeEmptyDirs="true" quiet="true">
+            <fileset dir="${samples.war}" includes="**/generated/*" />
+        </delete>
+        <delete includeEmptyDirs="true" quiet="true">
+            <fileset dir="${samples.war}" includes="**/generated" />
+        </delete>
+    </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/fb-project-setup.htm
----------------------------------------------------------------------
diff --git a/apps/samples/fb-project-setup.htm b/apps/samples/fb-project-setup.htm
new file mode 100755
index 0000000..ddc387c
--- /dev/null
+++ b/apps/samples/fb-project-setup.htm
@@ -0,0 +1,67 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>BlazeDS Flex Builder Integration</title>
+<link href="main.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+
+<h1>Opening the Samples Source Code in Flex Builder 3</h1>
+<h3>Unziping the samples source code </h3>
+<ol>
+  <li>Locate <strong>flex-src.zip</strong> in the <strong>WEB-INF\flex-src</strong> directory of the samples web application. For example, on a typical Windows installation using the Tomcat integrated server, flex-src.zip is located in C:\blazeds\tomcat\webapps\samples\WEB-INF\flex-src.</li>
+  <li>Unzip flex-src.zip to the root  folder of your Flex Builder workspace.</li>
+</ol>
+<h3>Creating Flex Builder projects </h3>
+<p>Create a Flex Builder project for each sample application you  are interested in. There are several approaches to create a Flex Builder project  for a Flex application that works with BlazeDS. We describe a simple approach here:</p>
+<ol>
+  <li>Select <strong>File&gt;New&gt;Project&hellip;</strong> in the Flex Builder menu.</li>
+  <li>    Expand Flex Builder, select <strong>Flex Project</strong> and click Next.</li>
+  <li>    Provide a project name. Use the exact name of the sample  folder. For example testdrive-httpservice.</li>
+  <li>    If you unzipped flex-src.zip in the root folder of your  Flex Builder workspace, keep the <strong>use default location</strong> checkbox checked.</li>
+  <li>    Select <strong>Web Application</strong> as the application type.</li>
+  <li>    Select <strong>Java</strong> as the application server type.</li>
+  <li>    Check use <strong>remote object access service</strong>.</li>
+  <li>    Uncheck Create combined Java/Flex project using WTP.  <strong>Note</strong> this checkbox will only exist if the Eclipse WTP feature is installed.</li>
+  <li> Click <strong>Next</strong>.</li>
+  <li>    Make sure the root folder for LiveCycle Data Services matches the root folder of your BlazeDS web application. If you are using the Tomcat integrated server on Windows, the settings should look similar  to this (you may need to adjust the exact folder based on your own  settings):</li>
+  <blockquote>
+    <p>Root Folder: C:\blazeds\tomcat\webapps\samples<br />
+      Root URL: <a href="http://localhost:8400/lcds-samples/">http://localhost:8400/samples/</a><br />
+    Context Root: /samples</p>
+    </blockquote>
+  <li>Click <strong>Validate Configuration</strong>, then <strong>Finish</strong>.</li>
+</ol>
+<h3>Adding a linked resource to the server configuration files</h3>
+<p>While working on the client-side of your applications, you may need to look at or change the BlazeDS server-side configuration. For example, you may need to look at existing destinations or create a new one. You can create a linked resource inside a Flex Builder project to make the BlazeDS configuration files easily accessible.</p>
+<p>To create a linked resource to the BlazeDS configuration files: </p>
+<ol>
+  <li>Right-click the project name in the project navigation view. </li>
+  <li>Select <strong>New&gt;Folder</strong> in the popup menu.</li>
+  <li>Specify the name of the folder as it will appear in the navigation view.  This     name can be different from the name of the folder in the file system. For example type <strong>server-config</strong>. </li>
+  <li>Click the <strong>Advanced</strong> button.</li>
+  <li>Check  <strong>Link to folder in the file system</strong>.</li>
+  <li>Click the <strong>Browse</strong> button and select the <strong>flex</strong> folder under the <strong>WEB-INF</strong> directory of your web application. For example, on a typical Windows installation using the Tomcat integrated server, select C:\blazeds\tomcat\webapps\samples\WEB-INF\flex. </li>
+  <li>Click <strong>Finish</strong>. The BlazeDS configuration files are now available in your Flex Builder project under the server-config folder. </li>
+</ol>
+
+<p>&nbsp;</p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/images/blazeds.png
----------------------------------------------------------------------
diff --git a/apps/samples/images/blazeds.png b/apps/samples/images/blazeds.png
new file mode 100755
index 0000000..669d4c9
Binary files /dev/null and b/apps/samples/images/blazeds.png differ

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/index.htm
----------------------------------------------------------------------
diff --git a/apps/samples/index.htm b/apps/samples/index.htm
new file mode 100755
index 0000000..e12ec93
--- /dev/null
+++ b/apps/samples/index.htm
@@ -0,0 +1,101 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>BlazeDS Samples</title>
+<link href="main.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+
+<h1><img src="images/blazeds.png" width="100" height="105" /></h1>
+<h1>BlazeDS Samples </h1>
+<div class="highlight">
+<h3>Starting the Samples Database </h3>
+<p>You have to <strong>start the sample database</strong> before you can run the BlazeDS samples. The samples use an HSQLDB database that located in the [installdir]/sampledb directory.</p>
+<p>To start the sample database:</p>
+<ol>
+  <li>Open a command prompt and go to the [installdir]/sampledb</li>
+  <li>Run startdb.bat (Windows) or startdb.sh (Unix-based systems)</li>
+</ol>
+</div>
+<h2>Source Code</h2>
+<p>The source code for all the sample applications is available in samples\WEB-INF\flex-src\flex-src.zip. </p>
+<ul>
+  <li>If you want to examine the source code using your favorite code editor, unzip <strong>flex-src.zip</strong> anywhere on your file system. </li>
+  <li>If you want to work with and compile the sample applications in <strong>Flash Builder</strong>,  read <a href="fb-project-setup.htm">these instructions</a> to set up your Flash Builder projects. </li>
+</ul>
+
+<h2>30 Minute Test Drive</h2>
+<p>The objective of this test drive is to give you, in a very short amount of time, an understanding of how the BlazeDS data services work and what they can do. 
+This test drive consists of a series of eight samples kept as concise as possible (typically between 10 and 50 lines of code) to clearly expose features of interest. </p>
+
+<p><a href="testdrive.htm">Take the test drive</a></p>
+
+<h2>Other Samples</h2>
+<ul>
+<li><a href="#inventory">Inventory Management</a></li>
+<li><a href="#traderdesktop">Trader Desktop</a></li>
+<li><a href="#dashboard">Collaboration Dashboard</a></li>
+<li><a href="#runtimeconfig">Runtime Configuration</a></li>
+</ul>
+
+<div class="item">
+<a name="inventory"></a>
+<h3>Inventory Management</h3>
+<p>This application demonstrates how to use the RemoteObject to build a simple CRUD (Create/Update/Delete) application.</p>
+<p>Click <a href="inventory/index.html">here</a> to start the Inventory Management application</p>
+</div>
+
+<div class="item">
+<a name="traderdesktop"></a>
+<h3>Trader Desktop </h3>
+<p>This example demonstrates how to use the message service to push data from the server to the client. At the server side, a Java component publishes simulated market data to a BlazeDS messaging destination. The Trader Desktop application subscribes to real time updates for the stocks specified in a configurable watch list. This application  lets you experiment with different types of channels (streaming, polling) supported by BlazeDS as well as a channel that uses adaptive polling. Using adaptive polling (using a per client outbound message queue processor), you have full control over  how messages are handled by queue processors  and delivered to individual clients. For example you can specify per-client delays for message delivery, and provide custom logic defining how messages are merged between deliveries.</p>
+<ol>
+  <li>Click <a href="traderdesktop/startfeed.jsp">here</a> to start the feed</li>
+  <li>Click <a href="traderdesktop/index.html">here</a> to start the Trader Desktop application</li>
+  <li>Click <a href="traderdesktop/stopfeed.jsp">here</a> to stop the feed</li>
+</ol>  
+</div>
+
+
+<div class="item">
+<a name="dashboard"></a>
+<h3>Collaboration Dashboard</h3>
+<p>The Collaboration Dashboard show how you can use the Message Service  to build collaborative applications. To try this sample, open the application in two different browser windows 
+and notice how selections made in one window are reflected in the other window. For example, the chart on the left shows total revenue across all regions on a monthly basis. 
+When you select a month in this chart, the pie chart in the upper right panel is updated to display a regional breakdown for the selected month. 
+If you select a region in the pie chart, the chart in the lower-right panel is updated to display the selected region's results compared to the average for the given time period.</p>
+<p><a href="dashboard/index.html">Run the sample </a></p>
+</div>
+
+<div class="item">
+<a name="runtimeconfig"></a>
+<h3>Runtime Configuration </h3>
+<p>Runtime configuration provides an alternative approach to defining destinations and adapters. In addition to statically defining destinations and adapters in the XML configuration files (remoting-config.xml and messaging-config.xml), you can  create destinations and adapters programmatically at runtime. Your runtime destinations and adapters can be injected at server startup, or created as needed during the life cycle of an application. The  remoting destination samples  provide examples of destinations injected at server startup. The messaging sample  provides an example of a destination created as needed. </p>
+<h4>Remoting destination </h4>
+<p><a href="runtimeconfig-remoting/index.html">Run the sample</a> </p>
+<p>See flex.samples.runtimeconfig.EmployeeRuntimeRemotingDestination.java to see how the &quot;runtime-employee-ro&quot; destination is created programmatically.</p>
+<h4>Messaging destination </h4>
+<p><a href="runtimeconfig-messaging/index.html">Run the sample</a> </p>
+<p>See flex.samples.runtimeconfig.ChatRoomService.java to see how the chat room destinations are created programmatically.</p>
+</div>
+
+<p>&copy; 2004-2010 Adobe Systems Incorporated. All rights reserved. </p>
+</body>
+</html>
\ No newline at end of file


[27/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/src/features/bootstrapservices/MessagingBootstrapService.java
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/src/features/bootstrapservices/MessagingBootstrapService.java b/apps/team/WEB-INF/src/features/bootstrapservices/MessagingBootstrapService.java
new file mode 100755
index 0000000..60f78ba
--- /dev/null
+++ b/apps/team/WEB-INF/src/features/bootstrapservices/MessagingBootstrapService.java
@@ -0,0 +1,330 @@
+/*
+ * 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.bootstrapservices;
+
+import java.util.Hashtable;
+
+import flex.messaging.MessageDestination;
+import flex.messaging.config.ConfigMap;
+import flex.messaging.config.NetworkSettings;
+import flex.messaging.config.ServerSettings;
+import flex.messaging.config.ThrottleSettings;
+import flex.messaging.config.ThrottleSettings.Policy;
+import flex.messaging.services.AbstractBootstrapService;
+import flex.messaging.services.Service;
+import flex.messaging.services.messaging.adapters.JMSAdapter;
+import flex.messaging.services.messaging.adapters.JMSSettings;
+
+/**
+ * This BootstrapService is used to dynamicaly create a Messaging Service along 
+ * with its Messaging Destinations without the need for any configuration files.
+ */
+public class MessagingBootstrapService extends AbstractBootstrapService
+{
+    
+    /**
+     * Called by the <code>MessageBroker</code> after all of the server 
+     * components are created but right before they are started. This is 
+     * usually the place to create dynamic components.
+     * 
+     * @param id Id of the <code>AbstractBootstrapService</code>.
+     * @param properties Properties for the <code>AbstractBootstrapService</code>. 
+     */
+    public void initialize(String id, ConfigMap properties)
+    {
+        Service messagingService = createService();
+        createDestination1(messagingService);
+        createDestination2(messagingService);
+    }
+
+    /**
+     * Called by the <code>MessageBroker</code> as server starts. Useful for
+     * custom code that needs to run after all the components are initialized
+     * and the server is starting up. 
+     */    
+    public void start()
+    {
+        // No-op.
+    }
+
+    /**
+     * Called by the <code>MessageBroker</code> as server stops. Useful for 
+     * custom code that needs to run as the server is shutting down.
+     */
+    public void stop()
+    {
+        // No-op.
+    }
+
+    /*
+    <?xml version="1.0" encoding="UTF-8"?>
+    <service id="message-service" class="flex.messaging.services.MessageService">
+
+    <!-- Example messaging-config.xml -->
+
+    <adapters>
+        <!--
+           id: a unique id specifying the adapter
+           class: the Flex Enterprise class which implements the adapter
+             possible values: flex.messaging.services.messaging.adapters.ActionScriptAdapter
+                              flex.messaging.services.messaging.adapters.JMSAdapter
+                              coldfusion.flex.CFEventGatewayAdapter
+           default: an optional attribute identifying the adapter to use when none is specified
+        -->
+        <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>
+     */
+    private Service createService()
+    {
+        String serviceId = "messaging-service";
+        String serviceClass = "flex.messaging.services.MessageService";
+        Service messageService = broker.createService(serviceId, serviceClass);
+
+        messageService.registerAdapter("actionscript", "flex.messaging.services.messaging.adapters.ActionScriptAdapter");
+        messageService.registerAdapter("jms", "flex.messaging.services.messaging.adapters.JMSAdapter");
+        messageService.setDefaultAdapter("actionscript");
+
+        return messageService;
+    }
+
+    /*
+    <!-- Example ActionScriptAdapter destination -->
+    <destination id="MyTopic">
+        <properties>
+            <network>
+                <!--
+                   Idle time in minutes for a subscriber to receive no messages
+                   that triggers it to be automatically unsubscribed.
+                   0 means don't force subscribers to unsubscribe automatically.
+                   Default value is 0.
+                -->
+                <subscription-timeout-minutes>0</subscription-timeout-minutes>
+
+                <!--
+                   Throttling can be set up destination-wide as well as per-client. 
+                   The inbound policy may be NONE, ERROR or IGNORE and the outbound policy may be NONE and IGNORE.
+                   All throttle frequency values are considered the maximum allowed messages per second.
+                   A frequency of 0 disables throttling altogether.
+                -->
+                <throttle-inbound policy="ERROR" max-frequency="0"/>
+                <throttle-outbound policy="IGNORE" max-frequency="0"/>
+            </network>
+
+            <server>
+                <!-- Max number of messages to maintain in memory cache -->
+                <max-cache-size>1000</max-cache-size>
+
+                <!-- message-time-to-live of 0 means live forever -->
+                <message-time-to-live>0</message-time-to-live>
+
+                <!-- 
+                   The subtopic feature lets you divide the messages that a Producer component sends to a destination 
+                   into specific categories at the destination.  You can configure a Consumer component that subscribes to 
+                   the destination to receive only messages sent to a specific subtopic or set of subtopics.  You use 
+                   wildcard characters (*) to send or receive messages from more than one subtopic.  The subtopic-separator 
+                   element is optional; the default value is period
+                -->
+                <allow-subtopics>true</allow-subtopics>
+                <subtopic-separator>.</subtopic-separator>
+
+                <!-- 
+                    Used to choose the algorithm for routing messages in a cluster.
+                    When set to server-to-server (the default), subscriptions are 
+                    broadcast through the cluster to ensure each server knows which 
+                    destinations, subtopics, and selector expressions define subscriptions
+                    for clients connected to other servers.  When a data message
+                    arrives, it is then only sent to servers who have clients interested
+                    in that message.  The other value for this setting "broadcast"
+                    will simply broadcast all data messages to all servers.  In this
+                    mode, subscribe/unsubscribe messages are not sent across the cluster
+                -->
+                <cluster-message-routing>server-to-server</cluster-message-routing>
+            </server>
+        </properties>
+
+        <channels>
+            <!--
+               Set the ref id of the default channels to use as transport for this service.
+               The channel is defined elsewhere using the channel-definition tag.
+            -->
+            <channel ref="my-polling-amf"/>
+        </channels>
+    </destination>
+    */
+    private void createDestination1(Service service)
+    {
+        String destinationId = "MyTopic";
+        MessageDestination destination = (MessageDestination)service.createDestination(destinationId);
+        
+        NetworkSettings ns = new NetworkSettings();
+        ns.setSubscriptionTimeoutMinutes(0);
+        ThrottleSettings ts = new ThrottleSettings();
+        ts.setInboundPolicy(Policy.ERROR);
+        ts.setIncomingDestinationFrequency(0);
+        ts.setOutboundPolicy(Policy.IGNORE);
+        ts.setOutgoingDestinationFrequency(0);
+        ns.setThrottleSettings(ts);
+        destination.setNetworkSettings(ns);
+        
+        ServerSettings ss = new ServerSettings();
+        ss.setMessageTTL(0);
+        ss.setBroadcastRoutingMode("server-to-server");
+        destination.setServerSettings(ss);
+
+        destination.addChannel("my-polling-amf");
+    }
+
+    /*
+    <!-- Example JMSAdapter destination -->
+    <destination id="MyJMSTopic">
+        <properties>
+            <server>
+                <!-- Optional. Default is false. This option is currently only used by JMS
+                     adapter when the destination-type is Topic. In that case, durable JMS
+                     consumers will be used by the JMS adapter. Note that this does not 
+                     guarantee durability between Flex clients and JMS adapter but rather
+                     between JMS adapter and JMS server.
+                <durable>false</durable>
+            </server>
+
+            <!-- For specifics on JMS, please reference the Java Message Service specification or your J2EE server documentation -->
+            <jms>
+                <!--
+                   This determines whether the adapter is performing topic (pub/sub) or queue (point-to-point) messaging.
+                   This element is optional and defaults to Topic.
+
+                <destination-type>Topic</destination-type>
+                -->
+
+                <!--
+                   The name of the destination in JMS
+                   This element is optional and defaults to the destination id
+
+                <destination-name>FlexTopic</destination-name>
+                -->
+
+                <!--
+                   The javax.jms.Message type which the adapter should use for this destination.
+                   Supported types: javax.jms.TextMessage, javax.jms.ObjectMessage
+                -->
+                <message-type>javax.jms.TextMessage</message-type>
+
+                <!-- The name of the JMS connection factory in JNDI -->
+                <connection-factory>jms/flex/TopicConnectionFactory</connection-factory>
+
+                <!-- The name of the destination in JNDI -->
+                <destination-jndi-name>jms/topic/flex/simpletopic</destination-jndi-name>
+
+                <!-- The JMS DeliveryMode for producers -->
+                <delivery-mode>NON_PERSISTENT</delivery-mode>
+
+                <!-- The JMS priority for messages sent by Flash producers -->
+                <message-priority>DEFAULT_PRIORITY</message-priority>
+
+                <!--
+                   The message acknowledgement mode for the JMS adapter
+                   None of these modes require any action on the part of the Flex messaging client.
+                   Supported modes:
+                     AUTO_ACKNOWLEDGE - the JMS provider client runtime automatically acknowledges the messages
+                     DUPS_OK_ACKNOWLEDGE - auto-acknowledgement of the messages is not required
+                     CLIENT_ACKNOWLEDGE - the JMS adapter should acknowledge that the message was received
+                -->
+                <acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
+
+                <!-- The JMS session transaction mode -->
+                <transacted-sessions>false</transacted-sessions>
+                
+                <!--
+                    The maximum number of producer proxies that this destination
+                    should use when communicating with the JMS Server. The default
+                    is 1 which implies all clients using this destinatin will
+                    share the same connection to the JMS server.
+                -->
+                <max-producers>1</max-producers>
+                
+                <!-- (Optional) JNDI environment. Use when using JMS on a remote JNDI server. 
+                Used to specify the JNDI environment to access an external JMS provider. 
+                -->
+                <initial-context-environment>
+                    <property>
+                        <name>Context.SECURITY_PRINCIPAL</name>
+                        <value>anonymous</value>
+                    </property>
+                    <property>
+                        <name>Context.SECURITY_CREDENTIALS</name>
+                        <value>anonymous</value>
+                    </property>
+                    <property>
+                        <name>Context.PROVIDER_URL</name>
+                        <value>http://{server.name}:1856</value>
+                    </property>
+                    <property>
+                        <name>Context.INITIAL_CONTEXT_FACTORY</name>
+                        <value>fiorano.jms.runtime.naming.FioranoInitialContextFactory</value>
+                    </property>
+                </initial-context-environment>
+            </jms>
+        </properties>
+
+        <channels>
+            <channel ref="my-polling-amf"/>
+        </channels>
+
+        <security>
+            <security-constraint ref="sample-users"/>
+        </security>
+
+        <adapter ref="jms"/>
+    </destination>
+     */
+    private void createDestination2(Service service)
+    {
+        String destinationId = "MyJMSTopic";
+        MessageDestination destination = (MessageDestination)service.createDestination(destinationId);
+
+        ServerSettings ss = new ServerSettings();
+        ss.setDurable(false);
+        destination.setServerSettings(ss);
+
+        String adapterId = "jms";
+        JMSAdapter adapter = (JMSAdapter)destination.createAdapter(adapterId);
+
+        // JMS settings are set at the adapter level
+        JMSSettings jms = new JMSSettings();
+        jms.setDestinationType("Topic");
+        jms.setMessageType("javax.jms.TextMessage");
+        jms.setConnectionFactory("jms/flex/TopicConnectionFactory");
+        jms.setDestinationJNDIName("jms/topic/flex/simpletopic");
+        jms.setDeliveryMode("NON_PERSISTENT");
+        //jms.setMessagePriority(javax.jms.Message.DEFAULT_PRIORITY);
+        jms.setAcknowledgeMode("AUTO_ACKNOWLEDGE");
+        jms.setMaxProducers(1);
+        Hashtable envProps = new Hashtable();
+        envProps.put("Context.SECURITY_PRINCIPAL", "anonymous");
+        envProps.put("Context.SECURITY_CREDENTIALS", "anonymous");
+        envProps.put("Context.PROVIDER_URL", "http://{server.name}:1856");
+        envProps.put("Context.INITIAL_CONTEXT_FACTORY", "fiorano.jms.runtime.naming.FioranoInitialContextFactory");
+        jms.setInitialContextEnvironment(envProps);
+        adapter.setJMSSettings(jms);
+
+        destination.setSecurityConstraint("sample-users");
+
+        destination.addChannel("my-polling-amf");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/src/features/bootstrapservices/RemotingBootstrapService.java
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/src/features/bootstrapservices/RemotingBootstrapService.java b/apps/team/WEB-INF/src/features/bootstrapservices/RemotingBootstrapService.java
new file mode 100755
index 0000000..8422a17
--- /dev/null
+++ b/apps/team/WEB-INF/src/features/bootstrapservices/RemotingBootstrapService.java
@@ -0,0 +1,220 @@
+/*
+ * 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.bootstrapservices;
+
+import flex.messaging.config.ConfigMap;
+import flex.messaging.services.AbstractBootstrapService;
+import flex.messaging.services.Service;
+import flex.messaging.services.remoting.RemotingDestination;
+
+/**
+ * This BootstrapService is used to dynamicaly create a Remoting Service along 
+ * with its Remoting Destinations without the need for any configuration files.
+ */
+public class RemotingBootstrapService extends AbstractBootstrapService
+{
+
+    /**
+     * Called by the <code>MessageBroker</code> after all of the server 
+     * components are created but right before they are started. This is 
+     * usually the place to create dynamic components.
+     * 
+     * @param id Id of the <code>AbstractBootstrapService</code>.
+     * @param properties Properties for the <code>AbstractBootstrapService</code>. 
+     */
+    public void initialize(String id, ConfigMap properties)
+    {
+        Service remotingService = createService();
+        createDestination1(remotingService);
+        createDestination2(remotingService);
+        createDestination3(remotingService);
+    }
+
+    /**
+     * Called by the <code>MessageBroker</code> as server starts. Useful for
+     * custom code that needs to run after all the components are initialized
+     * and the server is starting up. 
+     */    
+    public void start()
+    {
+        // No-op.
+    }
+
+    /**
+     * Called by the <code>MessageBroker</code> as server stops. Useful for 
+     * custom code that needs to run as the server is shutting down.
+     */
+    public void stop()
+    {
+        // No-op.
+    }
+
+    /*
+    <?xml version="1.0" encoding="UTF-8"?>
+    <service id="remoting-service" class="flex.messaging.services.RemotingService">
+
+        <!-- Example remoting-config.xml -->
+
+        <!--
+            The set of adapters available for this service. A service uses an 
+            adapter to handle the implementation specifc details of a 
+            destination.
+        -->
+        <adapters>
+            <!--
+                id: A unique id for this adapter-definition. Destinations use this
+                    id to select which adapter should be used to process requests.
+                class: The implementation class for the adapter. A single Remoting 
+                    Service adapter ships with Flex 2:
+                        flex.messaging.services.remoting.adapters.JavaAdapter
+                default: An optional boolean attribute identifying the adapter to
+                    use when none is specified for a destination.
+            -->
+            <adapter-definition id="java-object"
+                class="flex.messaging.services.remoting.adapters.JavaAdapter"
+                default="true"/>
+        </adapters>
+
+        <!--
+            The set of default channels to use to transport messages to 
+            remoting-service destinations.
+        -->
+        <default-channels>
+           <!--
+               ref: A reference to a channel-definition id. Channels are defined
+               in the top level configuration file.
+            -->
+            <channel ref="my-amf"/>
+            <channel ref="my-http"/>
+        </default-channels>
+    */
+    private Service createService()
+    {
+        String serviceId = "remoting-service";
+        String serviceClass = "flex.messaging.services.RemotingService";
+        Service remotingService = broker.createService(serviceId, serviceClass);
+
+        String adapterId = "java-object";
+        String adapterClass = "flex.messaging.services.remoting.adapters.JavaAdapter";
+        remotingService.registerAdapter(adapterId, adapterClass);
+        remotingService.setDefaultAdapter(adapterId);
+
+        remotingService.addDefaultChannel("my-amf");
+        remotingService.addDefaultChannel("my-http");
+
+        return remotingService;
+    }
+
+    /*
+    <!-- 
+        A simple example. 
+        
+        This destination uses the default set of channels 'my-amf' and 
+        'my-http', relies on the default adapter configured for this service, 
+        'java-object' (an instance of JavaAdapter), will use the default factory
+        of the JavaAdapter - the flex.messaging.factories.JavaFactory, and 
+        POJO instances of the class specified by the source property will be 
+        created in the default scope, the 'request' scope.
+    -->
+    <destination id="sample">
+        <properties>
+            <!-- source is the Java class name of the destination -->
+            <source>my.company.SampleService</source>
+        </properties>
+    </destination>
+     */
+    private void createDestination1(Service service)
+    {
+        String destinationId = "sample";
+        RemotingDestination destination = (RemotingDestination)service.createDestination(destinationId);
+        destination.setSource("my.company.SampleService");
+    }
+
+    /*
+    <!-- 
+        A more complex example.
+
+        A custom factory is used to create instances of the source specified
+        for this destination. Instances will be shared between requests in
+        the same session. This destination also restricts access to 
+        authenticated users who are in the 'sampleusers' role.
+    -->
+    <destination id="sampleByFactoryAndSecure">
+        <security>
+            <security-constraint ref="sample-users" />
+        </security>
+        <properties>
+            <!-- 
+                myJavaFactory is defined in the main configuration file. The 
+                source and all other properties are used by the factory to 
+                create the java class. Factory instance provides the java class
+                based on the properties provided such as scope.
+            -->
+            <factory>myJavaFactory</factory>
+            <source>my.company.SampleService</source>
+            <!-- Possible scope values are request, session or application. -->
+            <scope>session</scope>
+        </properties>
+    </destination>
+     */
+    private void createDestination2(Service service)
+    {
+        String destinationId = "sampleByFactoryAndSecure";
+        RemotingDestination destination = (RemotingDestination)service.createDestination(destinationId);
+        destination.setSecurityConstraint("sample-users");
+        destination.setFactory("myJavaFactory");
+        destination.setSource("my.company.SampleService");
+        destination.setScope("session");
+    }
+
+    /*
+    <!--
+        A verbose example using child tags.
+    -->
+    <destination id="sampleVerbose">
+        <channels>
+            <channel ref="my-secure-amf" />
+            <channel ref="my-secure-http" />
+        </channels>
+        <adapter ref="java-object" />
+        <security>
+            <security-constraint ref="sample-users" />
+        </security>
+        <properties>
+            <source>my.company.SampleService</source>
+            <scope>session</scope>
+            <factory>myJavaFactory</factory>
+        </properties>
+    </destination>
+     */
+    private void createDestination3(Service service)
+    {
+        String destinationId = "sampleVerbose";
+        RemotingDestination destination = (RemotingDestination)service.createDestination(destinationId);
+        destination.addChannel("my-secure-amf");
+        destination.addChannel("my-secure-http");
+        
+        String adapterId = "java-object";
+        destination.createAdapter(adapterId);
+        
+        destination.setSecurityConstraint("sample-users");
+        destination.setSource("my.company.SampleService");
+        destination.setScope("session");
+        destination.setFactory("myJavaFactory");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/src/features/messaging/customadapter/CustomActionscriptAdapter.java
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/src/features/messaging/customadapter/CustomActionscriptAdapter.java b/apps/team/WEB-INF/src/features/messaging/customadapter/CustomActionscriptAdapter.java
new file mode 100755
index 0000000..c5fa57e
--- /dev/null
+++ b/apps/team/WEB-INF/src/features/messaging/customadapter/CustomActionscriptAdapter.java
@@ -0,0 +1,96 @@
+/*
+ * 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.messaging.customadapter;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import flex.messaging.MessageClient;
+import flex.messaging.MessageClientListener;
+import flex.messaging.messages.CommandMessage;
+import flex.messaging.services.messaging.adapters.ActionScriptAdapter;
+
+/**
+ * A sample custom adapter that keeps track its own subscriptions.
+ */
+public class CustomActionscriptAdapter extends ActionScriptAdapter implements MessageClientListener
+{
+    /**
+     * Set of subscriptions (clientIds).
+     */
+    private Set<String> clientIds = new HashSet<String>();
+
+    /**
+     * Default constructor adds itself as the MessageClient created listener so
+     * it can get creation notifications as Consumers subscribe (and MessageClients
+     * get created for them on the server).
+     */
+    public CustomActionscriptAdapter()
+    {
+        MessageClient.addMessageClientCreatedListener(this);
+    }
+
+    /**
+     * Manage method is called when Consumer subscribes/unsubscribes.
+     * Override to update the clientIds set.
+     */
+    @Override public Object manage(CommandMessage commandMessage)
+    {
+        int operation = commandMessage.getOperation();
+        String clientId = (String)commandMessage.getClientId();
+        switch (operation)
+        {
+            case CommandMessage.SUBSCRIBE_OPERATION:
+                clientIds.add(clientId);
+                break;
+            case CommandMessage.UNSUBSCRIBE_OPERATION:
+                clientIds.remove(clientId);
+                break;
+            default:
+                break;
+        }
+        return super.manage(commandMessage);
+    }
+
+    /**
+     * Return true, so manage method gets called as Consumer subscribes.
+     */
+    public boolean handlesSubscriptions()
+    {
+        return true;
+    }
+
+    /**
+     * Implements {@link MessageClientListener#messageClientCreated(MessageClient)}
+     */
+    public void messageClientCreated(MessageClient messageClient)
+    {
+        // Add the adapter as MessageClient destroyed listener, so it can get
+        // destruction notifications as the MessageClient gets destroyed due to
+        // Consumer unsubscribe, disconnect, or session invalidation.
+        messageClient.addMessageClientDestroyedListener(this);
+    }
+
+    /**
+     * Implements {@link MessageClientListener#messageClientDestroyed(MessageClient)}
+     */
+    public void messageClientDestroyed(MessageClient messageClient)
+    {
+        String clientId = (String)messageClient.getClientId();
+        clientIds.remove(clientId);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/src/features/messaging/serverpush/ServerPushService.java
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/src/features/messaging/serverpush/ServerPushService.java b/apps/team/WEB-INF/src/features/messaging/serverpush/ServerPushService.java
new file mode 100755
index 0000000..5f46143
--- /dev/null
+++ b/apps/team/WEB-INF/src/features/messaging/serverpush/ServerPushService.java
@@ -0,0 +1,130 @@
+/*
+ * 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.messaging.serverpush;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import flex.messaging.FlexContext;
+import flex.messaging.MessageBroker;
+import flex.messaging.messages.AsyncMessage;
+import flex.messaging.messages.Message;
+import flex.messaging.util.UUIDUtils;
+
+/**
+ * This class can be used as a remote object by Flex client to start/stop pushing
+ * messages from the server.
+ */
+public class ServerPushService
+{
+    static int INFINITE_RUN = -1;
+
+    ScheduledExecutorService messagePushService;
+    MessageBroker broker;
+    int messageCount;
+    int currentRunCount;
+    int runCount;
+
+    public ServerPushService()
+    {
+        broker = FlexContext.getMessageBroker();
+    }
+
+    /**
+     * Push the specified number of messages per the specified number of millis,
+     * runCount number of times (-1 means indefinitely) to the specified destination.
+     */
+    public void startPush(String destinationId, int numberOfMessages, long numberOfMillis, int runCount)
+    {
+        startPush(destinationId, null, numberOfMessages, numberOfMillis, runCount);
+    }
+
+    /**
+     * Push the specified number of messages per the specified number of millis,
+     * runCount number of times (-1 means indefinitely) to the specified destination
+     * and subtopic.
+     */
+    public void startPush(String destinationId, String subtopic, int numberOfMessages, long numberOfMillis, int runCount)
+    {
+        if (messagePushService == null)
+            messagePushService = Executors.newScheduledThreadPool(10);
+
+        this.runCount = runCount;
+        currentRunCount = 0;
+
+        System.out.println("*** ServerPushService started: sending '" + numberOfMessages
+                + "' messages in '" + numberOfMillis + "ms' to destination '" + destinationId + "'[" + subtopic + "].");
+
+        MessageSenderCallable msc = new MessageSenderCallable(destinationId, subtopic, numberOfMessages, numberOfMillis);
+        messagePushService.schedule(msc, numberOfMillis, TimeUnit.MILLISECONDS);
+    }
+
+    public void stopPush()
+    {
+        if (messagePushService != null)
+        {
+            System.out.println("*** ServerPushService stopped.");
+            messagePushService.shutdown();
+            messagePushService = null;
+        }
+    }
+
+    class MessageSenderCallable implements Callable<Object>
+    {
+        private String destinationId;
+        private int numberOfMessages;
+        private long numberOfMillis;
+        private String subtopic;
+
+        public MessageSenderCallable(String destinationId, String subtopic, int numberOfMessages, long numberOfMillis)
+        {
+            this.destinationId = destinationId;
+            this.numberOfMessages = numberOfMessages;
+            this.numberOfMillis = numberOfMillis;
+            this.subtopic = subtopic;
+        }
+
+        public Object call() throws Exception
+        {
+            for (int i = 0; i < numberOfMessages; i++)
+            {
+                Message message = createMessage();
+                broker.routeMessageToService(message, null);
+            }
+            if (runCount == INFINITE_RUN || ++currentRunCount < runCount)
+            {
+                MessageSenderCallable messageSenderCallable = new MessageSenderCallable(destinationId, subtopic, numberOfMessages, numberOfMillis);
+                messagePushService.schedule(messageSenderCallable, numberOfMillis, TimeUnit.MILLISECONDS);
+            }
+            return null;
+        }
+
+        private Message createMessage()
+        {
+            AsyncMessage msg = new AsyncMessage();
+            msg.setDestination(destinationId);
+            msg.setMessageId(UUIDUtils.createUUID(false));
+            msg.setTimestamp(System.currentTimeMillis());
+            msg.setBody("Foo" + messageCount++);
+            if (subtopic != null)
+                msg.setHeader(AsyncMessage.SUBTOPIC_HEADER_NAME, subtopic);
+            return msg;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/src/features/remoting/AMFConnectionTest.java
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/src/features/remoting/AMFConnectionTest.java b/apps/team/WEB-INF/src/features/remoting/AMFConnectionTest.java
new file mode 100755
index 0000000..8bf62a5
--- /dev/null
+++ b/apps/team/WEB-INF/src/features/remoting/AMFConnectionTest.java
@@ -0,0 +1,76 @@
+/*
+ * 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.remoting;
+
+import flex.messaging.io.amf.client.AMFConnection;
+import flex.messaging.io.amf.client.exceptions.ClientStatusException;
+import flex.messaging.io.amf.client.exceptions.ServerStatusException;
+
+/**
+ * An AMFConnection sample that talks to a remoting destination.
+ */
+public class AMFConnectionTest
+{
+    private static final String DEFAULT_URL = "http://localhost:8400/team/messagebroker/amf";
+    private static final String DEFAULT_DESTINATION_ID = "remoting_AMF";
+
+    /**
+     * Given a remote method name, returns the AMF connection call needed using
+     * the default destination id.
+     */
+    private static String getOperationCall(String method)
+    {
+        return DEFAULT_DESTINATION_ID + "." + method;
+    }
+
+    // Not a test, just an example to show how to use AMFConnection.
+    public static void main(String[] args2)
+    {
+        // Create the AMF connection.
+        AMFConnection amfConnection = new AMFConnection();
+
+        // Connect to the remote url.
+        try
+        {
+            amfConnection.connect(DEFAULT_URL);
+        }
+        catch (ClientStatusException cse)
+        {
+            cse.printStackTrace();
+        }
+
+        // Make a remoting call and retrieve the result.
+        try
+        {
+            Object result = amfConnection.call(getOperationCall("echo"), "Foo");
+            System.out.println("Result: " + result);
+        }
+        catch (ClientStatusException cse)
+        {
+            cse.printStackTrace();
+        }
+        catch (ServerStatusException sse)
+        {
+            sse.printStackTrace();
+        }
+        finally
+        {
+            System.out.println("Done");
+            amfConnection.close();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/src/features/remoting/EchoService.java
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/src/features/remoting/EchoService.java b/apps/team/WEB-INF/src/features/remoting/EchoService.java
new file mode 100755
index 0000000..818a3ac
--- /dev/null
+++ b/apps/team/WEB-INF/src/features/remoting/EchoService.java
@@ -0,0 +1,130 @@
+/*
+ * 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 simple class that simply echoes back the provided text. Used by remoting
+ * samples.
+ */
+package features.remoting;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import features.remoting.externalizable.ExternalizableClass;
+import flex.messaging.io.BeanProxy;
+import flex.messaging.io.PropertyProxyRegistry;
+
+public class EchoService
+{
+    // Making sure the read-only properties of ReadOnly class are serialized
+    // back to the client.
+    static
+    {
+        PropertyProxyRegistry registry = PropertyProxyRegistry.getRegistry();
+        BeanProxy beanProxy = new BeanProxy();
+        beanProxy.setIncludeReadOnly(true);
+        registry.register(ReadOnly.class, beanProxy);
+    }
+
+    public String echo(String text)
+    {
+        return "I received '" + text + "' from you";
+    }
+
+    public int echoInt(int value)
+    {
+        return value;
+    }
+
+    public boolean echoBoolean(boolean value)
+    {
+        return value;
+    }
+
+    public List echoDenseArray(List array)
+    {
+        return array;
+    }
+
+    public Map echoSparseArray(Map array)
+    {
+        return array;
+    }
+
+    public Map echoMap(Map map)
+    {
+        return map;
+    }
+
+    public Map echoDictionary(Map dict)
+    {
+        return dict;
+    }
+
+    public Object echoIntVector(Object vector)
+    {
+        return vector;
+    }
+
+    public Object echoUIntVector(Object vector)
+    {
+        return vector;
+    }
+
+    public Object echoDoubleVector(Object vector)
+    {
+        return vector;
+    }
+
+    public Object echoObjectVector(Object vector)
+    {
+        return vector;
+    }
+
+    public Object echoStringVector(Object vector)
+    {
+        return vector;
+    }
+
+    public ExternalizableClass echoExternalizableClass(ExternalizableClass value)
+    {
+        return value;
+    }
+
+    public ReadOnly echoReadOnly()
+    {
+        ReadOnly ro = new ReadOnly("property1");
+        return ro;
+    }
+
+    // A Class that only has a read-only property.
+    public class ReadOnly
+    {
+        private String property;
+
+        public ReadOnly(String property)
+        {
+            this.property = property;
+        }
+
+        public String getProperty()
+        {
+            return property;
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/src/features/remoting/externalizable/ExternalizableClass.java
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/src/features/remoting/externalizable/ExternalizableClass.java b/apps/team/WEB-INF/src/features/remoting/externalizable/ExternalizableClass.java
new file mode 100755
index 0000000..c681502
--- /dev/null
+++ b/apps/team/WEB-INF/src/features/remoting/externalizable/ExternalizableClass.java
@@ -0,0 +1,43 @@
+/*
+ * 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.remoting.externalizable;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * A simple class that uses Externalizable interface to read and write its properties.
+ */
+public class ExternalizableClass implements Externalizable
+{
+    private String property1;
+    private String property2;
+
+    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+    {
+        property1 = (String)in.readObject();
+        property2 = (String)in.readObject();
+    }
+
+    public void writeExternal(ObjectOutput out) throws IOException
+    {
+        out.writeObject(property1);
+        out.writeObject(property2);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/src/features/runtimeconfig/RuntimeConfigurator.java
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/src/features/runtimeconfig/RuntimeConfigurator.java b/apps/team/WEB-INF/src/features/runtimeconfig/RuntimeConfigurator.java
new file mode 100755
index 0000000..ef4b3c3
--- /dev/null
+++ b/apps/team/WEB-INF/src/features/runtimeconfig/RuntimeConfigurator.java
@@ -0,0 +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;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/src/features/validators/deserialization/ClassLoggingDeserializationValidator.java
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/src/features/validators/deserialization/ClassLoggingDeserializationValidator.java b/apps/team/WEB-INF/src/features/validators/deserialization/ClassLoggingDeserializationValidator.java
new file mode 100755
index 0000000..2dff3da
--- /dev/null
+++ b/apps/team/WEB-INF/src/features/validators/deserialization/ClassLoggingDeserializationValidator.java
@@ -0,0 +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.
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/src/features/validators/deserialization/TestDeserializationValidator.java
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/src/features/validators/deserialization/TestDeserializationValidator.java b/apps/team/WEB-INF/src/features/validators/deserialization/TestDeserializationValidator.java
new file mode 100755
index 0000000..51c790e
--- /dev/null
+++ b/apps/team/WEB-INF/src/features/validators/deserialization/TestDeserializationValidator.java
@@ -0,0 +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.
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/build.xml
----------------------------------------------------------------------
diff --git a/apps/team/build.xml b/apps/team/build.xml
new file mode 100755
index 0000000..135d6b9
--- /dev/null
+++ b/apps/team/build.xml
@@ -0,0 +1,198 @@
+<?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" />
+    <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${env.ANT_HOME}/lib/ant-contrib-1.0b2.jar"/>
+    <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" />
+    <if>
+        <equals arg1="${sdk.version}" arg2="3"/>
+        <then>
+            <property name="template.dir" value="client-side-detection-with-history"/>
+            <property name="war.filename" value="team-sdk3.war"/>
+        </then>            
+        <else>
+            <property name="template.dir" value=""/>
+            <property name="war.filename" value="team.war"/>
+        </else>        
+    </if>
+
+    <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/7a58369c/apps/team/features/README.txt
----------------------------------------------------------------------
diff --git a/apps/team/features/README.txt b/apps/team/features/README.txt
new file mode 100755
index 0000000..d5160ac
--- /dev/null
+++ b/apps/team/features/README.txt
@@ -0,0 +1,2 @@
+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/7a58369c/apps/team/features/ajax/README.txt
----------------------------------------------------------------------
diff --git a/apps/team/features/ajax/README.txt b/apps/team/features/ajax/README.txt
new file mode 100755
index 0000000..3d903db
--- /dev/null
+++ b/apps/team/features/ajax/README.txt
@@ -0,0 +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.

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/ajax/messaging/TextMessage.html
----------------------------------------------------------------------
diff --git a/apps/team/features/ajax/messaging/TextMessage.html b/apps/team/features/ajax/messaging/TextMessage.html
new file mode 100755
index 0000000..ef529d3
--- /dev/null
+++ b/apps/team/features/ajax/messaging/TextMessage.html
@@ -0,0 +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>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/ajax/messaging/TextMessage.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/ajax/messaging/TextMessage.mxml b/apps/team/features/ajax/messaging/TextMessage.mxml
new file mode 100755
index 0000000..1e52de9
--- /dev/null
+++ b/apps/team/features/ajax/messaging/TextMessage.mxml
@@ -0,0 +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>
+        
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/messaging/cluster/messaging_AMF_Poll_Cluster.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/cluster/messaging_AMF_Poll_Cluster.mxml b/apps/team/features/messaging/cluster/messaging_AMF_Poll_Cluster.mxml
new file mode 100755
index 0000000..4f60505
--- /dev/null
+++ b/apps/team/features/messaging/cluster/messaging_AMF_Poll_Cluster.mxml
@@ -0,0 +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>
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/messaging/cluster/messaging_HTTP_Poll_Cluster.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/cluster/messaging_HTTP_Poll_Cluster.mxml b/apps/team/features/messaging/cluster/messaging_HTTP_Poll_Cluster.mxml
new file mode 100755
index 0000000..d157261
--- /dev/null
+++ b/apps/team/features/messaging/cluster/messaging_HTTP_Poll_Cluster.mxml
@@ -0,0 +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>
+</mx:Application>
\ No newline at end of file


[33/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex/services-config.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex/services-config.xml b/apps/samples-spring/WEB-INF/flex/services-config.xml
new file mode 100755
index 0000000..6898ed1
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex/services-config.xml
@@ -0,0 +1,122 @@
+<?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-include file-path="remoting-config.xml" />
+        <service-include file-path="proxy-config.xml" />
+        <service-include file-path="messaging-config.xml" />
+        <default-channels>
+           <channel ref="my-amf"/>
+        </default-channels>
+    </services>
+
+    <channels>
+
+        <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"/>
+        </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-longpolling-amf" class="mx.messaging.channels.AMFChannel">
+			<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amflongpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
+			<properties>
+				<polling-enabled>true</polling-enabled>
+				<polling-interval-seconds>5</polling-interval-seconds>
+				<wait-interval-millis>60000</wait-interval-millis>
+				<client-wait-interval-millis>1</client-wait-interval-millis>
+				<max-waiting-poll-requests>200</max-waiting-poll-requests>
+                <user-agent-settings>
+					<!-- MSIE 5, 6, 7 default max number of permanent HTTP connections is 2. -->
+					<user-agent match-on="MSIE" max-streaming-connections-per-session="1"/>
+					<!-- MSIE 8 max number is 6. -->
+					<user-agent match-on="MSIE 8" max-streaming-connections-per-session="5"/>
+					<!-- Firefox 1, 2 max number is 2. --> 
+					<user-agent match-on="Firefox" max-streaming-connections-per-session="1"/>
+					<!-- Firefox 3 max number is 6. -->
+					<user-agent match-on="Firefox/3" max-streaming-connections-per-session="5"/>
+					<!-- Safari 3, 4 max number is 4. -->  
+					<user-agent match-on="Safari" max-streaming-connections-per-session="3"/>
+					<!-- Chrome 0, 1, 2 max number is 6. -->
+					<user-agent match-on="Chrome" max-streaming-connections-per-session="5"/>
+					<!-- Opera 7, 9 max number is 4.-->
+					<user-agent match-on="Opera" max-streaming-connections-per-session="3"/>
+					<!-- Opera 8 max number is 8. -->  
+					<user-agent match-on="Opera 8" max-streaming-connections-per-session="7"/>
+					<!-- Opera 10 max number is 8. -->
+					<user-agent match-on="Opera 10" max-streaming-connections-per-session="7"/>
+                </user-agent-settings>
+			</properties>
+		</channel-definition>        
+		
+        <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>
+
+    </channels>
+    
+    <security>
+        <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>
+    	<security-constraint id="trusted">
+            <roles>
+                <role>ROLE_USER</role>
+                <role>ROLE_ADMIN</role>
+            </roles>
+        </security-constraint>
+    </security>
+
+    <logging>
+        <target class="flex.messaging.log.ConsoleTarget" level="Warn">
+            <properties>
+                <prefix>[BlazeDS] </prefix>
+                <includeDate>false</includeDate>
+                <includeTime>false</includeTime>
+                <includeLevel>false</includeLevel>
+                <includeCategory>false</includeCategory>
+            </properties>
+            <filters>
+                <pattern>Endpoint.*</pattern>
+                <pattern>Service.*</pattern>
+                <pattern>Configuration</pattern>
+            </filters>
+        </target>
+    </logging>
+
+    <system>
+        <redeploy>
+            <enabled>false</enabled>
+        </redeploy>
+    </system>
+
+</services-config>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/spring/app-config.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/spring/app-config.xml b/apps/samples-spring/WEB-INF/spring/app-config.xml
new file mode 100755
index 0000000..e13cdb8
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/spring/app-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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:security="http://www.springframework.org/schema/security"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:context="http://www.springframework.org/schema/context"
+	xsi:schemaLocation="
+		http://www.springframework.org/schema/beans
+		http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+		http://www.springframework.org/schema/security
+		http://www.springframework.org/schema/security/spring-security-3.0.xsd
+		http://www.springframework.org/schema/context
+		http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+	<!-- 
+		Enable annotation-based configuration. companyService and industryService 
+		(used in the Company Manager sample) are configured using annotations. 
+		Open CompanyDAO.java and IndustryDAO.java for details. 
+	-->
+	<context:annotation-config />
+	<context:component-scan base-package="org.springframework.flex.samples" />
+
+	<!-- Implementation of ProductDAO using low-level JDBC -->
+	<bean id="productService" class="org.springframework.flex.samples.product.ProductDAO">
+		<constructor-arg ref="dataSource" />
+	</bean>
+
+	<!-- Implementation of ContactDAO using Spring's JdbcTemplate -->
+	<bean id="contactService" class="org.springframework.flex.samples.contact.ContactDAO">
+		<constructor-arg ref="dataSource" />
+	</bean>
+
+	<!-- A secured implementation of ProductDAO -->
+	<bean id="securedProductService" class="org.springframework.flex.samples.product.ProductDAO">
+		<constructor-arg ref="dataSource" />
+		<security:intercept-methods>
+			<security:protect method="find*" access="ROLE_USER" />
+		</security:intercept-methods>
+	</bean>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/spring/infrastructure-config.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/spring/infrastructure-config.xml b/apps/samples-spring/WEB-INF/spring/infrastructure-config.xml
new file mode 100755
index 0000000..fa70dd2
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/spring/infrastructure-config.xml
@@ -0,0 +1,41 @@
+<?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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:jdbc="http://www.springframework.org/schema/jdbc"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:amq="http://activemq.apache.org/schema/core"
+    xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+        http://www.springframework.org/schema/jdbc
+        http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd">
+ 
+    <!-- Create and populate the tables of the embedded database -->
+    <bean id="dbInit" class="org.springframework.flex.samples.util.DatabaseInitializer">
+        <constructor-arg ref="dataSource" />
+    </bean>
+
+    <!--
+        Simple Spring-managed DataSource for embedded HSQL database
+        The dbInit bean takes care of creating and populating the sample tables.
+    -->
+    <jdbc:embedded-database id="dataSource" type="HSQL" />
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/spring/security-config.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/spring/security-config.xml b/apps/samples-spring/WEB-INF/spring/security-config.xml
new file mode 100755
index 0000000..9c342a7
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/spring/security-config.xml
@@ -0,0 +1,43 @@
+<?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.
+
+-->
+<beans:beans xmlns="http://www.springframework.org/schema/security"
+	xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
+
+	<http entry-point-ref="entryPoint">
+	    <anonymous enabled="false"/>
+		<form-login default-target-url="/spring-blazeds-security-101/index.html" login-page="/login.jsp" />
+	</http>
+    
+	<beans:bean id="entryPoint" 
+	    class="org.springframework.flex.security3.FlexAuthenticationEntryPoint"/>
+	
+	<authentication-manager>
+	   <authentication-provider>
+	       <user-service>
+	        <user name="john" password="john" authorities="ROLE_USER" />
+            <user name="admin" password="admin" authorities="ROLE_USER, ROLE_ADMIN" />
+            <user name="guest" password="guest" authorities="ROLE_GUEST" />
+	       </user-service>
+	   </authentication-provider>
+	</authentication-manager>
+
+</beans:beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/.classpath
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/.classpath b/apps/samples-spring/WEB-INF/src/spring-samples/.classpath
new file mode 100755
index 0000000..18eb959
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/.classpath
@@ -0,0 +1,68 @@
+<?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.
+
+-->
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/aopalliance-1.0.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/aspectjrt-1.6.3.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/aspectjweaver-1.6.5.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/backport-util-concurrent-2.2.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/cglib-nodep-2.1_3.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/commons-codec-1.3.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/commons-httpclient-3.1.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/commons-logging-1.1.1.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/flex-messaging-common.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/flex-messaging-core.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/flex-messaging-opt.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/flex-messaging-proxy.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/flex-messaging-remoting.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/flex-rds-server.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/hsqldb.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/jackson-core-asl-1.0.0.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/jstl-1.1.2.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.aop-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.asm-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.aspects-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.beans-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.context.support-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.context-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.core-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.expression-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.flex-1.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.instrument.tomcat-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.instrument-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.integration-1.0.4.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.jdbc-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.jms-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.orm-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.oxm-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.test-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.transaction-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.web.portlet-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.web.servlet-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.web.struts-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/org.springframework.web-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/spring-security-config-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/spring-security-core-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/spring-security-web-3.0.3.RELEASE.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR/standard-1.1.2.jar"/>
+	<classpathentry kind="var" path="WEBAPP_LIB_DIR"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/.project b/apps/samples-spring/WEB-INF/src/spring-samples/.project
new file mode 100755
index 0000000..ae8612b
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/.project
@@ -0,0 +1,35 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>spring-samples</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/Company.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/Company.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/Company.java
new file mode 100755
index 0000000..92415a1
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/Company.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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 org.springframework.flex.samples.company;
+
+import java.io.Serializable;
+
+import org.springframework.flex.samples.industry.Industry;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public class Company implements Serializable {
+
+    static final long serialVersionUID = 103844514947365244L;
+
+    private int id;
+
+    private String name;
+
+    private String address;
+
+    private String city;
+
+    private String state;
+
+    private String zip;
+
+    private String phone;
+
+    private Industry industry;
+
+    public Company() {
+
+    }
+
+    public int getId() {
+        return this.id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAddress() {
+        return this.address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getCity() {
+        return this.city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getState() {
+        return this.state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getZip() {
+        return this.zip;
+    }
+
+    public void setZip(String zip) {
+        this.zip = zip;
+    }
+
+    public String getPhone() {
+        return this.phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public Industry getIndustry() {
+        return this.industry;
+    }
+
+    public void setIndustry(Industry industry) {
+        this.industry = industry;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/CompanyDAO.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/CompanyDAO.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/CompanyDAO.java
new file mode 100755
index 0000000..4febd31
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/CompanyDAO.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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 org.springframework.flex.samples.company;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.sql.DataSource;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.flex.remoting.RemotingDestination;
+import org.springframework.flex.remoting.RemotingExclude;
+import org.springframework.flex.remoting.RemotingInclude;
+import org.springframework.flex.samples.industry.IIndustryDAO;
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
+import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
+import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
+import org.springframework.stereotype.Service;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+@Service("companyService")
+@RemotingDestination(channels = { "my-amf" })
+public class CompanyDAO implements ICompanyDAO {
+
+    private final SimpleJdbcTemplate template;
+
+    private final SimpleJdbcInsert insertCompany;
+
+    private final IIndustryDAO industryDAO;
+
+    private final RowMapper<Company> rowMapper = new ParameterizedRowMapper<Company>() {
+
+        public Company mapRow(ResultSet rs, int rowNum) throws SQLException {
+            Company company = new Company();
+            company.setId(rs.getInt("id"));
+            company.setName(rs.getString("name"));
+            company.setAddress(rs.getString("address"));
+            company.setCity(rs.getString("city"));
+            company.setState(rs.getString("state"));
+            company.setZip(rs.getString("zip"));
+            company.setPhone(rs.getString("phone"));
+            company.setIndustry(CompanyDAO.this.industryDAO.findById(rs.getInt("industry_id")));
+            return company;
+        }
+    };
+
+    @Autowired
+    public CompanyDAO(DataSource dataSource, IIndustryDAO industryDAO) {
+        this.template = new SimpleJdbcTemplate(dataSource);
+        this.insertCompany = new SimpleJdbcInsert(dataSource).withTableName("COMPANY").usingGeneratedKeyColumns("ID");
+        this.industryDAO = industryDAO;
+    }
+
+    @RemotingInclude
+    public Company findById(int id) {
+        return this.template.queryForObject("SELECT * FROM company WHERE id=?", this.rowMapper, id);
+    }
+
+    @RemotingInclude
+    public List<Company> findAll() {
+        return this.template.query("SELECT * FROM company ORDER BY name", this.rowMapper);
+    }
+
+    @RemotingInclude
+    public List<Company> findByName(String name) {
+        return this.template.query("SELECT * FROM company WHERE UPPER(name) LIKE ? ORDER BY name", this.rowMapper, "%" + name.toUpperCase() + "%");
+    }
+
+    @RemotingInclude
+    public Company create(Company company) {
+        Map<String, Object> parameters = new HashMap<String, Object>();
+        parameters.put("name", company.getName());
+        parameters.put("address", company.getAddress());
+        parameters.put("city", company.getCity());
+        parameters.put("state", company.getState());
+        parameters.put("zip", company.getZip());
+        parameters.put("phone", company.getPhone());
+        parameters.put("industry_id", company.getIndustry().getId());
+        Number id = this.insertCompany.executeAndReturnKey(parameters);
+        company.setId(id.intValue());
+        return company;
+    }
+
+    @RemotingInclude
+    public boolean update(Company company) {
+        int count = this.template.update("UPDATE company SET name=?, address=?, city=?, state=?, zip=?, phone=?, industry_id=? WHERE id=?",
+            company.getName(), company.getAddress(), company.getCity(), company.getState(), company.getZip(), company.getPhone(),
+            company.getIndustry().getId(), company.getId());
+        return count == 1;
+    }
+
+    @RemotingExclude
+    public boolean remove(Company company) {
+        int count = this.template.update("DELETE FROM company WHERE id=?", company.getId());
+        return count == 1;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/ICompanyDAO.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/ICompanyDAO.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/ICompanyDAO.java
new file mode 100755
index 0000000..937d8f4
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/company/ICompanyDAO.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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 org.springframework.flex.samples.company;
+
+import org.springframework.flex.samples.dao.IGenericDAO;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public interface ICompanyDAO extends IGenericDAO<Company> {
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/Contact.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/Contact.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/Contact.java
new file mode 100755
index 0000000..2bb839d
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/Contact.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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 org.springframework.flex.samples.contact;
+
+import java.io.Serializable;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public class Contact implements Serializable {
+
+    static final long serialVersionUID = 103844514947365244L;
+
+    private int id;
+
+    private String firstName;
+
+    private String lastName;
+
+    private String address;
+
+    private String city;
+
+    private String state;
+
+    private String zip;
+
+    private String phone;
+
+    private String email;
+
+    public Contact() {
+
+    }
+
+    public int getId() {
+        return this.id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getFirstName() {
+        return this.firstName;
+    }
+
+    public void setFirstName(String firstName) {
+        this.firstName = firstName;
+    }
+
+    public String getLastName() {
+        return this.lastName;
+    }
+
+    public void setLastName(String lastName) {
+        this.lastName = lastName;
+    }
+
+    public String getAddress() {
+        return this.address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getCity() {
+        return this.city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getState() {
+        return this.state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getZip() {
+        return this.zip;
+    }
+
+    public void setZip(String zip) {
+        this.zip = zip;
+    }
+
+    public String getPhone() {
+        return this.phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getEmail() {
+        return this.email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/ContactDAO.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/ContactDAO.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/ContactDAO.java
new file mode 100755
index 0000000..b6a7fb6
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/ContactDAO.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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.
+ */
+ 
+ /*
+  * This file has been modified by Adobe (Adobe Systems Incorporated).
+  * Date: April 10, 2010
+  * Reason: Migrated the DB used for samples-spring web app to HSQL.
+  */
+
+package org.springframework.flex.samples.contact;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.sql.DataSource;
+
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
+import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
+import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public class ContactDAO implements IContactDAO {
+
+    private final SimpleJdbcTemplate template;
+
+    private final SimpleJdbcInsert insertContact;
+
+    private final RowMapper<Contact> rowMapper = new ParameterizedRowMapper<Contact>() {
+
+        public Contact mapRow(ResultSet rs, int rowNum) throws SQLException {
+            Contact contact = new Contact();
+            contact.setId(rs.getInt("id"));
+            contact.setFirstName(rs.getString("first_name"));
+            contact.setLastName(rs.getString("last_name"));
+            contact.setAddress(rs.getString("address"));
+            contact.setCity(rs.getString("city"));
+            contact.setState(rs.getString("state"));
+            contact.setZip(rs.getString("zip"));
+            contact.setPhone(rs.getString("phone"));
+            contact.setEmail(rs.getString("email"));
+            return contact;
+        }
+    };
+
+    public ContactDAO(DataSource dataSource) {
+        this.template = new SimpleJdbcTemplate(dataSource);
+        this.insertContact = new SimpleJdbcInsert(dataSource).withTableName("CONTACT").usingGeneratedKeyColumns("ID");
+    }
+
+    public List<Contact> findAll() {
+        return this.template.query("SELECT * FROM contact ORDER BY first_name, last_name", this.rowMapper);
+    }
+
+    public List<Contact> findByName(String name) {
+        return this.template.query("SELECT * FROM contact WHERE UPPER(CONCAT(CONCAT(first_name, ' '), last_name)) LIKE ? ORDER BY first_name, last_name",
+            this.rowMapper, "%" + name.toUpperCase() + "%");
+    }
+
+    public Contact findById(int id) {
+        return this.template.queryForObject("SELECT * FROM contact WHERE id=?", this.rowMapper, id);
+    }
+
+    public Contact create(Contact contact) {
+        Map<String, Object> parameters = new HashMap<String, Object>();
+        parameters.put("first_name", contact.getFirstName());
+        parameters.put("last_name", contact.getLastName());
+        parameters.put("address", contact.getAddress());
+        parameters.put("city", contact.getCity());
+        parameters.put("state", contact.getState());
+        parameters.put("zip", contact.getZip());
+        parameters.put("phone", contact.getPhone());
+        parameters.put("email", contact.getEmail());
+        Number id = this.insertContact.executeAndReturnKey(parameters);
+        contact.setId(id.intValue());
+        return contact;
+    }
+
+    public boolean update(Contact contact) {
+        int count = this.template.update(
+            "UPDATE contact SET first_name=?, last_name=?, address=?, city=?, state=?, zip=?, phone=?, email=? WHERE id=?", contact.getFirstName(),
+            contact.getLastName(), contact.getAddress(), contact.getCity(), contact.getState(), contact.getZip(), contact.getPhone(),
+            contact.getEmail(), contact.getId());
+        return count == 1;
+    }
+
+    public boolean remove(Contact contact) {
+        int count = this.template.update("DELETE FROM contact WHERE id=?", contact.getId());
+        return count == 1;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/IContactDAO.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/IContactDAO.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/IContactDAO.java
new file mode 100755
index 0000000..752c68b
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/contact/IContactDAO.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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 org.springframework.flex.samples.contact;
+
+import org.springframework.flex.samples.dao.IGenericDAO;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public interface IContactDAO extends IGenericDAO<Contact> {
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/dao/IGenericDAO.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/dao/IGenericDAO.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/dao/IGenericDAO.java
new file mode 100755
index 0000000..83614e6
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/dao/IGenericDAO.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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 org.springframework.flex.samples.dao;
+
+import java.util.List;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public interface IGenericDAO<T> {
+
+    public List<T> findAll();
+
+    public List<T> findByName(String name);
+
+    public T findById(int id);
+
+    public T create(T item);
+
+    public boolean update(T item);
+
+    public boolean remove(T item);
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IIndustryDAO.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IIndustryDAO.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IIndustryDAO.java
new file mode 100755
index 0000000..980ede7
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IIndustryDAO.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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 org.springframework.flex.samples.industry;
+
+import org.springframework.flex.samples.dao.IGenericDAO;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public interface IIndustryDAO extends IGenericDAO<Industry> {
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/Industry.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/Industry.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/Industry.java
new file mode 100755
index 0000000..292c441
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/Industry.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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 org.springframework.flex.samples.industry;
+
+import java.io.Serializable;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public class Industry implements Serializable {
+
+    static final long serialVersionUID = 103844514947365244L;
+
+    private int id;
+
+    private String name;
+
+    public Industry() {
+
+    }
+
+    public int getId() {
+        return this.id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IndustryDAO.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IndustryDAO.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IndustryDAO.java
new file mode 100755
index 0000000..27ff898
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/industry/IndustryDAO.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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 org.springframework.flex.samples.industry;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.sql.DataSource;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.flex.remoting.RemotingDestination;
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
+import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
+import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
+import org.springframework.stereotype.Service;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+@Service("industryService")
+@RemotingDestination(channels = { "my-amf" })
+public class IndustryDAO implements IIndustryDAO {
+
+    private final SimpleJdbcTemplate template;
+
+    private final SimpleJdbcInsert insertIndustry;
+
+    private final RowMapper<Industry> rowMapper = new ParameterizedRowMapper<Industry>() {
+
+        public Industry mapRow(ResultSet rs, int rowNum) throws SQLException {
+            Industry industry = new Industry();
+            industry.setId(rs.getInt("id"));
+            industry.setName(rs.getString("name"));
+            return industry;
+        }
+    };
+
+    public List<Industry> findAll() {
+        return this.template.query("SELECT * FROM industry ORDER BY name", this.rowMapper);
+    }
+
+    public List<Industry> findByName(String name) {
+        return this.template.query("SELECT * FROM industry WHERE UPPER(name) LIKE ? ORDER BY name", this.rowMapper, "%" + name.toUpperCase() + "%");
+    }
+
+    @Autowired
+    public IndustryDAO(DataSource dataSource) {
+        this.template = new SimpleJdbcTemplate(dataSource);
+        this.insertIndustry = new SimpleJdbcInsert(dataSource).withTableName("INDUSTRY").usingGeneratedKeyColumns("ID");
+    }
+
+    public Industry findById(int id) {
+        return this.template.queryForObject("SELECT * FROM industry WHERE id=?", this.rowMapper, id);
+    }
+
+    public Industry create(Industry industry) {
+        Map<String, Object> parameters = new HashMap<String, Object>();
+        parameters.put("name", industry.getName());
+        Number id = this.insertIndustry.executeAndReturnKey(parameters);
+        industry.setId(id.intValue());
+        return industry;
+    }
+
+    public boolean update(Industry industry) {
+        int count = this.template.update("UPDATE industry SET name=? WHERE id=?", industry.getName());
+        return count == 1;
+    }
+
+    public boolean remove(Industry industry) {
+        int count = this.template.update("DELETE FROM industry WHERE id=?", industry.getId());
+        return count == 1;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/integration/Counter.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/integration/Counter.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/integration/Counter.java
new file mode 100755
index 0000000..2360fcc
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/integration/Counter.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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 org.springframework.flex.samples.integration;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * 
+ * @author Mark Fisher
+ * @author Jeremy Grelle
+ */
+public class Counter {
+
+    private volatile boolean running;
+
+    private final Log log = LogFactory.getLog(Counter.class);
+
+    private final AtomicInteger count = new AtomicInteger();
+
+    public Integer next() {
+        return this.running ? this.count.getAndIncrement() : null;
+    }
+
+    public void handle(String message) {
+        if ("start".equalsIgnoreCase(message)) {
+            this.running = true;
+        } else if ("stop".equalsIgnoreCase(message)) {
+            this.running = false;
+        } else {
+            try {
+                this.count.set(Integer.parseInt(message));
+            } catch (NumberFormatException e) {
+                this.log.info("UNSUPPORTED FLEX MESSAGE RECEIVED: " + message);
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/MarketFeed.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/MarketFeed.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/MarketFeed.java
new file mode 100755
index 0000000..cd5e4b5
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/MarketFeed.java
@@ -0,0 +1,201 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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.
+ */
+
+  /*
+  * This file has been modified by Adobe (Adobe Systems Incorporated).
+  * Date: May 19, 2010
+  * Reason(s): Fixed the following issues:
+  * BLZ-533: unexploded war fails to deploy on weblogic
+  * 
+  * Date: Oct 7, 2010
+  * Reason(s): Fixed the following issues:
+  * BLZ-573: Cannot create a new company in Company Manager Sample in Spring BlazeDS Integration Test Drive
+  * BLZ-574: Error in creating new contact in insync05 sample in Spring BlazeDS Integration test drive
+  */
+
+package org.springframework.flex.samples.marketfeed;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Random;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.springframework.core.io.Resource;
+import org.springframework.flex.messaging.AsyncMessageCreator;
+import org.springframework.flex.messaging.MessageTemplate;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import flex.messaging.messages.AsyncMessage;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public class MarketFeed {
+
+    private static FeedThread thread;
+
+    private final MessageTemplate template;
+
+    private final List<Stock> stockList;
+
+    public MarketFeed(MessageTemplate template, Resource filePath) throws IOException {
+        this.template = template;
+        this.stockList = getStocks(filePath.getInputStream());
+    }
+
+    public void start() {
+        if (thread == null) {
+            thread = new FeedThread(this.template, this.stockList);
+            thread.start();
+        }
+    }
+
+    public void stop() {
+        if (thread != null) {
+            thread.running = false;
+            thread = null;
+        }
+    }
+
+    private List<Stock> getStocks(InputStream fileInputStream) {
+
+        List<Stock> list = new ArrayList<Stock>();
+
+        try {
+            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+            factory.setValidating(false);
+            Document doc = factory.newDocumentBuilder().parse(fileInputStream);
+            NodeList stockNodes = doc.getElementsByTagName("stock");
+            int length = stockNodes.getLength();
+            Stock stock;
+            Node stockNode;
+            for (int i = 0; i < length; i++) {
+                stockNode = stockNodes.item(i);
+                stock = new Stock();
+                stock.setSymbol(getStringValue(stockNode, "symbol"));
+                stock.setName(getStringValue(stockNode, "company"));
+                stock.setLast(getDoubleValue(stockNode, "last"));
+                stock.setHigh(stock.getLast());
+                stock.setLow(stock.getLast());
+                stock.setOpen(stock.getLast());
+                stock.setChange(0);
+                list.add(stock);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return list;
+    }
+
+    private String getStringValue(Node node, String name) {
+        return ((Element) node).getElementsByTagName(name).item(0).getFirstChild().getNodeValue();
+    }
+
+    private double getDoubleValue(Node node, String name) {
+        return Double.parseDouble(getStringValue(node, name));
+    }
+
+    public static class FeedThread extends Thread {
+
+        public boolean running = false;
+
+        private final MessageTemplate template;
+
+        private final List<Stock> stockList;
+
+        private final Random random = new Random();
+
+        public FeedThread(MessageTemplate template, List<Stock> stockList) {
+            this.template = template;
+            this.stockList = stockList;
+        }
+
+        @Override
+        public void run() {
+            this.running = true;
+
+            int size = this.stockList.size();
+            int index = 0;
+
+            Stock stock;
+
+            while (this.running) {
+
+                stock = this.stockList.get(index);
+                simulateChange(stock);
+
+                index++;
+                if (index >= size) {
+                    index = 0;
+                }
+
+                sendStockUpdate(stock);
+
+                try {
+                    Thread.sleep(20);
+                } catch (InterruptedException e) {
+                }
+
+            }
+        }
+
+        private void sendStockUpdate(final Stock stock) {
+            template.send(new AsyncMessageCreator() {
+
+                public AsyncMessage createMessage() {
+                    AsyncMessage msg = template.createMessageForDestination("market-feed");
+                    msg.setHeader("DSSubtopic", stock.getSymbol());
+                    msg.setBody(stock);
+                    return msg;
+                }
+            });
+        }
+
+        private void simulateChange(Stock stock) {
+
+            double maxChange = stock.open * 0.005;
+            double change = maxChange - this.random.nextDouble() * maxChange * 2;
+            stock.change = change;
+            double last = stock.last + change;
+
+            if (last < stock.open + stock.open * 0.15 && last > stock.open - stock.open * 0.15) {
+                stock.last = last;
+            } else {
+                stock.last = stock.last - change;
+            }
+
+            if (stock.last > stock.high) {
+                stock.high = stock.last;
+            } else if (stock.last < stock.low) {
+                stock.low = stock.last;
+            }
+            stock.date = new Date();
+
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/Stock.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/Stock.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/Stock.java
new file mode 100755
index 0000000..bcef1f5
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/marketfeed/Stock.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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 org.springframework.flex.samples.marketfeed;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public class Stock implements Serializable {
+
+    private static final long serialVersionUID = -1763421100056755200L;
+
+    protected String symbol;
+
+    protected String name;
+
+    protected double low;
+
+    protected double high;
+
+    protected double open;
+
+    protected double last;
+
+    protected double change;
+
+    protected Date date;
+
+    public double getChange() {
+        return this.change;
+    }
+
+    public void setChange(double change) {
+        this.change = change;
+    }
+
+    public double getHigh() {
+        return this.high;
+    }
+
+    public void setHigh(double high) {
+        this.high = high;
+    }
+
+    public double getLast() {
+        return this.last;
+    }
+
+    public void setLast(double last) {
+        this.last = last;
+    }
+
+    public double getLow() {
+        return this.low;
+    }
+
+    public void setLow(double low) {
+        this.low = low;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public double getOpen() {
+        return this.open;
+    }
+
+    public void setOpen(double open) {
+        this.open = open;
+    }
+
+    public String getSymbol() {
+        return this.symbol;
+    }
+
+    public void setSymbol(String symbol) {
+        this.symbol = symbol;
+    }
+
+    public Date getDate() {
+        return this.date;
+    }
+
+    public void setDate(Date date) {
+        this.date = date;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/IProductDAO.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/IProductDAO.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/IProductDAO.java
new file mode 100755
index 0000000..6e3f6fc
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/IProductDAO.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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 org.springframework.flex.samples.product;
+
+import org.springframework.flex.samples.dao.IGenericDAO;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public interface IProductDAO extends IGenericDAO<Product> {
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/Product.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/Product.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/Product.java
new file mode 100755
index 0000000..f53157b
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/Product.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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 org.springframework.flex.samples.product;
+
+import java.io.Serializable;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public class Product implements Serializable {
+
+    static final long serialVersionUID = 103844514947365244L;
+
+    private int productId;
+
+    private String name;
+
+    private String description;
+
+    private String image;
+
+    private String category;
+
+    private double price;
+
+    private int qty;
+
+    public Product() {
+
+    }
+
+    public Product(int productId, String name, String description, String image, String category, double price, int qty) {
+        this.productId = productId;
+        this.name = name;
+        this.description = description;
+        this.image = image;
+        this.category = category;
+        this.price = price;
+        this.qty = qty;
+    }
+
+    public String getCategory() {
+        return this.category;
+    }
+
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    public String getDescription() {
+        return this.description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getImage() {
+        return this.image;
+    }
+
+    public void setImage(String image) {
+        this.image = image;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public double getPrice() {
+        return this.price;
+    }
+
+    public void setPrice(double price) {
+        this.price = price;
+    }
+
+    public int getProductId() {
+        return this.productId;
+    }
+
+    public void setProductId(int productId) {
+        this.productId = productId;
+    }
+
+    public int getQty() {
+        return this.qty;
+    }
+
+    public void setQty(int qty) {
+        this.qty = qty;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/ProductDAO.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/ProductDAO.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/ProductDAO.java
new file mode 100755
index 0000000..548f006
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/product/ProductDAO.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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 org.springframework.flex.samples.product;
+
+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 javax.sql.DataSource;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public class ProductDAO implements IProductDAO {
+
+    private final DataSource dataSource;
+
+    public ProductDAO(DataSource dataSource) {
+        this.dataSource = dataSource;
+    }
+
+    public List<Product> findAll() {
+        List<Product> list = new ArrayList<Product>();
+        Connection c = null;
+
+        try {
+            c = this.dataSource.getConnection();
+            Statement s = c.createStatement();
+            ResultSet rs = s.executeQuery("SELECT * FROM product ORDER BY name");
+            while (rs.next()) {
+                list.add(new Product(rs.getInt("id"), rs.getString("name"), rs.getString("description"), rs.getString("image"),
+                    rs.getString("category"), rs.getDouble("price"), rs.getInt("qty")));
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+        return list;
+    }
+
+    public List<Product> findByName(String name) {
+        List<Product> list = new ArrayList<Product>();
+        Connection c = null;
+        try {
+            c = this.dataSource.getConnection();
+            PreparedStatement ps = c.prepareStatement("SELECT * FROM product WHERE UPPER(name) LIKE ? ORDER BY name");
+            ps.setString(1, "%" + name.toUpperCase() + "%");
+            ResultSet rs = ps.executeQuery();
+            while (rs.next()) {
+                list.add(new Product(rs.getInt("id"), rs.getString("name"), rs.getString("description"), rs.getString("image"),
+                    rs.getString("category"), rs.getDouble("price"), rs.getInt("qty")));
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+        return list;
+    }
+
+    public Product findById(int id) {
+        Product product = new Product();
+        Connection c = null;
+        try {
+            c = this.dataSource.getConnection();
+            PreparedStatement ps = c.prepareStatement("SELECT * FROM product WHERE id=?");
+            ps.setInt(1, id);
+            ResultSet rs = ps.executeQuery();
+            if (rs.next()) {
+                product = new Product();
+                product.setProductId(rs.getInt("id"));
+                product.setName(rs.getString("name"));
+                product.setDescription(rs.getString("description"));
+                product.setImage(rs.getString("image"));
+                product.setCategory(rs.getString("category"));
+                product.setPrice(rs.getDouble("price"));
+                product.setQty(rs.getInt("qty"));
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+        return product;
+    }
+
+    public Product create(Product product) {
+        Connection c = null;
+        PreparedStatement ps = null;
+        try {
+            c = this.dataSource.getConnection();
+            ps = c.prepareStatement("INSERT INTO product (name, description, image, category, price, qty) VALUES (?, ?, ?, ?, ?, ?)",
+                new String[] { "ID" });
+            ps.setString(1, product.getName());
+            ps.setString(2, product.getDescription());
+            ps.setString(3, product.getImage());
+            ps.setString(4, product.getCategory());
+            ps.setDouble(5, product.getPrice());
+            ps.setInt(6, product.getQty());
+            ps.executeUpdate();
+            ResultSet rs = ps.getGeneratedKeys();
+            rs.next();
+            // Update the id in the returned object. This is important as this value must be returned to the client.
+            int id = rs.getInt(1);
+            product.setProductId(id);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+        return product;
+    }
+
+    public boolean update(Product product) {
+        Connection c = null;
+        try {
+            c = this.dataSource.getConnection();
+            PreparedStatement ps = c.prepareStatement("UPDATE product SET name=?, description=?, image=?, category=?, price=?, qty=? WHERE id=?");
+            ps.setString(1, product.getName());
+            ps.setString(2, product.getDescription());
+            ps.setString(3, product.getImage());
+            ps.setString(4, product.getCategory());
+            ps.setDouble(5, product.getPrice());
+            ps.setInt(6, product.getQty());
+            ps.setInt(7, product.getProductId());
+            return ps.executeUpdate() == 1;
+        } catch (SQLException e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+
+    }
+
+    public boolean remove(Product product) {
+        Connection c = null;
+        try {
+            c = this.dataSource.getConnection();
+            PreparedStatement ps = c.prepareStatement("DELETE FROM product WHERE id=?");
+            ps.setInt(1, product.getProductId());
+            int count = ps.executeUpdate();
+            return count == 1;
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/secured/Security3Helper.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/secured/Security3Helper.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/secured/Security3Helper.java
new file mode 100755
index 0000000..24bd1c0
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/secured/Security3Helper.java
@@ -0,0 +1,29 @@
+/*
+ * 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 org.springframework.flex.samples.secured;
+
+import java.util.Map;
+
+import org.springframework.flex.security3.AuthenticationResultUtils;
+
+
+public class Security3Helper {
+
+    public Map<String, Object> getAuthentication() {
+        return AuthenticationResultUtils.getAuthenticationResult();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/simplefeed/SimpleFeed.java
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/simplefeed/SimpleFeed.java b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/simplefeed/SimpleFeed.java
new file mode 100755
index 0000000..939bdde
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/src/spring-samples/src/org/springframework/flex/samples/simplefeed/SimpleFeed.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2002-2009 the original author or authors.
+ * 
+ * Licensed 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.
+ */
+
+ /*
+  * This file has been modified by Adobe (Adobe Systems Incorporated).
+  * Date: Oct 7, 2010
+  * Reason(s): Fixed the following issues:
+  * BLZ-573: Cannot create a new company in Company Manager Sample in Spring BlazeDS Integration Test Drive
+  * BLZ-574: Error in creating new contact in insync05 sample in Spring BlazeDS Integration test drive
+  */
+
+package org.springframework.flex.samples.simplefeed;
+
+import java.util.Random;
+
+import org.springframework.flex.messaging.MessageTemplate;
+
+/**
+ * 
+ * @author Christophe Coenraets
+ * @author Jeremy Grelle
+ */
+public class SimpleFeed {
+
+    private static FeedThread thread;
+
+    private final MessageTemplate template;
+
+    public SimpleFeed(MessageTemplate template) {
+        this.template = template;
+    }
+
+    public void start() {
+        if (thread == null) {
+            thread = new FeedThread(this.template);
+            thread.start();
+        }
+    }
+
+    public void stop() {
+        if (thread != null) {
+            thread.running = false;
+            thread = null;
+        }
+    }
+
+    public static class FeedThread extends Thread {
+
+        public boolean running = false;
+
+        private final MessageTemplate template;
+
+        public FeedThread(MessageTemplate template) {
+            this.template = template;
+        }
+
+        @Override
+        public void run() {
+            this.running = true;
+            Random random = new Random();
+            double initialValue = 35;
+            double currentValue = 35;
+            double maxChange = initialValue * 0.005;
+
+            while (this.running) {
+                double change = maxChange - random.nextDouble() * maxChange * 2;
+                double newValue = currentValue + change;
+
+                if (currentValue < initialValue + initialValue * 0.15 && currentValue > initialValue - initialValue * 0.15) {
+                    currentValue = newValue;
+                } else {
+                    currentValue -= change;
+                }
+
+                this.template.send("simple-feed", new Double(currentValue));
+
+                try {
+                    Thread.sleep(300);
+                } catch (InterruptedException e) {
+                }
+
+            }
+        }
+    }
+
+}


[39/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/history/history.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/history/history.js b/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/history/history.js
new file mode 100755
index 0000000..0f82450
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/history/history.js
@@ -0,0 +1,722 @@
+/*
+ * 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.
+ */
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        ie8: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+        if (browser.version == 8)
+        {
+            browser.ie = false;
+            browser.ie8 = true;
+        }
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    function hashChangeHandler()
+    {
+        currentHref = document.location.href;
+        var flexAppUrl = getHash();
+        //ADR: to fix multiple
+        if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+            var pl = getPlayers();
+            for (var i = 0; i < pl.length; i++) {
+                pl[i].browserURLChange(flexAppUrl);
+            }
+        } else {
+            getPlayer().browserURLChange(flexAppUrl);
+        }
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+        var i;
+
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+                for (i = 0; i < o.length; i++) {
+                    if (typeof o[i].browserURLChange != "undefined")
+                        return o[i];
+                }
+                for (i = 0; i < e.length; i++) {
+                    if (typeof e[i].browserURLChange != "undefined")
+                        return e[i];
+                }
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+            for (i = 0; i < e.length; i++) {
+                if (typeof e[i].browserURLChange != "undefined")
+                {
+                    return e[i];
+                }
+            }
+            for (i = 0; i < o.length; i++) {
+                if (typeof o[i].browserURLChange != "undefined")
+                {
+                    return o[i];
+                }
+            }
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var i;
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+                        currentHref = document.location.href;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                var flexAppUrl = getHash();
+                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
+                {    
+                    // If it did change and we're running Safari 3.x or earlier, 
+                    // then we have to look the old state up in our hand-maintained 
+                    // array since document.location.hash won't have changed, 
+                    // then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                    flexAppUrl = historyHash[currentHistoryLength];
+                }
+
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            iframe.src = 'javascript:false;'; 
+
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox || browser.ie8)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+
+        if (browser.ie8)        
+            document.body.onhashchange = hashChangeHandler;
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        },
+        getUserAgent: function() {
+            return navigator.userAgent;
+        },
+        getPlatform: function() {
+            return navigator.platform;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/history/historyFrame.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/history/historyFrame.html b/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/history/historyFrame.html
new file mode 100755
index 0000000..63bdd3e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/history/historyFrame.html
@@ -0,0 +1,45 @@
+<!--
+  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>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/index.template.html b/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/index.template.html
new file mode 100755
index 0000000..e3e9c81
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/swfobject.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/swfobject.js b/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/swfobject.js
new file mode 100755
index 0000000..07730fa
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/swfobject.js
@@ -0,0 +1,793 @@
+/*
+ * 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.
+ */
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+	
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+		ON_READY_STATE_CHANGE = "onreadystatechange",
+		
+		win = window,
+		doc = document,
+		nav = navigator,
+		
+		plugin = false,
+		domLoadFnArr = [main],
+		regObjArr = [],
+		objIdArr = [],
+		listenersArr = [],
+		storedAltContent,
+		storedAltContentId,
+		storedCallbackFn,
+		storedCallbackObj,
+		isDomLoaded = false,
+		isExpressInstallActive = false,
+		dynamicStylesheet,
+		dynamicStylesheetMedia,
+		autoHideShow = true,
+	
+	/* Centralized function for browser feature detection
+		- User agent string detection is only used when no good alternative is possible
+		- Is executed directly for optimal performance
+	*/	
+	ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+			u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+				plugin = true;
+				ie = false; // cascaded feature detection for Internet Explorer
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			try {
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+				if (a) { // a will return null when ActiveX is disabled
+					d = a.GetVariable("$version");
+					if (d) {
+						ie = true; // cascaded feature detection for Internet Explorer
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+			}
+			catch(e) {}
+		}
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+	}(),
+	
+	/* Cross-browser onDomLoad
+		- Will fire an event as soon as the DOM of a web page is loaded
+		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+		- Regular onload serves as fallback
+	*/ 
+	onDomLoad = function() {
+		if (!ua.w3) { return; }
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+			callDomLoadFunctions();
+		}
+		if (!isDomLoaded) {
+			if (typeof doc.addEventListener != UNDEF) {
+				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+			}		
+			if (ua.ie && ua.win) {
+				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+					if (doc.readyState == "complete") {
+						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+						callDomLoadFunctions();
+					}
+				});
+				if (win == top) { // if not inside an iframe
+					(function(){
+						if (isDomLoaded) { return; }
+						try {
+							doc.documentElement.doScroll("left");
+						}
+						catch(e) {
+							setTimeout(arguments.callee, 0);
+							return;
+						}
+						callDomLoadFunctions();
+					})();
+				}
+			}
+			if (ua.wk) {
+				(function(){
+					if (isDomLoaded) { return; }
+					if (!/loaded|complete/.test(doc.readyState)) {
+						setTimeout(arguments.callee, 0);
+						return;
+					}
+					callDomLoadFunctions();
+				})();
+			}
+			addLoadEvent(callDomLoadFunctions);
+		}
+	}();
+	
+	function callDomLoadFunctions() {
+		if (isDomLoaded) { return; }
+		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+			t.parentNode.removeChild(t);
+		}
+		catch (e) { return; }
+		isDomLoaded = true;
+		var dl = domLoadFnArr.length;
+		for (var i = 0; i < dl; i++) {
+			domLoadFnArr[i]();
+		}
+	}
+	
+	function addDomLoadEvent(fn) {
+		if (isDomLoaded) {
+			fn();
+		}
+		else { 
+			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+		}
+	}
+	
+	/* Cross-browser onload
+		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+		- Will fire an event as soon as a web page including all of its assets are loaded 
+	 */
+	function addLoadEvent(fn) {
+		if (typeof win.addEventListener != UNDEF) {
+			win.addEventListener("load", fn, false);
+		}
+		else if (typeof doc.addEventListener != UNDEF) {
+			doc.addEventListener("load", fn, false);
+		}
+		else if (typeof win.attachEvent != UNDEF) {
+			addListener(win, "onload", fn);
+		}
+		else if (typeof win.onload == "function") {
+			var fnOld = win.onload;
+			win.onload = function() {
+				fnOld();
+				fn();
+			};
+		}
+		else {
+			win.onload = fn;
+		}
+	}
+	
+	/* Main function
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
+	*/
+	function main() { 
+		if (plugin) {
+			testPlayerVersion();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Detect the Flash Player version for non-Internet Explorer browsers
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+		  a. Both release and build numbers can be detected
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+	*/
+	function testPlayerVersion() {
+		var b = doc.getElementsByTagName("body")[0];
+		var o = createElement(OBJECT);
+		o.setAttribute("type", FLASH_MIME_TYPE);
+		var t = b.appendChild(o);
+		if (t) {
+			var counter = 0;
+			(function(){
+				if (typeof t.GetVariable != UNDEF) {
+					var d = t.GetVariable("$version");
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				else if (counter < 10) {
+					counter++;
+					setTimeout(arguments.callee, 10);
+					return;
+				}
+				b.removeChild(o);
+				t = null;
+				matchVersions();
+			})();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Perform Flash Player and SWF version matching; static publishing only
+	*/
+	function matchVersions() {
+		var rl = regObjArr.length;
+		if (rl > 0) {
+			for (var i = 0; i < rl; i++) { // for each registered object element
+				var id = regObjArr[i].id;
+				var cb = regObjArr[i].callbackFn;
+				var cbObj = {success:false, id:id};
+				if (ua.pv[0] > 0) {
+					var obj = getElementById(id);
+					if (obj) {
+						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+							setVisibility(id, true);
+							if (cb) {
+								cbObj.success = true;
+								cbObj.ref = getObjectById(id);
+								cb(cbObj);
+							}
+						}
+						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+							var att = {};
+							att.data = regObjArr[i].expressInstall;
+							att.width = obj.getAttribute("width") || "0";
+							att.height = obj.getAttribute("height") || "0";
+							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+							// parse HTML object param element's name-value pairs
+							var par = {};
+							var p = obj.getElementsByTagName("param");
+							var pl = p.length;
+							for (var j = 0; j < pl; j++) {
+								if (p[j].getAttribute("name").toLowerCase() != "movie") {
+									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+								}
+							}
+							showExpressInstall(att, par, id, cb);
+						}
+						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+							displayAltContent(obj);
+							if (cb) { cb(cbObj); }
+						}
+					}
+				}
+				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+					setVisibility(id, true);
+					if (cb) {
+						var o = getObjectById(id); // test whether there is an HTML object element or not
+						if (o && typeof o.SetVariable != UNDEF) { 
+							cbObj.success = true;
+							cbObj.ref = o;
+						}
+						cb(cbObj);
+					}
+				}
+			}
+		}
+	}
+	
+	function getObjectById(objectIdStr) {
+		var r = null;
+		var o = getElementById(objectIdStr);
+		if (o && o.nodeName == "OBJECT") {
+			if (typeof o.SetVariable != UNDEF) {
+				r = o;
+			}
+			else {
+				var n = o.getElementsByTagName(OBJECT)[0];
+				if (n) {
+					r = n;
+				}
+			}
+		}
+		return r;
+	}
+	
+	/* Requirements for Adobe Express Install
+		- only one instance can be active at a time
+		- fp 6.0.65 or higher
+		- Win/Mac OS only
+		- no Webkit engines older than version 312
+	*/
+	function canExpressInstall() {
+		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+	}
+	
+	/* Show the Adobe Express Install dialog
+		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+	*/
+	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+		isExpressInstallActive = true;
+		storedCallbackFn = callbackFn || null;
+		storedCallbackObj = {success:false, id:replaceElemIdStr};
+		var obj = getElementById(replaceElemIdStr);
+		if (obj) {
+			if (obj.nodeName == "OBJECT") { // static publishing
+				storedAltContent = abstractAltContent(obj);
+				storedAltContentId = null;
+			}
+			else { // dynamic publishing
+				storedAltContent = obj;
+				storedAltContentId = replaceElemIdStr;
+			}
+			att.id = EXPRESS_INSTALL_ID;
+			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+				fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+			if (typeof par.flashvars != UNDEF) {
+				par.flashvars += "&" + fv;
+			}
+			else {
+				par.flashvars = fv;
+			}
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			if (ua.ie && ua.win && obj.readyState != 4) {
+				var newObj = createElement("div");
+				replaceElemIdStr += "SWFObjectNew";
+				newObj.setAttribute("id", replaceElemIdStr);
+				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						obj.parentNode.removeChild(obj);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			createSWF(att, par, replaceElemIdStr);
+		}
+	}
+	
+	/* Functions to abstract and display alternative content
+	*/
+	function displayAltContent(obj) {
+		if (ua.ie && ua.win && obj.readyState != 4) {
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			var el = createElement("div");
+			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+			el.parentNode.replaceChild(abstractAltContent(obj), el);
+			obj.style.display = "none";
+			(function(){
+				if (obj.readyState == 4) {
+					obj.parentNode.removeChild(obj);
+				}
+				else {
+					setTimeout(arguments.callee, 10);
+				}
+			})();
+		}
+		else {
+			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+		}
+	} 
+
+	function abstractAltContent(obj) {
+		var ac = createElement("div");
+		if (ua.win && ua.ie) {
+			ac.innerHTML = obj.innerHTML;
+		}
+		else {
+			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+			if (nestedObj) {
+				var c = nestedObj.childNodes;
+				if (c) {
+					var cl = c.length;
+					for (var i = 0; i < cl; i++) {
+						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+							ac.appendChild(c[i].cloneNode(true));
+						}
+					}
+				}
+			}
+		}
+		return ac;
+	}
+	
+	/* Cross-browser dynamic SWF creation
+	*/
+	function createSWF(attObj, parObj, id) {
+		var r, el = getElementById(id);
+		if (ua.wk && ua.wk < 312) { return r; }
+		if (el) {
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+				attObj.id = id;
+			}
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+				var att = "";
+				for (var i in attObj) {
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+						if (i.toLowerCase() == "data") {
+							parObj.movie = attObj[i];
+						}
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							att += ' class="' + attObj[i] + '"';
+						}
+						else if (i.toLowerCase() != "classid") {
+							att += ' ' + i + '="' + attObj[i] + '"';
+						}
+					}
+				}
+				var par = "";
+				for (var j in parObj) {
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+					}
+				}
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+				r = getElementById(attObj.id);	
+			}
+			else { // well-behaving browsers
+				var o = createElement(OBJECT);
+				o.setAttribute("type", FLASH_MIME_TYPE);
+				for (var m in attObj) {
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							o.setAttribute("class", attObj[m]);
+						}
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+							o.setAttribute(m, attObj[m]);
+						}
+					}
+				}
+				for (var n in parObj) {
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+						createObjParam(o, n, parObj[n]);
+					}
+				}
+				el.parentNode.replaceChild(o, el);
+				r = o;
+			}
+		}
+		return r;
+	}
+	
+	function createObjParam(el, pName, pValue) {
+		var p = createElement("param");
+		p.setAttribute("name", pName);	
+		p.setAttribute("value", pValue);
+		el.appendChild(p);
+	}
+	
+	/* Cross-browser SWF removal
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
+	*/
+	function removeSWF(id) {
+		var obj = getElementById(id);
+		if (obj && obj.nodeName == "OBJECT") {
+			if (ua.ie && ua.win) {
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						removeObjectInIE(id);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			else {
+				obj.parentNode.removeChild(obj);
+			}
+		}
+	}
+	
+	function removeObjectInIE(id) {
+		var obj = getElementById(id);
+		if (obj) {
+			for (var i in obj) {
+				if (typeof obj[i] == "function") {
+					obj[i] = null;
+				}
+			}
+			obj.parentNode.removeChild(obj);
+		}
+	}
+	
+	/* Functions to optimize JavaScript compression
+	*/
+	function getElementById(id) {
+		var el = null;
+		try {
+			el = doc.getElementById(id);
+		}
+		catch (e) {}
+		return el;
+	}
+	
+	function createElement(el) {
+		return doc.createElement(el);
+	}
+	
+	/* Updated attachEvent function for Internet Explorer
+		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+	*/	
+	function addListener(target, eventType, fn) {
+		target.attachEvent(eventType, fn);
+		listenersArr[listenersArr.length] = [target, eventType, fn];
+	}
+	
+	/* Flash Player and SWF content version matching
+	*/
+	function hasPlayerVersion(rv) {
+		var pv = ua.pv, v = rv.split(".");
+		v[0] = parseInt(v[0], 10);
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+		v[2] = parseInt(v[2], 10) || 0;
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+	}
+	
+	/* Cross-browser dynamic CSS creation
+		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+	*/	
+	function createCSS(sel, decl, media, newStyle) {
+		if (ua.ie && ua.mac) { return; }
+		var h = doc.getElementsByTagName("head")[0];
+		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+		var m = (media && typeof media == "string") ? media : "screen";
+		if (newStyle) {
+			dynamicStylesheet = null;
+			dynamicStylesheetMedia = null;
+		}
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+			// create dynamic stylesheet + get a global reference to it
+			var s = createElement("style");
+			s.setAttribute("type", "text/css");
+			s.setAttribute("media", m);
+			dynamicStylesheet = h.appendChild(s);
+			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+			}
+			dynamicStylesheetMedia = m;
+		}
+		// add style rule
+		if (ua.ie && ua.win) {
+			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+				dynamicStylesheet.addRule(sel, decl);
+			}
+		}
+		else {
+			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+			}
+		}
+	}
+	
+	function setVisibility(id, isVisible) {
+		if (!autoHideShow) { return; }
+		var v = isVisible ? "visible" : "hidden";
+		if (isDomLoaded && getElementById(id)) {
+			getElementById(id).style.visibility = v;
+		}
+		else {
+			createCSS("#" + id, "visibility:" + v);
+		}
+	}
+
+	/* Filter to avoid XSS attacks
+	*/
+	function urlEncodeIfNecessary(s) {
+		var regex = /[\\\"<>\.;]/;
+		var hasBadChars = regex.exec(s) != null;
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+	}
+	
+	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+	*/
+	var cleanup = function() {
+		if (ua.ie && ua.win) {
+			window.attachEvent("onunload", function() {
+				// remove listeners to avoid memory leaks
+				var ll = listenersArr.length;
+				for (var i = 0; i < ll; i++) {
+					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+				}
+				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+				var il = objIdArr.length;
+				for (var j = 0; j < il; j++) {
+					removeSWF(objIdArr[j]);
+				}
+				// cleanup library's main closures to avoid memory leaks
+				for (var k in ua) {
+					ua[k] = null;
+				}
+				ua = null;
+				for (var l in swfobject) {
+					swfobject[l] = null;
+				}
+				swfobject = null;
+			});
+		}
+	}();
+	
+	return {
+		/* Public API
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
+		*/ 
+		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+			if (ua.w3 && objectIdStr && swfVersionStr) {
+				var regObj = {};
+				regObj.id = objectIdStr;
+				regObj.swfVersion = swfVersionStr;
+				regObj.expressInstall = xiSwfUrlStr;
+				regObj.callbackFn = callbackFn;
+				regObjArr[regObjArr.length] = regObj;
+				setVisibility(objectIdStr, false);
+			}
+			else if (callbackFn) {
+				callbackFn({success:false, id:objectIdStr});
+			}
+		},
+		
+		getObjectById: function(objectIdStr) {
+			if (ua.w3) {
+				return getObjectById(objectIdStr);
+			}
+		},
+		
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+			var callbackObj = {success:false, id:replaceElemIdStr};
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+				setVisibility(replaceElemIdStr, false);
+				addDomLoadEvent(function() {
+					widthStr += ""; // auto-convert to string
+					heightStr += "";
+					var att = {};
+					if (attObj && typeof attObj === OBJECT) {
+						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+							att[i] = attObj[i];
+						}
+					}
+					att.data = swfUrlStr;
+					att.width = widthStr;
+					att.height = heightStr;
+					var par = {}; 
+					if (parObj && typeof parObj === OBJECT) {
+						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+							par[j] = parObj[j];
+						}
+					}
+					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+							if (typeof par.flashvars != UNDEF) {
+								par.flashvars += "&" + k + "=" + flashvarsObj[k];
+							}
+							else {
+								par.flashvars = k + "=" + flashvarsObj[k];
+							}
+						}
+					}
+					if (hasPlayerVersion(swfVersionStr)) { // create SWF
+						var obj = createSWF(att, par, replaceElemIdStr);
+						if (att.id == replaceElemIdStr) {
+							setVisibility(replaceElemIdStr, true);
+						}
+						callbackObj.success = true;
+						callbackObj.ref = obj;
+					}
+					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+						att.data = xiSwfUrlStr;
+						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+						return;
+					}
+					else { // show alternative content
+						setVisibility(replaceElemIdStr, true);
+					}
+					if (callbackFn) { callbackFn(callbackObj); }
+				});
+			}
+			else if (callbackFn) { callbackFn(callbackObj);	}
+		},
+		
+		switchOffAutoHideShow: function() {
+			autoHideShow = false;
+		},
+		
+		ua: ua,
+		
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		},
+		
+		hasFlashPlayerVersion: hasPlayerVersion,
+		
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
+			if (ua.w3) {
+				return createSWF(attObj, parObj, replaceElemIdStr);
+			}
+			else {
+				return undefined;
+			}
+		},
+		
+		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+			if (ua.w3 && canExpressInstall()) {
+				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+			}
+		},
+		
+		removeSWF: function(objElemIdStr) {
+			if (ua.w3) {
+				removeSWF(objElemIdStr);
+			}
+		},
+		
+		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+			if (ua.w3) {
+				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+			}
+		},
+		
+		addDomLoadEvent: addDomLoadEvent,
+		
+		addLoadEvent: addLoadEvent,
+		
+		getQueryParamValue: function(param) {
+			var q = doc.location.search || doc.location.hash;
+			if (q) {
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+				if (param == null) {
+					return urlEncodeIfNecessary(q);
+				}
+				var pairs = q.split("&");
+				for (var i = 0; i < pairs.length; i++) {
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+					}
+				}
+			}
+			return "";
+		},
+		
+		// For internal usage only
+		expressInstallCallback: function() {
+			if (isExpressInstallActive) {
+				var obj = getElementById(EXPRESS_INSTALL_ID);
+				if (obj && storedAltContent) {
+					obj.parentNode.replaceChild(storedAltContent, obj);
+					if (storedAltContentId) {
+						setVisibility(storedAltContentId, true);
+						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+					}
+					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+				}
+				isExpressInstallActive = false;
+			} 
+		}
+	};
+}();

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync05/src/Contact.as
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync05/src/Contact.as b/apps/samples-spring/WEB-INF/flex-src/insync05/src/Contact.as
new file mode 100755
index 0000000..ffa1f02
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync05/src/Contact.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
+{
+	[Bindable]
+	[RemoteClass(alias="org.springframework.flex.samples.contact.Contact")]
+	public class Contact
+	{
+		public var id:int = -1;
+		public var firstName:String;
+		public var lastName:String;
+		public var email:String;
+		public var phone:String;
+		public var address:String;
+		public var city:String;
+		public var state:String;
+		public var zip:String;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync05/src/ContactForm.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync05/src/ContactForm.mxml b/apps/samples-spring/WEB-INF/flex-src/insync05/src/ContactForm.mxml
new file mode 100755
index 0000000..ee0fe5b
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync05/src/ContactForm.mxml
@@ -0,0 +1,133 @@
+<?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:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		   xmlns:s="library://ns.adobe.com/flex/spark" 
+		   xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
+		   label="{contact.id>-1?contact.firstName+' '+contact.lastName:'New Contact'}">
+
+	<fx:Script>
+		<![CDATA[
+
+			import mx.rpc.events.FaultEvent;
+			import mx.rpc.events.ResultEvent;
+			import mx.controls.Alert;
+			
+			[Bindable] public var contact:Contact;
+			
+			private function save():void
+			{
+				contact.firstName = firstName.text;
+				contact.lastName = lastName.text;
+				contact.email = email.text;
+				contact.phone = phone.text;
+				contact.address = address.text;
+				contact.city = city.text;
+				contact.state = state.text;
+				contact.zip = zip.text;
+				if (contact.id == -1)
+				{
+					ro.create(contact);	
+				}
+				else
+				{
+					ro.update(contact);
+				}
+			}			
+			
+			private function create_resultHandler(event:ResultEvent):void
+			{
+				contact.id = event.result.id;
+			}
+			
+			private function update_resultHandler(event:ResultEvent):void
+			{
+				// no specific action for now
+			}
+			
+			private function deleteItem():void
+			{
+				ro.remove(contact);		
+				closeItem();
+			}
+			
+			private function closeItem():void
+			{
+				parent.removeChild(this);
+			}
+			
+			private function remove_resultHandler(event:ResultEvent):void
+			{
+				contact = null;
+			}
+			
+			private function faultHandler(event:FaultEvent):void
+			{
+				Alert.show(event.fault.faultDetail);
+			}
+			
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<mx:RemoteObject id="ro" destination="contactService" fault="faultHandler(event)" endpoint="{&apos;http://{server.name}:{server.port}/samples-spring/messagebroker/amf&apos;}">
+			<mx:method name="create" result="create_resultHandler(event)"/>
+			<mx:method name="update" result="update_resultHandler(event)"/>
+			<mx:method name="remove" result="remove_resultHandler(event)"/>
+		</mx:RemoteObject>
+	</fx:Declarations>
+
+	<mx:Form>
+		<mx:FormItem label="Id">
+			<mx:TextInput text="{contact.id}" enabled="false"/>
+		</mx:FormItem>
+		<mx:FormItem label="First Name">
+			<mx:TextInput id="firstName" text="{contact.firstName}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Last Name">
+			<mx:TextInput id="lastName" text="{contact.lastName}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Email">
+			<mx:TextInput id="email" text="{contact.email}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Phone">
+			<mx:TextInput id="phone" text="{contact.phone}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Address">
+			<mx:TextInput id="address" text="{contact.address}"/>
+		</mx:FormItem>
+		<mx:FormItem label="City">
+			<mx:TextInput id="city" text="{contact.city}"/>
+		</mx:FormItem>
+		<mx:FormItem label="State">
+			<mx:TextInput id="state" text="{contact.state}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Zip">
+			<mx:TextInput id="zip" text="{contact.zip}"/>
+		</mx:FormItem>
+	</mx:Form>
+	
+	<s:HGroup left="8" bottom="8">
+		<s:Button label="Close" click="closeItem()"/>
+		<s:Button label="Save" click="save()"/>
+		<s:Button label="Delete" click="deleteItem()"/>
+	</s:HGroup>
+
+</mx:Canvas>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync05/src/insync05.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync05/src/insync05.mxml b/apps/samples-spring/WEB-INF/flex-src/insync05/src/insync05.mxml
new file mode 100755
index 0000000..4450358
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync05/src/insync05.mxml
@@ -0,0 +1,89 @@
+<?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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:local="*">
+	
+	<fx:Script>
+		<![CDATA[
+			
+			import mx.collections.ArrayCollection;
+			import mx.controls.Alert;
+			import mx.rpc.events.FaultEvent;
+			import mx.rpc.events.ResultEvent;
+			
+			[Bindable] private var contacts:ArrayCollection;
+			
+			private function resultHandler(event:ResultEvent):void
+			{
+				contacts = event.result as ArrayCollection
+			}
+			
+			private function faultHandler(event:FaultEvent):void
+			{
+				Alert.show(event.fault.faultDetail);
+			}
+			
+			public function openContact(contact:Contact):void
+			{
+				var children:Array = tn.getChildren();
+				for (var i:int = 0; i<children.length; i++)
+				{
+					if (ContactForm(children[i]).contact.id == contact.id)
+					{
+						tn.selectedChild = children[i];
+						return;
+					}
+				}
+				
+				var form:ContactForm = new ContactForm();
+				tn.addChild(form);
+				form.contact = contact;
+				tn.selectedChild = form;
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<s:RemoteObject id="ro" destination="contactService" fault="faultHandler(event)" endpoint="{&apos;http://{server.name}:{server.port}/samples-spring/messagebroker/amf&apos;}">
+			<s:method name="findByName" result="resultHandler(event)"/>
+		</s:RemoteObject>
+	</fx:Declarations>
+	
+	<s:controlBarContent>
+		<s:TextInput id="searchStr"/>
+		<s:Button label="Search" click="ro.findByName(searchStr.text)"/>
+		<mx:Button label="New Contact" click="openContact(new Contact())"/>
+	</s:controlBarContent>
+	
+	<mx:HDividedBox  top="8" left="8" right="8" bottom="8">
+		<mx:DataGrid id="dg" dataProvider="{contacts}" width="30%" height="100%"
+					 doubleClickEnabled="{dg.selectedItem != null}"
+					 doubleClick="openContact(dg.selectedItem as Contact)">
+			<mx:columns>
+				<mx:DataGridColumn dataField="firstName" headerText="First Name"/>
+				<mx:DataGridColumn dataField="lastName" headerText="Last Name"/>
+			</mx:columns>
+		</mx:DataGrid>
+		<mx:TabNavigator id="tn" width="70%" height="100%"/>
+	</mx:HDividedBox>
+	
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync06/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync06/.actionScriptProperties b/apps/samples-spring/WEB-INF/flex-src/insync06/.actionScriptProperties
new file mode 100755
index 0000000..bdabdba
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync06/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="insync06.mxml" projectUUID="cef66dd7-3cb6-46e2-976f-96991d0b8b89" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="insync06.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync06/.flexProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync06/.flexProperties b/apps/samples-spring/WEB-INF/flex-src/insync06/.flexProperties
new file mode 100755
index 0000000..1d99468
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync06/.flexProperties
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync06/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync06/.project b/apps/samples-spring/WEB-INF/flex-src/insync06/.project
new file mode 100755
index 0000000..c78b675
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync06/.project
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>insync06</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync06/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync06/build.xml b/apps/samples-spring/WEB-INF/flex-src/insync06/build.xml
new file mode 100755
index 0000000..2888084
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync06/build.xml
@@ -0,0 +1,76 @@
+<?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-spring.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="context.root" value="samples-spring" />
+    <property name="application.name" value="insync06" />
+    <property name="application.file" value="insync06" />
+    <property name="application.bin.dir" value="${samples-spring.war}/insync06" />
+    <property name="application.src.dir" value="${samples-spring.war}/WEB-INF/flex-src/insync06/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-spring.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"
+            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-spring/WEB-INF/flex-src/insync06/html-template/history/history.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/history/history.css b/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/history/history.css
new file mode 100755
index 0000000..4a7f791
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync06/html-template/history/history.css
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }


[50/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds-spring/WEB-INF/classes/commons-logging.properties
----------------------------------------------------------------------
diff --git a/apps/blazeds-spring/WEB-INF/classes/commons-logging.properties b/apps/blazeds-spring/WEB-INF/classes/commons-logging.properties
new file mode 100755
index 0000000..46c3be4
--- /dev/null
+++ b/apps/blazeds-spring/WEB-INF/classes/commons-logging.properties
@@ -0,0 +1,19 @@
+# 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.
+
+# suppress logging for 3rd-party libraries using commons-logging
+# Flex logging is not configured here. It is configured through in the logging section of flex-config.xml
+org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
+org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds-spring/WEB-INF/flex-servlet.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds-spring/WEB-INF/flex-servlet.xml b/apps/blazeds-spring/WEB-INF/flex-servlet.xml
new file mode 100755
index 0000000..21d1e5a
--- /dev/null
+++ b/apps/blazeds-spring/WEB-INF/flex-servlet.xml
@@ -0,0 +1,34 @@
+<?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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:flex="http://www.springframework.org/schema/flex"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+        http://www.springframework.org/schema/flex 
+        http://www.springframework.org/schema/flex/spring-flex-1.5.xsd">
+ 
+    <flex:message-broker>
+        <flex:message-service
+            default-channels="my-streaming-amf,my-longpolling-amf,my-polling-amf" />
+        <flex:secured />
+    </flex:message-broker>
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds-spring/WEB-INF/flex/messaging-config.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds-spring/WEB-INF/flex/messaging-config.xml b/apps/blazeds-spring/WEB-INF/flex/messaging-config.xml
new file mode 100755
index 0000000..34f4d3f
--- /dev/null
+++ b/apps/blazeds-spring/WEB-INF/flex/messaging-config.xml
@@ -0,0 +1,32 @@
+<?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-polling-amf"/>
+    </default-channels>
+
+</service>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds-spring/WEB-INF/flex/proxy-config.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds-spring/WEB-INF/flex/proxy-config.xml b/apps/blazeds-spring/WEB-INF/flex/proxy-config.xml
new file mode 100755
index 0000000..9335e6c
--- /dev/null
+++ b/apps/blazeds-spring/WEB-INF/flex/proxy-config.xml
@@ -0,0 +1,43 @@
+<?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>
+
+    <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>
+
+    <default-channels>
+        <channel ref="my-amf"/>
+    </default-channels>
+
+    <destination id="DefaultHTTP">
+    </destination>
+
+</service>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds-spring/WEB-INF/flex/remoting-config.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds-spring/WEB-INF/flex/remoting-config.xml b/apps/blazeds-spring/WEB-INF/flex/remoting-config.xml
new file mode 100755
index 0000000..88a4a1f
--- /dev/null
+++ b/apps/blazeds-spring/WEB-INF/flex/remoting-config.xml
@@ -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.
+
+-->
+<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>
+
+</service>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds-spring/WEB-INF/flex/services-config.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds-spring/WEB-INF/flex/services-config.xml b/apps/blazeds-spring/WEB-INF/flex/services-config.xml
new file mode 100755
index 0000000..289fbfe
--- /dev/null
+++ b/apps/blazeds-spring/WEB-INF/flex/services-config.xml
@@ -0,0 +1,117 @@
+<?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-include file-path="remoting-config.xml" />
+        <service-include file-path="proxy-config.xml" />
+        <service-include file-path="messaging-config.xml" />        
+    </services>
+
+    <security>
+        <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-constraint id="basic-read-access">
+            <auth-method>Basic</auth-method>
+            <roles>
+                <role>guests</role>
+                <role>accountants</role>
+                <role>employees</role>
+                <role>managers</role>
+            </roles>
+        </security-constraint>
+         -->
+    </security>
+
+    <channels>
+
+        <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"/>
+        </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>
+        -->
+    </channels>
+
+    <logging>
+        <target class="flex.messaging.log.ConsoleTarget" level="Error">
+            <properties>
+                <prefix>[BlazeDS] </prefix>
+                <includeDate>false</includeDate>
+                <includeTime>false</includeTime>
+                <includeLevel>false</includeLevel>
+                <includeCategory>false</includeCategory>
+            </properties>
+            <filters>
+                <pattern>Endpoint.*</pattern>
+                <pattern>Service.*</pattern>
+                <pattern>Configuration</pattern>
+            </filters>
+        </target>
+    </logging>
+
+    <system>
+        <redeploy>
+            <enabled>false</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>
+            <watch-file>{context.root}/WEB-INF/flex/data-management-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/blazeds-spring/WEB-INF/spring/app-config.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds-spring/WEB-INF/spring/app-config.xml b/apps/blazeds-spring/WEB-INF/spring/app-config.xml
new file mode 100755
index 0000000..b78ba74
--- /dev/null
+++ b/apps/blazeds-spring/WEB-INF/spring/app-config.xml
@@ -0,0 +1,29 @@
+<?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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:security="http://www.springframework.org/schema/security"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:context="http://www.springframework.org/schema/context"
+	xsi:schemaLocation="
+		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+		http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd
+		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds-spring/WEB-INF/spring/infrastructure-config.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds-spring/WEB-INF/spring/infrastructure-config.xml b/apps/blazeds-spring/WEB-INF/spring/infrastructure-config.xml
new file mode 100755
index 0000000..5cbe9ab
--- /dev/null
+++ b/apps/blazeds-spring/WEB-INF/spring/infrastructure-config.xml
@@ -0,0 +1,25 @@
+<?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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
+
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds-spring/WEB-INF/spring/security-config.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds-spring/WEB-INF/spring/security-config.xml b/apps/blazeds-spring/WEB-INF/spring/security-config.xml
new file mode 100755
index 0000000..06edb10
--- /dev/null
+++ b/apps/blazeds-spring/WEB-INF/spring/security-config.xml
@@ -0,0 +1,41 @@
+<?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.
+
+-->
+<beans:beans xmlns="http://www.springframework.org/schema/security"
+    xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
+
+    <http entry-point-ref="entryPoint">
+        <anonymous enabled="false"/>
+    </http>
+    
+    <beans:bean id="entryPoint" class="org.springframework.security.web.authentication.Http403ForbiddenEntryPoint"/>
+    
+    <authentication-manager>
+       <authentication-provider>
+           <user-service>
+            <user name="john" password="john" authorities="ROLE_USER" />
+            <user name="admin" password="admin" authorities="ROLE_USER, ROLE_ADMIN" />
+            <user name="guest" password="guest" authorities="ROLE_GUEST" />
+           </user-service>
+       </authentication-provider>
+    </authentication-manager>
+
+</beans:beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds-spring/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds-spring/WEB-INF/web.xml b/apps/blazeds-spring/WEB-INF/web.xml
new file mode 100755
index 0000000..ec5c772
--- /dev/null
+++ b/apps/blazeds-spring/WEB-INF/web.xml
@@ -0,0 +1,102 @@
+<?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.
+
+-->
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+
+    <display-name>BlazeDS Spring Integration Application</display-name>
+    <description>BlazeDS Spring Integration Application</description>
+
+    <context-param>
+        <param-name>contextConfigLocation</param-name>
+        <param-value>
+            /WEB-INF/spring/*-config.xml
+        </param-value>
+    </context-param>
+    
+    <filter>
+        <filter-name>springSecurityFilterChain</filter-name>
+        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+    </filter>
+
+    <filter-mapping>
+      <filter-name>springSecurityFilterChain</filter-name>
+      <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <!-- Http Flex Session attribute and binding listener support -->
+    <listener>
+        <listener-class>flex.messaging.HttpFlexSession</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+    </listener>
+
+    <!-- Spring Dispatcher Servlet -->   
+    <servlet>
+        <servlet-name>flex</servlet-name>
+        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+<!-- begin rds
+    <servlet>
+        <servlet-name>RDSDispatchServlet</servlet-name>
+        <display-name>RDSDispatchServlet</display-name>
+        <servlet-class>flex.rds.server.servlet.FrontEndServlet</servlet-class>
+        <init-param>
+            <param-name>useAppserverSecurity</param-name>
+            <param-value>true</param-value>
+        </init-param>
+        <init-param>
+			<param-name>messageBrokerId</param-name>
+			<param-value>_messageBroker</param-value>
+		</init-param>
+        <load-on-startup>10</load-on-startup>
+    </servlet>
+
+    <servlet-mapping id="RDS_DISPATCH_MAPPING">
+        <servlet-name>RDSDispatchServlet</servlet-name>
+        <url-pattern>/CFIDE/main/ide.cfm</url-pattern>
+    </servlet-mapping>
+end rds -->
+
+    <servlet-mapping>
+        <servlet-name>flex</servlet-name>
+        <url-pattern>/messagebroker/*</url-pattern>
+     </servlet-mapping>
+
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+        <welcome-file>index.htm</welcome-file>
+    </welcome-file-list>
+
+    <!-- for WebSphere deployment, please uncomment -->
+    <!--
+    <resource-ref>
+        <description>Flex Messaging WorkManager</description>
+        <res-ref-name>wm/MessagingWorkManager</res-ref-name>
+        <res-type>com.ibm.websphere.asynchbeans.WorkManager</res-type>
+        <res-auth>Container</res-auth>
+        <res-sharing-scope>Shareable</res-sharing-scope>
+    </resource-ref>
+    -->
+
+</web-app>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds-spring/build.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds-spring/build.xml b/apps/blazeds-spring/build.xml
new file mode 100755
index 0000000..dc3b1c4
--- /dev/null
+++ b/apps/blazeds-spring/build.xml
@@ -0,0 +1,97 @@
+<?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="blazeds-spring.war/build.xml" default="main" basedir="../..">
+
+    <property file="${basedir}/build.properties" />
+    <property name="blazeds-spring.war" value="${basedir}/apps/blazeds-spring" />
+    <property name="dist.dir" value="${basedir}/dist" />
+    <property name="src.dir" value="${blazeds-spring.war}/WEB-INF/src"/>
+    <property name="classes.dir" value="${blazeds-spring.war}/WEB-INF/classes"/>
+
+    <path id="classpath">
+        <fileset dir="${blazeds-spring.war}/WEB-INF/lib" includes="**/*.jar" />
+    </path>
+
+    <target name="main" depends="clean,compile" />
+
+    <target name="prepare">
+        <mkdir dir="${blazeds-spring.war}/WEB-INF/src" />
+        <mkdir dir="${blazeds-spring.war}/WEB-INF/lib" />
+        <mkdir dir="${blazeds-spring.war}/WEB-INF/classes" />
+    </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="copy-resources">
+        <copy todir="${blazeds-spring.war}/WEB-INF/lib">
+            <fileset dir="${basedir}/lib" includes="${webapp.ce.lib}" />
+            <fileset dir="${basedir}/lib/spring" includes="**/*" />
+            <fileset dir="${basedir}/lib/aspectj" includes="**/*" />
+        </copy>
+        <copy todir="${classes.dir}">
+            <fileset dir="${basedir}/lib" includes="${webapp.classes}" />
+        </copy>
+    
+    	<propertyfile file="${blazeds-spring.war}/WEB-INF/flex/version.properties">
+    	    <entry key="build" value="${manifest.Implementation-Version}.${build.number}"/>
+    	    <entry key="minimumSDKVersion" value="${min.sdk.version}"/>
+    	</propertyfile>
+
+    </target>
+
+    <target name="compile" depends="prepare,run-depend,copy-resources" description="compile">
+        <javac source="1.4" 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}/blazeds-spring.war" webxml="${blazeds-spring.war}/WEB-INF/web.xml">
+            <manifest>
+                <attribute name="Sealed" value="${manifest.sealed}" />
+                <attribute name="Implementation-Title" value="${manifest.Implementation-Title} - BlazeDS Spring Integration Application" />
+                <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}" />
+                <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}" />
+            </manifest>
+            <fileset dir="${blazeds-spring.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="${blazeds-spring.war}/WEB-INF/lib" includes="**/*" />
+        </delete>
+        <delete quiet="true">
+            <fileset dir="${classes.dir}" includes="**/*.class"/>
+        </delete>
+        <delete quiet="true" file="${dist.dir}/blazeds-spring.war" />
+    </target>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds-spring/index.htm
----------------------------------------------------------------------
diff --git a/apps/blazeds-spring/index.htm b/apps/blazeds-spring/index.htm
new file mode 100755
index 0000000..8ce9112
--- /dev/null
+++ b/apps/blazeds-spring/index.htm
@@ -0,0 +1,50 @@
+<!--
+  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.
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>Welcome to BlazeDS</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<style>
+body, pre { font-family:Tahoma,Helvetica,sans-serif; font-size:10pt; }
+div.indent { margin-left: 20;}
+span.reference { font-weight: bold }
+span.header {white-space:nowrap }
+span.title {font-size:12pt; color:blue}
+span.highlight { background-color: #FFFFB7 }
+table.code { font-family: courier; font-size: 9pt;}
+span.fade { color:#666666; font-size:11px }
+</style>
+</head>
+<body>
+<span class="title">Welcome to BlazeDS</span>
+<br>
+&nbsp;<br>
+This is an empty BlazeDS application that serves as a template for creating your custom BlazeDS Spring application.
+<!--
+<br>&nbsp;<br>
+If you're looking for sample Flex applications, check with the system administrator for the URL where the samples are deployed.
+-->
+<br>
+&nbsp;<br>
+Visit the <a href="http://opensource.adobe.com/wiki/display/blazeds/BlazeDS">product page</a> for documentation and further information.
+</body>
+</html>
+
+
+
+

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds/WEB-INF/classes/commons-logging.properties
----------------------------------------------------------------------
diff --git a/apps/blazeds/WEB-INF/classes/commons-logging.properties b/apps/blazeds/WEB-INF/classes/commons-logging.properties
new file mode 100755
index 0000000..46c3be4
--- /dev/null
+++ b/apps/blazeds/WEB-INF/classes/commons-logging.properties
@@ -0,0 +1,19 @@
+# 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.
+
+# suppress logging for 3rd-party libraries using commons-logging
+# Flex logging is not configured here. It is configured through in the logging section of flex-config.xml
+org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
+org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds/WEB-INF/flex/messaging-config.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds/WEB-INF/flex/messaging-config.xml b/apps/blazeds/WEB-INF/flex/messaging-config.xml
new file mode 100755
index 0000000..34f4d3f
--- /dev/null
+++ b/apps/blazeds/WEB-INF/flex/messaging-config.xml
@@ -0,0 +1,32 @@
+<?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-polling-amf"/>
+    </default-channels>
+
+</service>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds/WEB-INF/flex/proxy-config.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds/WEB-INF/flex/proxy-config.xml b/apps/blazeds/WEB-INF/flex/proxy-config.xml
new file mode 100755
index 0000000..9335e6c
--- /dev/null
+++ b/apps/blazeds/WEB-INF/flex/proxy-config.xml
@@ -0,0 +1,43 @@
+<?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>
+
+    <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>
+
+    <default-channels>
+        <channel ref="my-amf"/>
+    </default-channels>
+
+    <destination id="DefaultHTTP">
+    </destination>
+
+</service>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds/WEB-INF/flex/remoting-config.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds/WEB-INF/flex/remoting-config.xml b/apps/blazeds/WEB-INF/flex/remoting-config.xml
new file mode 100755
index 0000000..88a4a1f
--- /dev/null
+++ b/apps/blazeds/WEB-INF/flex/remoting-config.xml
@@ -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.
+
+-->
+<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>
+
+</service>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds/WEB-INF/flex/services-config.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds/WEB-INF/flex/services-config.xml b/apps/blazeds/WEB-INF/flex/services-config.xml
new file mode 100755
index 0000000..289fbfe
--- /dev/null
+++ b/apps/blazeds/WEB-INF/flex/services-config.xml
@@ -0,0 +1,117 @@
+<?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-include file-path="remoting-config.xml" />
+        <service-include file-path="proxy-config.xml" />
+        <service-include file-path="messaging-config.xml" />        
+    </services>
+
+    <security>
+        <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-constraint id="basic-read-access">
+            <auth-method>Basic</auth-method>
+            <roles>
+                <role>guests</role>
+                <role>accountants</role>
+                <role>employees</role>
+                <role>managers</role>
+            </roles>
+        </security-constraint>
+         -->
+    </security>
+
+    <channels>
+
+        <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"/>
+        </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>
+        -->
+    </channels>
+
+    <logging>
+        <target class="flex.messaging.log.ConsoleTarget" level="Error">
+            <properties>
+                <prefix>[BlazeDS] </prefix>
+                <includeDate>false</includeDate>
+                <includeTime>false</includeTime>
+                <includeLevel>false</includeLevel>
+                <includeCategory>false</includeCategory>
+            </properties>
+            <filters>
+                <pattern>Endpoint.*</pattern>
+                <pattern>Service.*</pattern>
+                <pattern>Configuration</pattern>
+            </filters>
+        </target>
+    </logging>
+
+    <system>
+        <redeploy>
+            <enabled>false</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>
+            <watch-file>{context.root}/WEB-INF/flex/data-management-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/blazeds/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds/WEB-INF/web.xml b/apps/blazeds/WEB-INF/web.xml
new file mode 100755
index 0000000..9bf2f4a
--- /dev/null
+++ b/apps/blazeds/WEB-INF/web.xml
@@ -0,0 +1,82 @@
+<?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.
+
+-->
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+
+    <display-name>BlazeDS</display-name>
+    <description>BlazeDS Application</description>
+
+    <!-- Http Flex Session attribute and binding listener support -->
+    <listener>
+        <listener-class>flex.messaging.HttpFlexSession</listener-class>
+    </listener>
+
+    <!-- MessageBroker Servlet -->
+    <servlet>
+        <servlet-name>MessageBrokerServlet</servlet-name>
+        <display-name>MessageBrokerServlet</display-name>
+        <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
+        <init-param>
+            <param-name>services.configuration.file</param-name>
+            <param-value>/WEB-INF/flex/services-config.xml</param-value>
+       </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    
+<!-- begin rds
+    <servlet>
+        <servlet-name>RDSDispatchServlet</servlet-name>
+		<display-name>RDSDispatchServlet</display-name>
+        <servlet-class>flex.rds.server.servlet.FrontEndServlet</servlet-class>
+		<init-param>
+			<param-name>useAppserverSecurity</param-name>
+			<param-value>true</param-value>
+		</init-param>        
+        <load-on-startup>10</load-on-startup>
+    </servlet>
+
+    <servlet-mapping id="RDS_DISPATCH_MAPPING">
+        <servlet-name>RDSDispatchServlet</servlet-name>
+        <url-pattern>/CFIDE/main/ide.cfm</url-pattern>
+    </servlet-mapping>
+end rds -->
+
+    <servlet-mapping>
+        <servlet-name>MessageBrokerServlet</servlet-name>
+        <url-pattern>/messagebroker/*</url-pattern>
+    </servlet-mapping>
+
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+        <welcome-file>index.htm</welcome-file>
+    </welcome-file-list>
+
+    <!-- for WebSphere deployment, please uncomment -->
+    <!--
+    <resource-ref>
+        <description>Flex Messaging WorkManager</description>
+        <res-ref-name>wm/MessagingWorkManager</res-ref-name>
+        <res-type>com.ibm.websphere.asynchbeans.WorkManager</res-type>
+        <res-auth>Container</res-auth>
+        <res-sharing-scope>Shareable</res-sharing-scope>
+    </resource-ref>
+    -->
+
+</web-app>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds/build.xml
----------------------------------------------------------------------
diff --git a/apps/blazeds/build.xml b/apps/blazeds/build.xml
new file mode 100755
index 0000000..8d8731b
--- /dev/null
+++ b/apps/blazeds/build.xml
@@ -0,0 +1,98 @@
+<?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="blazeds.war/build.xml" default="main" basedir="../..">
+
+    <property file="${basedir}/build.properties" />
+    <property name="blazeds.war" value="${basedir}/apps/blazeds" />
+    <property name="dist.dir" value="${basedir}/dist" />
+    <property name="src.dir" value="${blazeds.war}/WEB-INF/src"/>
+    <property name="classes.dir" value="${blazeds.war}/WEB-INF/classes"/>
+
+    <path id="classpath">
+        <fileset dir="${blazeds.war}/WEB-INF/lib" includes="**/*.jar" />
+    </path>
+
+    <target name="main" depends="clean,compile" />
+
+    <target name="prepare">
+        <mkdir dir="${blazeds.war}/WEB-INF/src" />
+        <mkdir dir="${blazeds.war}/WEB-INF/lib" />
+        <mkdir dir="${blazeds.war}/WEB-INF/classes" />
+    </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="copy-resources">
+        <copy todir="${blazeds.war}/WEB-INF/lib">
+            <fileset dir="${basedir}/lib" includes="${webapp.ce.lib}" />
+        </copy>
+        <copy todir="${classes.dir}">
+            <fileset dir="${basedir}/lib" includes="${webapp.classes}" />
+        </copy>
+    
+    	<propertyfile file="${blazeds.war}/WEB-INF/flex/version.properties">
+    	    <entry key="build" value="${manifest.Implementation-Version}.${build.number}"/>
+    	    <entry key="minimumSDKVersion" value="${min.sdk.version}"/>
+    	</propertyfile>
+
+    </target>
+
+    <target name="compile" depends="prepare,run-depend,copy-resources" description="compile">
+        <javac source="1.4" 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}/blazeds.war" webxml="${blazeds.war}/WEB-INF/web.xml">
+            <manifest>
+                <attribute name="Sealed" value="${manifest.sealed}" />
+                <attribute name="Implementation-Title" value="${manifest.Implementation-Title} - BlazeDS Application" />
+                <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}" />
+                <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}" />
+            </manifest>
+            <fileset dir="${blazeds.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="${blazeds.war}/WEB-INF/lib" includes="${webapp.ce.lib},${old.jars.to.clean}" />
+        </delete>
+        <delete quiet="true">
+            <fileset dir="${classes.dir}" includes="**/*.class"/>
+        </delete>
+        <delete quiet="true" file="${dist.dir}/blazeds.war" />
+        <delete quiet="true" dir="${blazeds.war}/WEB-INF/lib" />
+        <delete quiet="true" dir="${blazeds.war}/WEB-INF/src" />
+        <delete quiet="true" file="${blazeds.war}/WEB-INF/flex/version.properties" />
+    </target>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/blazeds/index.htm
----------------------------------------------------------------------
diff --git a/apps/blazeds/index.htm b/apps/blazeds/index.htm
new file mode 100755
index 0000000..aeec257
--- /dev/null
+++ b/apps/blazeds/index.htm
@@ -0,0 +1,50 @@
+<!--
+  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.
+-->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>Welcome to BlazeDS</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<style>
+body, pre { font-family:Tahoma,Helvetica,sans-serif; font-size:10pt; }
+div.indent { margin-left: 20;}
+span.reference { font-weight: bold }
+span.header {white-space:nowrap }
+span.title {font-size:12pt; color:blue}
+span.highlight { background-color: #FFFFB7 }
+table.code { font-family: courier; font-size: 9pt;}
+span.fade { color:#666666; font-size:11px }
+</style>
+</head>
+<body>
+<span class="title">Welcome to BlazeDS</span>
+<br>
+&nbsp;<br>
+This is an empty BlazeDS application that serves as a template for creating your custom application.
+<!--
+<br>&nbsp;<br>
+If you're looking for sample Flex applications, check with the system administrator for the URL where the samples are deployed.
+-->
+<br>
+&nbsp;<br>
+Visit the <a href="http://opensource.adobe.com/wiki/display/blazeds/BlazeDS">product page</a> for documentation and further information.
+</body>
+</html>
+
+
+
+

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/ConsoleResultWindow.mxml
----------------------------------------------------------------------
diff --git a/apps/ds-console/ConsoleResultWindow.mxml b/apps/ds-console/ConsoleResultWindow.mxml
new file mode 100755
index 0000000..4a8eac2
--- /dev/null
+++ b/apps/ds-console/ConsoleResultWindow.mxml
@@ -0,0 +1,48 @@
+<?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:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" title="Results" width="200" height="200" showCloseButton="true" close="close()" borderStyle="solid">
+	<mx:Script>
+	<![CDATA[
+
+		import mx.managers.*;
+
+		public function showResult(result:Object):void
+		{
+			resultMessage.text = result.toString();
+		}
+
+		public function showSuccess():void
+		{
+			resultMessage.text = "Operation executed";
+		}
+
+		private function close():void
+		{
+			PopUpManager.removePopUp(this);
+		}
+
+	]]>
+	</mx:Script>
+	<mx:Spacer height="20%"/>	    
+	<mx:VBox height="80%">
+	   <mx:Label id="resultMessage" /> 
+	</mx:VBox>
+	
+</mx:TitleWindow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/WEB-INF/flex/services-config.xml
----------------------------------------------------------------------
diff --git a/apps/ds-console/WEB-INF/flex/services-config.xml b/apps/ds-console/WEB-INF/flex/services-config.xml
new file mode 100755
index 0000000..9283f8c
--- /dev/null
+++ b/apps/ds-console/WEB-INF/flex/services-config.xml
@@ -0,0 +1,116 @@
+<?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>
+        <!--
+                REMOTING SERVICE
+        -->
+        <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>
+       
+            <!-- Runtime management console destination -->
+            <destination id="RuntimeManagement" channels="amf">
+                <properties>
+                    <source>flex.management.jmx.MBeanServerGateway</source>
+                </properties>
+                
+                <!-- 
+                If running the console on WebSphere with administrative security enabled uncomment this section.  Also, 
+                create a User Group called "console_administrator" and add any users that are allowed to use the console to this group.
+                These users must also have at least one role that allows them to access MBeans under WebSphere security.  Finally,
+                be sure to use the WebSphere login-command below.  
+                <security>
+                    <security-constraint ref="console"/>
+                </security>
+                -->                
+            </destination>
+            
+        </service>
+
+    </services>
+    
+    
+        <security>
+            <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"/>
+            -->
+        
+	        <!--  
+	        If running the console on WebSphere with administrative security enabled uncomment this section.  Also, 
+	        create a User Group called "console_administrator" and add any users that are allowed to use the console to this group.
+	        These users must also have at least one role that allows them to access MBeans under WebSphere security.  Finally,
+	        be sure to use the WebSphere login-command above.  
+	        <security-constraint id="console">
+	            <auth-method>Basic</auth-method>
+	            <roles>
+	                <role>console_administrator</role>
+           	    </roles>
+           	</security-constraint>
+           	-->        
+        </security>
+
+
+    <channels>
+
+        <channel-definition id="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>
+
+    </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>true</includeCategory>
+            </properties>
+            <filters>
+                <pattern>Endpoint.*</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>
+            <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/ds-console/WEB-INF/install-web.xml
----------------------------------------------------------------------
diff --git a/apps/ds-console/WEB-INF/install-web.xml b/apps/ds-console/WEB-INF/install-web.xml
new file mode 100755
index 0000000..a741ed8
--- /dev/null
+++ b/apps/ds-console/WEB-INF/install-web.xml
@@ -0,0 +1,48 @@
+<?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.
+
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+    <display-name>Console</display-name>
+    <description>Administration tools for monitoring and management</description>
+
+    <!-- MessageBroker Servlet -->
+    <servlet>
+        <servlet-name>MessageBrokerServlet</servlet-name>
+        <display-name>MessageBrokerServlet</display-name>
+        <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
+        <init-param>
+            <param-name>services.configuration.file</param-name>
+            <param-value>/WEB-INF/flex/services-config.xml</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>MessageBrokerServlet</servlet-name>
+        <url-pattern>/messagebroker/*</url-pattern>
+    </servlet-mapping>
+
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+    </welcome-file-list>
+
+</web-app>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/apps/ds-console/WEB-INF/web.xml b/apps/ds-console/WEB-INF/web.xml
new file mode 100755
index 0000000..61c89e5
--- /dev/null
+++ b/apps/ds-console/WEB-INF/web.xml
@@ -0,0 +1,57 @@
+<?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.
+
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+    <display-name>Console</display-name>
+    <description>Administration tools for monitoring and management</description>
+
+    <context-param>
+        <param-name>flex.class.path</param-name>
+        <param-value>/WEB-INF/flex/hotfixes,/WEB-INF/flex/jars</param-value>
+    </context-param>
+
+    <!-- MessageBroker Servlet -->
+    <servlet>
+        <servlet-name>MessageBrokerServlet</servlet-name>
+        <display-name>MessageBrokerServlet</display-name>
+        <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
+        <init-param>
+            <param-name>services.configuration.file</param-name>
+            <param-value>/WEB-INF/flex/services-config.xml</param-value>
+        </init-param>
+        <init-param>
+            <param-name>flex.write.path</param-name>
+            <param-value>/WEB-INF/flex</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>MessageBrokerServlet</servlet-name>
+        <url-pattern>/messagebroker/*</url-pattern>
+    </servlet-mapping>
+    
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+    </welcome-file-list>
+
+</web-app>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/build.xml
----------------------------------------------------------------------
diff --git a/apps/ds-console/build.xml b/apps/ds-console/build.xml
new file mode 100755
index 0000000..7923ff8
--- /dev/null
+++ b/apps/ds-console/build.xml
@@ -0,0 +1,174 @@
+<?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="ds-console.war/build.xml" default="main" basedir="../..">
+
+    <property environment="env" />
+        
+    <property file="${basedir}/build.properties"/>
+    <property name="ds-console.war" value="${basedir}/apps/ds-console"/>
+    <property name="dist.dir" value="${basedir}/dist"/>
+    <property name="src.dir" value="${ds-console.war}/WEB-INF/src"/>
+    <property name="classes.dir" value="${ds-console.war}/WEB-INF/classes"/>
+    <property name="mxmlc.dir" value="${basedir}/bin"/>
+    
+    
+    <property name="application.name" value="DS Console" />
+    <property name="application.dir" value="${ds-console.war}" />
+    <property name="application.file" value="console" />
+
+    <path id="classpath">
+        <fileset dir="${ds-console.war}/WEB-INF/lib" includes="**/*.jar"/>
+    </path>
+
+    <target name="main" depends="clean,ds-console"/>
+    <target name="ds-console" depends="compile,compile-swf"/>
+
+    <property environment="env"/>
+    <property name="ant-contrib.jar" location="${env.ANT_HOME}/lib/ant-contrib-1.0b2.jar"/>
+    <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${ant-contrib.jar}"/>
+
+    <target name="prepare">
+        <mkdir dir="${ds-console.war}/WEB-INF/lib"/>
+        <mkdir dir="${ds-console.war}/WEB-INF/classes"/>
+    </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 to the lib directory -->
+        <copy todir="${ds-console.war}/WEB-INF/lib">
+            <fileset dir="${basedir}/lib" includes="${webapp.lib}" />
+        </copy>
+
+        <!-- copy to the classes directory -->
+        <copy todir="${ds-console.war}/WEB-INF/classes">
+            <fileset dir="${ds-console.war}/WEB-INF/src">
+                <include name="**/*.xml"/>
+            </fileset>
+            <fileset dir="${basedir}/lib" includes="${webapp.classes}" />
+        </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.4" debug="${src.debug}" destdir="${classes.dir}" srcdir="${src.dir}" classpathref="classpath"/>
+    </target>
+
+    <target name="compile-swf" >
+
+        <delete file="${ds-console.war}/${application.file}.swf"/>
+        <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/lib/flexTasks.jar" />
+        <property name="FLEX_HOME" value="${basedir}"/>
+
+        <mxmlc file="${application.dir}/${application.file}.mxml" 
+            output="${application.dir}/${application.file}.swf"
+            actionscript-file-encoding="UTF-8"
+            keep-generated-actionscript="false"
+            incremental="false"
+            services="${ds-console.war}/WEB-INF/flex/services-config.xml"
+            context-root="ds-console" 
+            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"
+            history="true"
+            express-install="true"
+            output="${application.dir}"/>
+
+    </target>
+
+    <target name="package" description=" Creates distribution war file">
+        <mkdir dir="${dist.dir}"/>
+        <antcall target="compile-swf"/>
+        <delete file="${dist.dir}/ds-console.war"/>
+        <war file="${dist.dir}/ds-console.war"
+            webxml="${ds-console.war}/WEB-INF/install-web.xml">
+            <manifest>
+                <attribute name="Sealed" value="${manifest.sealed}"/>
+                <attribute name="Implementation-Title" value="${manifest.Implementation-Title} - ${application.name}"/>
+                <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}"/>
+                <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/>
+            </manifest>
+            <fileset dir="${ds-console.war}">
+                <include name="index.html"/>
+                <include name="console.swf"/>
+                <include name="playerProductInstall.swf"/>
+                <include name="swfobject.js"/>
+                <include name="history/*"/>
+                <include name="WEB-INF/flex/services-config.xml"/>
+                <include name="WEB-INF/classes/*"/>
+                <include name="WEB-INF/lib/**/*"/>
+            </fileset>
+        </war>
+    </target>
+
+    <target name="clean" description="--> Removes jars and classes">
+        <delete quiet="true">
+            <fileset dir="${ds-console.war}/" includes="swfobject.js,index.html,console.swf,expressInstall.swf,history/*"/>
+        </delete>
+        <delete quiet="true">
+            <fileset dir="${ds-console.war}/WEB-INF/lib" includes="${webapp.lib},${webtier.lib}"/>
+        </delete>
+        <delete quiet="true" includeEmptyDirs="true">
+            <fileset dir="${ds-console.war}/WEB-INF/flex/locale" includes="**/*"/>
+        </delete>        
+        <delete quiet="true">
+            <fileset dir="${ds-console.war}/WEB-INF/flex/jars" includes="**/*"/>
+        </delete>
+        <delete quiet="true" includeEmptyDirs="true">
+            <fileset dir="${ds-console.war}/WEB-INF/flex/frameworks" includes="**/*"/>
+        </delete>
+        <delete quiet="true" includeEmptyDirs="true">
+            <fileset dir="${ds-console.war}/WEB-INF/flex" includes="*.ser,mxml-manifest.xml,cache.dep"/>
+        </delete>
+        <delete quiet="true">
+            <fileset dir="${classes.dir}" includes="**/*.class"/>
+        </delete>
+        <delete quiet="true" file="${dist.dir}/console.war"/>
+        <delete quiet="true" file="${dist.dir}/ds-console.war"/>
+        <delete quiet="true" dir="${ds-console.war}/history" />
+        <delete quiet="true" dir="${ds-console.war}/WEB-INF/lib" />
+        <delete quiet="true" dir="${ds-console.war}/WEB-INF/classes" />
+
+    </target>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console.mxml
----------------------------------------------------------------------
diff --git a/apps/ds-console/console.mxml b/apps/ds-console/console.mxml
new file mode 100755
index 0000000..f616a52
--- /dev/null
+++ b/apps/ds-console/console.mxml
@@ -0,0 +1,105 @@
+<?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:console="console.containers.*" xmlns="*" creationComplete="initApp();">
+    <mx:Script>
+        <![CDATA[
+            import console.ConsoleListener;
+            import console.containers.LogManager;
+            import console.containers.DestinationManager;
+            import console.containers.EndpointManager;
+            import console.containers.DefaultPanel;
+            import mx.core.Container;
+            import console.containers.UpdateListener;
+            import console.events.ManagementOperationInvokeEvent;
+            import mx.collections.ArrayCollection;
+            import console.containers.ServerManager;
+            import console.containers.AdvancedPanel;
+            import console.ConsoleManager;
+            import mx.messaging.management.*;
+            import mx.rpc.events.ResultEvent;
+            
+            private var manager:ConsoleManager;
+            private var advPanel:AdvancedPanel;
+            private var srvManager:ServerManager;
+            private var currentSelectedPanel:Container;
+            private var consoleListener:ConsoleListener;
+            
+            [Bindable]
+            public var appsList:ArrayCollection;
+            
+            private function initApp():void
+            {
+                appsList = new ArrayCollection;
+                
+                manager = ConsoleManager.getInstance();
+                manager.parent = this;
+                
+                consoleNavigator.addChild(new DefaultPanel());
+                consoleNavigator.addChild(new ServerManager());
+                consoleNavigator.addChild(new EndpointManager());
+                consoleNavigator.addChild(new DestinationManager());
+                consoleNavigator.addChild(new LogManager());
+                consoleNavigator.addChild(new AdvancedPanel());
+                
+                consoleListener = new ConsoleListener(this);
+                
+                currentSelectedPanel = consoleNavigator.selectedChild as Container;
+                manager.activateListener(consoleNavigator.selectedChild as UpdateListener);
+            }
+            
+            private function setCurrentTab():void
+            {
+                manager.deactivateListener(currentSelectedPanel as UpdateListener);
+                manager.activateListener(consoleNavigator.selectedChild as UpdateListener);
+                
+                currentSelectedPanel = consoleNavigator.selectedChild as Container;
+            }
+             
+            private function setCurrentApp():void
+            {
+                manager.currentApp = appSelect.selectedItem.data.label as String;
+            }             
+          
+            private function updatePollInterval():void
+            {
+                manager.timerInterval = pollIntervalSlider.value * 1000;
+            }
+             
+            public function updateModel(model:Object):void
+            {
+                 var mbeanModel:Object = manager.mbeanModel;
+                 for each (var appObj:Object in mbeanModel)
+                 {
+                     var names:Array = (appObj.label as String).split(".");
+                     appsList.addItem({label: names[2], data: appObj});
+                 }                 
+                 appSelect.selectedIndex = 0;
+            }
+        ]]>
+    </mx:Script>
+    <mx:HBox width="100%" textAlign="left" horizontalAlign="right">
+        <mx:Label text="Application"/>
+        <mx:ComboBox id="appSelect" dataProvider="{appsList}" labelField="label" width="300" change="{setCurrentApp()}" editable="false" enabled="true"/>
+        <mx:Label text="Polling Interval (seconds)" />
+        <mx:HSlider id="pollIntervalSlider" minimum="0" maximum="20" snapInterval=".5" enabled="true" change="{updatePollInterval()}"/>
+    </mx:HBox>
+    <mx:TabNavigator width="100%" height="100%" id="consoleNavigator" change="{setCurrentTab()}">
+    </mx:TabNavigator>
+</mx:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/ConsoleListener.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/ConsoleListener.as b/apps/ds-console/console/ConsoleListener.as
new file mode 100755
index 0000000..72e7bb9
--- /dev/null
+++ b/apps/ds-console/console/ConsoleListener.as
@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 console
+{
+    import console.containers.UpdateListener;
+
+    public class ConsoleListener extends UpdateListener
+    {
+        private var _console:console;
+        
+        public function ConsoleListener(c:console)
+        {
+            _console = c;
+            ConsoleManager.getInstance().registerListener(this, []);
+        }
+        
+        public override function mbeanModelUpdate(mbeanModel:Object):void
+        {
+                 for each (var appObj:Object in mbeanModel)
+                 {
+                     var names:Array = (appObj.label as String).split(".");
+                     _console.appsList.addItem({label: names[2], data: appObj});
+                 }                 
+                 _console.appSelect.selectedIndex = 0;
+        }
+    }
+}
\ No newline at end of file


[23/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/withoutui/messaging_withoutUI.as
----------------------------------------------------------------------
diff --git a/apps/team/features/withoutui/messaging_withoutUI.as b/apps/team/features/withoutui/messaging_withoutUI.as
new file mode 100755
index 0000000..d226c70
--- /dev/null
+++ b/apps/team/features/withoutui/messaging_withoutUI.as
@@ -0,0 +1,145 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 flash.display.Sprite;
+    import flash.events.Event;
+    import flash.text.TextField;
+    
+    import mx.collections.ArrayCollection;
+    import mx.collections.ArrayList;
+    import mx.core.mx_internal;
+    import mx.events.PropertyChangeEvent;
+    import mx.messaging.ChannelSet;
+    import mx.messaging.Consumer;
+    import mx.messaging.Producer;
+    import mx.messaging.channels.AMFChannel;
+    import mx.messaging.config.ConfigMap;
+    import mx.messaging.config.LoaderConfig;
+    import mx.messaging.events.ChannelFaultEvent;
+    import mx.messaging.events.MessageAckEvent;
+    import mx.messaging.events.MessageEvent;
+    import mx.messaging.events.MessageFaultEvent;
+    import mx.messaging.messages.AcknowledgeMessage;
+    import mx.messaging.messages.AcknowledgeMessageExt;
+    import mx.messaging.messages.AsyncMessage;
+    import mx.messaging.messages.AsyncMessageExt;
+    import mx.messaging.messages.CommandMessage;
+    import mx.messaging.messages.CommandMessageExt;
+    import mx.messaging.messages.ErrorMessage;
+    import mx.messaging.messages.HTTPRequestMessage;
+    import mx.messaging.messages.MessagePerformanceInfo;
+    import mx.utils.ObjectProxy;
+    import mx.utils.ObjectUtil;
+    import mx.utils.RpcClassAliasInitializer;
+
+    use namespace mx_internal;
+
+    /**
+     * A messaging sample that does not use any Flex UI classes. To get this working,
+     * first the url of LoaderConfig needs to be set due to BLZ-522 bug. Then, some
+     * classes need to be registered with Flash, see the registerClassAliases method. 
+     */ 
+    public class messaging_withoutUI extends Sprite
+    {
+        private static const CHANNEL_ID:String = "my-amf-poll";
+        private static const CHANNEL_URL:String = "http://localhost:8400/team/messagebroker/myamfpoll";
+        private static const DESTINATION_ID:String = "messaging_AMF_Poll";
+
+        private var channelSet:ChannelSet;
+        private var producer:Producer;  
+        private var consumer:Consumer;
+        private var text:TextField;
+
+        public function messaging_withoutUI()
+        {
+            RpcClassAliasInitializer.registerClassAliases(); 
+            
+            setupChannelSet();
+            setupProducer();
+            setupConsumer();
+            consumer.subscribe();
+
+            text = new TextField();
+            text.border = true;
+            text.width = 300;  
+            text.text = "initializing. . .";
+            addChild(text);
+
+        }
+
+        private function consumerMsgHandler(event:Event):void 
+        {
+            trace("Consumer received msg: " + ObjectUtil.toString(event));
+            text.text = "Consumer received message: " + (event as MessageEvent).message.body;
+        }
+
+        private function consumerPropChangeHandler(event:PropertyChangeEvent):void
+        {
+            // Make sure the ack is for a subscribe operation.
+            if(event.property == "subscribed" && consumer.subscribed)
+            {
+                // Send the message.
+                var msg:AsyncMessage = new AsyncMessage();
+                msg.body = "hello";
+                producer.send(msg);
+            }
+        }       
+
+        private function setupChannelSet():void
+        {
+            channelSet = new ChannelSet(); 
+            var channel:AMFChannel = new AMFChannel(CHANNEL_ID, CHANNEL_URL);
+            channel.pollingEnabled = true; 
+            channel.pollingInterval = 2000; 
+            channelSet.addChannel(channel); 
+        }
+        
+        private function setupConsumer():void
+        {
+            consumer = new Consumer();
+            consumer.channelSet = channelSet; 
+            consumer.destination = DESTINATION_ID;
+            consumer.addEventListener(MessageEvent.MESSAGE, consumerMsgHandler);
+            consumer.addEventListener(ChannelFaultEvent.FAULT, faultHandler);
+            consumer.addEventListener(MessageFaultEvent.FAULT, faultHandler);
+            consumer.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, consumerPropChangeHandler); 
+        }
+
+        private function setupProducer():void
+        {
+            producer = new Producer();
+            producer.channelSet = channelSet;
+            producer.destination = DESTINATION_ID;
+            producer.addEventListener(MessageAckEvent.ACKNOWLEDGE, producerAckHandler);
+            producer.addEventListener(MessageFaultEvent.FAULT, faultHandler);
+        }
+
+        private function producerAckHandler(event:Event):void
+        {
+            trace("Producer received ack: " + ObjectUtil.toString(event));
+        }
+
+        private function faultHandler(event:Event):void 
+        {
+            trace("Server fault: " + ObjectUtil.toString(event));
+        }
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/withoutui/remoting_withoutUI.as
----------------------------------------------------------------------
diff --git a/apps/team/features/withoutui/remoting_withoutUI.as b/apps/team/features/withoutui/remoting_withoutUI.as
new file mode 100755
index 0000000..a6f3d51
--- /dev/null
+++ b/apps/team/features/withoutui/remoting_withoutUI.as
@@ -0,0 +1,116 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 flash.display.Sprite;
+    import flash.events.Event;
+    import flash.text.TextField;
+    
+    import mx.collections.ArrayCollection;
+    import mx.collections.ArrayList;
+    import mx.core.mx_internal;
+    import mx.events.PropertyChangeEvent;
+    import mx.messaging.ChannelSet;
+    import mx.messaging.Consumer;
+    import mx.messaging.Producer;
+    import mx.messaging.channels.AMFChannel;
+    import mx.messaging.config.ConfigMap;
+    import mx.messaging.config.LoaderConfig;
+    import mx.messaging.events.ChannelFaultEvent;
+    import mx.messaging.events.MessageAckEvent;
+    import mx.messaging.events.MessageEvent;
+    import mx.messaging.events.MessageFaultEvent;
+    import mx.messaging.messages.AcknowledgeMessage;
+    import mx.messaging.messages.AcknowledgeMessageExt;
+    import mx.messaging.messages.AsyncMessage;
+    import mx.messaging.messages.AsyncMessageExt;
+    import mx.messaging.messages.CommandMessage;
+    import mx.messaging.messages.CommandMessageExt;
+    import mx.messaging.messages.ErrorMessage;
+    import mx.messaging.messages.HTTPRequestMessage;
+    import mx.messaging.messages.MessagePerformanceInfo;
+    import mx.rpc.events.FaultEvent;
+    import mx.rpc.events.ResultEvent;
+    import mx.rpc.remoting.RemoteObject;
+    import mx.utils.ObjectProxy;
+    import mx.utils.ObjectUtil;
+    import mx.utils.RpcClassAliasInitializer;
+
+    use namespace mx_internal;
+
+    /**
+     * A messaging sample that does not use any Flex UI classes. To get this working,
+     * first the url of LoaderConfig needs to be set due to BLZ-522 bug. Then, some
+     * classes need to be registered with Flash, see the registerClassAliases method. 
+     */ 
+    public class remoting_withoutUI extends Sprite
+    {
+        private static const CHANNEL_ID:String = "my-amf";
+        private static const CHANNEL_URL:String = "http://localhost:8400/team/messagebroker/amf";
+        private static const DESTINATION_ID:String = "remoting_AMF";
+
+        private var channelSet:ChannelSet;
+        private var ro:RemoteObject;          
+        private var text:TextField;
+
+        public function remoting_withoutUI()
+        {
+            RpcClassAliasInitializer.registerClassAliases(); 
+            
+            setupChannelSet();
+            setupRO();
+            
+            text = new TextField();
+            text.border = true;
+            text.width = 300;  
+            text.text = "initializing. . .";
+            addChild(text);
+
+            ro.echo("hello");
+        }
+
+        private function resultHandler(event:Event):void 
+        {
+            trace("RemoteObject received result: " + ObjectUtil.toString(event));
+            text.text = "RemoteObject receives result: " + (event as ResultEvent).message.body;
+        }       
+
+        private function setupChannelSet():void
+        {
+            channelSet = new ChannelSet(); 
+            var channel:AMFChannel = new AMFChannel(CHANNEL_ID, CHANNEL_URL);
+            channelSet.addChannel(channel); 
+        }
+        
+        private function setupRO():void
+        {
+            ro = new RemoteObject();
+            ro.channelSet = channelSet; 
+            ro.destination = DESTINATION_ID;
+            ro.addEventListener(ResultEvent.RESULT, resultHandler);
+            ro.addEventListener(ChannelFaultEvent.FAULT, faultHandler);
+            ro.addEventListener(FaultEvent.FAULT, faultHandler);             
+        }
+        
+        private function faultHandler(event:Event):void 
+        {
+            trace("Server fault: " + ObjectUtil.toString(event));
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
new file mode 100755
index 0000000..f633a8d
--- /dev/null
+++ b/build.properties
@@ -0,0 +1,97 @@
+# 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.
+
+
+
+
+
+src.depend=true
+src.debug=on
+
+blazeds.dir=${basedir}
+qa.dir=${basedir}/qa
+appserver.dir=${basedir}/servers/apache-tomcat-6.0.29
+
+local.sdk.lib.dir=./modules/sdk/lib
+local.sdk.frameworks.dir=./frameworks
+local.sdk.bundles.dir=./frameworks/locale
+
+sdk.bin.dir=${blazeds1.dir}/bin
+sdk.lib.dir=${blazeds1.dir}/lib
+compc.dir=${blazeds1.dir}/bin
+
+sdk.version=4
+sdk.frameworks=${local.sdk.frameworks.dir}
+sdk.zip.dir=${blazeds.dir}/resources/flex_sdk
+sdk.zip.file=flex_sdk_${sdk.version}.zip
+sdk.zip=${sdk.zip.dir}/${sdk.zip.file}
+
+min.sdk.version=3.5
+
+branch=blazeds/trunk
+
+webapp.ce.lib=flex-messaging-common.jar,flex-messaging-core.jar,flex-messaging-proxy.jar,flex-messaging-remoting.jar,flex-messaging-opt.jar,commons-logging-1.1.1.jar,commons-codec-1.5.jar,commons-httpclient-3.1.jar,backport-util-concurrent.jar,concurrent.jar,cfgatewayadapter.jar,xalan.jar,flex-rds-server.jar
+webapp.lib=flex-messaging-common.jar,flex-messaging-core.jar,flex-messaging-proxy.jar,flex-messaging-remoting.jar,flex-messaging-opt.jar,,commons-logging-1.1.1.jar,commons-codec-1.5.jar,commons-httpclient-3.1.jar,backport-util-concurrent.jar,concurrent.jar,jsafeJCE.jar,fxgutils.jar,flex-rds-server.jar
+webapp.classes=commons-logging.properties
+webtier.lib=flex-bootstrap.jar,flex-bootstrap-jsp.jar
+webtier.jars=asc.jar,batik*.jar,commons-collections-3.1.jar,commons-discovery.jar,commons-logging-1.1.1.jar,flex-messaging-common.jar,flex-webtier-jsp.jar,flex-webtier.jar,license.jar,velocity-dep-1.4-flex.jar,mxmlc.jar,oscache.jar,swfutils.jar,xercesImpl.jar,xercesPatch.jar,xmlParserAPIs.jar,flex-fontkit.jar,fxgutils.jar,mm-velocity-1.4.jar
+flex.libs=playerglobal.swc,automation.swc,datavisualization.swc,flex.swc,framework.swc,utilities.swc,fds.swc,rpc.swc
+axis.jars=activation.jar, axis.jar, commons-discovery-0.2.jar, jaxrpc.jar, saaj.jar, wsdl4j-1.5.1.jar
+qa-services.jars=qa-services.jar, qa-services-wm.jar, javax_mail.jar
+jgroups.jars=jgroups-core-2.9.0GA.jar,log4j.jar
+
+# Set this to true if you have an updated version of a non-fds swc in the frameworks/local-swcs directory
+# that needs to be used by the build until the regular approval process picks up the external 
+# change.
+# This should always be false unless you are explicitly overriding a swc (or swcs).
+# See the readme.txt file in the local-swcs directory for more information.
+use.local.swcs=false
+
+servlet.jar=${blazeds.dir}/servers/apache-tomcat-6.0.29/lib/servlet-api.jar
+jms.jar=${blazeds.dir}/lib/jms.jar
+jta.jar=${blazeds.dir}/lib/jta.jar
+jmxri.jar=${blazeds.dir}/lib/jmxri.jar
+hsqldb.jar=${blazeds.dir}/lib/hsqldb/hsqldb.jar
+junit.jar=${ant.home}/lib/junit.jar
+
+#player uninstaller file names
+uninstaller.exe=uninstall_flash_player.exe
+
+#player 11 file names
+fp11.installer.exe=11.1/win/InstallAX.exe
+fp11.installer.plugin.exe=11.1/win/InstallPlugin.exe
+
+#player 10 file names
+fp10.installer.exe=10.2/win/InstallAX.exe
+fp10.installer.plugin.exe=10.2/win/InstallPlugin.exe
+
+#player 9 file name
+fp9.installer.exe=win/Install Flash Player 9 ActiveX.exe
+fp9.installer.plugin.exe=win/Install Flash Player 9 Plugin.exe
+
+
+# set the fb3 pro license in your environment if don't want watermarks
+# using environment variable so that we're not checking in a 
+# plain text license into source control
+env.fb3_license=fake
+env.fb4_license=fake
+
+######################
+# Manifest Entries
+######################
+manifest.sealed=false
+manifest.Implementation-Title=BlazeDS
+manifest.Implementation-Version=4.6.0
+manifest.Implementation-Vendor=Adobe Systems Inc.

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
new file mode 100755
index 0000000..61d1abc
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,813 @@
+<?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.
+
+-->
+
+
+
+<!--
+
+Notes: If you're running the main target, then there is no need to call clean first.
+Each of the main targets for the modules will call clean themselves before proceeding.
+
+-->
+<project name="BlazeDS" default="main" basedir=".">
+    <property environment="env"/>
+
+    <!-- properties -->
+    <property file="${basedir}/build.properties" />
+    <property name="dist.dir" value="${basedir}/dist"/>
+    <property name="qa.dir" value="${basedir}/qa"/>
+
+    <!--if CruiseControl is used, label is set to SVN revision number-->
+    <property name="label" value="dev"/>
+    <property name="build.number" value="${label}"/>
+
+    <property name="subproject.target" value="main" />
+
+    <property name="server.baseurl" value="http://localhost:8400"/>
+
+    <property name="ant-contrib.jar" location="${env.ANT_HOME}/lib/ant-contrib-1.0b2.jar"/>
+    <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${ant-contrib.jar}"/>
+
+    <property name="tmp.dir" value="${basedir}/packagetemp/temp" />
+    <property name="local.sdk.dir" value="resources/flex_sdk" />
+    
+    <property name="env.FLEX_HOME" value="${basedir}/../flex-sdk"/>
+    <!-- set FLEX_HOME from environment if not already set -->
+    <property name="FLEX_HOME" value="${env.FLEX_HOME}"/>
+
+    <target name="check-env" 
+        depends="check-flex-home, load-more-properties, check-playerglobal-home" />
+    
+    <target name="check-flex-home" unless="flexhome.exists"
+        description="Check FLEX_HOME for both a directory and a file">
+
+        <echo message="FLEX_HOME is ${env.FLEX_HOME}"/>
+
+        <available file="${env.FLEX_HOME}" 
+            type="dir" 
+            property="FLEX_HOME.set"/>
+
+        <fail message="The environment variable FLEX_HOME is not set to a directory" 
+            unless="FLEX_HOME.set"/>
+
+        <property name="flex-sdk-description.xml" 
+            value="${env.FLEX_HOME}/flex-sdk-description.xml"/>
+
+        <available file="${flex-sdk-description.xml}" 
+            type="file" 
+            property="flex-sdk-description.xml.exists"/>
+        
+        <fail message="The file ${flex-sdk-description.xml} does not exist" 
+            unless="flex-sdk-description.xml"/>
+            
+    </target>
+
+    <target name="load-more-properties" 
+            description="load the FLEX_HOME/build.properties to pick up playerglobal.version">
+        <property file="${FLEX_HOME}/build.properties" />
+    </target>
+    
+    <target name="check-playerglobal-home" unless="playerglobal.swc.exists"
+        description="Check PLAYERGLOBAL_HOME for both a directory and a swc file">
+
+        <echo message="PLAYERGLOBAL_HOME is ${env.PLAYERGLOBAL_HOME}"/>
+        <echo message="playerglobal.version is ${playerglobal.version}"/>
+
+        <available file="${env.PLAYERGLOBAL_HOME}" 
+            type="dir" 
+            property="PLAYERGLOBAL_HOME.set"/>
+
+        <fail message="The environment variable PLAYERGLOBAL_HOME is not set to a directory" 
+            unless="PLAYERGLOBAL_HOME.set"/>
+
+        <property name="playerglobal.swc" 
+            value="${env.PLAYERGLOBAL_HOME}/${playerglobal.version}/playerglobal.swc"/>
+
+        <available file="${playerglobal.swc}" 
+            type="file" 
+            property="playerglobal.swc.exists"/>
+        
+        <fail message="The file ${playerglobal.swc} does not exist" 
+            unless="playerglobal.swc.exists"/>
+            
+        <echo message="playerglobal.swc is ${playerglobal.swc}"/>
+    </target>
+    
+    <target name="thirdparty-downloads" unless="no.thirdparty-downloads" description="Downloads all the required thirdparty code.">
+        <ant antfile="${basedir}/downloads.xml" dir="${basedir}"/>
+    </target>
+    
+    <target name="main" depends="check-env,clean,thirdparty-downloads,sdk,webtier,common,core,proxy,remoting,opt,apps,createMMSFile" description="full build">
+        <tstamp>
+            <format property="build.datetime" pattern="MM/dd/yyyy hh:mm:ss aa" />
+        </tstamp>
+        <echo>ant main target completed on ${build.datetime}</echo>
+    </target>
+
+    <target name="help">
+        <echo message="run ant -projecthelp to see the available targets"/>
+    </target>
+
+    <!-- must be setup before building other targets -->
+    <target name="sdk" description="get the sdk and add to the server">
+        <ant antfile="${basedir}/modules/sdk/build.xml"/>
+    </target>
+    
+    <target name="webtier" description="get the webtier corresponding to the SDK used">
+        <ant antfile="${basedir}/qa/resources/webtier/build.xml"/>
+    </target>
+
+    <target name="common" description="full build of the common module">
+        <ant antfile="${basedir}/modules/common/build.xml" target="${subproject.target}"/>
+    </target>
+
+    <target name="core" description="full build of the core module">
+        <ant antfile="${basedir}/modules/core/build.xml" target="${subproject.target}"/>
+    </target>
+
+    <target name="proxy" description="full build of the proxy module">
+        <ant antfile="${basedir}/modules/proxy/build.xml" target="${subproject.target}"/>
+    </target>
+
+    <target name="remoting" description="full build of the remoting module">
+        <ant antfile="${basedir}/modules/remoting/build.xml" target="${subproject.target}"/>
+    </target>
+
+    <target name="opt" description="full build of the opt module">
+        <ant antfile="${basedir}/modules/opt/build.xml" target="${subproject.target}"/>
+    </target>
+
+    <target name="ajax" description="full build of the fds-ajax bridge">
+        <ant antfile="${basedir}/resources/fds-ajax-bridge/build.xml" dir="${basedir}/resources/fds-ajax-bridge"/>
+    </target>
+
+	<!-- removing aspectj dependencies
+	    <target name="apps" depends="consoleapp,samplesapp,blazedsapp,blazeds-springapp,samples-springapp,qaapp,qa-manualapp,teamapp" description="full build of all active apps" />-->
+    <target name="apps" depends="consoleapp,samplesapp,blazedsapp,qaapp,qa-manualapp,teamapp" description="full build of all active apps" />
+
+    <target name="samplesapp" description="full build of the samples app">
+        <ant antfile="${basedir}/apps/samples/build.xml" target="${subproject.target}"/>
+    </target>
+
+    <target name="samples-springapp" description="full build of the spring-samples app">
+        <ant antfile="${basedir}/apps/samples-spring/build.xml" target="${subproject.target}"/>
+    </target>
+
+    <target name="blazedsapp" description="full build of the blazeds app">
+        <ant antfile="${basedir}/apps/blazeds/build.xml" target="${subproject.target}"/>
+    </target>
+
+    <target name="blazeds-springapp" description="full build of the blazeds-spring app">
+        <ant antfile="${basedir}/apps/blazeds-spring/build.xml" target="${subproject.target}"/>
+    </target>
+
+    <target name="consoleapp" description="full build of the flex admin app">
+        <if>
+            <equals arg1="${sdk.version}" arg2="3"/>
+            <then>
+                <echo message="Console app doesn't build with SDK 3, skipping."/>
+            </then>
+            <else>
+                <ant antfile="${basedir}/apps/ds-console/build.xml" target="${subproject.target}"/>
+            </else>
+        </if>
+    </target>
+
+    <target name="qaapp" description="full build of the qa app">
+        <ant antfile="${qa.dir}/apps/qa-regress/build.xml" dir="${qa.dir}"/>
+    </target>
+
+    <target name="qa-manualapp" description="full build of the qa manual testing app">
+        <ant antfile="${qa.dir}/apps/qa-manual/build.xml" />
+    </target>
+
+    <target name="teamapp" description="full build of the team app">
+        <ant antfile="${basedir}/apps/team/build.xml" target="${subproject.target}"/>
+    </target>
+
+    <target name="postbuilds">
+        <ant antfile="${basedir}/modules/core/build.xml" target="postbuilds"/>
+    </target>
+
+    <target name="createMMSFile"
+        description="create mms.cfg in order to enable local shared object access"
+        if="isWindows">
+        <if>
+            <isset property="env.WINDIR"/>
+            <then>
+                <property name="ocx.dir" value="${env.WINDIR}/system32/Macromed/Flash/" />
+            </then>
+            <else>
+                <if>
+                    <isset property="env.WinDir"/>
+                    <then>
+                        <property name="ocx.dir" value="${env.WinDir}/system32/Macromed/Flash/" />
+                    </then>
+                    <else>
+                        <property name="ocx.dir" value="${env.windir}/system32/Macromed/Flash/" />
+                    </else>
+                </if>
+            </else>
+        </if>
+        <!-- Sets the default maximum local shared object storage size to unlimited -->
+        <echo file="${ocx.dir}/mms.cfg" append="false">LocalStorageLimit=6</echo>
+    </target>
+
+    <target name="package" depends="package-clean" description="package task which creates zips">
+        <mkdir dir="${dist.dir}"/>
+
+        <!-- package qa apps -->
+        <!-- <ant antfile="${qa.dir}/apps/qa-manual/build.xml" target="package"/> -->
+        <ant antfile="${qa.dir}/apps/qa-regress/build.xml" target="package"/>
+        
+        <ant antfile="${basedir}/apps/samples/build.xml" target="package"/>
+        <ant antfile="${basedir}/apps/samples-spring/build.xml" target="package"/>
+        <ant antfile="${basedir}/apps/blazeds/build.xml" target="package"/>
+        <ant antfile="${basedir}/apps/blazeds-spring/build.xml" target="package"/>
+        <ant antfile="${basedir}/apps/ds-console/build.xml" target="package"/>
+
+        <ant antfile="${appserver.dir}/build.xml" target="package"/>
+
+        <antcall target="package-oem" />
+
+        <copy todir="${dist.dir}/lib">
+            <fileset dir="${basedir}/lib">
+                <include name="flex-messaging-common.jar"/>
+                <include name="flex-messaging-core.jar"/>               
+            </fileset>
+        </copy>
+
+        <antcall target="javadoc" />
+
+        <!-- add apps to Tomcat -->
+        <unzip src="${dist.dir}/blazeds.war" dest="${dist.dir}/tomcat/webapps/blazeds" />
+        <unzip src="${dist.dir}/blazeds-spring.war" dest="${dist.dir}/tomcat/webapps/blazeds-spring" />
+        <unzip src="${dist.dir}/samples.war" dest="${dist.dir}/tomcat/webapps/samples" />
+        <unzip src="${dist.dir}/samples-spring.war" dest="${dist.dir}/tomcat/webapps/samples-spring" />
+        <unzip src="${dist.dir}/ds-console.war" dest="${dist.dir}/tomcat/webapps/ds-console" />
+
+        <!-- generate turnkey zip -->
+        <antcall target="package-turnkey"/>
+
+        <!-- generate binary zip -->
+        <zip destfile="${dist.dir}/blazeds-bin-${manifest.Implementation-Version}.${label}.zip"
+            comment="${manifest.Implementation-Title} ${manifest.Implementation-Version}.${label}">
+            <fileset dir="${dist.dir}" includes="blazeds.war"/>
+            <zipfileset dir="${basedir}/collateral" includes="blazeds-bin-readme.htm" fullpath="blazeds-bin-readme.htm"/>
+        </zip>
+
+        <!-- generate src zip -->
+        <antcall target="package-src"/>
+
+        <!-- generate java amf client zip -->
+        <zip destfile="${dist.dir}/blazeds-java-amf.${label}.zip"
+            comment="${manifest.Implementation-Title} ${manifest.Implementation-Version}.${label}">
+            <fileset dir="${dist.dir}/lib" includes="*"/>           
+        </zip>
+        
+        <!-- geneate md5 checksums for the four zips -->
+        <checksum forceOverwrite="yes" format="MD5SUM">
+            <fileset dir="${dist.dir}">
+                <include name="blazeds-*.zip" />
+            </fileset>
+        </checksum>
+
+        <antcall target="package-automation" />
+
+    </target>
+
+
+    <target name="package-turnkey">
+        
+         <zip destfile="${dist.dir}/blazeds-turnkey-${manifest.Implementation-Version}.${label}.zip"
+              comment="${manifest.Implementation-Title} ${manifest.Implementation-Version}.${label}">
+              <fileset dir="${dist.dir}" includes="blazeds.war,blazeds-spring.war,samples.war,samples-spring.war,ds-console.war"/>
+              <zipfileset dir="${dist.dir}/tomcat" prefix="tomcat" excludes="bin,bin/*,work/"/>
+              <zipfileset dir="${dist.dir}/tomcat/bin" prefix="tomcat/bin"  filemode="744"/>
+              <zipfileset dir="${dist.dir}/docs" prefix="docs"/>
+            
+              <zipfileset dir="${basedir}/resources" prefix="resources">
+                  <exclude name="fds-ajax-bridge/build.xml"/>
+                  <exclude name="clustering/JGroups-2.9.0.GA.src.zip"/>
+                  <exclude name="flex_sdk/*.zip"/>
+                  <exclude name="flex_sdk/*.htm"/>
+                  <exclude name="flex_sdk/readme.txt"/>
+              </zipfileset>
+            
+              <zipfileset dir="${basedir}/lib" prefix="resources/clustering" includes="jgroups*"/>
+              <zipfileset dir="${basedir}/lib" prefix="resources/lib" includes="flex-messaging*"/>
+              <zipfileset dir="${basedir}/collateral" includes="blazeds-turnkey-readme.htm" fullpath="blazeds-turnkey-readme.htm"/>
+              <zipfileset dir="${dist.dir}/sampledb" prefix="sampledb" filemode="744"/>
+         </zip>
+    </target>
+    
+    
+    
+    <target name="package-src">
+        
+       <zip destfile="${dist.dir}/blazeds-src-${manifest.Implementation-Version}.${label}.zip"
+            comment="${manifest.Implementation-Title} ${manifest.Implementation-Version}.${label}">
+            <zipfileset dir="${basedir}/collateral" includes="blazeds-src-readme.htm" fullpath="blazeds-src-readme.htm"/>
+               <fileset dir="${basedir}">
+                <include name="adobe.header"/>
+                <include name="build.properties"/>
+                <include name="build.xml"/>
+                <include name="readme.txt"/>
+                   <include name="collateral/**/*"/>
+                   <include name="development/**/*"/>
+                   <include name="sampledb/**/*"/>
+               </fileset>
+
+            <!-- apps folder -->
+               <zipfileset dir="${basedir}/apps" prefix="apps">
+
+                <!-- blazeds app -->
+                <include name="blazeds/**/*"/>
+                <exclude name="blazeds/WEB-INF/lib/"/>
+                <exclude name="blazeds/WEB-INF/src/"/>
+
+                <!-- blazeds-spring app -->
+                <include name="blazeds-spring/**/*"/>
+                <exclude name="blazeds-spring/WEB-INF/lib/"/>
+                <exclude name="blazeds-spring/WEB-INF/src/"/>
+
+                <!-- ds-console app -->
+                <include name="ds-console/**/*"/>
+                <exclude name="ds-console/history/"/>
+                <exclude name="ds-console/*.swf"/>
+                <exclude name="ds-console/*.html"/>
+                <exclude name="ds-console/*.js"/>
+                <exclude name="ds-console/WEB-INF/lib/"/>
+                <exclude name="ds-console/WEB-INF/classes/"/>
+
+                <!-- samples app -->
+                <include name="samples/images/"/>
+                <include name="samples/*.htm"/>
+                <include name="samples/main.css"/>
+                <include name="samples/README.txt"/>
+                <include name="samples/build.xml"/>
+
+                <include name="samples/WEB-INF/"/>
+                <exclude name="samples/WEB-INF/classes/"/>
+                <exclude name="samples/WEB-INF/lib/b*"/>
+                <exclude name="samples/WEB-INF/lib/c*"/>
+                <exclude name="samples/WEB-INF/lib/f*"/>
+                <exclude name="samples/WEB-INF/flex-src/*.zip"/>
+                <exclude name="samples/WEB-INF/flex-src/**/datavisualization*.swc"/>
+
+                <!-- samples-spring app -->
+                <include name="samples-spring/images/"/>
+                <include name="samples-spring/*.htm"/>
+                <include name="samples-spring/main.css"/>
+                <include name="samples-spring/README.txt"/>
+                <include name="samples-spring/build.xml"/>
+
+                <include name="samples-spring/WEB-INF/"/>
+                <exclude name="samples-spring/WEB-INF/classes/"/>
+                <exclude name="samples-spring/WEB-INF/lib/b*"/>
+                <exclude name="samples-spring/WEB-INF/lib/c*"/>
+                <exclude name="samples-spring/WEB-INF/lib/f*"/>
+                <exclude name="samples-spring/WEB-INF/flex-src/*.zip"/>
+                <exclude name="samples-spring/WEB-INF/flex-src/**/datavisualization*.swc"/>
+
+                <!-- team app -->
+                <include name="team/**/*"/>
+                <exclude name="team/WEB-INF/lib/"/>
+                <exclude name="team/WEB-INF/classes/"/>
+                <exclude name="team/WEB-INF/flex/jars/"/>
+                <exclude name="team/WEB-INF/flex/libs/"/>
+                <exclude name="team/WEB-INF/flex/locale/"/>
+                <exclude name="team/WEB-INF/flex/*.ser"/>
+                <exclude name="team/WEB-INF/flex/flash-unicode-table.xml"/>
+                <exclude name="team/WEB-INF/flex/flex-sdk-description.xml"/>
+                <exclude name="team/WEB-INF/flex/mxml-manifest.xml"/>
+
+            </zipfileset>
+
+               <!-- qa folder -->
+               <zipfileset dir="${basedir}/qa" prefix="qa">
+                   <!-- qa-manual app -->
+                   <include name="apps/qa-manual/**/*"/>
+                   <exclude name="apps/qa-manual/bugs/"/>
+
+                   <!-- common excludes for both qa-manual and qa-regress apps -->
+                   <exclude name="apps/**/WEB-INF/classes/"/>
+                   <exclude name="apps/**/WEB-INF/lib/"/>
+                   <exclude name="apps/**/WEB-INF/flex/jars/"/>
+                   <exclude name="apps/**/WEB-INF/flex/libs/"/>
+                   <exclude name="apps/**/WEB-INF/flex/locale/"/>
+                   <exclude name="apps/**/WEB-INF/flex/*.ser"/>
+                   <exclude name="apps/**/WEB-INF/flex/flash-unicode-table.xml"/>
+                   <exclude name="apps/**/WEB-INF/flex/flex-sdk-description.xml"/>
+                   <exclude name="apps/**/WEB-INF/flex/mxml-manifest.xml"/>
+                   <exclude name="apps/**/WEB-INF/flex/flex-config.xml"/>
+                   <exclude name="apps/**/WEB-INF/flex/flex-webtier-config.xml"/>
+                   <exclude name="apps/**/WEB-INF/flex/messaging-config.xml"/>
+                   <exclude name="apps/**/WEB-INF/flex/proxy-config.xml"/>
+                   <exclude name="apps/**/WEB-INF/flex/remoting-config.xml"/>
+                   <exclude name="apps/**/WEB-INF/flex/services-config.xml"/>
+
+                   <!-- qa-regress app -->
+                   <include name="apps/qa-regress/**/*"/>
+                   <exclude name="apps/qa-regress/features/"/>
+                   <exclude name="apps/qa-regress/lib/"/>
+                   <exclude name="apps/qa-regress/testsuites/mxunit/tests/proxyService/webService/bugs/"/>
+                   <exclude name="apps/qa-regress/testsuites/mxunit/tests/proxyService/webService/noproxy/"/>
+                   <exclude name="apps/qa-regress/testsuites/mxunit/tests/proxyService/webService/general/array*"/>
+                   <exclude name="apps/qa-regress/testsuites/mxunit/tests/proxyService/webService/general/attributesScript.mxml"/>
+                   <exclude name="apps/qa-regress/testsuites/mxunit/tests/proxyService/webService/general/deserializeDocLitArray.mxml"/>
+                   <exclude name="apps/qa-regress/testsuites/mxunit/tests/proxyService/webService/general/twoDimensionalArrayScript.mxml"/>
+                   <exclude name="apps/qa-regress/testsuites/mxunit/tests/proxyService/webService/mxWebService/DotNetDocLiteralTests/"/>
+                   <exclude name="apps/qa-regress/testsuites/mxunit/tests/proxyService/webService/mxWebService/mxWebServiceAmpersandInWSDL.mxml"/>
+                   <exclude name="apps/qa-regress/testsuites/mxunit/tests/proxyService/webService/mxWebService/mxWebServiceDotDotInWSDL.mxml"/>
+                   <exclude name="apps/qa-regress/testsuites/mxunit/tests/proxyService/webService/mxWebService/mxWebServiceMethod*.mxml"/>
+                   <exclude name="apps/qa-regress/testsuites/mxunit/tests/proxyService/webService/mxWebService/mxWebServiceSetEndpointURI.mxml"/>
+                   <exclude name="apps/qa-regress/testsuites/mxunit/tests/proxyService/webService/mxWebService/mxWebServiceUseProxyFalseFault.mxml"/>
+                   <exclude name="apps/qa-regress/testsuites/mxunit/tests/proxyService/webService/mxWebService/mxWebServiceUseProxyTrue.mxml"/>
+
+                   <exclude name="apps/qa-regress/testsuites/flexunit/src/tests/flexunit/wscl/interop/Query*.*"/>
+                   <exclude name="apps/qa-regress/testsuites/flexunit/src/tests/flexunit/wscl/interop/*DotNet*"/>
+                   <exclude name="apps/qa-regress/testsuites/flexunit/src/tests/flexunit/wscl/interop/SOAPBuilderRound2CFCTest.as"/>
+                   <exclude name="apps/qa-regress/testsuites/flexunit/src/tests/flexunit/wscl/interop/SOAPBuilderRound3Compound1.as"/>
+                   <exclude name="apps/qa-regress/testsuites/flexunit/src/tests/flexunit/wscl/interop/SOAPBuilderRound3Compound1_WhiteMesaTest.as"/>
+
+                   <include name="features/**/*"/>
+
+                   <include name="lib/**/*"/>
+                   <exclude name="lib/tools/"/>
+                   <exclude name="lib/ms*.jar"/>
+                   <exclude name="lib/commons-codec-1.3.jar"/>
+                   <exclude name="lib/commons-httpclient-3.1.jar"/>
+                   <exclude name="lib/commons-logging.jar"/>
+                   <exclude name="lib/qa-config.jar"/>
+                   <exclude name="lib/qa-flexunit.jar"/>
+                   <exclude name="lib/qa-mxunit.jar"/>
+                   <exclude name="lib/qa-utils.jar"/>
+                   <exclude name="lib/browserServer.jar"/>
+                   <exclude name="lib/xalan.jar"/>
+
+                   <include name="resources/config/*"/>
+                   <include name="resources/frameworks/*"/>
+                   <include name="resources/webtier/"/>
+                   <include name="src/**/*"/>
+                   <include name="build.*"/>
+               </zipfileset>
+
+
+               <!-- frameworks folder -->
+               <zipfileset dir="${basedir}/frameworks" prefix="frameworks">
+                   <include name="**/datavisualization*.swc"/>
+                   <include name="local-swcs/*"/>
+               </zipfileset>
+
+               <!-- lib folder -->
+               <zipfileset dir="${basedir}/lib" prefix="lib">
+                   <include name="hsqldb/*"/>
+                   <include name="spring/*"/>
+
+                   <include name="commons*.*"/>
+                   <exclude name="commons-logging.jar"/>
+                   <exclude name="commons-collections.jar"/>
+
+                   <include name="j*.*"/>
+                   <include name="flex-w*.*"/>
+                   <include name="flex-b*.*"/>
+                   <include name="xalan*.*"/>
+                   <include name="backport*.*"/>
+                   <include name="cfgatewayadapter.jar"/>
+                   <include name="concurrent.jar"/>
+                   <include name="oscache.jar"/>
+                   <include name="servlet.jar"/>
+               </zipfileset>
+
+               <!-- modules folder -->
+               <zipfileset dir="${basedir}/modules" prefix="modules">                      
+                   <include name="**/src/**/*"/>
+                   <include name="**/lib/*"/>
+                   <include name="core/test/src/**/*"/>
+                   <include name="**/AdobeInfo.xml"/>
+                   <include name="**/build.xml"/>
+                   <exclude name="rds/"/> 
+               </zipfileset>
+
+               <!-- servers folder -->
+               <zipfileset dir="${basedir}/servers" prefix="servers">
+                   <exclude name="apache-tomcat-6.0.29/lib/blazeds/"/>
+                   <exclude name="apache-tomcat-6.0.29/conf/Catalina/localhost/qa-perf.xml"/>
+                   <exclude name="apache-tomcat-6.0.29/logs/"/>
+                   <exclude name="apache-tomcat-6.0.29/work/"/>
+               </zipfileset>
+
+               <!-- resources folder -->
+            <zipfileset dir="${basedir}/resources" prefix="resources">
+                <exclude name="security/tomcat/*.jar"/>
+                <exclude name="flex_sdk/*.zip"/>
+            </zipfileset>
+
+        </zip>
+    </target>
+
+<!--
+***************************************************************************
+    Target - package-automation
+*************************************************************************** -->
+    <target name="package-automation" description="Create QA Automation package">
+        <zip destfile="${basedir}/dist/qa-automation.zip">
+            <zipfileset dir="${qa.dir}/automation"/>
+        </zip>
+    </target>
+
+    <target name="package-oem" description="Create OEM package">
+
+            <delete dir="${basedir}/packagetemp" failonerror="false" includeEmptyDirs="true"/>
+            <mkdir dir="${basedir}/dist"/>
+
+            <!-- Copy sdk zip and other community resources -->
+            <copy todir="${basedir}/packagetemp">
+                <fileset dir="${basedir}">
+                    <include name="resources/**/*"/>
+                    <exclude name="resources/flex_sdk/**/*"/>                    
+                </fileset>
+            </copy>
+
+            <!-- Copy community jars -->
+            <copy todir="${basedir}/packagetemp/lib">
+                <fileset dir="${basedir}/lib">
+                    <include name="flex-messaging-common.jar"/>
+                    <include name="flex-messaging-core.jar"/>
+                    <include name="flex-messaging-proxy.jar"/>
+                    <include name="flex-messaging-remoting.jar"/>
+                    <include name="flex-messaging-opt.jar"/>
+                    <include name="flex-bootstrap.jar"/>
+                    <include name="flex-bootstrap-jsp.jar"/>
+                    <include name="flex-webtier.jar"/>
+                    <include name="flex-webtier-jsp.jar"/>
+                    <include name="oscache.jar"/>
+                    <include name="cfgatewayadapter.jar"/>
+                    <include name="flex-rds-server.jar"/>
+                </fileset>
+            </copy>
+
+            <copy todir="${basedir}/packagetemp/console_src">
+                <fileset dir="${basedir}/apps/ds-console">
+                    <include name="console/**/*"/>
+                    <include name="*.mxml"/>
+                </fileset>
+            </copy>
+
+            <zip destfile="${basedir}/dist/blazeds-oem.zip">
+                <fileset dir="${dist.dir}" includes="ds-console.war"/>
+                <zipfileset dir="${basedir}/packagetemp"/>
+            </zip>
+     </target>
+
+    <target name="package-oem-small" depends="package-oem" description="Create Small OEM package">
+        <echo message="Creating smaller Flex_SDK. . ."/>
+        <mkdir dir="${tmp.dir}"/>
+        <unzip src="${basedir}/dist/blazeds-oem.zip" dest="${tmp.dir}"/> 
+        <mkdir dir="${tmp.dir}/${local.sdk.dir}/expanded"/>
+        <unzip src="${basedir}/packagetemp/${local.sdk.dir}/${sdk.zip.file}" dest="${tmp.dir}/${local.sdk.dir}/expanded">
+            <!--<patternset>
+                <include name="ant/lib/flexTasks.jar" />
+                <include name="asdoc/**/*"/>
+                <include name="bin/*"/>
+                <include name="lib/*"/>
+                <include name="frameworks/*"/>
+                <include name="frameworks/libs/**"/>
+                <include name="frameworks/locale/**"/>
+                <include name="runtimes/player/**/*"/>
+                <include name="templates/**/*"/>
+            </patternset>-->           
+        </unzip>
+        <delete includeEmptyDirs="true" quiet="true">
+            <fileset dir="${tmp.dir}/${local.sdk.dir}" includes="${sdk.zip.file}" />
+        </delete>
+        <zip destfile="${tmp.dir}/${local.sdk.dir}/${sdk.zip.file}">
+            <fileset dir="${tmp.dir}/${local.sdk.dir}/expanded" includes="**/**"/>
+        </zip>
+        <delete dir="${tmp.dir}/${local.sdk.dir}/expanded" failonerror="false" />
+        <zip destfile="${basedir}/dist/blazeds-oem-small.zip">
+            <fileset dir="${tmp.dir}" includes="**/**"/>
+        </zip>
+        <delete dir="${tmp.dir}" failonerror="false" />
+    </target>
+    
+    <target name="package-clean">
+        <delete failonerror="false" includeEmptyDirs="true">
+            <fileset dir="${dist.dir}" includes="**/*"/>
+        </delete>
+    </target>
+
+    <target name="clean" description="clean">
+        <ant antfile="${basedir}/modules/sdk/build.xml" target="clean"/>
+        <ant antfile="${basedir}/modules/remoting/build.xml" target="clean"/>
+        <ant antfile="${basedir}/modules/proxy/build.xml" target="clean"/>
+        <ant antfile="${basedir}/modules/common/build.xml" target="clean"/>
+        <ant antfile="${basedir}/modules/core/build.xml" target="clean"/>
+        <ant antfile="${basedir}/modules/opt/build.xml" target="clean"/>
+        <ant antfile="${basedir}/apps/blazeds/build.xml" target="clean"/>
+        <ant antfile="${basedir}/apps/blazeds-spring/build.xml" target="clean"/>
+        <ant antfile="${basedir}/apps/ds-console/build.xml" target="clean"/>
+        <ant antfile="${basedir}/apps/samples/build.xml" target="clean"/>
+        <ant antfile="${basedir}/apps/samples-spring/build.xml" target="clean"/>
+        <ant antfile="${basedir}/apps/team/build.xml" target="clean"/>
+        <ant antfile="${basedir}/resources/fds-ajax-bridge/build.xml" target="clean"/>
+        <ant antfile="${basedir}/qa/apps/qa-manual/build.xml" target="clean"/>
+        <ant antfile="${basedir}/qa/apps/qa-regress/build.xml" target="clean"/>
+        <ant antfile="${basedir}/qa/resources/webtier/build.xml" target="clean"/>
+        <ant antfile="${basedir}/qa/src/build.xml" target="clean"/>
+        <delete>
+            <fileset dir="." includes="TEST-*.xml"/>
+        </delete>
+        <delete quiet="true" dir="${basedir}/dist"/>
+        <delete quiet="true" dir="${basedir}/sampledb" includes="hsqldb.jar"/>
+        <delete quiet="true" dir="${basedir}/templates"/>
+        <delete>
+            <fileset dir="resources/clustering" includes="{jgroups.jars},jgroups-LICENSE.txt" />
+        </delete>
+    </target>
+
+    <target name="super-clean" depends="thirdparty-clean,clean" description="Cleans everything including thirdparty downloads."/>
+	
+    <target name="thirdparty-clean" unless="no.thirdparty-clean" description="Removes all thirdparty downloads.">
+        <ant antfile="${basedir}/downloads.xml" target="clean" dir="${basedir}"/>
+    </target>
+        
+    <target name="generated-clean">
+        <delete includeEmptyDirs="true" quiet="true">
+            <fileset dir="${basedir}/apps" includes="**/generated/*" />
+        </delete>
+        <delete includeEmptyDirs="true" quiet="true">
+            <fileset dir="${basedir}/apps" includes="**/generated" />
+        </delete>
+    </target>
+
+    <target name="unit" description="Runs JUnit tests">
+        <ant antfile="${basedir}/modules/core/build.xml" target="unit"> 
+            <property name="feature" value="${feature}" /> <!-- runs subset of unit tests -->
+        </ant>
+    </target>
+
+    <!-- Don't try to start server if it is already running -->
+     <target name="check.server">
+        <condition property="server.running">
+            <http url="${server.baseurl}"/>
+        </condition>
+     </target>
+
+    <target name="set.extension" description="set vars per os">
+        <osfamily property="os.family"/>
+        <switch value="${os.family}">
+            <case value="windows">
+                <property name="shellext" value="bat"/>
+            </case>
+            <case value="unix">
+                <property name="shellext" value="sh"/>
+            </case>
+            <case value="mac">
+                <property name="shellext" value="sh"/>
+            </case>
+        </switch>
+    </target>
+
+    <target name="startserver" description="Start Tomcat Server" depends="set.extension, check.server"
+            unless="server.running">
+        <exec spawn="true" executable="${appserver.dir}/bin/catalina.${shellext}"
+            dir="${appserver.dir}/bin">
+            <arg line="start" />
+           </exec>
+    </target>
+
+    <target name="stopserver" description="Stop Tomcat Server"
+    depends="set.extension">
+        <exec spawn="true" executable="${appserver.dir}/bin/catalina.${shellext}"
+            dir="${appserver.dir}/bin">
+            <arg line="stop" />
+        </exec>
+    </target>
+    
+     <target name="waitforAppserverToStart" >
+        <echo message="Waiting for appserver to start: requesting ${server.baseurl}/qa-regress"/>
+        <waitfor maxwait="120" maxwaitunit="second" checkevery="15" timeoutproperty="bTimeout">
+            <http url="${server.baseurl}/qa-regress"/>
+        </waitfor>
+        <switch value="${bTimeout}">
+            <case value="true">
+                <property name="bAppServerStarted" value="false"/>
+            </case>
+            <default>
+                <property name="bAppServerStarted" value="true"/>
+            </default>
+        </switch>
+        <echo>Flex has started: ${bAppServerStarted} ...continuing</echo>
+    </target>
+
+    <target name="checkintests" description="checkintests">
+ 
+        <!-- run flexunit-->
+        <ant antfile="${qa.dir}/apps/qa-regress/testsuites/flexunit/build.xml" target="main" >
+            <property name="basedir" value="${qa.dir}" />
+            <property name="feature" value="checkintests" /> <!-- runs rpc and messaging -->
+            <property name="alwaysshowreport" value="false" /> <!-- will only show report if there are failures -->
+        </ant>
+    
+        <!-- JUnit tests already start the server, if necessary 
+        <antcall target="startserver"/>
+        -->
+        <!-- run java unit tests -->
+        <property name="feature" value="checkintests-all"/>
+        <antcall target="unit" >
+            <param name="feature" value="${feature}" /> <!-- runs subset of unit tests -->
+        </antcall>
+
+        <antcall target="stopserver"/>
+    </target>
+
+    <target name="parseresults">
+            <java classname="utils.TestResultsParser">
+            <classpath>
+                <pathelement location="${qa.dir}/classes"/>
+                <fileset dir="${qa.dir}/lib">
+                  <include name="*.jar" />
+                </fileset>
+            </classpath>
+            <arg line="${qa.dir}/sdk/testsuites/mxunit/reports"/>
+        </java>
+    </target>
+
+    <target name="ocx" description="Update the ActiveX player to the latest.  You must CLOSE YOUR BROWSERS for this to work.">
+        <property name="ant-contrib.jar" location="${env.ANT_HOME}/lib/ant-contrib-1.0b2.jar"/>
+        
+        
+        <if>
+            <equals arg1="${sdk.version}" arg2="3"/>
+            <then>
+                <property name="installer.exe" value="${fp9.installer.exe}"/>
+                <property name="installer.plugin.exe" value="${fp9.installer.plugin.exe}"/>
+            </then>
+            <else>
+                <property name="installer.exe" value="${fp11.installer.exe}"/>
+                <property name="installer.plugin.exe" value="${fp11.installer.plugin.exe}"/>
+            </else> 
+        </if>
+        
+  
+        <available file="${basedir}/qa/automation/bin/${uninstaller.exe}" property="uninstaller.exists" />
+
+        <if>
+            <and>
+                <equals arg1="${uninstaller.exists}" arg2="true" />
+                <not>
+                    <equals arg1="${skip.uninstall}" arg2="true" />
+                </not>
+            </and>
+            <then>
+                <echo>Uninstalling the old ActiveX and Plugin players.</echo>
+                <exec dir="${basedir}" executable="${basedir}/qa/automation/bin/${uninstaller.exe}" >
+                    <arg line="-uninstall" />
+                </exec>
+            </then>
+            <else>
+                <echo>Uninstall was skipped.</echo>
+                <echo> - skip.uninstall? ${skip.uninstall}</echo>
+            </else>
+        </if>
+
+        <echo>Installing the new player.</echo>
+        <exec dir="${basedir}/bin" executable="${basedir}/bin/${installer.exe}">
+           <arg line="-install"/>
+        </exec>
+        <echo>Installing the plugin player.</echo>
+        <exec dir="${basedir}/bin" executable="${basedir}/bin/${installer.plugin.exe}">
+           <arg line="-install"/>
+        </exec>
+    </target>
+
+    <target name="javadoc">
+        <delete dir="${basedir}/docs" failonerror="false" includeEmptyDirs="true" />
+        <ant antfile="${basedir}/modules/core/build.xml" target="javadoc" >
+            <property name="build.number" value="${build.number}"/>
+        </ant>
+        <copy todir="${dist.dir}/docs" >
+            <fileset dir="${basedir}/docs" includes="javadoc.zip"/>
+        </copy>
+    </target>
+   
+</project>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/collateral/blazeds-bin-readme.htm
----------------------------------------------------------------------
diff --git a/collateral/blazeds-bin-readme.htm b/collateral/blazeds-bin-readme.htm
new file mode 100755
index 0000000..bc556c1
--- /dev/null
+++ b/collateral/blazeds-bin-readme.htm
@@ -0,0 +1,270 @@
+<!--
+  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>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<title>BlazeDS Binary Readme</title>
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+	{font-family:"Cambria Math";
+	panose-1:2 4 5 3 5 4 6 3 2 4;}
+@font-face
+	{font-family:Verdana;
+	panose-1:2 11 6 4 3 5 4 4 2 4;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+	{margin:0in;
+	margin-bottom:.0001pt;
+	font-size:12.0pt;
+	font-family:"Times New Roman","serif";
+	color:windowtext;}
+h3
+	{mso-style-link:"Heading 3 Char";
+	margin-right:0in;
+	margin-left:0in;
+	font-size:13.5pt;
+	font-family:"Times New Roman","serif";
+	color:black;
+	font-weight:bold;}
+a:link, span.MsoHyperlink
+	{color:blue;
+	text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+	{color:purple;
+	text-decoration:underline;}
+p
+	{margin-right:2.6pt;
+	margin-left:2.6pt;
+	font-size:12.0pt;
+	font-family:"Verdana","sans-serif";
+	color:black;}
+pre
+	{mso-style-link:"HTML Preformatted Char";
+	margin:0in;
+	margin-bottom:.0001pt;
+	font-size:10.0pt;
+	font-family:"Courier New";
+	color:windowtext;}
+span.Heading3Char
+	{mso-style-name:"Heading 3 Char";
+	mso-style-link:"Heading 3";
+	font-family:"Cambria","serif";
+	color:#4F81BD;
+	font-weight:bold;}
+span.HTMLPreformattedChar
+	{mso-style-name:"HTML Preformatted Char";
+	mso-style-link:"HTML Preformatted";
+	font-family:"Courier New";}
+.MsoChpDefault
+	{font-size:10.0pt;}
+@page Section1
+	{size:8.5in 11.0in;
+	margin:1.0in 1.25in 1.0in 1.25in;}
+div.Section1
+	{page:Section1;}
+ /* List Definitions */
+ ol
+	{margin-bottom:0in;}
+ul
+	{margin-bottom:0in;}
+-->
+</style>
+
+</head>
+
+<body lang=EN-US link=blue vlink=purple>
+
+<div class=Section1>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>BlazeDS Binary Distribution</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>This BlazeDS Binary distribution includes
+the Adobe BlazeDS web application whose licenses are described below:</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal><u><span style='font-size:14.0pt'>Adobe BlazeDS License
+Information</span></u><span style='font-size:14.0pt'>:</span></p>
+
+<p class=MsoNormal>&nbsp;</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>�
+2004-2008 Adobe Systems Incorporated. All rights reserved.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+program is free software: you can redistribute it and/or modify it under the
+terms of the GNU Lesser General Public License, Version 3, as published by the
+Free Software Foundation.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE.� See the GNU Lesser General Public License for more
+details.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>You
+should have received a copy of the GNU Lesser General Public License along with
+this program.� If not, see http://www.gnu.org/licenses/.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>You
+shall not disclaim warranty or limit liability differently from the terms of
+Sections 15 and 16 of the GNU General Public License, Version 3, which is
+incorporated into the GNU Lesser General Public License.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>You
+shall preserve all legal notices or author attributions in the program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>You
+shall not misrepresent the original version of the program, and you shall mark
+all modified versions of the program in reasonable ways to show the differences
+from the original version of the program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>�</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>In
+accordance with Section 7(f) of the GNU General Public License, Version 3,
+which is incorporated into the GNU Lesser General Public License, certain
+portions of this program are licensed under Apache 2.0 which requires the
+indemnification of the author or licensors of the software licensed under
+Apache 2.0 license by those who convey the program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>If
+you have any questions regarding this agreement or if you wish to request any
+information from Adobe please use the address and contact information included
+with this program to contact the Adobe office serving your jurisdiction.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>By
+downloading, using, modifying, distributing and/or accessing the program, you
+agree to the GNU Lesser General Public License, Version 3.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>The name &ldquo;BlazeDS&rdquo; and the BlazeDS logo must not be  used to endorse or promote products derived from this software without prior  written permission from Adobe. &nbsp;Similarly, products derived from this open  source software may not be called &quot;BlazeDS&quot;, nor may  &quot;BlazeDS&quot; appear in their name or the BlazeDS logo appear with such  products, without prior written permission of Adobe.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>&nbsp;</span></b></p>
+
+<p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:10.0pt'>NOTICES
+RELATED TO CERTAIN THIRD PARTY MATERIALS:</span></b></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Apache
+1.1 Licensed Products</span></u><span style='font-size:10.0pt'>:� </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+product includes software listed below that were developed by the Apache
+Software Foundation (http://www.apache.org/).� Such software is licensed under
+the Apache Software License, Version 1.1; you may obtain a copy of such license
+at� http://apache.org/licenses/LICENSE-1.1.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>-
+Apache Commons</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- commons-codec-1.3.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- commons-fileupload-1.1.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- commons-httpclient-3.0.1.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- commons-io-1.1.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>- Apache
+Velocity</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- mm-velocity-1.4.jar</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>-
+Apache XML</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>��
+-- xalan.jar (version 2.5.2)</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>Creative
+Commons Licensed Products</span></u><span style='font-size:10.0pt'>: </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+software uses the java.util.concurrent (concurrent.jar version 1.3.3) API and
+the backport of java.util.concurrent API. Both packages are public-domain
+sources from the JSR 166 CVS repository, the dl.util.concurrent package, and
+the Doug Lea's collections package.backport-util-concurrent.jar (version 2.2)
+The license terms of these packages can be found here
+(http://creativecommons.org:81/licenses/publicdomain/). </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><u><span style='font-size:10.0pt'>GNU
+LGPLv.2.1 Licensed Products</span></u><span style='font-size:10.0pt'>: </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>&nbsp;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>This
+software uses the JGroups toolkit library for reliable multicast communication
+(jgroups.jar).� Such JGroups library is licensed under� the GNU Lesser General
+Public License, Version 2.1, a copy of which is included with such library.�
+You may also obtain a copy of such license at <a
+href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.�� </span></p>
+
+
+</div>
+
+</body>
+
+</html>


[47/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/chat/html-template/history/history.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/chat/html-template/history/history.js b/apps/samples-spring/WEB-INF/flex-src/chat/html-template/history/history.js
new file mode 100755
index 0000000..0f82450
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/chat/html-template/history/history.js
@@ -0,0 +1,722 @@
+/*
+ * 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.
+ */
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        ie8: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+        if (browser.version == 8)
+        {
+            browser.ie = false;
+            browser.ie8 = true;
+        }
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    function hashChangeHandler()
+    {
+        currentHref = document.location.href;
+        var flexAppUrl = getHash();
+        //ADR: to fix multiple
+        if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+            var pl = getPlayers();
+            for (var i = 0; i < pl.length; i++) {
+                pl[i].browserURLChange(flexAppUrl);
+            }
+        } else {
+            getPlayer().browserURLChange(flexAppUrl);
+        }
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+        var i;
+
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+                for (i = 0; i < o.length; i++) {
+                    if (typeof o[i].browserURLChange != "undefined")
+                        return o[i];
+                }
+                for (i = 0; i < e.length; i++) {
+                    if (typeof e[i].browserURLChange != "undefined")
+                        return e[i];
+                }
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+            for (i = 0; i < e.length; i++) {
+                if (typeof e[i].browserURLChange != "undefined")
+                {
+                    return e[i];
+                }
+            }
+            for (i = 0; i < o.length; i++) {
+                if (typeof o[i].browserURLChange != "undefined")
+                {
+                    return o[i];
+                }
+            }
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var i;
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+                        currentHref = document.location.href;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                var flexAppUrl = getHash();
+                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
+                {    
+                    // If it did change and we're running Safari 3.x or earlier, 
+                    // then we have to look the old state up in our hand-maintained 
+                    // array since document.location.hash won't have changed, 
+                    // then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                    flexAppUrl = historyHash[currentHistoryLength];
+                }
+
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            iframe.src = 'javascript:false;'; 
+
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox || browser.ie8)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+
+        if (browser.ie8)        
+            document.body.onhashchange = hashChangeHandler;
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        },
+        getUserAgent: function() {
+            return navigator.userAgent;
+        },
+        getPlatform: function() {
+            return navigator.platform;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/chat/html-template/history/historyFrame.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/chat/html-template/history/historyFrame.html b/apps/samples-spring/WEB-INF/flex-src/chat/html-template/history/historyFrame.html
new file mode 100755
index 0000000..63bdd3e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/chat/html-template/history/historyFrame.html
@@ -0,0 +1,45 @@
+<!--
+  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>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/chat/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/chat/html-template/index.template.html b/apps/samples-spring/WEB-INF/flex-src/chat/html-template/index.template.html
new file mode 100755
index 0000000..e3e9c81
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/chat/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/chat/html-template/swfobject.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/chat/html-template/swfobject.js b/apps/samples-spring/WEB-INF/flex-src/chat/html-template/swfobject.js
new file mode 100755
index 0000000..07730fa
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/chat/html-template/swfobject.js
@@ -0,0 +1,793 @@
+/*
+ * 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.
+ */
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+	
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+		ON_READY_STATE_CHANGE = "onreadystatechange",
+		
+		win = window,
+		doc = document,
+		nav = navigator,
+		
+		plugin = false,
+		domLoadFnArr = [main],
+		regObjArr = [],
+		objIdArr = [],
+		listenersArr = [],
+		storedAltContent,
+		storedAltContentId,
+		storedCallbackFn,
+		storedCallbackObj,
+		isDomLoaded = false,
+		isExpressInstallActive = false,
+		dynamicStylesheet,
+		dynamicStylesheetMedia,
+		autoHideShow = true,
+	
+	/* Centralized function for browser feature detection
+		- User agent string detection is only used when no good alternative is possible
+		- Is executed directly for optimal performance
+	*/	
+	ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+			u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+				plugin = true;
+				ie = false; // cascaded feature detection for Internet Explorer
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			try {
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+				if (a) { // a will return null when ActiveX is disabled
+					d = a.GetVariable("$version");
+					if (d) {
+						ie = true; // cascaded feature detection for Internet Explorer
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+			}
+			catch(e) {}
+		}
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+	}(),
+	
+	/* Cross-browser onDomLoad
+		- Will fire an event as soon as the DOM of a web page is loaded
+		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+		- Regular onload serves as fallback
+	*/ 
+	onDomLoad = function() {
+		if (!ua.w3) { return; }
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+			callDomLoadFunctions();
+		}
+		if (!isDomLoaded) {
+			if (typeof doc.addEventListener != UNDEF) {
+				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+			}		
+			if (ua.ie && ua.win) {
+				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+					if (doc.readyState == "complete") {
+						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+						callDomLoadFunctions();
+					}
+				});
+				if (win == top) { // if not inside an iframe
+					(function(){
+						if (isDomLoaded) { return; }
+						try {
+							doc.documentElement.doScroll("left");
+						}
+						catch(e) {
+							setTimeout(arguments.callee, 0);
+							return;
+						}
+						callDomLoadFunctions();
+					})();
+				}
+			}
+			if (ua.wk) {
+				(function(){
+					if (isDomLoaded) { return; }
+					if (!/loaded|complete/.test(doc.readyState)) {
+						setTimeout(arguments.callee, 0);
+						return;
+					}
+					callDomLoadFunctions();
+				})();
+			}
+			addLoadEvent(callDomLoadFunctions);
+		}
+	}();
+	
+	function callDomLoadFunctions() {
+		if (isDomLoaded) { return; }
+		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+			t.parentNode.removeChild(t);
+		}
+		catch (e) { return; }
+		isDomLoaded = true;
+		var dl = domLoadFnArr.length;
+		for (var i = 0; i < dl; i++) {
+			domLoadFnArr[i]();
+		}
+	}
+	
+	function addDomLoadEvent(fn) {
+		if (isDomLoaded) {
+			fn();
+		}
+		else { 
+			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+		}
+	}
+	
+	/* Cross-browser onload
+		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+		- Will fire an event as soon as a web page including all of its assets are loaded 
+	 */
+	function addLoadEvent(fn) {
+		if (typeof win.addEventListener != UNDEF) {
+			win.addEventListener("load", fn, false);
+		}
+		else if (typeof doc.addEventListener != UNDEF) {
+			doc.addEventListener("load", fn, false);
+		}
+		else if (typeof win.attachEvent != UNDEF) {
+			addListener(win, "onload", fn);
+		}
+		else if (typeof win.onload == "function") {
+			var fnOld = win.onload;
+			win.onload = function() {
+				fnOld();
+				fn();
+			};
+		}
+		else {
+			win.onload = fn;
+		}
+	}
+	
+	/* Main function
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
+	*/
+	function main() { 
+		if (plugin) {
+			testPlayerVersion();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Detect the Flash Player version for non-Internet Explorer browsers
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+		  a. Both release and build numbers can be detected
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+	*/
+	function testPlayerVersion() {
+		var b = doc.getElementsByTagName("body")[0];
+		var o = createElement(OBJECT);
+		o.setAttribute("type", FLASH_MIME_TYPE);
+		var t = b.appendChild(o);
+		if (t) {
+			var counter = 0;
+			(function(){
+				if (typeof t.GetVariable != UNDEF) {
+					var d = t.GetVariable("$version");
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				else if (counter < 10) {
+					counter++;
+					setTimeout(arguments.callee, 10);
+					return;
+				}
+				b.removeChild(o);
+				t = null;
+				matchVersions();
+			})();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Perform Flash Player and SWF version matching; static publishing only
+	*/
+	function matchVersions() {
+		var rl = regObjArr.length;
+		if (rl > 0) {
+			for (var i = 0; i < rl; i++) { // for each registered object element
+				var id = regObjArr[i].id;
+				var cb = regObjArr[i].callbackFn;
+				var cbObj = {success:false, id:id};
+				if (ua.pv[0] > 0) {
+					var obj = getElementById(id);
+					if (obj) {
+						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+							setVisibility(id, true);
+							if (cb) {
+								cbObj.success = true;
+								cbObj.ref = getObjectById(id);
+								cb(cbObj);
+							}
+						}
+						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+							var att = {};
+							att.data = regObjArr[i].expressInstall;
+							att.width = obj.getAttribute("width") || "0";
+							att.height = obj.getAttribute("height") || "0";
+							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+							// parse HTML object param element's name-value pairs
+							var par = {};
+							var p = obj.getElementsByTagName("param");
+							var pl = p.length;
+							for (var j = 0; j < pl; j++) {
+								if (p[j].getAttribute("name").toLowerCase() != "movie") {
+									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+								}
+							}
+							showExpressInstall(att, par, id, cb);
+						}
+						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+							displayAltContent(obj);
+							if (cb) { cb(cbObj); }
+						}
+					}
+				}
+				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+					setVisibility(id, true);
+					if (cb) {
+						var o = getObjectById(id); // test whether there is an HTML object element or not
+						if (o && typeof o.SetVariable != UNDEF) { 
+							cbObj.success = true;
+							cbObj.ref = o;
+						}
+						cb(cbObj);
+					}
+				}
+			}
+		}
+	}
+	
+	function getObjectById(objectIdStr) {
+		var r = null;
+		var o = getElementById(objectIdStr);
+		if (o && o.nodeName == "OBJECT") {
+			if (typeof o.SetVariable != UNDEF) {
+				r = o;
+			}
+			else {
+				var n = o.getElementsByTagName(OBJECT)[0];
+				if (n) {
+					r = n;
+				}
+			}
+		}
+		return r;
+	}
+	
+	/* Requirements for Adobe Express Install
+		- only one instance can be active at a time
+		- fp 6.0.65 or higher
+		- Win/Mac OS only
+		- no Webkit engines older than version 312
+	*/
+	function canExpressInstall() {
+		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+	}
+	
+	/* Show the Adobe Express Install dialog
+		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+	*/
+	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+		isExpressInstallActive = true;
+		storedCallbackFn = callbackFn || null;
+		storedCallbackObj = {success:false, id:replaceElemIdStr};
+		var obj = getElementById(replaceElemIdStr);
+		if (obj) {
+			if (obj.nodeName == "OBJECT") { // static publishing
+				storedAltContent = abstractAltContent(obj);
+				storedAltContentId = null;
+			}
+			else { // dynamic publishing
+				storedAltContent = obj;
+				storedAltContentId = replaceElemIdStr;
+			}
+			att.id = EXPRESS_INSTALL_ID;
+			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+				fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+			if (typeof par.flashvars != UNDEF) {
+				par.flashvars += "&" + fv;
+			}
+			else {
+				par.flashvars = fv;
+			}
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			if (ua.ie && ua.win && obj.readyState != 4) {
+				var newObj = createElement("div");
+				replaceElemIdStr += "SWFObjectNew";
+				newObj.setAttribute("id", replaceElemIdStr);
+				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						obj.parentNode.removeChild(obj);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			createSWF(att, par, replaceElemIdStr);
+		}
+	}
+	
+	/* Functions to abstract and display alternative content
+	*/
+	function displayAltContent(obj) {
+		if (ua.ie && ua.win && obj.readyState != 4) {
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			var el = createElement("div");
+			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+			el.parentNode.replaceChild(abstractAltContent(obj), el);
+			obj.style.display = "none";
+			(function(){
+				if (obj.readyState == 4) {
+					obj.parentNode.removeChild(obj);
+				}
+				else {
+					setTimeout(arguments.callee, 10);
+				}
+			})();
+		}
+		else {
+			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+		}
+	} 
+
+	function abstractAltContent(obj) {
+		var ac = createElement("div");
+		if (ua.win && ua.ie) {
+			ac.innerHTML = obj.innerHTML;
+		}
+		else {
+			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+			if (nestedObj) {
+				var c = nestedObj.childNodes;
+				if (c) {
+					var cl = c.length;
+					for (var i = 0; i < cl; i++) {
+						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+							ac.appendChild(c[i].cloneNode(true));
+						}
+					}
+				}
+			}
+		}
+		return ac;
+	}
+	
+	/* Cross-browser dynamic SWF creation
+	*/
+	function createSWF(attObj, parObj, id) {
+		var r, el = getElementById(id);
+		if (ua.wk && ua.wk < 312) { return r; }
+		if (el) {
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+				attObj.id = id;
+			}
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+				var att = "";
+				for (var i in attObj) {
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+						if (i.toLowerCase() == "data") {
+							parObj.movie = attObj[i];
+						}
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							att += ' class="' + attObj[i] + '"';
+						}
+						else if (i.toLowerCase() != "classid") {
+							att += ' ' + i + '="' + attObj[i] + '"';
+						}
+					}
+				}
+				var par = "";
+				for (var j in parObj) {
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+					}
+				}
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+				r = getElementById(attObj.id);	
+			}
+			else { // well-behaving browsers
+				var o = createElement(OBJECT);
+				o.setAttribute("type", FLASH_MIME_TYPE);
+				for (var m in attObj) {
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							o.setAttribute("class", attObj[m]);
+						}
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+							o.setAttribute(m, attObj[m]);
+						}
+					}
+				}
+				for (var n in parObj) {
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+						createObjParam(o, n, parObj[n]);
+					}
+				}
+				el.parentNode.replaceChild(o, el);
+				r = o;
+			}
+		}
+		return r;
+	}
+	
+	function createObjParam(el, pName, pValue) {
+		var p = createElement("param");
+		p.setAttribute("name", pName);	
+		p.setAttribute("value", pValue);
+		el.appendChild(p);
+	}
+	
+	/* Cross-browser SWF removal
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
+	*/
+	function removeSWF(id) {
+		var obj = getElementById(id);
+		if (obj && obj.nodeName == "OBJECT") {
+			if (ua.ie && ua.win) {
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						removeObjectInIE(id);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			else {
+				obj.parentNode.removeChild(obj);
+			}
+		}
+	}
+	
+	function removeObjectInIE(id) {
+		var obj = getElementById(id);
+		if (obj) {
+			for (var i in obj) {
+				if (typeof obj[i] == "function") {
+					obj[i] = null;
+				}
+			}
+			obj.parentNode.removeChild(obj);
+		}
+	}
+	
+	/* Functions to optimize JavaScript compression
+	*/
+	function getElementById(id) {
+		var el = null;
+		try {
+			el = doc.getElementById(id);
+		}
+		catch (e) {}
+		return el;
+	}
+	
+	function createElement(el) {
+		return doc.createElement(el);
+	}
+	
+	/* Updated attachEvent function for Internet Explorer
+		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+	*/	
+	function addListener(target, eventType, fn) {
+		target.attachEvent(eventType, fn);
+		listenersArr[listenersArr.length] = [target, eventType, fn];
+	}
+	
+	/* Flash Player and SWF content version matching
+	*/
+	function hasPlayerVersion(rv) {
+		var pv = ua.pv, v = rv.split(".");
+		v[0] = parseInt(v[0], 10);
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+		v[2] = parseInt(v[2], 10) || 0;
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+	}
+	
+	/* Cross-browser dynamic CSS creation
+		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+	*/	
+	function createCSS(sel, decl, media, newStyle) {
+		if (ua.ie && ua.mac) { return; }
+		var h = doc.getElementsByTagName("head")[0];
+		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+		var m = (media && typeof media == "string") ? media : "screen";
+		if (newStyle) {
+			dynamicStylesheet = null;
+			dynamicStylesheetMedia = null;
+		}
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+			// create dynamic stylesheet + get a global reference to it
+			var s = createElement("style");
+			s.setAttribute("type", "text/css");
+			s.setAttribute("media", m);
+			dynamicStylesheet = h.appendChild(s);
+			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+			}
+			dynamicStylesheetMedia = m;
+		}
+		// add style rule
+		if (ua.ie && ua.win) {
+			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+				dynamicStylesheet.addRule(sel, decl);
+			}
+		}
+		else {
+			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+			}
+		}
+	}
+	
+	function setVisibility(id, isVisible) {
+		if (!autoHideShow) { return; }
+		var v = isVisible ? "visible" : "hidden";
+		if (isDomLoaded && getElementById(id)) {
+			getElementById(id).style.visibility = v;
+		}
+		else {
+			createCSS("#" + id, "visibility:" + v);
+		}
+	}
+
+	/* Filter to avoid XSS attacks
+	*/
+	function urlEncodeIfNecessary(s) {
+		var regex = /[\\\"<>\.;]/;
+		var hasBadChars = regex.exec(s) != null;
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+	}
+	
+	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+	*/
+	var cleanup = function() {
+		if (ua.ie && ua.win) {
+			window.attachEvent("onunload", function() {
+				// remove listeners to avoid memory leaks
+				var ll = listenersArr.length;
+				for (var i = 0; i < ll; i++) {
+					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+				}
+				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+				var il = objIdArr.length;
+				for (var j = 0; j < il; j++) {
+					removeSWF(objIdArr[j]);
+				}
+				// cleanup library's main closures to avoid memory leaks
+				for (var k in ua) {
+					ua[k] = null;
+				}
+				ua = null;
+				for (var l in swfobject) {
+					swfobject[l] = null;
+				}
+				swfobject = null;
+			});
+		}
+	}();
+	
+	return {
+		/* Public API
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
+		*/ 
+		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+			if (ua.w3 && objectIdStr && swfVersionStr) {
+				var regObj = {};
+				regObj.id = objectIdStr;
+				regObj.swfVersion = swfVersionStr;
+				regObj.expressInstall = xiSwfUrlStr;
+				regObj.callbackFn = callbackFn;
+				regObjArr[regObjArr.length] = regObj;
+				setVisibility(objectIdStr, false);
+			}
+			else if (callbackFn) {
+				callbackFn({success:false, id:objectIdStr});
+			}
+		},
+		
+		getObjectById: function(objectIdStr) {
+			if (ua.w3) {
+				return getObjectById(objectIdStr);
+			}
+		},
+		
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+			var callbackObj = {success:false, id:replaceElemIdStr};
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+				setVisibility(replaceElemIdStr, false);
+				addDomLoadEvent(function() {
+					widthStr += ""; // auto-convert to string
+					heightStr += "";
+					var att = {};
+					if (attObj && typeof attObj === OBJECT) {
+						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+							att[i] = attObj[i];
+						}
+					}
+					att.data = swfUrlStr;
+					att.width = widthStr;
+					att.height = heightStr;
+					var par = {}; 
+					if (parObj && typeof parObj === OBJECT) {
+						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+							par[j] = parObj[j];
+						}
+					}
+					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+							if (typeof par.flashvars != UNDEF) {
+								par.flashvars += "&" + k + "=" + flashvarsObj[k];
+							}
+							else {
+								par.flashvars = k + "=" + flashvarsObj[k];
+							}
+						}
+					}
+					if (hasPlayerVersion(swfVersionStr)) { // create SWF
+						var obj = createSWF(att, par, replaceElemIdStr);
+						if (att.id == replaceElemIdStr) {
+							setVisibility(replaceElemIdStr, true);
+						}
+						callbackObj.success = true;
+						callbackObj.ref = obj;
+					}
+					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+						att.data = xiSwfUrlStr;
+						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+						return;
+					}
+					else { // show alternative content
+						setVisibility(replaceElemIdStr, true);
+					}
+					if (callbackFn) { callbackFn(callbackObj); }
+				});
+			}
+			else if (callbackFn) { callbackFn(callbackObj);	}
+		},
+		
+		switchOffAutoHideShow: function() {
+			autoHideShow = false;
+		},
+		
+		ua: ua,
+		
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		},
+		
+		hasFlashPlayerVersion: hasPlayerVersion,
+		
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
+			if (ua.w3) {
+				return createSWF(attObj, parObj, replaceElemIdStr);
+			}
+			else {
+				return undefined;
+			}
+		},
+		
+		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+			if (ua.w3 && canExpressInstall()) {
+				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+			}
+		},
+		
+		removeSWF: function(objElemIdStr) {
+			if (ua.w3) {
+				removeSWF(objElemIdStr);
+			}
+		},
+		
+		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+			if (ua.w3) {
+				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+			}
+		},
+		
+		addDomLoadEvent: addDomLoadEvent,
+		
+		addLoadEvent: addLoadEvent,
+		
+		getQueryParamValue: function(param) {
+			var q = doc.location.search || doc.location.hash;
+			if (q) {
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+				if (param == null) {
+					return urlEncodeIfNecessary(q);
+				}
+				var pairs = q.split("&");
+				for (var i = 0; i < pairs.length; i++) {
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+					}
+				}
+			}
+			return "";
+		},
+		
+		// For internal usage only
+		expressInstallCallback: function() {
+			if (isExpressInstallActive) {
+				var obj = getElementById(EXPRESS_INSTALL_ID);
+				if (obj && storedAltContent) {
+					obj.parentNode.replaceChild(storedAltContent, obj);
+					if (storedAltContentId) {
+						setVisibility(storedAltContentId, true);
+						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+					}
+					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+				}
+				isExpressInstallActive = false;
+			} 
+		}
+	};
+}();

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/chat/src/chat.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/chat/src/chat.mxml b/apps/samples-spring/WEB-INF/flex-src/chat/src/chat.mxml
new file mode 100755
index 0000000..538851f
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/chat/src/chat.mxml
@@ -0,0 +1,86 @@
+<?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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx"
+			   applicationComplete="init()">
+
+
+	<fx:Script>
+		<![CDATA[
+			
+			import mx.messaging.messages.AsyncMessage;
+			import mx.messaging.messages.IMessage;
+			
+			private function init():void
+			{
+				consumer.subscribe();
+			}
+			
+			private function send():void
+			{
+				var message:IMessage = new AsyncMessage();
+				message.body.userId = userId.text;
+				message.body.chatMessage = msg.text;
+				producer.send(message);
+				msg.text = "";
+			}
+			
+			private function messageHandler(message:IMessage):void
+			{
+				log.text += message.body.userId + ": " + message.body.chatMessage + "\n";	
+			}
+			
+		]]>
+	</fx:Script>	
+	
+	<fx:Declarations>
+		<!-- The ChannelSet API allows you to dynamically define your endpoints *at runtime*. In the example below, 
+		we hardcode the endpoint URLs. In real life, the client application would typically load these parameters 
+		dynamically. For example, the client application could read these parameters from an XML file loaded using 
+		the HTTPService at startup. The first channel added to the channelSet, is the first channel that the system 
+		will use to try to communicate with the server. If the first channel fails, the system will try to communicate 
+		with the second channel defined in the channelSet. -->
+		<mx:ChannelSet id="cs">
+			<mx:StreamingAMFChannel uri="/samples-spring/messagebroker/streamingamf"/>
+			<mx:AMFChannel uri="/samples-spring/messagebroker/amflongpolling"/>
+			<mx:AMFChannel uri="/samples-spring/messagebroker/amfpolling"/>
+		</mx:ChannelSet>
+		
+		<mx:Producer id="producer" destination="chat" channelSet="{cs}"/>
+		<mx:Consumer id="consumer" destination="chat" channelSet="{cs}" message="messageHandler(event.message)"/>
+	</fx:Declarations>
+
+	<s:Panel title="Chat" top="12" bottom="12" left="12" right="12">
+		<s:TextArea id="log" width="100%" height="100%" borderVisible="false"/>
+		<s:controlBarContent>
+			<mx:Form width="100%" paddingTop="4" paddingBottom="4" paddingLeft="4" paddingRight="4">
+				<mx:FormItem label="User Id:">
+					<s:TextInput id="userId" width="100" enter="send()"/>
+				</mx:FormItem>				
+				<mx:FormItem label="Message:" width="100%" direction="horizontal">
+					<s:TextInput id="msg" width="100%" enter="send()"/>
+					<s:Button label="Send" click="send()"/> 
+				</mx:FormItem>				
+			</mx:Form>
+		</s:controlBarContent>
+	</s:Panel>
+
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/collaboration/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/collaboration/.actionScriptProperties b/apps/samples-spring/WEB-INF/flex-src/collaboration/.actionScriptProperties
new file mode 100755
index 0000000..34a7b09
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/collaboration/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="collaboration.mxml" projectUUID="494f5a5c-03a0-4a1a-b85b-78075a2c515a" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="collaboration.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/collaboration/.flexProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/collaboration/.flexProperties b/apps/samples-spring/WEB-INF/flex-src/collaboration/.flexProperties
new file mode 100755
index 0000000..1d99468
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/collaboration/.flexProperties
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/collaboration/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/collaboration/.project b/apps/samples-spring/WEB-INF/flex-src/collaboration/.project
new file mode 100755
index 0000000..ac12586
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/collaboration/.project
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>collaboration</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/collaboration/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/collaboration/build.xml b/apps/samples-spring/WEB-INF/flex-src/collaboration/build.xml
new file mode 100755
index 0000000..6182c5e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/collaboration/build.xml
@@ -0,0 +1,76 @@
+<?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-spring.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="context.root" value="samples-spring" />
+    <property name="application.name" value="collaboration" />
+    <property name="application.file" value="collaboration" />
+    <property name="application.bin.dir" value="${samples-spring.war}/collaboration" />
+    <property name="application.src.dir" value="${samples-spring.war}/WEB-INF/flex-src/collaboration/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-spring.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"
+            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-spring/WEB-INF/flex-src/collaboration/html-template/history/history.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/history/history.css b/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/history/history.css
new file mode 100755
index 0000000..4a7f791
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/collaboration/html-template/history/history.css
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }


[30/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
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


[08/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/HttpFlexSession.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/HttpFlexSession.java b/modules/core/src/flex/messaging/HttpFlexSession.java
new file mode 100755
index 0000000..f305fb9
--- /dev/null
+++ b/modules/core/src/flex/messaging/HttpFlexSession.java
@@ -0,0 +1,666 @@
+/*
+ * 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.messaging;
+
+import flex.messaging.log.Log;
+import flex.messaging.log.LogCategories;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionAttributeListener;
+import javax.servlet.http.HttpSessionBindingEvent;
+import javax.servlet.http.HttpSessionBindingListener;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.security.Principal;
+import java.util.Enumeration;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * FlexSession implementation for use with HTTP-based channels.
+ *
+ * @author shodgson
+ */
+public class HttpFlexSession extends FlexSession
+    implements HttpSessionBindingListener, HttpSessionListener, HttpSessionAttributeListener, Serializable
+{
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @exclude
+     * Not for public use. This constructor is used to create an instance of this class that
+     * will operate as a javax.servlet.http.HttpSessionListener registered in web.xml.
+     */
+    public HttpFlexSession()
+    {}
+
+    /**
+     * @exclude
+     * Not for public use. Constructs new instances that effectively wrap pre-existing JEE HttpSession instances.
+     */
+    public HttpFlexSession(HttpFlexSessionProvider provider) 
+    {
+        super(provider);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Serializable version uid.
+     */
+    private static final long serialVersionUID = -1260409488935306147L;
+
+    /**
+     * Attribute name that HttpFlexSession is stored under in the HttpSession.
+     */
+    /* package-private */ static final String SESSION_ATTRIBUTE = "__flexSession";
+
+    /**
+     * This attribute is set on the request associated with a Flex Session when
+     * a logout command is being processed.  The reason that this is necessary is
+     * that a single HttpServletRequest may contain more than one Flex command/message.
+     * In this case, every message following a "logout" command should behave as if the
+     * user has logged out.  However, since in getUserPrincipal, we check the request
+     * object if the Session has no principal, if the current request object
+     * has a principal object associated with it (as it does on Tomcat/JBoss),
+     * messages following a "logout" will use this principal.  We thus need to
+     * invalidate the user principal in the request on logout.  Since the field
+     * is read-only we do so using this attribute.
+     */
+    private static final String INVALIDATED_REQUEST = "__flexInvalidatedRequest";
+
+    public static final String SESSION_MAP = "LCDS_HTTP_TO_FLEX_SESSION_MAP";
+
+    /**
+     * Internal flag indicating whether we are a registered listener in web.xml.
+     */
+    /* package-private */ static volatile boolean isHttpSessionListener;
+
+    /**
+     * Flag to indicate whether we've logged a warning if we weren't registered in web.xml and
+     * can't redispatch attribute and binding events to Flex listeners.
+     */
+    /* package-private */ static volatile boolean warnedNoEventRedispatch;
+
+    /**
+     * The log category to send the warning for no event redispatch to.
+     */
+    /* package-private */  static String WARN_LOG_CATEGORY = LogCategories.CONFIGURATION;
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Reference to the HttpSession allows us to invalidate it and use it for attribute management.
+     */
+    /* package-private */ HttpSession httpSession;
+
+    /**
+     * @exclude
+     * Static lock for creating httpSessionToFlexSession map
+     */
+    public static final Object mapLock = new Object();
+
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * HttpSessionAttributeListener callback; processes the addition of an attribute to an HttpSession.
+     *
+     * NOTE: Callback is not made against an HttpFlexSession associated with a request
+     * handling thread.
+     * @param event the HttpSessionBindingEvent
+     */
+    public void attributeAdded(HttpSessionBindingEvent event)
+    {
+        if (!event.getName().equals(SESSION_ATTRIBUTE))
+        {
+            // Accessing flexSession via map because it may have already been unbound from httpSession.
+            Map httpSessionToFlexSessionMap = getHttpSessionToFlexSessionMap(event.getSession());
+            HttpFlexSession flexSession = (HttpFlexSession)httpSessionToFlexSessionMap.get(event.getSession().getId());
+            if (flexSession != null)
+            {
+                String name = event.getName();
+                Object value = event.getValue();
+                flexSession.notifyAttributeBound(name, value);
+                flexSession.notifyAttributeAdded(name, value);
+            }
+        }
+    }
+
+    /**
+     * HttpSessionAttributeListener callback; processes the removal of an attribute from an HttpSession.
+     *
+     * NOTE: Callback is not made against an HttpFlexSession associated with a request
+     * handling thread.
+     * @param event the HttpSessionBindingEvent
+     */
+    public void attributeRemoved(HttpSessionBindingEvent event)
+    {
+        if (!event.getName().equals(SESSION_ATTRIBUTE))
+        {
+            // Accessing flexSession via map because it may have already been unbound from httpSession.
+            Map httpSessionToFlexSessionMap = getHttpSessionToFlexSessionMap(event.getSession());
+            HttpFlexSession flexSession = (HttpFlexSession)httpSessionToFlexSessionMap.get(event.getSession().getId());
+            if (flexSession != null)
+            {
+                String name = event.getName();
+                Object value = event.getValue();
+                flexSession.notifyAttributeUnbound(name, value);
+                flexSession.notifyAttributeRemoved(name, value);
+            }
+        }
+    }
+
+    /**
+     * HttpSessionAttributeListener callback; processes the replacement of an attribute in an HttpSession.
+     *
+     * NOTE: Callback is not made against an HttpFlexSession associated with a request
+     * handling thread.
+     * @param event the HttpSessionBindingEvent
+     */
+    public void attributeReplaced(HttpSessionBindingEvent event)
+    {
+        if (!event.getName().equals(SESSION_ATTRIBUTE))
+        {
+            // Accessing flexSession via map because it may have already been unbound from httpSession.
+            Map httpSessionToFlexSessionMap = getHttpSessionToFlexSessionMap(event.getSession());
+            HttpFlexSession flexSession = (HttpFlexSession)httpSessionToFlexSessionMap.get(event.getSession().getId());
+            if (flexSession != null)
+            {
+                String name = event.getName();
+                Object value = event.getValue();
+                Object newValue = flexSession.getAttribute(name);
+                flexSession.notifyAttributeUnbound(name, value);
+                flexSession.notifyAttributeReplaced(name, value);
+                flexSession.notifyAttributeBound(name, newValue);
+            }
+        }
+    }
+
+    /**
+     * Creates or retrieves a FlexSession for the current Http request.
+     * The HttpFlexSession wraps the underlying J2EE HttpSession.
+     * Not intended for public use.
+     *
+     * @param req The Http request.
+     *
+     * @return The HttpFlexSession.
+     * 
+     * @deprecated This method has been deprecated in favor of session providers registered with a <tt>MessageBroker</tt>.
+     * @see flex.messaging.FlexSessionManager
+     * @see flex.messaging.HttpFlexSessionProvider
+     */
+    public static HttpFlexSession getFlexSession(HttpServletRequest req)
+    {
+        HttpFlexSession flexSession;
+        HttpSession httpSession = req.getSession(true);
+
+        if (!isHttpSessionListener && !warnedNoEventRedispatch)
+        {
+            warnedNoEventRedispatch = true;
+            if (Log.isWarn())
+                Log.getLogger(WARN_LOG_CATEGORY).warn("HttpFlexSession has not been registered as a listener in web.xml for this application so no events will be dispatched to FlexSessionAttributeListeners or FlexSessionBindingListeners. To correct this, register flex.messaging.HttpFlexSession as a listener in web.xml.");
+        }
+
+        boolean isNew = false;
+        synchronized (httpSession)
+        {
+            flexSession = (HttpFlexSession)httpSession.getAttribute(HttpFlexSession.SESSION_ATTRIBUTE);
+            if (flexSession == null)
+            {
+                flexSession = new HttpFlexSession();
+                // Correlate this FlexSession to the HttpSession before triggering any listeners.
+                FlexContext.setThreadLocalSession(flexSession);
+                httpSession.setAttribute(SESSION_ATTRIBUTE, flexSession);
+                flexSession.setHttpSession(httpSession);
+                isNew = true;
+            }
+            else
+            {
+                FlexContext.setThreadLocalSession(flexSession);
+                if (flexSession.httpSession == null)
+                {
+                    // httpSession is null if the instance is new or is from
+                    // serialization.
+                    flexSession.setHttpSession(httpSession);
+                    isNew = true;
+                }
+            }
+        }
+
+        if (isNew)
+        {
+            flexSession.notifyCreated();
+
+            if (Log.isDebug())
+                Log.getLogger(FLEX_SESSION_LOG_CATEGORY).debug("FlexSession created with id '" + flexSession.getId() + "' for an Http-based client connection.");
+        }
+
+        return flexSession;
+    }    
+
+    /**
+     * Returns the user principal associated with the session. This will
+     * be null if the user has not authenticated.
+     *
+     * @return The Principal associated with the session.
+     */
+    public Principal getUserPrincipal()
+    {
+        Principal p = super.getUserPrincipal();
+        if (p == null)
+        {
+            HttpServletRequest req = FlexContext.getHttpRequest();
+            if (req != null && req.getAttribute(INVALIDATED_REQUEST) == null)
+                p = req.getUserPrincipal();
+        }
+        return p;
+    }
+
+    /**
+     * Invalidates the session.
+     */
+    public void invalidate()
+    {
+        // If the HttpFlexSession is the current active FlexSession for the thread
+        // we'll invalidate it but we need to recreate a new HttpFlexSession because
+        // the client's HttpSession is still active.
+        boolean recreate = FlexContext.getFlexSession() == this;
+        invalidate(recreate);
+    }
+
+    /**
+     * @exclude
+     * Used by Http endpoints when they receive notification from a client that it has
+     * disconnected its channel.
+     * Supports invalidating the HttpFlexSession and underlying JEE HttpSession without
+     * triggering session recreation.
+     */
+    public void invalidate(boolean recreate)
+    {
+        synchronized (httpSession)
+        {
+            try
+            {
+                // Invalidating the HttpSession will trigger invalidation of the HttpFlexSession
+                // either via the sessionDestroyed() event if registration as an HttpSession listener worked
+                // or via the valueUnbound() event if it didn't.
+                httpSession.invalidate();
+            }
+            catch (IllegalStateException e)
+            {
+                // Make sure any related mapping is removed.
+                try
+                {
+                    Map httpSessionToFlexSessionMap = getHttpSessionToFlexSessionMap(httpSession);
+                    httpSessionToFlexSessionMap.remove(httpSession.getId());
+                }
+                catch (Exception ignore)
+                {
+                    // NOWARN
+                }
+
+                // And invalidate this FlexSession.
+                super.invalidate();
+            }
+        }
+        if (recreate)
+        {
+            HttpServletRequest req = FlexContext.getHttpRequest();
+
+            if (req != null)
+            {
+                // Set an attribute on the request denoting that the userPrincipal in the request
+                // is now invalid.
+                req.setAttribute(INVALIDATED_REQUEST, "true");
+
+                AbstractFlexSessionProvider sessionProvider = getFlexSessionProvider();
+                
+                // BLZ-531: When using spring integration getting a null pointer exception when calling invalidate 
+                // on a FlexSession twice
+                // If originally the HttpFlexSession was created using the deprecated HttpFlexSession.getFlexSession(request) API, 
+                // it does not have an associated AbstractFlexSessionProvider. Invoking invalidate(true) on such a session 
+                // results in the "recreated" FlexSession being NULL. To prevent this from happening, in case session provider 
+                // is NULL, we create the session using the deprecated HttpFlexSession.getFlexSession(request) API.
+                FlexSession session = sessionProvider == null ? 
+                        getFlexSession(req) : ((HttpFlexSessionProvider)sessionProvider).getOrCreateSession(req);
+
+                FlexContext.setThreadLocalObjects(FlexContext.getFlexClient(),
+                        session, FlexContext.getMessageBroker(), req,
+                        FlexContext.getHttpResponse(), FlexContext.getServletConfig());
+            }
+            // else, the session was invalidated outside of a request being processed.
+        }
+    }
+
+    /**
+     * Returns the attribute bound to the specified name in the session, or null
+     * if no attribute is bound under the name.
+     *
+     * @param name The name the target attribute is bound to.
+     * @return The attribute bound to the specified name.
+     */
+    public Object getAttribute(String name)
+    {
+        return httpSession.getAttribute(name);
+    }
+
+    /**
+     * Returns the names of all attributes bound to the session.
+     *
+     * @return The names of all attributes bound to the session.
+     */
+    public Enumeration getAttributeNames()
+    {
+        return httpSession.getAttributeNames();
+    }
+
+    /**
+     * Returns the Id for the session.
+     *
+     * @return The Id for the session.
+     */
+    public String getId()
+    {
+        return httpSession.getId();
+    }
+
+    /**
+     * @exclude
+     * FlexClient invokes this to determine whether the session can be used to push messages
+     * to the client.
+     *
+     * @return true if the FlexSession supports direct push; otherwise false (polling is assumed).
+     */
+    public boolean isPushSupported()
+    {
+        return false;
+    }
+
+    /**
+     * Removes the attribute bound to the specified name in the session.
+     *
+     * @param name The name of the attribute to remove.
+     */
+    public void removeAttribute(String name)
+    {
+        httpSession.removeAttribute(name);
+    }
+
+    /**
+     * Implements HttpSessionListener.
+     * HttpSession created events are handled by setting an internal flag indicating that registration
+     * as an HttpSession listener was successful and we will be notified of session attribute changes and
+     * session destruction.
+     * NOTE: This method is not invoked against an HttpFlexSession associated with a request
+     * handling thread.
+     * @param event the HttpSessionEvent
+     */
+    public void sessionCreated(HttpSessionEvent event)
+    {
+        isHttpSessionListener = true;
+    }
+
+    /**
+     * Implements HttpSessionListener.
+     * When an HttpSession is destroyed, the associated HttpFlexSession is also destroyed.
+     * NOTE: This method is not invoked against an HttpFlexSession associated with a request
+     * handling thread.
+     * @param event the HttpSessionEvent
+     */
+    public void sessionDestroyed(HttpSessionEvent event)
+    {
+        HttpSession session = event.getSession();
+        Map httpSessionToFlexSessionMap = getHttpSessionToFlexSessionMap(session);
+        HttpFlexSession flexSession = (HttpFlexSession)httpSessionToFlexSessionMap.remove(session.getId());
+        if (flexSession != null)
+        {
+            // invalidate the flex session
+            flexSession.superInvalidate();
+
+            // Send notifications to attribute listeners if needed.
+            // This may send extra notifications if attributeRemoved is called first by the server,
+            // but Java servlet 2.4 says session destroy is first, then attributes.
+            // Guard against pre-2.4 containers that dispatch events in an incorrect order, 
+            // meaning skip attribute processing here if the underlying session state is no longer valid.
+            try
+            {
+                for (Enumeration e = session.getAttributeNames(); e.hasMoreElements(); )
+                {
+                    String name = (String) e.nextElement();
+                    if (name.equals(SESSION_ATTRIBUTE))
+                        continue;
+                    Object value = session.getAttribute(name);
+                    if (value != null)
+                    {
+                        flexSession.notifyAttributeUnbound(name, value);
+                        flexSession.notifyAttributeRemoved(name, value);
+                    }
+                }
+            }
+            catch (IllegalStateException ignore)
+            {
+                // NOWARN
+                // Old servlet container that dispatches events out of order.
+            }
+        }
+    }
+
+    /**
+     * Binds an attribute to the session under the specified name.
+     *
+     * @param name The name to bind the attribute under.
+     *
+     * @param value The attribute value.
+     */
+    public void setAttribute(String name, Object value)
+    {
+        httpSession.setAttribute(name, value);
+    }
+
+    /**
+     * Implements HttpSessionBindingListener.
+     * This is a no-op.
+     * NOTE: This method is not invoked against an HttpFlexSession associated with a request
+     * handling thread.
+     * @param event the HttpSessionBindingEvent
+     */
+    public void valueBound(HttpSessionBindingEvent event)
+    {
+        // No-op.
+    }
+
+    /**
+     * Implements HttpSessionBindingListener.
+     * This callback will destroy the HttpFlexSession upon being unbound, only in the
+     * case where we haven't been registered as an HttpSessionListener in web.xml and
+     * can't shut down based on the HttpSession being invalidated.
+     * NOTE: This method is not invoked against an HttpFlexSession associated with a request
+     * handling thread.
+     * @param event the HttpSessionBindingEvent
+     */
+    public void valueUnbound(HttpSessionBindingEvent event)
+    {
+        if (!isHttpSessionListener)
+        {
+            Map httpSessionToFlexSessionMap = getHttpSessionToFlexSessionMap(event.getSession());
+            HttpFlexSession flexSession = (HttpFlexSession)httpSessionToFlexSessionMap.remove(event.getSession().getId());
+            if (flexSession != null)
+                flexSession.superInvalidate();
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Protected Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * We don't need to do anything here other than log out some info about the session that's shutting down.
+     */
+    protected void internalInvalidate()
+    {
+        if (Log.isDebug())
+            Log.getLogger(FLEX_SESSION_LOG_CATEGORY).debug("FlexSession with id '" + getId() + "' for an Http-based client connection has been invalidated.");
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Private Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Associates a HttpSession with the FlexSession.
+     *
+     * @param httpSession The HttpSession to associate with the FlexSession.
+     */
+    /* package-private */ void setHttpSession(HttpSession httpSession)
+    {
+        synchronized (lock)
+        {
+            this.httpSession = httpSession;
+            // Update lookup table for event redispatch.
+            Map httpSessionToFlexSessionMap = getHttpSessionToFlexSessionMap(httpSession);
+            httpSessionToFlexSessionMap.put(httpSession.getId(), this);
+        }
+    }
+
+    /**
+     * @exclude
+     * Invoked by HttpSessionListener or binding listener on HttpSession invalidation to invalidate the wrapping
+     * FlexSession.
+     */
+    private void superInvalidate()
+    {
+        super.invalidate();
+    }
+
+    /**
+     * Implements Serializable; only the Principal needs to be serialized as all
+     * attribute storage is delegated to the associated HttpSession.
+     *
+     * @param stream The stream to read instance state from.
+     */
+    private void writeObject(ObjectOutputStream stream)
+    {
+        try
+        {
+            Principal principal = super.getUserPrincipal();
+            if (principal != null && principal instanceof Serializable)
+                stream.writeObject(principal);
+        }
+        catch (IOException e)
+        {
+            // Principal was Serializable and non-null; if this happens there's nothing we can do.
+            // The user will need to reauthenticate if necessary.
+        }
+        catch (LocalizedException ignore)
+        {
+            // This catch block added for bug 194144.
+            // On BEA WebLogic, writeObject() is sometimes invoked on invalidated session instances
+            // and in this case the checkValid() invocation in super.getUserPrincipal() throws.
+            // Ignore this exception.
+        }
+    }
+
+    /**
+     * Implements Serializable; only the Principal needs to be serialized as all
+     * attribute storage is delegated to the associated HttpSession.
+     *
+     * @param stream The stream to write instance state to.
+     */
+    private void readObject(ObjectInputStream stream)
+    {
+        try
+        {
+            setUserPrincipal((Principal)stream.readObject());
+        }
+        catch (Exception e)
+        {
+            // Principal was not serialized or failed to serialize; ignore.
+            // The user will need to reauthenticate if necessary.
+        }
+    }
+
+    /**
+     * Map of HttpSession Ids to FlexSessions. We need this when registered as a listener
+     * in web.xml in order to trigger the destruction of a FlexSession when its associated HttpSession
+     * is invalidated/destroyed. The Servlet spec prior to version 2.4 defined the session destruction event
+     * to be dispatched after attributes are unbound from the session so when we receive notification that
+     * an HttpSession is destroyed there's no way to get to the associated FlexSession attribute because it
+     * has already been unbound... Additionally, we need it to handle attribute removal events that happen
+     * during HttpSession destruction because the FlexSession can be unbound from the session before the
+     * other attributes we receive notification for.
+     *
+     * Because of this, it's simplest to just maintain this lookup table and use it for all HttpSession
+     * related event handling.
+     *
+     * The table is maintained on the servlet context instead of statically in order to prevent collisions
+     * across web-apps.
+     */
+    private Map getHttpSessionToFlexSessionMap(HttpSession session)
+    {
+        try
+        {
+            ServletContext context = session.getServletContext();
+            Map map = (Map)context.getAttribute(SESSION_MAP);
+
+            if(map==null){
+                // map should never be null here as it is created during MessageBrokerServlet start-up
+                if (Log.isError())
+                    Log.getLogger(FLEX_SESSION_LOG_CATEGORY).error("HttpSession to FlexSession map not created in message broker for "
+                            + session.getId());
+                MessageException me = new MessageException();
+                me.setMessage(10032, new Object[] {session.getId()});
+                throw me;
+            }
+            return map;
+        }
+        catch(Exception e)
+        {
+            if (Log.isDebug())
+                Log.getLogger(FLEX_SESSION_LOG_CATEGORY).debug("Unable to get HttpSession to FlexSession map for "
+                        + session.getId() + " " + e.toString());
+            return new ConcurrentHashMap();
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/HttpFlexSessionProvider.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/HttpFlexSessionProvider.java b/modules/core/src/flex/messaging/HttpFlexSessionProvider.java
new file mode 100755
index 0000000..9a077b9
--- /dev/null
+++ b/modules/core/src/flex/messaging/HttpFlexSessionProvider.java
@@ -0,0 +1,94 @@
+/*
+ * 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.messaging;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import flex.messaging.log.Log;
+
+/**
+ * Provider implementation for <code>HttpFlexSession</code>s.
+ * Not intended for public use.
+ */
+public class HttpFlexSessionProvider extends AbstractFlexSessionProvider
+{
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Factory method to get an existing <tt>HttpFlexSession</tt> for the current request,
+     * or create and return a new <code>HttpFlexSession</code> if necessary.
+     * The <code>HttpFlexSession</code> wraps the underlying J2EE <code>HttpSession</code>.
+     * Not intended for public use.
+     * 
+     * @param request The current <tt>HttpServletRequest</tt>.
+     * @return A <tt>HttpFlexSession</tt>.
+     */
+    public HttpFlexSession getOrCreateSession(HttpServletRequest request)
+    {
+        HttpFlexSession flexSession;
+        HttpSession httpSession = request.getSession(true);
+
+        if (!HttpFlexSession.isHttpSessionListener && !HttpFlexSession.warnedNoEventRedispatch)
+        {
+            HttpFlexSession.warnedNoEventRedispatch = true;
+            if (Log.isWarn())
+                Log.getLogger(HttpFlexSession.WARN_LOG_CATEGORY).warn("HttpFlexSession has not been registered as a listener in web.xml for this application so no events will be dispatched to FlexSessionAttributeListeners or FlexSessionBindingListeners. To correct this, register flex.messaging.HttpFlexSession as a listener in web.xml.");
+        }
+
+        boolean isNew = false;
+        synchronized (httpSession)
+        {
+            flexSession = (HttpFlexSession)httpSession.getAttribute(HttpFlexSession.SESSION_ATTRIBUTE);
+            if (flexSession == null)
+            {
+                flexSession = new HttpFlexSession(this);
+                // Correlate this FlexSession to the HttpSession before triggering any listeners.
+                FlexContext.setThreadLocalSession(flexSession);
+                httpSession.setAttribute(HttpFlexSession.SESSION_ATTRIBUTE, flexSession);
+                flexSession.setHttpSession(httpSession);
+                isNew = true;
+            }
+            else
+            {
+                FlexContext.setThreadLocalSession(flexSession);
+                if (flexSession.httpSession == null)
+                {
+                    // httpSession is null if the instance is new or is from
+                    // serialization.
+                    flexSession.setHttpSession(httpSession);
+                    isNew = true;
+                }
+            }
+        }
+
+        if (isNew)
+        {
+            getFlexSessionManager().registerFlexSession(flexSession);
+            flexSession.notifyCreated();
+
+            if (Log.isDebug())
+                Log.getLogger(HttpFlexSession.FLEX_SESSION_LOG_CATEGORY).debug("FlexSession created with id '" + flexSession.getId() + "' for an Http-based client connection.");
+        }
+
+        return flexSession;
+    }
+    }


[24/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/messaging/throttle/messaging_ThrottleInbound.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/throttle/messaging_ThrottleInbound.mxml b/apps/team/features/messaging/throttle/messaging_ThrottleInbound.mxml
new file mode 100755
index 0000000..b14661f
--- /dev/null
+++ b/apps/team/features/messaging/throttle/messaging_ThrottleInbound.mxml
@@ -0,0 +1,155 @@
+<?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();">
+
+    <!-- A sample that one can use to talk to messaging destinations with inbound
+         throttling and ERROR or IGNORE policies using different channels supported
+         by BlazeDS. Destinations have low inbound throttling limits and the sample
+         can be used to generate high number of message to see inbound throttling
+         handled according to the policy.
+     -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>
+            <mx:Label text="Destination to use "/>
+            <mx:ComboBox id="destinationsCB" dataProvider="{destinations}" selectedIndex="0" width="300"
+                change="setupChannelsCB();"/>
+        </mx:HBox>
+        <mx:HBox>
+            <mx:Label text="Channel to use "/>
+            <mx:ComboBox id="channelsCB" selectedIndex="0" width="200"
+                change="setupComponents()"/>
+        </mx:HBox>
+        <mx:HBox>
+            <mx:Label text="Producer"/>
+            <mx:Button label="Send 10 Foo{counter}" click="sendMessage(10)"/>
+            <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:HBox width="100%">
+            <mx:Spacer width="100%"/>
+            <mx:CheckBox id="dmCB" label="Display received messages?" selected="{displayMessages}"/>
+            <mx:Button label="Clear" click='output.text = ""'/>
+        </mx:HBox>
+        <mx:TextArea id="output" width="100%" height="100%"/>
+    </mx:Panel>
+
+    <mx:Binding source="dmCB.selected" destination="displayMessages"/>
+
+    <mx:Producer id="producer"
+        fault="producerFaultHandler(event)"/>
+
+    <mx:Consumer id="consumer"
+        fault="consumerFaultHandler(event)"
+        message="consumerMessageHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+            import mx.collections.ArrayCollection;
+            import mx.messaging.ChannelSet;
+            import mx.messaging.config.ServerConfig;
+            import mx.messaging.events.MessageFaultEvent;
+            import mx.messaging.events.MessageEvent;
+            import mx.messaging.messages.AsyncMessage;
+
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+
+            [Bindable]
+            public var counter:int = 0;
+
+            [Bindable]
+            public var destinations:Array = ['messaging_ThrottleInbound_PolicyError',
+                                             'messaging_ThrottleInbound_PolicyIgnore'];
+            [Bindable]
+            public var destinationId:String;
+            [Bindable]
+            public var displayMessages:Boolean;
+
+
+            private function creationCompleteHandler():void
+            {
+                var target:TraceTarget = new TraceTarget();
+                target.includeLevel = true;
+                target.filters = ["mx.messaging.*", "mx.rpc.*"];
+                Log.addTarget(target);
+
+                displayMessages = true;
+                setupChannelsCB();
+                setupComponents();
+            }
+
+            private function setupChannelsCB():void
+            {
+                destinationId = destinationsCB.selectedLabel;
+                channelsCB.dataProvider = new ArrayCollection((ServerConfig.getChannelSet(destinationId) as ChannelSet).channelIds);
+            }
+
+            private function setupComponents():void
+            {
+                // Setup consumer.
+                consumer.unsubscribe();
+                consumer.destination = destinationId;
+                var cs:ChannelSet = new ChannelSet();
+                cs.addChannel(ServerConfig.getChannel(channelsCB.selectedItem.toString()));
+                consumer.channelSet = cs;
+
+                // Setup producer.
+                producer.destination = destinationId;
+                producer.channelSet = cs;
+            }
+
+            private function sendMessage(n:int=1):void
+            {
+                var msg:AsyncMessage = null;
+                for (var i:int = 0; i < n; i++)
+                {
+                    msg = new AsyncMessage();
+                    msg.body = "Foo" + counter++;
+                    producer.send(msg);
+                }
+            }
+
+            private function consumerMessageHandler(event:MessageEvent):void
+            {
+                if (displayMessages)
+                    output.text += "Consumer received message: "+ event.message.body + "\n";
+            }
+
+            private function consumerFaultHandler(event:MessageFaultEvent):void
+            {
+                output.text += "Consumer received fault: " + event.faultString + "\n";
+            }
+
+            private function producerFaultHandler(event:MessageFaultEvent):void
+            {
+                output.text += "Producer 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/7a58369c/apps/team/features/messaging/throttle/messaging_ThrottleOutbound.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/throttle/messaging_ThrottleOutbound.mxml b/apps/team/features/messaging/throttle/messaging_ThrottleOutbound.mxml
new file mode 100755
index 0000000..5fbbaf9
--- /dev/null
+++ b/apps/team/features/messaging/throttle/messaging_ThrottleOutbound.mxml
@@ -0,0 +1,228 @@
+<?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();">
+
+    <!-- A sample that one can use to talk to messaging destinations with outbound
+         throttling and IGNORE policy using different channels supported by BlazeDS.
+         Destinations have low outbound throttling limits and the sample
+         can be used to generate high number of message to see outbound throttling
+         handled according to the policy.
+     -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>
+            <mx:Label text="Destination to use "/>
+            <mx:ComboBox id="destinationsCB" dataProvider="{destinations}" selectedIndex="0" width="300"
+                change="setupChannelsCB();"/>
+        </mx:HBox>
+        <mx:HBox>
+            <mx:Label text="Channel to use "/>
+            <mx:ComboBox id="channelsCB" selectedIndex="0" width="200"
+                change="setupComponents();"/>
+            <mx:Button label="Poll" click="poll()"
+                enabled="{!currentChannel.mx_internal::realtime}"/>
+        </mx:HBox>
+        <mx:HBox>
+            <mx:Label text="Push messages"/>
+            <mx:Label text="Push rate per second"/>
+            <mx:TextInput id="ti1" width="50" text="10"/>
+            <mx:Label text="Number of runs"/>
+            <mx:TextInput id="ti2" width="50" text="-1"/>
+            <mx:Button label="Start push" click="startPush();"/>
+            <mx:Button label="Stop push" click="stopPush();"/>
+        </mx:HBox>
+        <mx:HBox>
+            <mx:Label text="Consumer"/>
+            <mx:Button label="Subcribe" click="consumerSubscribe();" enabled="{!consumer.subscribed}"/>
+            <mx:Button label="Unsubscribe" click="consumerUnsubscribe();" 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:HBox>
+            <mx:Label text="Message receive rate"/>
+            <mx:Label text="In the last second: {currentRate.toFixed(2)}m/s"/>
+            <mx:Label text="Since subscribe: {globalRate.toFixed(2)}m/s"/>
+        </mx:HBox>
+        <mx:HBox width="100%">
+            <mx:Spacer width="100%"/>
+            <mx:CheckBox id="dmCB" label="Display received messages?" selected="{displayMessages}"/>
+            <mx:Button label="Clear" click='output.text = ""'/>
+        </mx:HBox>
+        <mx:TextArea id="output" width="100%" height="100%"/>
+    </mx:Panel>
+
+    <mx:Binding source="dmCB.selected" destination="displayMessages"/>
+
+    <mx:RemoteObject id="serverPushRO" destination="serverPushRO"/>
+
+    <mx:Consumer id="consumer"
+        fault="consumerFaultHandler(event)"
+        message="consumerMessageHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+            import mx.collections.ArrayCollection;
+            import mx.core.mx_internal;
+            import mx.messaging.ChannelSet;
+            import mx.messaging.Channel;
+            import mx.messaging.channels.PollingChannel;
+            import mx.messaging.config.ServerConfig;
+            import mx.messaging.events.MessageFaultEvent;
+            import mx.messaging.events.MessageEvent;
+            import mx.messaging.messages.AsyncMessage;
+
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+
+            [Bindable]
+            public var currentChannel:Channel;
+            [Bindable]
+            public var destinations:Array = ['messaging_ThrottleOutbound_PolicyIgnore'];
+            [Bindable]
+            public var destinationId:String;
+            [Bindable]
+            public var displayMessages:Boolean;
+
+            // How often to measure the message rate.
+            public const MEASUREMENT_TIME_MILLIS:int = 1000;
+            private var measurementTimer:Timer;
+
+            // Used to keep track of global message receive rate since subscription.
+            [Bindable]
+            public var globalRate:Number;
+            private var globalStartTime:Number;
+            private var globalMessages:int;
+
+            // Used to keep track of message receive rate in the last second.
+            [Bindable]
+            private var currentRate:Number;
+            [Bindable]
+            private var interval:Number;
+            private var startTime:int = 0;
+            private var currentMessages:int;
+
+            private function creationCompleteHandler():void
+            {
+                var target:TraceTarget = new TraceTarget();
+                target.includeLevel = true;
+                target.filters = ["mx.messaging.*", "mx.rpc.*"];
+                Log.addTarget(target);
+
+                displayMessages = true;
+                setupChannelsCB();
+                setupComponents();
+
+                measurementTimer = new Timer(MEASUREMENT_TIME_MILLIS, 0);
+                measurementTimer.addEventListener(TimerEvent.TIMER, measurementTimerHandler);
+            }
+
+            private function setupChannelsCB():void
+            {
+                destinationId = destinationsCB.selectedLabel;
+                channelsCB.dataProvider = new ArrayCollection((ServerConfig.getChannelSet(destinationId) as ChannelSet).channelIds);
+            }
+
+            private function setupComponents():void
+            {
+                currentChannel = ServerConfig.getChannel(channelsCB.selectedItem.toString());
+
+                consumer.unsubscribe();
+                consumer.destination = destinationId;
+                var cs:ChannelSet = new ChannelSet();
+                cs.addChannel(currentChannel);
+                consumer.channelSet = cs;
+            }
+
+            private function consumerSubscribe():void
+            {
+                globalStartTime = getTimer();
+                globalMessages = 0;
+                currentMessages = 0;
+                startTime = 0;
+
+                if (!measurementTimer.running)
+                    measurementTimer.start();
+
+                consumer.subscribe();
+            }
+
+            private function consumerUnsubscribe():void
+            {
+                globalRate = 0;
+                currentRate = 0;
+                if (measurementTimer.running)
+                    measurementTimer.stop();
+                if (consumer.subscribed)
+                    consumer.unsubscribe();
+            }
+
+            private function consumerMessageHandler(event:MessageEvent):void
+            {
+                currentMessages++;
+                globalMessages++;
+
+                if (displayMessages)
+                    output.text += "Consumer received message: "+ event.message.body + "\n";
+            }
+
+            private function consumerFaultHandler(event:MessageFaultEvent):void
+            {
+                output.text += "Consumer received fault: " + event.faultString + "\n";
+            }
+
+            private function measurementTimerHandler(event:TimerEvent):void
+            {
+                var now:int = getTimer();
+                if (startTime == 0)
+                {
+                    globalStartTime = now;
+                    startTime = now;
+                }
+
+                var temp:Number = Number(now - startTime);
+                if (temp >= MEASUREMENT_TIME_MILLIS)
+                {
+                    interval = temp;
+                    currentRate = 1000.0 * currentMessages / interval;
+                    globalRate = 1000.0 * globalMessages / Number(now - globalStartTime);
+                    currentMessages = 0;
+                    startTime = now;
+                }
+            }
+
+            private function startPush():void
+            {
+                serverPushRO.startPush(destinationId, uint(ti1.text), 1000, uint(ti2.text));
+            }
+
+            private function stopPush():void
+            {
+                serverPushRO.stopPush();
+            }
+
+            private function poll():void
+            {
+                output.text += "Polling" + "\n";
+                (currentChannel as PollingChannel).poll();
+            }
+        ]]>
+    </mx:Script>
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/remoting/externalizable/ExternalizableClass.as
----------------------------------------------------------------------
diff --git a/apps/team/features/remoting/externalizable/ExternalizableClass.as b/apps/team/features/remoting/externalizable/ExternalizableClass.as
new file mode 100755
index 0000000..fefddd5
--- /dev/null
+++ b/apps/team/features/remoting/externalizable/ExternalizableClass.as
@@ -0,0 +1,56 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 flash.utils.IDataInput;
+    import flash.utils.IDataOutput;
+    import flash.utils.IExternalizable;
+
+    /**
+     * A simple class that uses IExternalizable interface to read and write its properties.
+     */ 
+    [RemoteClass(alias="features.remoting.externalizable.ExternalizableClass")]
+    public class ExternalizableClass implements IExternalizable
+    {
+        public var property1:String;
+        public var property2:String;
+
+        public function ExternalizableClass()
+        {
+        }
+
+        public function readExternal(input:IDataInput):void
+        {
+            property1 = input.readObject() as String;
+            property2 = input.readObject() as String;
+        }
+
+        public function writeExternal(output:IDataOutput):void
+        {
+            output.writeObject(property1);
+            output.writeObject(property2);
+        }
+
+        public function toString():String
+        {
+            return "ExternalizableClass [property1: " + property1 + ", property2: " + property2 + "]";
+        }
+        
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/remoting/externalizable/remoting_Externalizable.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/remoting/externalizable/remoting_Externalizable.mxml b/apps/team/features/remoting/externalizable/remoting_Externalizable.mxml
new file mode 100755
index 0000000..25cd31d
--- /dev/null
+++ b/apps/team/features/remoting/externalizable/remoting_Externalizable.mxml
@@ -0,0 +1,80 @@
+<?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();">
+    
+    <!-- 
+        A remoting example that sends and receives classes that use Externalizable
+        interfaces to read and writes their properties.
+    -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>
+            <mx:Label text="Enter properties of the ExternalizableClass"/>
+            <mx:TextInput id="ti1" text="property1"/>
+            <mx:TextInput id="ti2" text="property2"/>
+            <mx:Button label="Send" click="echo()"/>
+            <mx:Button label="Clear" click='ta.text = ""'/>
+        </mx:HBox>	
+        <mx:TextArea id="ta" width="100%" height="100%"/>
+    </mx:Panel>
+
+    <mx:RemoteObject id="remoteObject" 
+        destination="remoting_AMF"
+        result="resultHandler(event)"
+        fault="faultHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+            import mx.rpc.events.FaultEvent;
+            import mx.rpc.events.ResultEvent;
+
+            private var value:ExternalizableClass = new ExternalizableClass();
+
+            private function creationCompleteHandler():void
+            {
+                var target:TraceTarget = new TraceTarget();
+                target.includeLevel = true;
+                target.filters = ["mx.messaging.*", "mx.rpc.*"];
+                Log.addTarget(target);
+            }
+
+            private function echo():void
+            {
+                value.property1 = ti1.text;
+                value.property2 = ti2.text;
+                remoteObject.echoExternalizableClass(value);
+            }
+
+            private function resultHandler(event:ResultEvent):void
+            {
+                var returnedValue:ExternalizableClass = event.result as ExternalizableClass;
+                ta.text += "Server responded: "  + returnedValue + "\n";
+            }
+
+            private function faultHandler(event:FaultEvent):void
+            {
+                ta.text += "Received fault: " + event.fault + "\n";
+            }
+        ]]>
+    </mx:Script>
+
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/remoting/filteredAckRemoting.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/remoting/filteredAckRemoting.mxml b/apps/team/features/remoting/filteredAckRemoting.mxml
new file mode 100755
index 0000000..1a888aa
--- /dev/null
+++ b/apps/team/features/remoting/filteredAckRemoting.mxml
@@ -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.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
+    creationComplete="creationCompleteHandler();">
+    
+    <!-- A simple remoting sample where client sends a text and server simply
+         echoes it back using an AMF channel.
+    -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>    
+        	<mx:Label text="Enter a text for the server to echo"/>        
+            <mx:TextInput id="ti" text="Hello World!"/>
+        	<mx:Button label="Send" click="echo()"/>
+            <mx:Button label="Clear" click='ta.text = ""'/>                	
+        </mx:HBox>        	
+        <mx:TextArea id="ta" width="100%" height="100%"/>           
+    </mx:Panel>
+
+    <mx:RemoteObject id="remoteObject" 
+        destination="filteredAck"
+        result="resultHandler(event)"
+        fault="faultHandler(event)"/>
+                    
+    <mx:Script>
+        <![CDATA[
+        
+    	    import mx.rpc.events.FaultEvent;	                
+            import mx.rpc.events.ResultEvent;
+            
+			import mx.logging.Log;
+	        import mx.logging.targets.TraceTarget;			
+	        					
+    		private function creationCompleteHandler():void
+    		{
+                var target:TraceTarget = new TraceTarget();
+		        target.includeLevel = true;
+		        target.filters = ["mx.messaging.*", "mx.rpc.*"];
+		        Log.addTarget(target);            			
+    		}
+    		     		 
+            private function echo():void
+            {
+                var text:String = ti.text;
+                remoteObject.echo(text);
+            }
+                                                            
+            private function resultHandler(event:ResultEvent):void
+            {
+                ta.text += "Server responded: "+ event.result + "\n";  
+            }
+                       
+            private function faultHandler(event:FaultEvent):void
+            {
+                ta.text += "Received fault: " + event.fault + "\n";
+            }      
+            
+        ]]>
+    </mx:Script>
+
+</mx:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/remoting/filteredFaultRemoting.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/remoting/filteredFaultRemoting.mxml b/apps/team/features/remoting/filteredFaultRemoting.mxml
new file mode 100755
index 0000000..586ddf8
--- /dev/null
+++ b/apps/team/features/remoting/filteredFaultRemoting.mxml
@@ -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.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
+    creationComplete="creationCompleteHandler();">
+    
+    <!-- A simple remoting sample where client sends a text and server simply
+         echoes it back using an AMF channel.
+    -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>    
+        	<mx:Label text="Enter a text for the server to echo"/>        
+            <mx:TextInput id="ti" text="Hello World!"/>
+        	<mx:Button label="Send" click="echo()"/>
+            <mx:Button label="Clear" click='ta.text = ""'/>                	
+        </mx:HBox>        	
+        <mx:TextArea id="ta" width="100%" height="100%"/>           
+    </mx:Panel>
+
+    <mx:RemoteObject id="remoteObject" 
+        destination="filteredFault"
+        result="resultHandler(event)"
+        fault="faultHandler(event)"/>
+                    
+    <mx:Script>
+        <![CDATA[
+        
+    	    import mx.rpc.events.FaultEvent;	                
+            import mx.rpc.events.ResultEvent;
+            
+			import mx.logging.Log;
+	        import mx.logging.targets.TraceTarget;			
+	        					
+    		private function creationCompleteHandler():void
+    		{
+                var target:TraceTarget = new TraceTarget();
+		        target.includeLevel = true;
+		        target.filters = ["mx.messaging.*", "mx.rpc.*"];
+		        Log.addTarget(target);            			
+    		}
+    		     		 
+            private function echo():void
+            {
+                var text:String = ti.text;
+                remoteObject.echo(text);
+            }
+                                                            
+            private function resultHandler(event:ResultEvent):void
+            {
+                ta.text += "Server responded: "+ event.result + "\n";  
+            }
+                       
+            private function faultHandler(event:FaultEvent):void
+            {
+                ta.text += "Received fault: " + event.fault + "\n";
+            }      
+            
+        ]]>
+    </mx:Script>
+
+</mx:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/remoting/remoting_AMF.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/remoting/remoting_AMF.mxml b/apps/team/features/remoting/remoting_AMF.mxml
new file mode 100755
index 0000000..f0d876f
--- /dev/null
+++ b/apps/team/features/remoting/remoting_AMF.mxml
@@ -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.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
+    creationComplete="creationCompleteHandler();">
+    
+    <!-- A simple remoting sample where client sends a text and server simply
+         echoes it back using an AMF channel.
+    -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>    
+        	<mx:Label text="Enter a text for the server to echo"/>        
+            <mx:TextInput id="ti" text="Hello World!"/>
+        	<mx:Button label="Send" click="echo()"/>
+            <mx:Button label="Clear" click='ta.text = ""'/>                	
+        </mx:HBox>        	
+        <mx:TextArea id="ta" width="100%" height="100%"/>           
+    </mx:Panel>
+
+    <mx:RemoteObject id="remoteObject" 
+        destination="remoting_AMF"
+        result="resultHandler(event)"
+        fault="faultHandler(event)"/>
+                    
+    <mx:Script>
+        <![CDATA[
+        
+    	    import mx.rpc.events.FaultEvent;	                
+            import mx.rpc.events.ResultEvent;
+            
+			import mx.logging.Log;
+	        import mx.logging.targets.TraceTarget;			
+	        					
+    		private function creationCompleteHandler():void
+    		{
+                var target:TraceTarget = new TraceTarget();
+		        target.includeLevel = true;
+		        target.filters = ["mx.messaging.*", "mx.rpc.*"];
+		        Log.addTarget(target);            			
+    		}
+    		     		 
+            private function echo():void
+            {
+                var text:String = ti.text;
+                remoteObject.echo(text);
+            }
+                                                            
+            private function resultHandler(event:ResultEvent):void
+            {
+                ta.text += "Server responded: "+ event.result + "\n";  
+            }
+                       
+            private function faultHandler(event:FaultEvent):void
+            {
+                ta.text += "Received fault: " + event.fault + "\n";
+            }      
+            
+        ]]>
+    </mx:Script>
+
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/remoting/remoting_AMFX.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/remoting/remoting_AMFX.mxml b/apps/team/features/remoting/remoting_AMFX.mxml
new file mode 100755
index 0000000..0f2b7f0
--- /dev/null
+++ b/apps/team/features/remoting/remoting_AMFX.mxml
@@ -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.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
+    creationComplete="creationCompleteHandler();">
+    
+    <!-- A simple remoting sample where client sends a text and server simply
+         echoes it back using an AMF channel.
+    -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>    
+            <mx:Label text="Enter a text for the server to echo"/>        
+            <mx:TextInput id="ti" text="Hello World!"/>
+            <mx:Button label="Send" click="echo()"/>
+            <mx:Button label="Clear" click='ta.text = ""'/>                 
+        </mx:HBox>          
+        <mx:TextArea id="ta" width="100%" height="100%"/>           
+    </mx:Panel>
+
+    <mx:RemoteObject id="remoteObject" 
+        destination="remoting_AMFX"
+        result="resultHandler(event)"
+        fault="faultHandler(event)"/>
+                    
+    <mx:Script>
+        <![CDATA[
+        
+            import mx.rpc.events.FaultEvent;                    
+            import mx.rpc.events.ResultEvent;
+            
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;          
+                                
+            private function creationCompleteHandler():void
+            {
+                var target:TraceTarget = new TraceTarget();
+                target.includeLevel = true;
+                target.filters = ["mx.messaging.*", "mx.rpc.*"];
+                Log.addTarget(target);                      
+            }
+                         
+            private function echo():void
+            {
+                var text:String = ti.text;
+                remoteObject.echo(text);
+            }
+                                                            
+            private function resultHandler(event:ResultEvent):void
+            {
+                ta.text += "Server responded: "+ event.result + "\n";  
+            }
+                       
+            private function faultHandler(event:FaultEvent):void
+            {
+                ta.text += "Received fault: " + event.fault + "\n";
+            }      
+            
+        ]]>
+    </mx:Script>
+
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/remoting/remoting_AMF_Dictionary.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/remoting/remoting_AMF_Dictionary.mxml b/apps/team/features/remoting/remoting_AMF_Dictionary.mxml
new file mode 100755
index 0000000..c7f9488
--- /dev/null
+++ b/apps/team/features/remoting/remoting_AMF_Dictionary.mxml
@@ -0,0 +1,104 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
+    creationComplete="creationCompleteHandler();">
+
+    <!-- A remoting sample where client sends the new Dictionary type to the server
+         which in turn echoes the Dictionary back using AMF.
+    -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>
+            <mx:Button label="Echo Sparse Array" click="echoSparseArray()"/>
+            <mx:Button label="Echo Dense Array" click="echoDenseArray()"/>
+            <mx:Button label="Echo Map" click="echoMap()"/>
+            <mx:Button label="Echo Dictionary" click="echoDictionary()"/>
+            <mx:Button label="Clear" click='ta.text = ""'/>
+        </mx:HBox>
+        <mx:TextArea id="ta" width="100%" height="100%"/>
+    </mx:Panel>
+
+    <mx:RemoteObject id="remoteObject"
+        destination="remoting_AMF"
+        result="resultHandler(event)"
+        fault="faultHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+
+            import mx.rpc.events.FaultEvent;
+            import mx.rpc.events.ResultEvent;
+
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+
+            private function creationCompleteHandler():void
+            {
+                var target:TraceTarget = new TraceTarget();
+                target.includeLevel = true;
+                target.filters = ["mx.messaging.*", "mx.rpc.*"];
+                Log.addTarget(target);
+            }
+
+            private function echoDenseArray():void
+            {
+                var array:Array = [];
+                for (var i:int = 0; i < 5; i++)
+                    array[i] = "value" + i;
+                remoteObject.echoDenseArray(array);
+            }
+
+            private function echoSparseArray():void
+            {
+                var array:Array = [];
+                for (var i:int = 0; i < 5; i++)
+                    array["foo" + i] = "value" + i;
+                remoteObject.echoSparseArray(array);
+            }
+
+            private function echoMap():void
+            {
+                var map:Object = new Object();
+                for (var i:int = 0; i < 5; i++)
+                    map["key"+ i] = "value" + i;
+                remoteObject.echoMap(map);
+            }
+
+            private function echoDictionary():void
+            {
+                var dict:Dictionary = new Dictionary(true);
+                for (var i:int = 0; i < 5; i++)
+                    dict["key"+ i] = "value" + i;
+                remoteObject.echoDictionary(dict);
+            }
+
+            private function resultHandler(event:ResultEvent):void
+            {
+                ta.text += "Server responded: "+ event.result + "\n";
+            }
+
+            private function faultHandler(event:FaultEvent):void
+            {
+                ta.text += "Received fault: " + event.fault + "\n";
+            }
+
+        ]]>
+    </mx:Script>
+
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/remoting/remoting_AMF_Legacy.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/remoting/remoting_AMF_Legacy.mxml b/apps/team/features/remoting/remoting_AMF_Legacy.mxml
new file mode 100755
index 0000000..be09cad
--- /dev/null
+++ b/apps/team/features/remoting/remoting_AMF_Legacy.mxml
@@ -0,0 +1,78 @@
+<?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();">
+    <!--
+        This is an example of legacy way of making remote object calls with a 
+        NetConnection, rather than RemoteObject. 
+    -->
+    
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>    
+            <mx:Label text="Enter a text for the server to echo"/>
+            <mx:TextInput id="ti" text="Hello World!"/>
+            <mx:Button label="Send" click="echo()"/>
+            <mx:Button label="Clear" click='ta.text = ""'/>
+        </mx:HBox>
+        <mx:TextArea id="ta" width="100%" height="100%"/>
+    </mx:Panel>
+
+    <mx:Script>
+        <![CDATA[
+            import flash.net.NetConnection;
+            import flash.net.ObjectEncoding;
+            import flash.net.Responder;
+
+            private var nc:NetConnection
+            
+            private function creationCompleteHandler():void
+            {
+                nc = new NetConnection();
+                nc.client = this;
+                nc.objectEncoding = ObjectEncoding.AMF0;
+                nc.connect("http://localhost:8400/team/messagebroker/amf" );
+            }
+
+            private function echo():void
+            {
+                nc.call( "remoting_AMF.echo", new Responder( resultHandler, faultHandler ), ti.text );
+            }
+
+            private function resultHandler(result:Object):void
+            {
+                ta.text += "Server responded: "+ result + "\n";
+            }
+
+            private function faultHandler(fault:Object):void
+            {
+                ta.text += "Received fault: " + fault + "\n";
+            }
+
+            /**
+             * Called when AppendToGatewayUrl header is in the AMF message.
+             */
+            public function AppendToGatewayUrl(value:String):void
+            {
+                //No-op
+            }
+        ]]>
+    </mx:Script>
+
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/remoting/remoting_AMF_ReadOnly.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/remoting/remoting_AMF_ReadOnly.mxml b/apps/team/features/remoting/remoting_AMF_ReadOnly.mxml
new file mode 100755
index 0000000..b9aa571
--- /dev/null
+++ b/apps/team/features/remoting/remoting_AMF_ReadOnly.mxml
@@ -0,0 +1,69 @@
+<?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();">
+    
+    <!-- A simple remoting sample where the client receives a read-only object
+         from the server.
+    -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>
+        	<mx:Button label="Echo read-only" click="remoteObject.echoReadOnly()"/>
+            <mx:Button label="Clear" click='ta.text = ""'/>
+        </mx:HBox>        	
+        <mx:TextArea id="ta" width="100%" height="100%"/>
+    </mx:Panel>
+
+    <mx:RemoteObject id="remoteObject" 
+        destination="remoting_AMF"
+        result="resultHandler(event)"
+        fault="faultHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+        
+            import mx.rpc.events.FaultEvent;
+            import mx.rpc.events.ResultEvent;
+
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+
+            private function creationCompleteHandler():void
+            {
+                var target:TraceTarget = new TraceTarget();
+                target.includeLevel = true;
+                target.filters = ["mx.messaging.*", "mx.rpc.*"];
+                Log.addTarget(target);
+            }
+
+            private function resultHandler(event:ResultEvent):void
+            {
+                ta.text += "Server responded: "+ event.result.property + "\n";
+            }
+
+            private function faultHandler(event:FaultEvent):void
+            {
+                ta.text += "Received fault: " + event.fault + "\n";
+            }
+
+        ]]>
+    </mx:Script>
+
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/remoting/remoting_AMF_Vector.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/remoting/remoting_AMF_Vector.mxml b/apps/team/features/remoting/remoting_AMF_Vector.mxml
new file mode 100755
index 0000000..b4c6d69
--- /dev/null
+++ b/apps/team/features/remoting/remoting_AMF_Vector.mxml
@@ -0,0 +1,122 @@
+<?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();">
+
+    <!-- A remoting sample where client sends the new Vector type to the server
+         which in turn echoes the Vector back using AMF. Make sure you enable the
+         prefer-vectors flag in the channel configuration.
+    -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>
+            <mx:Button label="Echo Int Vector" click="echoIntVector()"/>
+            <mx:Button label="Echo UInt Vector" click="echoUIntVector()"/>
+            <mx:Button label="Echo Double Vector" click="echoDoubleVector()"/>
+            <mx:Button label="Echo Object Vector" click="echoObjectVector()"/>
+            <mx:Button label="Echo String Vector" click="echoStringVector()"/>
+            <mx:Button label="Clear" click='ta.text = ""'/>
+        </mx:HBox>
+        <mx:HBox>
+            <mx:Button label="Echo Fixed Int Vector" click="echoIntVector(true)"/>
+            <mx:Button label="Echo Fixed UInt Vector" click="echoUIntVector(true)"/>
+            <mx:Button label="Echo Fixed Double Vector" click="echoDoubleVector(true)"/>
+            <mx:Button label="Echo Fixed Object Vector" click="echoObjectVector(true)"/>
+            <mx:Button label="Echo Fixed String Vector" click="echoStringVector(true)"/>
+            <mx:Button label="Clear" click='ta.text = ""'/>
+        </mx:HBox>
+        <mx:TextArea id="ta" width="100%" height="100%"/>
+    </mx:Panel>
+
+    <mx:RemoteObject id="remoteObject"
+        destination="remoting_AMF"
+        result="resultHandler(event)"
+        fault="faultHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+
+            import mx.rpc.events.FaultEvent;
+            import mx.rpc.events.ResultEvent;
+
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+
+            private function creationCompleteHandler():void
+            {
+                var target:TraceTarget = new TraceTarget();
+                target.includeLevel = true;
+                target.filters = ["mx.messaging.*", "mx.rpc.*"];
+                Log.addTarget(target);
+            }
+
+            private function echoIntVector(fixed:Boolean=false):void
+            {
+                var vector:Vector.<int> = new Vector.<int>(5, fixed);
+                for (var i:int = 0; i < 5; i++)
+                    vector[i] = i;
+                remoteObject.echoIntVector(vector);
+            }
+
+            private function echoUIntVector(fixed:Boolean=false):void
+            {
+                var vector:Vector.<uint> = new Vector.<uint>(5, fixed);
+                for (var i:uint = 0; i < 5; i++)
+                    vector[i] = uint.MAX_VALUE;
+                remoteObject.echoUIntVector(vector);
+            }
+
+            private function echoDoubleVector(fixed:Boolean=false):void
+            {
+                var vector:Vector.<Number> = new Vector.<Number>(5, fixed);
+                for (var i:int = 0; i < 5; i++)
+                    vector[i] = Number(i);
+                remoteObject.echoDoubleVector(vector);
+            }
+
+            private function echoObjectVector(fixed:Boolean=false):void
+            {
+                var vector:Vector.<Object> = new Vector.<Object>(5, fixed);
+                for (var i:int = 0; i < 5; i++)
+                    vector[i] = "value" + i;
+                remoteObject.echoObjectVector(vector);
+            }
+
+            private function echoStringVector(fixed:Boolean=false):void
+            {
+                var vector:Vector.<String> = new Vector.<String>(5, fixed);
+                for (var i:int = 0; i < 5; i++)
+                    vector[i] = "value" + i;
+                remoteObject.echoStringVector(vector);
+            }
+
+            private function resultHandler(event:ResultEvent):void
+            {
+                ta.text += "Server responded: "+ event.result + "\n";
+            }
+
+            private function faultHandler(event:FaultEvent):void
+            {
+                ta.text += "Received fault: " + event.fault + "\n";
+            }
+
+        ]]>
+    </mx:Script>
+
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/runtimeconfig/runtimeconfig_MessageDestination.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/runtimeconfig/runtimeconfig_MessageDestination.mxml b/apps/team/features/runtimeconfig/runtimeconfig_MessageDestination.mxml
new file mode 100755
index 0000000..7ea1683
--- /dev/null
+++ b/apps/team/features/runtimeconfig/runtimeconfig_MessageDestination.mxml
@@ -0,0 +1,150 @@
+<?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();">
+
+    <!-- This sample calls a remote object to dynamically create a message 
+         destination and tries to use that destination.
+    -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>
+            <mx:Button label="Create Destination" click="createDestination();" 
+                enabled="{!destinationCreated}"/>
+            <mx:Button label="Remove Destination" click="removeDestination();" 
+                enabled="{destinationCreated}"/> 
+        </mx:HBox>
+        <mx:HBox enabled="{destinationCreated}">
+            <mx:Label text="Producer"/>
+            <mx:Button label="Send Foo" click="sendMessage()"/>
+            <mx:Button label="Disconnect" click="producer.disconnect();" enabled="{producer.connected}"/>
+            <mx:CheckBox label="Connected?" selected="{producer.connected}"/>
+        </mx:HBox>
+        <mx:HBox enabled="{destinationCreated}">
+            <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:RemoteObject id="runtimeConfigurator" 
+        destination="RuntimeConfigurator"/>
+
+    <mx:Producer id="producer" 
+        destination="messaging_AMF_Poll_Runtime"
+        fault="messageFaultHandler(event)"/>
+
+    <mx:Consumer id="consumer" 
+        destination="messaging_AMF_Poll_Runtime"
+        fault="messageFaultHandler(event)" 
+        message="messageHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+            import mx.messaging.ChannelSet;
+            import mx.messaging.channels.AMFChannel;
+            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.rpc.AsyncToken;
+            import mx.rpc.AsyncResponder;
+            import mx.rpc.events.FaultEvent;
+            import mx.rpc.events.ResultEvent;
+
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+
+            [Bindable]
+            public var destinationCreated:Boolean = false;
+
+            private function creationCompleteHandler():void
+            {
+                var target:TraceTarget = new TraceTarget();
+                target.includeLevel = true;
+                target.filters = ["mx.messaging.*", "mx.rpc.*"];
+                Log.addTarget(target);  
+
+                // Need to set the ChannelSet for dynamically created destinations. 
+                // This channel should match with whatever channel the destination uses.
+                var channelSet:ChannelSet = new ChannelSet();
+                var channel:AMFChannel = new AMFChannel("my-amf-poll", "http://localhost:8400/team/messagebroker/myamfpoll");
+                channelSet.addChannel(channel);
+                producer.channelSet = channelSet;
+                consumer.channelSet = channelSet;
+            }
+
+            private function createDestination():void
+            {
+                var token:AsyncToken = runtimeConfigurator.createMessageDestination();
+                token.addResponder(new AsyncResponder(
+                    function (event:ResultEvent, token:Object=null):void
+                    {
+                        ta.text += "RuntimeConfigurator result: "+ event.result + "\n";
+                        destinationCreated = true;
+                    },
+                    function (event:FaultEvent, token:Object=null):void
+                    {
+                        ta.text += "RuntimeConfigurator fault: " + event.fault + "\n";
+                        destinationCreated = false;
+                    })); 
+            }
+
+            private function removeDestination():void
+            {
+                var token:AsyncToken = runtimeConfigurator.removeMessageDestination();
+                token.addResponder(new AsyncResponder(
+                    function (event:ResultEvent, token:Object=null):void
+                    {
+                        ta.text += "RuntimeConfigurator result: "+ event.result + "\n";
+                        destinationCreated = false;
+                    },
+                    function (event:FaultEvent, token:Object=null):void
+                    {
+                        ta.text += "RuntimeConfigurator fault: " + event.fault + "\n";
+                        destinationCreated = false;
+                    }));
+            }
+
+            private function sendMessage():void
+            {
+                var msg:AsyncMessage = new AsyncMessage();
+                msg.body = "Foo";
+                producer.send(msg);
+            }
+
+            private function messageHandler(event:MessageEvent):void
+            {
+                ta.text += "Consumer received message: "+ event.message.body + "\n";
+            }
+
+            private function messageFaultHandler(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/7a58369c/apps/team/features/runtimeconfig/runtimeconfig_MessageDestinationWithJMS.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/runtimeconfig/runtimeconfig_MessageDestinationWithJMS.mxml b/apps/team/features/runtimeconfig/runtimeconfig_MessageDestinationWithJMS.mxml
new file mode 100755
index 0000000..4aa0167
--- /dev/null
+++ b/apps/team/features/runtimeconfig/runtimeconfig_MessageDestinationWithJMS.mxml
@@ -0,0 +1,131 @@
+<?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();">
+
+    <!-- This sample calls a remote object to dynamically create a message 
+         destination that uses JMSAdapter and tries to use that destination.
+    -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>
+            <mx:Button label="Create Destination" click="createDestination();"/> 
+        </mx:HBox>
+        <mx:HBox enabled="{destinationCreated}">
+            <mx:Label text="Producer"/>
+            <mx:Button label="Send Foo" click="sendMessage()"/>
+            <mx:Button label="Disconnect" click="producer.disconnect();" enabled="{producer.connected}"/>
+            <mx:CheckBox label="Connected?" selected="{producer.connected}"/>
+        </mx:HBox>
+        <mx:HBox enabled="{destinationCreated}">
+            <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:RemoteObject id="runtimeConfigurator" 
+        destination="RuntimeConfigurator"
+        result="resultHandler(event)"
+        fault="faultHandler(event)"/>
+
+    <mx:Producer id="producer" 
+        destination="messaging_AMF_Poll_JMS_Topic_Runtime"
+        fault="messageFaultHandler(event)"/>
+
+    <mx:Consumer id="consumer" 
+        destination="messaging_AMF_Poll_JMS_Topic_Runtime"
+        fault="messageFaultHandler(event)" 
+        message="messageHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+            import mx.messaging.ChannelSet;
+            import mx.messaging.channels.AMFChannel;
+            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.rpc.events.FaultEvent;
+            import mx.rpc.events.ResultEvent;
+
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+
+            [Bindable]
+            public var destinationCreated:Boolean = false;
+
+            private function creationCompleteHandler():void
+            {
+                var target:TraceTarget = new TraceTarget();
+                target.includeLevel = true;
+                target.filters = ["mx.messaging.*", "mx.rpc.*"];
+                Log.addTarget(target);  
+
+                // Need to set the ChannelSet for dynamically created destinations. 
+                // This channel should match with whatever channel the destination uses.
+                var channelSet:ChannelSet = new ChannelSet();
+                var channel:AMFChannel = new AMFChannel("my-amf-poll", "http://localhost:8400/team/messagebroker/myamfpoll");
+                channelSet.addChannel(channel);
+                producer.channelSet = channelSet;
+                consumer.channelSet = channelSet;
+            }
+
+            private function createDestination():void
+            {
+                runtimeConfigurator.createMessageDestinationWithJMSAdapter();
+            }
+
+            private function resultHandler(event:ResultEvent):void
+            {
+                ta.text += "RuntimeConfigurator result: "+ event.result + "\n";
+                destinationCreated = true;
+            }
+
+            private function faultHandler(event:FaultEvent):void
+            {
+                ta.text += "RuntimeConfigurator fault: " + event.fault + "\n";
+            }
+
+            private function sendMessage():void
+            {
+                var msg:AsyncMessage = new AsyncMessage();
+                msg.body = "Foo";
+                producer.send(msg);
+            }
+
+            private function messageHandler(event:MessageEvent):void
+            {
+                ta.text += "Consumer received message: "+ event.message.body + "\n";
+            }
+
+            private function messageFaultHandler(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/7a58369c/apps/team/features/security-constraints/README.txt
----------------------------------------------------------------------
diff --git a/apps/team/features/security-constraints/README.txt b/apps/team/features/security-constraints/README.txt
new file mode 100755
index 0000000..3f7a722
--- /dev/null
+++ b/apps/team/features/security-constraints/README.txt
@@ -0,0 +1,6 @@
+This is an overview of how to secure BlazeDS destinations:
+
+1- In services-config.xml, under security section, uncomment a login command for your application server. 
+2- In services-config.xml, under security section, define a security constraint that your destinatios will refer to. A security constraint can be basic or custom and it can have one or more roles. Basic authentication means a browser window pops up asking the user for username and password when the client tries to access the destination. Custom authentication means instead of a browser window, the Flex application itself passes the authentication to BlazeDS. Roles are application server specific. For example, in Tomcat, they are defined in conf/tomcat-user.xml file.
+3- In your destination definition, refer to the security constraint you defined in the previous step with "<security-constraint ref=""/>" tag.
+4- If your destinations are using basic authentication, then no extra work is required in your Flex application. If they are using custom authentication, then you need to pass the credentials to BlazeDS, preferably using ChannelSet.login method and listening for authentication success or failure with AsyncToken pattern.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/security-constraints/securityConstraint_Basic.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/security-constraints/securityConstraint_Basic.mxml b/apps/team/features/security-constraints/securityConstraint_Basic.mxml
new file mode 100755
index 0000000..f9ecde9
--- /dev/null
+++ b/apps/team/features/security-constraints/securityConstraint_Basic.mxml
@@ -0,0 +1,71 @@
+<?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();">
+
+    <!-- A simple remoting sample where client sends a text and server simply
+         echoes it back. The destination is secured using basic security constraint
+         where a browser window pops up for username and password.
+    -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>
+            <mx:Label text="Enter a text for the server to echo"/>
+            <mx:TextInput id="ti" text="Hello World!"/>
+            <mx:Button label="Send" click="remoteObject.echo(ti.text);"/>
+        </mx:HBox>
+        <mx:TextArea id="ta" width="100%" height="100%"/>
+    </mx:Panel>
+
+    <mx:RemoteObject id="remoteObject"
+        destination="remoting_AMF_SecurityConstraint_Basic"
+        result="resultHandler(event)"
+        fault="faultHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+
+            import mx.rpc.events.FaultEvent;
+            import mx.rpc.events.ResultEvent;
+
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+
+            private function creationCompleteHandler():void
+            {
+                var target:TraceTarget = new TraceTarget();
+                target.includeLevel = true;
+                target.filters = ["mx.messaging.*", "mx.rpc.*"];
+                Log.addTarget(target);
+            }
+
+            private function resultHandler(event:ResultEvent):void
+            {
+                ta.text += "Server responded: "+ event.result + "\n";
+            }
+
+            private function faultHandler(event:FaultEvent):void
+            {
+                ta.text += "Received fault: " + event.fault + "\n";
+            }
+
+        ]]>
+    </mx:Script>
+
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/security-constraints/securityConstraint_Custom.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/security-constraints/securityConstraint_Custom.mxml b/apps/team/features/security-constraints/securityConstraint_Custom.mxml
new file mode 100755
index 0000000..de90fef
--- /dev/null
+++ b/apps/team/features/security-constraints/securityConstraint_Custom.mxml
@@ -0,0 +1,140 @@
+<?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();">
+
+    <!-- A simple remoting sample where client sends a text and server simply
+         echoes it back. The destination is secured using custom security constraint
+         where instead of a browser window for username and password, application 
+         itself handles authentication.
+    -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>
+            <mx:Label text="Username"/>
+            <mx:TextInput id="unameTI" text="sampleuser"/>
+            <mx:Label text="Password"/>
+            <mx:TextInput id="passTI" text="samplepassword"/>
+            <mx:Button label="Login" click="login(unameTI.text, passTI.text)"/>
+            <mx:Button label="Logout" click="logout()"/>
+            <mx:CheckBox id="authenticatedCB" label="Authenticated?"/>
+        </mx:HBox>
+        <mx:HBox>
+            <mx:Label text="Enter a text for the server to echo"/>
+            <mx:TextInput id="ti" text="Hello World!"/>
+            <mx:Button label="Echo" click="remoteObject.echo(ti.text);" enabled="{authenticatedCB.selected}"/>
+        </mx:HBox>
+        <mx:TextArea id="ta" width="100%" height="100%"/>
+    </mx:Panel>
+
+    <mx:RemoteObject id="remoteObject"
+        destination="remoting_AMF_SecurityConstraint_Custom"
+        result="resultHandler(event)"
+        fault="faultHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+            import mx.binding.utils.BindingUtils;
+            import mx.controls.Alert;
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+            import mx.messaging.config.ServerConfig;
+            import mx.rpc.AsyncResponder;
+            import mx.rpc.AsyncToken;
+            import mx.rpc.events.FaultEvent;
+            import mx.rpc.events.ResultEvent;
+
+            private function creationCompleteHandler():void
+            {
+                var target:TraceTarget = new TraceTarget();
+                target.includeLevel = true;
+                target.filters = ["mx.messaging.*", "mx.rpc.*"];
+                Log.addTarget(target);
+                
+                // Pre-initialize channelSet, so we can login and bind to authenticatedCB.
+                if (remoteObject.channelSet == null)
+                {
+                    remoteObject.channelSet = ServerConfig.getChannelSet(remoteObject.destination);
+                    BindingUtils.bindProperty(authenticatedCB, "selected", remoteObject.channelSet, "authenticated");
+                }
+            }
+
+            private function login(username:String, password:String):void
+            {
+                // Login and handle success or failure of authentication 
+                var token:AsyncToken = remoteObject.channelSet.login(username, password);
+                token.addResponder(new AsyncResponder(
+                    function(event:ResultEvent, token:Object=null):void 
+                    {
+                        switch(event.result) 
+                        {
+                            case "success":
+                                trace("authentication success");
+                            break;
+                            default:
+                                trace(event.result); 
+                        }
+                    },
+                    function(event:FaultEvent, token:Object=null):void
+                    {
+                        switch(event.fault.faultCode)
+                        {
+                            case "Client.Authentication":
+                            default:
+                                Alert.show("Login failure: " + event.fault.faultString);
+                        }
+                    }));
+            }
+
+            private function logout():void
+            {
+                // Logout and handle success or failure of authentication 
+                var token:AsyncToken = remoteObject.channelSet.logout();
+                token.addResponder(new AsyncResponder(
+                    function(event:ResultEvent, token:Object=null):void 
+                    {
+                        switch (event.result) 
+                        {
+                            case "success":
+                                authenticatedCB.selected = false;
+                            break;
+                            default:
+                                trace(event.result); 
+                        }
+                    },
+                    function(event:FaultEvent, token:Object=null):void
+                    {
+                        trace(event.fault);
+                    }));
+            }
+
+            private function resultHandler(event:ResultEvent):void
+            {
+                ta.text += "Server responded: "+ event.result + "\n";
+            }
+
+            private function faultHandler(event:FaultEvent):void
+            {
+                ta.text += "Received fault: " + event.fault + "\n";
+            }
+
+        ]]>
+    </mx:Script>
+
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/security-constraints/securityConstraint_Legacy.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/security-constraints/securityConstraint_Legacy.mxml b/apps/team/features/security-constraints/securityConstraint_Legacy.mxml
new file mode 100755
index 0000000..501c44c
--- /dev/null
+++ b/apps/team/features/security-constraints/securityConstraint_Legacy.mxml
@@ -0,0 +1,104 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
+    creationComplete="creationCompleteHandler();">
+
+    <!-- A simple remoting sample where client sends a text and server simply
+         echoes it back. The destination is secured using custom security constraint
+         where instead of a browser window for username and password, application 
+         itself handles authentication. 
+         
+         Note that this sample uses legacy authentication where RemoteObject#setCredentials 
+         are used instead of ChannelSet#login. This is not recommended.
+    -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>
+            <mx:Label text="Username"/>
+            <mx:TextInput id="unameTI" text="sampleuser"/>
+            <mx:Label text="Password"/>
+            <mx:TextInput id="passTI" text="samplepassword"/>
+            <mx:Button label="SetCredentials" click="setCredentials(unameTI.text, passTI.text)"/>
+            <mx:Button label="Logout" click="logout()"/>
+            <mx:CheckBox id="authenticatedCB" label="Authenticated?"/>
+        </mx:HBox>
+        <mx:HBox>
+            <mx:Label text="Enter a text for the server to echo"/>
+            <mx:TextInput id="ti" text="Hello World!"/>
+            <mx:Button label="Echo" click="remoteObject.echo(ti.text);"/>
+        </mx:HBox>
+        <mx:TextArea id="ta" width="100%" height="100%"/>
+    </mx:Panel>
+
+    <mx:RemoteObject id="remoteObject"
+        destination="remoting_AMF_SecurityConstraint_Custom"
+        result="resultHandler(event)"
+        fault="faultHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+            import mx.binding.utils.BindingUtils;
+            import mx.controls.Alert;
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+            import mx.messaging.config.ServerConfig;
+            import mx.rpc.AsyncResponder;
+            import mx.rpc.AsyncToken;
+            import mx.rpc.events.FaultEvent;
+            import mx.rpc.events.ResultEvent;
+
+            private function creationCompleteHandler():void
+            {
+                var target:TraceTarget = new TraceTarget();
+                target.includeLevel = true;
+                target.filters = ["mx.messaging.*", "mx.rpc.*"];
+                Log.addTarget(target);
+
+                // Pre-initialize channelSet, so we can bind to authenticatedCB.
+                if (remoteObject.channelSet == null)
+                {
+                    remoteObject.channelSet = ServerConfig.getChannelSet(remoteObject.destination);
+                    BindingUtils.bindProperty(authenticatedCB, "selected", remoteObject.channelSet, "authenticated");
+                }
+            }
+
+            private function setCredentials(username:String, password:String):void
+            {
+                remoteObject.setCredentials(username, password);
+            }
+
+            private function logout():void
+            {
+                remoteObject.logout();
+            }
+
+            private function resultHandler(event:ResultEvent):void
+            {
+                ta.text += "Server responded: "+ event.result + "\n";
+            }
+
+            private function faultHandler(event:FaultEvent):void
+            {
+                ta.text += "Received fault: " + event.fault + "\n";
+            }
+
+        ]]>
+    </mx:Script>
+
+</mx:Application>
\ No newline at end of file


[26/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/messaging/cluster/messaging_SecureAMF_Poll_Cluster.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/cluster/messaging_SecureAMF_Poll_Cluster.mxml b/apps/team/features/messaging/cluster/messaging_SecureAMF_Poll_Cluster.mxml
new file mode 100755
index 0000000..57367b6
--- /dev/null
+++ b/apps/team/features/messaging/cluster/messaging_SecureAMF_Poll_Cluster.mxml
@@ -0,0 +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>
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/messaging/cluster/messaging_SecureHTTP_Poll_Cluster.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/cluster/messaging_SecureHTTP_Poll_Cluster.mxml b/apps/team/features/messaging/cluster/messaging_SecureHTTP_Poll_Cluster.mxml
new file mode 100755
index 0000000..d5da650
--- /dev/null
+++ b/apps/team/features/messaging/cluster/messaging_SecureHTTP_Poll_Cluster.mxml
@@ -0,0 +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_SecureHTTP_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_SecureHTTP_Poll_Cluster"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_SecureHTTP_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/7a58369c/apps/team/features/messaging/customadapter/messaging_CustomAdapter.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/customadapter/messaging_CustomAdapter.mxml b/apps/team/features/messaging/customadapter/messaging_CustomAdapter.mxml
new file mode 100755
index 0000000..190b737
--- /dev/null
+++ b/apps/team/features/messaging/customadapter/messaging_CustomAdapter.mxml
@@ -0,0 +1,101 @@
+<?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();">
+
+    <!-- 
+        A sample that talks to a destination that has a custom Actionscript adapter.
+    -->
+    <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_CustomAdapter"
+        fault="faultHandler(event)"/>
+
+    <mx:Consumer id="consumer" 
+        destination="messaging_CustomAdapter"
+        acknowledge="ackHandler(event)"
+        fault="faultHandler(event)" 
+        message="messageHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+            import mx.messaging.events.MessageAckEvent;
+            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 ackHandler(event:MessageAckEvent):void
+            {
+                ta.text += "Consumer received ACK: " + event.message.body + "\n";
+            }
+
+            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/7a58369c/apps/team/features/messaging/discardedMessaging.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/discardedMessaging.mxml b/apps/team/features/messaging/discardedMessaging.mxml
new file mode 100755
index 0000000..d65c395
--- /dev/null
+++ b/apps/team/features/messaging/discardedMessaging.mxml
@@ -0,0 +1,119 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
+    creationComplete="creationCompleteHandler();">
+
+    <!-- An example where the client manually initiates a poll request without 
+         relying on polling-interval
+    -->
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>
+            <mx:Label text="Producer"/>
+            <mx:TextInput id="msgInput"/>
+            <mx:Button label="Send" 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="subscribeConsumer();" enabled="{!consumer.subscribed}"/>
+            <mx:Button label="Unsubscribe" click="consumer.unsubscribe();" enabled="{consumer.subscribed}"/>
+            <mx:Button label="Poll" click="poll();"/>
+            <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="dev/null"
+        fault="faultHandler(event)"/>
+
+    <mx:Consumer id="consumer" 
+        destination="dev/null"
+        fault="faultHandler(event)" 
+        message="messageHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+
+            import mx.messaging.events.MessageFaultEvent;
+            import mx.messaging.events.MessageEvent;
+
+            import mx.messaging.ChannelSet;
+            import mx.messaging.Producer;
+            import mx.messaging.Consumer;
+            import mx.messaging.channels.PollingChannel;
+            import mx.messaging.messages.AsyncMessage;
+
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+
+            public var pc:PollingChannel;
+
+            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 = msgInput.text;
+                producer.send(msg);
+            }
+
+            private function messageHandler(event:MessageEvent):void
+            {
+                ta.text += "Consumer: received message: "+ event.message.body + "\n";
+            }
+
+            private function faultHandler(event:Object):void
+            {
+                ta.text += "Received fault: " + event.faultString + "\n";
+            }
+
+            private function poll():void
+            {
+                ta.text += "Polling" + "\n";
+                if (!consumer.subscribed)
+                {
+                    subscribeConsumer();
+                }
+                pc.poll();
+            }
+
+            private function subscribeConsumer():void
+            {
+                ta.text += "Subscribing Consumer \n";
+                consumer.subscribe();
+
+                var pcs:ChannelSet = consumer.channelSet;
+                pc = PollingChannel(pcs.currentChannel);
+            }
+        ]]>
+    </mx:Script>
+
+</mx:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/messaging/jms/messaging_AMF_LongPoll_JMS_Topic.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/jms/messaging_AMF_LongPoll_JMS_Topic.mxml b/apps/team/features/messaging/jms/messaging_AMF_LongPoll_JMS_Topic.mxml
new file mode 100755
index 0000000..576f7f4
--- /dev/null
+++ b/apps/team/features/messaging/jms/messaging_AMF_LongPoll_JMS_Topic.mxml
@@ -0,0 +1,91 @@
+<?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();">
+
+    <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_LongPoll_JMS_Topic"
+        fault="faultHandler(event)"/>
+
+    <mx:Consumer id="consumer"
+        destination="messaging_AMF_LongPoll_JMS_Topic"
+        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/7a58369c/apps/team/features/messaging/jms/messaging_AMF_Poll_JMS_Queue.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/jms/messaging_AMF_Poll_JMS_Queue.mxml b/apps/team/features/messaging/jms/messaging_AMF_Poll_JMS_Queue.mxml
new file mode 100755
index 0000000..0e08155
--- /dev/null
+++ b/apps/team/features/messaging/jms/messaging_AMF_Poll_JMS_Queue.mxml
@@ -0,0 +1,91 @@
+<?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();">
+    
+    <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_JMS_Queue"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_AMF_Poll_JMS_Queue"
+        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/7a58369c/apps/team/features/messaging/jms/messaging_AMF_Poll_JMS_Topic.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/jms/messaging_AMF_Poll_JMS_Topic.mxml b/apps/team/features/messaging/jms/messaging_AMF_Poll_JMS_Topic.mxml
new file mode 100755
index 0000000..c75e5c3
--- /dev/null
+++ b/apps/team/features/messaging/jms/messaging_AMF_Poll_JMS_Topic.mxml
@@ -0,0 +1,91 @@
+<?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();">
+    
+    <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_JMS_Topic"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_AMF_Poll_JMS_Topic"
+        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/7a58369c/apps/team/features/messaging/jms/messaging_HTTP_Poll_JMS_Queue.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/jms/messaging_HTTP_Poll_JMS_Queue.mxml b/apps/team/features/messaging/jms/messaging_HTTP_Poll_JMS_Queue.mxml
new file mode 100755
index 0000000..dda51fe
--- /dev/null
+++ b/apps/team/features/messaging/jms/messaging_HTTP_Poll_JMS_Queue.mxml
@@ -0,0 +1,91 @@
+<?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();">
+    
+    <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_JMS_Queue"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_HTTP_Poll_JMS_Queue"
+        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/7a58369c/apps/team/features/messaging/jms/messaging_HTTP_Poll_JMS_Topic.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/jms/messaging_HTTP_Poll_JMS_Topic.mxml b/apps/team/features/messaging/jms/messaging_HTTP_Poll_JMS_Topic.mxml
new file mode 100755
index 0000000..c8306af
--- /dev/null
+++ b/apps/team/features/messaging/jms/messaging_HTTP_Poll_JMS_Topic.mxml
@@ -0,0 +1,91 @@
+<?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();">
+    
+    <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_JMS_Topic"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_HTTP_Poll_JMS_Topic"
+        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/7a58369c/apps/team/features/messaging/messaging_AMF.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/messaging_AMF.mxml b/apps/team/features/messaging/messaging_AMF.mxml
new file mode 100755
index 0000000..5ff2534
--- /dev/null
+++ b/apps/team/features/messaging/messaging_AMF.mxml
@@ -0,0 +1,121 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
+    creationComplete="creationCompleteHandler();">
+
+    <!-- An example where the client manually initiates a poll request without 
+         relying on polling-interval
+    -->
+    <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="subscribeConsumer();" enabled="{!consumer.subscribed}"/>
+            <mx:Button label="Unsubscribe" click="consumer.unsubscribe();" enabled="{consumer.subscribed}"/>
+            <mx:Button label="Poll" click="poll();"/>
+            <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"
+        fault="faultHandler(event)"/>
+
+    <mx:Consumer id="consumer" 
+        destination="messaging_AMF"
+        fault="faultHandler(event)" 
+        message="messageHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+
+            import mx.messaging.events.MessageFaultEvent;
+            import mx.messaging.events.MessageEvent;
+
+            import mx.messaging.ChannelSet;
+            import mx.messaging.Producer;
+            import mx.messaging.Consumer;
+            import mx.messaging.channels.PollingChannel;
+            import mx.messaging.messages.AsyncMessage;
+
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+
+            public var pc:PollingChannel;
+
+            [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:Object):void
+            {
+                ta.text += "Received fault: " + event.faultString + "\n";
+            }
+
+            private function poll():void
+            {
+                ta.text += "Polling" + "\n";
+                if (!consumer.subscribed)
+                {
+                    subscribeConsumer();
+                }
+                pc.poll();
+            }
+
+            private function subscribeConsumer():void
+            {
+                ta.text += "Subscribing Consumer \n";
+                consumer.subscribe();
+
+                var pcs:ChannelSet = consumer.channelSet;
+                pc = PollingChannel(pcs.currentChannel);
+            }
+        ]]>
+    </mx:Script>
+
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/messaging/messaging_AMF_LongPoll.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/messaging_AMF_LongPoll.mxml b/apps/team/features/messaging/messaging_AMF_LongPoll.mxml
new file mode 100755
index 0000000..dfa7593
--- /dev/null
+++ b/apps/team/features/messaging/messaging_AMF_LongPoll.mxml
@@ -0,0 +1,91 @@
+<?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();">
+    
+    <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_LongPoll"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_AMF_LongPoll"
+        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/7a58369c/apps/team/features/messaging/messaging_AMF_Piggyback.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/messaging_AMF_Piggyback.mxml b/apps/team/features/messaging/messaging_AMF_Piggyback.mxml
new file mode 100755
index 0000000..9312b8c
--- /dev/null
+++ b/apps/team/features/messaging/messaging_AMF_Piggyback.mxml
@@ -0,0 +1,104 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
+    creationComplete="creationCompleteHandler();">
+
+    <!-- An example where the client relies on piggybacking for server updates.
+         The intended use for piggybacking is to support very light-weight psuedo-polling,
+         where rather than the client channel polling the server on a fixed or adaptive interval,
+         when the client sends a non-command message to the server (via a Producer or RemoteObject or DataService)
+         we'll piggyback any pending data for the client's messaging or data management subscriptions
+         along with the response to the client's message. Piggybacking can also be used
+         on a channel that has polling enabled but on a wide interval like 5 or 10 seconds or more,
+         in which case the app will feel more responsive if the client is sending messages to the server.
+    -->
+    <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_Piggyback"
+        fault="faultHandler(event)"/>
+
+    <mx:Consumer id="consumer"
+        destination="messaging_AMF_Piggyback"
+        fault="faultHandler(event)"
+        message="messageHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+
+            import mx.messaging.events.MessageFaultEvent;
+            import mx.messaging.events.MessageEvent;
+
+            import mx.messaging.ChannelSet;
+            import mx.messaging.Producer;
+            import mx.messaging.Consumer;
+            import mx.messaging.messages.AsyncMessage;
+
+            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:Object):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/7a58369c/apps/team/features/messaging/messaging_AMF_Poll.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/messaging_AMF_Poll.mxml b/apps/team/features/messaging/messaging_AMF_Poll.mxml
new file mode 100755
index 0000000..5dba032
--- /dev/null
+++ b/apps/team/features/messaging/messaging_AMF_Poll.mxml
@@ -0,0 +1,91 @@
+<?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();">
+    
+    <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"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_AMF_Poll"
+        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/7a58369c/apps/team/features/messaging/messaging_AMF_Stream.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/messaging_AMF_Stream.mxml b/apps/team/features/messaging/messaging_AMF_Stream.mxml
new file mode 100755
index 0000000..c134fbb
--- /dev/null
+++ b/apps/team/features/messaging/messaging_AMF_Stream.mxml
@@ -0,0 +1,91 @@
+<?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();">
+    
+    <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_Stream"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_AMF_Stream"
+        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/7a58369c/apps/team/features/messaging/messaging_HTTP.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/messaging_HTTP.mxml b/apps/team/features/messaging/messaging_HTTP.mxml
new file mode 100755
index 0000000..7491e2b
--- /dev/null
+++ b/apps/team/features/messaging/messaging_HTTP.mxml
@@ -0,0 +1,117 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
+    creationComplete="creationCompleteHandler();">
+    
+    <!-- An example where the client manually initiates a poll request without 
+         relying on polling-interval
+    -->
+    <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();"/>
+        </mx:HBox>
+        <mx:HBox>
+            <mx:Label text="Consumer"/>
+            <mx:Button label="Subcribe" click="subscribeConsumer();" enabled="{!consumer.subscribed}"/>
+            <mx:Button label="Unsubscribe" click="consumer.unsubscribe();" enabled="{consumer.subscribed}"/>
+            <mx:Button label="Poll" click="poll();"/>
+            <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"
+        fault="faultHandler(event)"/>
+
+    <mx:Consumer id="consumer" 
+        destination="messaging_HTTP"
+        fault="faultHandler(event)" 
+        message="messageHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+            import mx.messaging.events.MessageFaultEvent;
+            import mx.messaging.events.MessageEvent;
+
+            import mx.messaging.ChannelSet;
+            import mx.messaging.Producer;
+            import mx.messaging.Consumer;
+            import mx.messaging.channels.PollingChannel;
+            import mx.messaging.messages.AsyncMessage;
+
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+
+            public var pc:PollingChannel;
+
+            [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:Object):void
+            {
+                ta.text += "Received fault: " + event.faultString + "\n";
+            }
+
+            private function poll():void
+            {
+                ta.text += "Polling" + "\n";
+	            if (!consumer.subscribed)
+	                subscribeConsumer();
+                pc.poll();
+            }
+
+            private function subscribeConsumer():void
+            {
+                ta.text += "Subscribing Consumer \n";
+                consumer.subscribe();  
+
+                var pcs:ChannelSet = consumer.channelSet;
+                pc = PollingChannel(pcs.currentChannel);
+            }
+        ]]>
+    </mx:Script>
+
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/messaging/messaging_HTTP_LongPoll.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/messaging_HTTP_LongPoll.mxml b/apps/team/features/messaging/messaging_HTTP_LongPoll.mxml
new file mode 100755
index 0000000..233c2be
--- /dev/null
+++ b/apps/team/features/messaging/messaging_HTTP_LongPoll.mxml
@@ -0,0 +1,91 @@
+<?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();">
+    
+    <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_LongPoll"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_HTTP_LongPoll"
+        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/7a58369c/apps/team/features/messaging/messaging_HTTP_Piggyback.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/messaging_HTTP_Piggyback.mxml b/apps/team/features/messaging/messaging_HTTP_Piggyback.mxml
new file mode 100755
index 0000000..244263d
--- /dev/null
+++ b/apps/team/features/messaging/messaging_HTTP_Piggyback.mxml
@@ -0,0 +1,104 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
+    creationComplete="creationCompleteHandler();">
+
+    <!-- An example where the client relies on piggybacking for server updates.
+         The intended use for piggybacking is to support very light-weight psuedo-polling,
+         where rather than the client channel polling the server on a fixed or adaptive interval,
+         when the client sends a non-command message to the server (via a Producer or RemoteObject or DataService)
+         we'll piggyback any pending data for the client's messaging or data management subscriptions
+         along with the response to the client's message. Piggybacking can also be used
+         on a channel that has polling enabled but on a wide interval like 5 or 10 seconds or more,
+         in which case the app will feel more responsive if the client is sending messages to the server.
+    -->
+    <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_Piggyback"
+        fault="faultHandler(event)"/>
+
+    <mx:Consumer id="consumer"
+        destination="messaging_HTTP_Piggyback"
+        fault="faultHandler(event)"
+        message="messageHandler(event)"/>
+
+    <mx:Script>
+        <![CDATA[
+
+            import mx.messaging.events.MessageFaultEvent;
+            import mx.messaging.events.MessageEvent;
+
+            import mx.messaging.ChannelSet;
+            import mx.messaging.Producer;
+            import mx.messaging.Consumer;
+            import mx.messaging.messages.AsyncMessage;
+
+            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:Object):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/7a58369c/apps/team/features/messaging/messaging_HTTP_Poll.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/messaging_HTTP_Poll.mxml b/apps/team/features/messaging/messaging_HTTP_Poll.mxml
new file mode 100755
index 0000000..d385345
--- /dev/null
+++ b/apps/team/features/messaging/messaging_HTTP_Poll.mxml
@@ -0,0 +1,91 @@
+<?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();">
+    
+    <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"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_HTTP_Poll"
+        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/7a58369c/apps/team/features/messaging/messaging_HTTP_Stream.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/messaging_HTTP_Stream.mxml b/apps/team/features/messaging/messaging_HTTP_Stream.mxml
new file mode 100755
index 0000000..51516dc
--- /dev/null
+++ b/apps/team/features/messaging/messaging_HTTP_Stream.mxml
@@ -0,0 +1,91 @@
+<?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();">
+    
+    <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_Stream"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_HTTP_Stream"
+        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


[36/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/history/history.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/history/history.js b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/history/history.js
new file mode 100755
index 0000000..0f82450
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/history/history.js
@@ -0,0 +1,722 @@
+/*
+ * 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.
+ */
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        ie8: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+        if (browser.version == 8)
+        {
+            browser.ie = false;
+            browser.ie8 = true;
+        }
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    function hashChangeHandler()
+    {
+        currentHref = document.location.href;
+        var flexAppUrl = getHash();
+        //ADR: to fix multiple
+        if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+            var pl = getPlayers();
+            for (var i = 0; i < pl.length; i++) {
+                pl[i].browserURLChange(flexAppUrl);
+            }
+        } else {
+            getPlayer().browserURLChange(flexAppUrl);
+        }
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+        var i;
+
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+                for (i = 0; i < o.length; i++) {
+                    if (typeof o[i].browserURLChange != "undefined")
+                        return o[i];
+                }
+                for (i = 0; i < e.length; i++) {
+                    if (typeof e[i].browserURLChange != "undefined")
+                        return e[i];
+                }
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+            for (i = 0; i < e.length; i++) {
+                if (typeof e[i].browserURLChange != "undefined")
+                {
+                    return e[i];
+                }
+            }
+            for (i = 0; i < o.length; i++) {
+                if (typeof o[i].browserURLChange != "undefined")
+                {
+                    return o[i];
+                }
+            }
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var i;
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+                        currentHref = document.location.href;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                var flexAppUrl = getHash();
+                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
+                {    
+                    // If it did change and we're running Safari 3.x or earlier, 
+                    // then we have to look the old state up in our hand-maintained 
+                    // array since document.location.hash won't have changed, 
+                    // then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                    flexAppUrl = historyHash[currentHistoryLength];
+                }
+
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            iframe.src = 'javascript:false;'; 
+
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox || browser.ie8)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+
+        if (browser.ie8)        
+            document.body.onhashchange = hashChangeHandler;
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        },
+        getUserAgent: function() {
+            return navigator.userAgent;
+        },
+        getPlatform: function() {
+            return navigator.platform;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/history/historyFrame.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/history/historyFrame.html b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/history/historyFrame.html
new file mode 100755
index 0000000..63bdd3e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/history/historyFrame.html
@@ -0,0 +1,45 @@
+<!--
+  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>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/index.template.html b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/index.template.html
new file mode 100755
index 0000000..e3e9c81
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/swfobject.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/swfobject.js b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/swfobject.js
new file mode 100755
index 0000000..07730fa
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/html-template/swfobject.js
@@ -0,0 +1,793 @@
+/*
+ * 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.
+ */
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+	
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+		ON_READY_STATE_CHANGE = "onreadystatechange",
+		
+		win = window,
+		doc = document,
+		nav = navigator,
+		
+		plugin = false,
+		domLoadFnArr = [main],
+		regObjArr = [],
+		objIdArr = [],
+		listenersArr = [],
+		storedAltContent,
+		storedAltContentId,
+		storedCallbackFn,
+		storedCallbackObj,
+		isDomLoaded = false,
+		isExpressInstallActive = false,
+		dynamicStylesheet,
+		dynamicStylesheetMedia,
+		autoHideShow = true,
+	
+	/* Centralized function for browser feature detection
+		- User agent string detection is only used when no good alternative is possible
+		- Is executed directly for optimal performance
+	*/	
+	ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+			u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+				plugin = true;
+				ie = false; // cascaded feature detection for Internet Explorer
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			try {
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+				if (a) { // a will return null when ActiveX is disabled
+					d = a.GetVariable("$version");
+					if (d) {
+						ie = true; // cascaded feature detection for Internet Explorer
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+			}
+			catch(e) {}
+		}
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+	}(),
+	
+	/* Cross-browser onDomLoad
+		- Will fire an event as soon as the DOM of a web page is loaded
+		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+		- Regular onload serves as fallback
+	*/ 
+	onDomLoad = function() {
+		if (!ua.w3) { return; }
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+			callDomLoadFunctions();
+		}
+		if (!isDomLoaded) {
+			if (typeof doc.addEventListener != UNDEF) {
+				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+			}		
+			if (ua.ie && ua.win) {
+				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+					if (doc.readyState == "complete") {
+						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+						callDomLoadFunctions();
+					}
+				});
+				if (win == top) { // if not inside an iframe
+					(function(){
+						if (isDomLoaded) { return; }
+						try {
+							doc.documentElement.doScroll("left");
+						}
+						catch(e) {
+							setTimeout(arguments.callee, 0);
+							return;
+						}
+						callDomLoadFunctions();
+					})();
+				}
+			}
+			if (ua.wk) {
+				(function(){
+					if (isDomLoaded) { return; }
+					if (!/loaded|complete/.test(doc.readyState)) {
+						setTimeout(arguments.callee, 0);
+						return;
+					}
+					callDomLoadFunctions();
+				})();
+			}
+			addLoadEvent(callDomLoadFunctions);
+		}
+	}();
+	
+	function callDomLoadFunctions() {
+		if (isDomLoaded) { return; }
+		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+			t.parentNode.removeChild(t);
+		}
+		catch (e) { return; }
+		isDomLoaded = true;
+		var dl = domLoadFnArr.length;
+		for (var i = 0; i < dl; i++) {
+			domLoadFnArr[i]();
+		}
+	}
+	
+	function addDomLoadEvent(fn) {
+		if (isDomLoaded) {
+			fn();
+		}
+		else { 
+			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+		}
+	}
+	
+	/* Cross-browser onload
+		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+		- Will fire an event as soon as a web page including all of its assets are loaded 
+	 */
+	function addLoadEvent(fn) {
+		if (typeof win.addEventListener != UNDEF) {
+			win.addEventListener("load", fn, false);
+		}
+		else if (typeof doc.addEventListener != UNDEF) {
+			doc.addEventListener("load", fn, false);
+		}
+		else if (typeof win.attachEvent != UNDEF) {
+			addListener(win, "onload", fn);
+		}
+		else if (typeof win.onload == "function") {
+			var fnOld = win.onload;
+			win.onload = function() {
+				fnOld();
+				fn();
+			};
+		}
+		else {
+			win.onload = fn;
+		}
+	}
+	
+	/* Main function
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
+	*/
+	function main() { 
+		if (plugin) {
+			testPlayerVersion();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Detect the Flash Player version for non-Internet Explorer browsers
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+		  a. Both release and build numbers can be detected
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+	*/
+	function testPlayerVersion() {
+		var b = doc.getElementsByTagName("body")[0];
+		var o = createElement(OBJECT);
+		o.setAttribute("type", FLASH_MIME_TYPE);
+		var t = b.appendChild(o);
+		if (t) {
+			var counter = 0;
+			(function(){
+				if (typeof t.GetVariable != UNDEF) {
+					var d = t.GetVariable("$version");
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				else if (counter < 10) {
+					counter++;
+					setTimeout(arguments.callee, 10);
+					return;
+				}
+				b.removeChild(o);
+				t = null;
+				matchVersions();
+			})();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Perform Flash Player and SWF version matching; static publishing only
+	*/
+	function matchVersions() {
+		var rl = regObjArr.length;
+		if (rl > 0) {
+			for (var i = 0; i < rl; i++) { // for each registered object element
+				var id = regObjArr[i].id;
+				var cb = regObjArr[i].callbackFn;
+				var cbObj = {success:false, id:id};
+				if (ua.pv[0] > 0) {
+					var obj = getElementById(id);
+					if (obj) {
+						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+							setVisibility(id, true);
+							if (cb) {
+								cbObj.success = true;
+								cbObj.ref = getObjectById(id);
+								cb(cbObj);
+							}
+						}
+						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+							var att = {};
+							att.data = regObjArr[i].expressInstall;
+							att.width = obj.getAttribute("width") || "0";
+							att.height = obj.getAttribute("height") || "0";
+							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+							// parse HTML object param element's name-value pairs
+							var par = {};
+							var p = obj.getElementsByTagName("param");
+							var pl = p.length;
+							for (var j = 0; j < pl; j++) {
+								if (p[j].getAttribute("name").toLowerCase() != "movie") {
+									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+								}
+							}
+							showExpressInstall(att, par, id, cb);
+						}
+						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+							displayAltContent(obj);
+							if (cb) { cb(cbObj); }
+						}
+					}
+				}
+				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+					setVisibility(id, true);
+					if (cb) {
+						var o = getObjectById(id); // test whether there is an HTML object element or not
+						if (o && typeof o.SetVariable != UNDEF) { 
+							cbObj.success = true;
+							cbObj.ref = o;
+						}
+						cb(cbObj);
+					}
+				}
+			}
+		}
+	}
+	
+	function getObjectById(objectIdStr) {
+		var r = null;
+		var o = getElementById(objectIdStr);
+		if (o && o.nodeName == "OBJECT") {
+			if (typeof o.SetVariable != UNDEF) {
+				r = o;
+			}
+			else {
+				var n = o.getElementsByTagName(OBJECT)[0];
+				if (n) {
+					r = n;
+				}
+			}
+		}
+		return r;
+	}
+	
+	/* Requirements for Adobe Express Install
+		- only one instance can be active at a time
+		- fp 6.0.65 or higher
+		- Win/Mac OS only
+		- no Webkit engines older than version 312
+	*/
+	function canExpressInstall() {
+		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+	}
+	
+	/* Show the Adobe Express Install dialog
+		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+	*/
+	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+		isExpressInstallActive = true;
+		storedCallbackFn = callbackFn || null;
+		storedCallbackObj = {success:false, id:replaceElemIdStr};
+		var obj = getElementById(replaceElemIdStr);
+		if (obj) {
+			if (obj.nodeName == "OBJECT") { // static publishing
+				storedAltContent = abstractAltContent(obj);
+				storedAltContentId = null;
+			}
+			else { // dynamic publishing
+				storedAltContent = obj;
+				storedAltContentId = replaceElemIdStr;
+			}
+			att.id = EXPRESS_INSTALL_ID;
+			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+				fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+			if (typeof par.flashvars != UNDEF) {
+				par.flashvars += "&" + fv;
+			}
+			else {
+				par.flashvars = fv;
+			}
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			if (ua.ie && ua.win && obj.readyState != 4) {
+				var newObj = createElement("div");
+				replaceElemIdStr += "SWFObjectNew";
+				newObj.setAttribute("id", replaceElemIdStr);
+				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						obj.parentNode.removeChild(obj);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			createSWF(att, par, replaceElemIdStr);
+		}
+	}
+	
+	/* Functions to abstract and display alternative content
+	*/
+	function displayAltContent(obj) {
+		if (ua.ie && ua.win && obj.readyState != 4) {
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			var el = createElement("div");
+			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+			el.parentNode.replaceChild(abstractAltContent(obj), el);
+			obj.style.display = "none";
+			(function(){
+				if (obj.readyState == 4) {
+					obj.parentNode.removeChild(obj);
+				}
+				else {
+					setTimeout(arguments.callee, 10);
+				}
+			})();
+		}
+		else {
+			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+		}
+	} 
+
+	function abstractAltContent(obj) {
+		var ac = createElement("div");
+		if (ua.win && ua.ie) {
+			ac.innerHTML = obj.innerHTML;
+		}
+		else {
+			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+			if (nestedObj) {
+				var c = nestedObj.childNodes;
+				if (c) {
+					var cl = c.length;
+					for (var i = 0; i < cl; i++) {
+						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+							ac.appendChild(c[i].cloneNode(true));
+						}
+					}
+				}
+			}
+		}
+		return ac;
+	}
+	
+	/* Cross-browser dynamic SWF creation
+	*/
+	function createSWF(attObj, parObj, id) {
+		var r, el = getElementById(id);
+		if (ua.wk && ua.wk < 312) { return r; }
+		if (el) {
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+				attObj.id = id;
+			}
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+				var att = "";
+				for (var i in attObj) {
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+						if (i.toLowerCase() == "data") {
+							parObj.movie = attObj[i];
+						}
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							att += ' class="' + attObj[i] + '"';
+						}
+						else if (i.toLowerCase() != "classid") {
+							att += ' ' + i + '="' + attObj[i] + '"';
+						}
+					}
+				}
+				var par = "";
+				for (var j in parObj) {
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+					}
+				}
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+				r = getElementById(attObj.id);	
+			}
+			else { // well-behaving browsers
+				var o = createElement(OBJECT);
+				o.setAttribute("type", FLASH_MIME_TYPE);
+				for (var m in attObj) {
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							o.setAttribute("class", attObj[m]);
+						}
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+							o.setAttribute(m, attObj[m]);
+						}
+					}
+				}
+				for (var n in parObj) {
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+						createObjParam(o, n, parObj[n]);
+					}
+				}
+				el.parentNode.replaceChild(o, el);
+				r = o;
+			}
+		}
+		return r;
+	}
+	
+	function createObjParam(el, pName, pValue) {
+		var p = createElement("param");
+		p.setAttribute("name", pName);	
+		p.setAttribute("value", pValue);
+		el.appendChild(p);
+	}
+	
+	/* Cross-browser SWF removal
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
+	*/
+	function removeSWF(id) {
+		var obj = getElementById(id);
+		if (obj && obj.nodeName == "OBJECT") {
+			if (ua.ie && ua.win) {
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						removeObjectInIE(id);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			else {
+				obj.parentNode.removeChild(obj);
+			}
+		}
+	}
+	
+	function removeObjectInIE(id) {
+		var obj = getElementById(id);
+		if (obj) {
+			for (var i in obj) {
+				if (typeof obj[i] == "function") {
+					obj[i] = null;
+				}
+			}
+			obj.parentNode.removeChild(obj);
+		}
+	}
+	
+	/* Functions to optimize JavaScript compression
+	*/
+	function getElementById(id) {
+		var el = null;
+		try {
+			el = doc.getElementById(id);
+		}
+		catch (e) {}
+		return el;
+	}
+	
+	function createElement(el) {
+		return doc.createElement(el);
+	}
+	
+	/* Updated attachEvent function for Internet Explorer
+		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+	*/	
+	function addListener(target, eventType, fn) {
+		target.attachEvent(eventType, fn);
+		listenersArr[listenersArr.length] = [target, eventType, fn];
+	}
+	
+	/* Flash Player and SWF content version matching
+	*/
+	function hasPlayerVersion(rv) {
+		var pv = ua.pv, v = rv.split(".");
+		v[0] = parseInt(v[0], 10);
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+		v[2] = parseInt(v[2], 10) || 0;
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+	}
+	
+	/* Cross-browser dynamic CSS creation
+		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+	*/	
+	function createCSS(sel, decl, media, newStyle) {
+		if (ua.ie && ua.mac) { return; }
+		var h = doc.getElementsByTagName("head")[0];
+		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+		var m = (media && typeof media == "string") ? media : "screen";
+		if (newStyle) {
+			dynamicStylesheet = null;
+			dynamicStylesheetMedia = null;
+		}
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+			// create dynamic stylesheet + get a global reference to it
+			var s = createElement("style");
+			s.setAttribute("type", "text/css");
+			s.setAttribute("media", m);
+			dynamicStylesheet = h.appendChild(s);
+			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+			}
+			dynamicStylesheetMedia = m;
+		}
+		// add style rule
+		if (ua.ie && ua.win) {
+			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+				dynamicStylesheet.addRule(sel, decl);
+			}
+		}
+		else {
+			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+			}
+		}
+	}
+	
+	function setVisibility(id, isVisible) {
+		if (!autoHideShow) { return; }
+		var v = isVisible ? "visible" : "hidden";
+		if (isDomLoaded && getElementById(id)) {
+			getElementById(id).style.visibility = v;
+		}
+		else {
+			createCSS("#" + id, "visibility:" + v);
+		}
+	}
+
+	/* Filter to avoid XSS attacks
+	*/
+	function urlEncodeIfNecessary(s) {
+		var regex = /[\\\"<>\.;]/;
+		var hasBadChars = regex.exec(s) != null;
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+	}
+	
+	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+	*/
+	var cleanup = function() {
+		if (ua.ie && ua.win) {
+			window.attachEvent("onunload", function() {
+				// remove listeners to avoid memory leaks
+				var ll = listenersArr.length;
+				for (var i = 0; i < ll; i++) {
+					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+				}
+				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+				var il = objIdArr.length;
+				for (var j = 0; j < il; j++) {
+					removeSWF(objIdArr[j]);
+				}
+				// cleanup library's main closures to avoid memory leaks
+				for (var k in ua) {
+					ua[k] = null;
+				}
+				ua = null;
+				for (var l in swfobject) {
+					swfobject[l] = null;
+				}
+				swfobject = null;
+			});
+		}
+	}();
+	
+	return {
+		/* Public API
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
+		*/ 
+		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+			if (ua.w3 && objectIdStr && swfVersionStr) {
+				var regObj = {};
+				regObj.id = objectIdStr;
+				regObj.swfVersion = swfVersionStr;
+				regObj.expressInstall = xiSwfUrlStr;
+				regObj.callbackFn = callbackFn;
+				regObjArr[regObjArr.length] = regObj;
+				setVisibility(objectIdStr, false);
+			}
+			else if (callbackFn) {
+				callbackFn({success:false, id:objectIdStr});
+			}
+		},
+		
+		getObjectById: function(objectIdStr) {
+			if (ua.w3) {
+				return getObjectById(objectIdStr);
+			}
+		},
+		
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+			var callbackObj = {success:false, id:replaceElemIdStr};
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+				setVisibility(replaceElemIdStr, false);
+				addDomLoadEvent(function() {
+					widthStr += ""; // auto-convert to string
+					heightStr += "";
+					var att = {};
+					if (attObj && typeof attObj === OBJECT) {
+						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+							att[i] = attObj[i];
+						}
+					}
+					att.data = swfUrlStr;
+					att.width = widthStr;
+					att.height = heightStr;
+					var par = {}; 
+					if (parObj && typeof parObj === OBJECT) {
+						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+							par[j] = parObj[j];
+						}
+					}
+					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+							if (typeof par.flashvars != UNDEF) {
+								par.flashvars += "&" + k + "=" + flashvarsObj[k];
+							}
+							else {
+								par.flashvars = k + "=" + flashvarsObj[k];
+							}
+						}
+					}
+					if (hasPlayerVersion(swfVersionStr)) { // create SWF
+						var obj = createSWF(att, par, replaceElemIdStr);
+						if (att.id == replaceElemIdStr) {
+							setVisibility(replaceElemIdStr, true);
+						}
+						callbackObj.success = true;
+						callbackObj.ref = obj;
+					}
+					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+						att.data = xiSwfUrlStr;
+						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+						return;
+					}
+					else { // show alternative content
+						setVisibility(replaceElemIdStr, true);
+					}
+					if (callbackFn) { callbackFn(callbackObj); }
+				});
+			}
+			else if (callbackFn) { callbackFn(callbackObj);	}
+		},
+		
+		switchOffAutoHideShow: function() {
+			autoHideShow = false;
+		},
+		
+		ua: ua,
+		
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		},
+		
+		hasFlashPlayerVersion: hasPlayerVersion,
+		
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
+			if (ua.w3) {
+				return createSWF(attObj, parObj, replaceElemIdStr);
+			}
+			else {
+				return undefined;
+			}
+		},
+		
+		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+			if (ua.w3 && canExpressInstall()) {
+				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+			}
+		},
+		
+		removeSWF: function(objElemIdStr) {
+			if (ua.w3) {
+				removeSWF(objElemIdStr);
+			}
+		},
+		
+		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+			if (ua.w3) {
+				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+			}
+		},
+		
+		addDomLoadEvent: addDomLoadEvent,
+		
+		addLoadEvent: addLoadEvent,
+		
+		getQueryParamValue: function(param) {
+			var q = doc.location.search || doc.location.hash;
+			if (q) {
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+				if (param == null) {
+					return urlEncodeIfNecessary(q);
+				}
+				var pairs = q.split("&");
+				for (var i = 0; i < pairs.length; i++) {
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+					}
+				}
+			}
+			return "";
+		},
+		
+		// For internal usage only
+		expressInstallCallback: function() {
+			if (isExpressInstallActive) {
+				var obj = getElementById(EXPRESS_INSTALL_ID);
+				if (obj && storedAltContent) {
+					obj.parentNode.replaceChild(storedAltContent, obj);
+					if (storedAltContentId) {
+						setVisibility(storedAltContentId, true);
+						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+					}
+					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+				}
+				isExpressInstallActive = false;
+			} 
+		}
+	};
+}();

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/src/Main.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/src/Main.mxml b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/src/Main.mxml
new file mode 100755
index 0000000..f44d71e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-101/src/Main.mxml
@@ -0,0 +1,39 @@
+<?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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx">
+
+	<fx:Declarations>
+		<!-- "productService" is defined in Spring's configuration file WEB-INF/config/web-application-config.xml
+		and provides remote access to the org.springframework.flex.samples.product.ProductDAO class --> 
+		<s:RemoteObject id="ro" destination="productService" endpoint="{&apos;http://{server.name}:{server.port}/samples-spring/messagebroker/amf&apos;}"/>
+	</fx:Declarations>
+
+	<s:layout>
+		<s:VerticalLayout/>
+	</s:layout>
+	
+	<mx:DataGrid dataProvider="{ro.findAll.lastResult}" width="100%" height="100%"/>
+	
+	<!-- the findAll() method is defined in org.springframework.flex.samples.product.ProductDAO -->
+	<s:Button label="Get Data" click="ro.findAll()"/>
+
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/.actionScriptProperties b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/.actionScriptProperties
new file mode 100755
index 0000000..4cf4c69
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="Main.mxml" projectUUID="a11f3dd4-3678-494b-b759-bb8260c1c8bb" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="Main.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/.flexProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/.flexProperties b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/.flexProperties
new file mode 100755
index 0000000..1d99468
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/.flexProperties
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/.project b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/.project
new file mode 100755
index 0000000..8b82afb
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/.project
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>spring-blazeds-security-101</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/build.xml b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/build.xml
new file mode 100755
index 0000000..d36a89c
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/build.xml
@@ -0,0 +1,76 @@
+<?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-spring.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="context.root" value="samples-spring" />
+    <property name="application.name" value="spring-blazeds-security-101" />
+    <property name="application.file" value="Main" />
+    <property name="application.bin.dir" value="${samples-spring.war}/spring-blazeds-security-101" />
+    <property name="application.src.dir" value="${samples-spring.war}/WEB-INF/flex-src/spring-blazeds-security-101/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-spring.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"
+            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-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/history/history.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/history/history.css b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/history/history.css
new file mode 100755
index 0000000..4a7f791
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/history/history.css
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }


[14/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/build.xml
----------------------------------------------------------------------
diff --git a/modules/core/build.xml b/modules/core/build.xml
new file mode 100755
index 0000000..8812542
--- /dev/null
+++ b/modules/core/build.xml
@@ -0,0 +1,244 @@
+<?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="modules/core/build.xml" default="main" basedir="../..">
+
+    <!-- properties -->
+    <property file="${basedir}/build.properties"/>
+    <property name="module.dir" value="${basedir}/modules/core"/>
+    <property name="test.dir" value="${module.dir}/test/src"/>
+
+    <!-- to exclude tests, add test.excludes to local.properties -->
+    <property file="${test.dir}/local.properties"/>
+    <!-- Set up feature to can run subset of tests -->
+    <property file="${qa.dir}/features/${feature}.properties" /> <!-- includes only feature -->
+    <property file="${qa.dir}/features/full.properties" />       <!-- includes all filesets -->
+
+    <property name="lib.dir" value="${basedir}/lib"/>
+    <property name="module.lib.dir" location="${module.dir}/lib"/>
+    <property name="tomcat.lib.dir" location="${basedir}/servers/apache-tomcat-6.0.29/lib" />
+    <property name="module.src" value="${module.dir}/src"/>
+    <property name="module.classes" value="${module.dir}/classes"/>
+    <property name="module.jar" value="${lib.dir}/flex-messaging-core.jar"/>
+    <property name="module.test.src" value="${module.dir}/test/src"/>
+    <property name="module.test.classes" value="${module.dir}/test/classes"/>
+    <property name="module.dist.dir" value="${basedir}/dist/source"/>
+    <property name="common.src" value="${basedir}/modules/common/src"/>
+
+    <property name="remoting.src" value="${basedir}/modules/remoting/src"/>
+    <property name="proxy.src" value="${basedir}/modules/proxy/src"/>
+    <property name="opt.src" value="${basedir}/modules/opt/src"/>    
+
+    <property name="build.number" value=""/>
+
+    <!-- j2ee apis required to compile -->
+    <path id="classpath">
+        <fileset dir="${lib.dir}" includes="**/*.jar"/>
+        <fileset dir="${module.lib.dir}" includes="**/*.jar"/>
+        <fileset dir="${tomcat.lib.dir}" includes="**/*.jar"/>
+    </path>
+
+    <path id="test.classpath">
+        <fileset dir="${lib.dir}" includes="**/*.jar" excludes="adt.jar" />
+        <pathelement location="${module.test.classes}"/>
+    </path>
+
+    <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
+
+    <target name="main" depends="clean,prepare,run-depend,jar" description="cleans and runs the full build"/>
+    <target name="dev" depends="prepare,run-depend,jar" description="runs src.depend build for development"/>
+
+    <target name="prepare">
+        <mkdir dir="${lib.dir}"/>
+        <mkdir dir="${module.classes}"/>
+    </target>
+
+    <target name="run-depend" if="src.depend">
+        <echo message="Removing class files that changed and dependent class files."/>
+        <depend cache="${module.classes}" srcdir="${module.src}" destdir="${module.classes}"/>
+    </target>
+
+    <target name="compile" depends="prepare" description="compile">
+        <javac debug="${src.debug}" destdir="${module.classes}" 
+        	srcdir="${module.src}" classpathref="classpath" >
+            <include name="**/*.java" />
+           	<exclude name="flex/messaging/cluster/JGroupsCluster.java" />
+           	<exclude name="flex/messaging/cluster/ClusterNode.java" />
+           	<exclude name="flex/messaging/cluster/ClusterMembershipListener.java" />
+            </javac>
+        <echo file="${module.classes}/flex/messaging/version.properties" append="false">build=${build.number}</echo>
+			
+        <copy todir="${module.classes}/flex/messaging" overwrite="true">
+            <fileset dir="${module.src}/flex/messaging" includes="*.properties"/>
+        </copy>
+        <copy toDir="${module.classes}" file="${module.dir}/AdobeInfo.xml" />
+    </target>
+
+	<!-- only compile jgroups code if jgroups present -->
+	<condition property="jgroups.available">
+	  <available classname="org.jgroups.Channel" classpathref="classpath"/>
+	</condition>
+
+	<target name="compile-jgroups" depends="prepare" if="jgroups.available">
+		<echo >-== Found JGroups, compiling JGroups cluster implementation ==-</echo>
+        <javac debug="${src.debug}" destdir="${module.classes}" srcdir="${module.src}"
+			classpathref="classpath" >
+           	<include name= "flex/messaging/cluster/JGroupsCluster.java" />
+           	<include name= "flex/messaging/cluster/ClusterNode.java" />
+           	<include name= "flex/messaging/cluster/ClusterMembershipListener.java" />
+		</javac>
+	</target>
+
+    <!-- jar containing messaging core infrastructure -->
+    <target name="jar" depends="compile,compile-jgroups">
+
+        <jar destfile="${module.jar}" basedir="${module.classes}">
+            <include name="AdobeInfo.xml"/>
+            <include name="flex/management/**"/>
+            <include name="flex/messaging/**"/>
+            <include name="flex/core/**"/>
+            <exclude name=".dependency-info/**"/>
+            <manifest>
+        		<attribute name="Sealed" value="${manifest.sealed}"/>
+        		<attribute name="Implementation-Title" value="${manifest.Implementation-Title} - Community Edition"/>
+			    <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}"/> 
+			    <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/>
+            </manifest>
+        </jar>
+
+        <delete failonerror="false">
+            <fileset dir="${module.classes}/flex/messaging" includes="*.properties"/>
+        </delete>
+
+    </target>
+
+    <target name="clean" description="clean">
+        <delete file="${module.jar}" failonerror="false"/>
+        <delete failonerror="false" includeEmptyDirs="true">
+            <fileset dir="${module.classes}">
+                <include name="**/*"/>
+                <exclude name="dependencies.txt"/>
+                <exclude name=".dependency-info/**"/>
+            </fileset>
+        </delete>
+        <delete dir="${module.test.classes}" failonerror="false" includeEmptyDirs="true"/>
+        <delete dir="${module.classes}" failonerror="false" includeEmptyDirs="true"/>
+    </target>
+
+	<!-- only run unit tests if junit present -->
+    <condition property="junit.available">
+        <available file="${junit.jar}" />
+    </condition>
+
+    <target name="startserver" description="Start Tomcat Server">
+        <ant antfile="${basedir}/build.xml" target="startserver"/>
+    </target>
+
+    <target name="stopserver" description="Stop Tomcat Server">
+        <ant antfile="${basedir}/build.xml" target="stopserver"/>
+    </target>
+
+ 	<target name="waitforAppserverToStart">
+        <ant antfile="${basedir}/build.xml" target="waitforAppserverToStart"/>
+    </target>
+    
+    <target name="unit" depends="startserver, waitforAppserverToStart, runtests, stopserver, check-test-results" description="runs unit tests">
+        <if>
+            <not>
+                <equals arg1="${junit.available}" arg2="true"/>
+            </not>
+            <then>
+                <echo>Unit test can not be run as junit.jar was not found in ${ant.home}/lib. See http://www.junit.org</echo>
+            </then>
+        </if>
+    </target>
+
+    <target name="compile-tests" if="junit.available">
+        <echo message="Compiling test code..."/>
+        <mkdir dir="${module.test.classes}"/>
+
+        <javac srcdir="${module.test.src}" destdir="${module.test.classes}" debug="true">
+            <classpath refid="classpath"/>
+        </javac>
+
+        <copy todir="${module.test.classes}">
+            <fileset dir="${module.test.src}" includes="**/*.xml,**/*.xsd"/>
+        </copy>
+    </target>
+
+    <target name="runtests" depends="compile-tests" if="junit.available">
+        <junit printsummary="yes" dir="${test.dir}" fork="yes" maxmemory="1024m" timeout="90000" showoutput="yes"
+            haltonerror="false"
+            haltonfailure="false" 
+            failureproperty="test-failed">
+            <sysproperty key="royale.home" value="${basedir}"/>
+            <classpath refid="test.classpath"/>
+            <formatter type="xml" usefile="true"/>
+            <batchtest fork="yes">
+                <fileset dir="${module.test.src}"
+                    includes="${junit.core.includes}"
+                    excludes="${junit.core.excludes}"/>
+            </batchtest>
+        </junit>
+    </target>
+
+    <!-- If one of more unit tests fail, runtests sets unit-test-failed property
+         which gets checked by this target and reported
+    -->
+    <target name="check-test-results">
+        <fail if="test-failed" message="One or more unit tests failed."/>
+    </target>
+
+   <target name="javadoc">
+
+        <path id="javadoc.classpath">
+            <path refid="classpath"/>
+            <fileset dir="${basedir}/modules/opt/lib" includes="*.jar" excludes="catalina-708.jar"/>
+        </path>
+
+        <mkdir dir="${basedir}/docs"/>
+        <mkdir dir="${basedir}/docs/api"/>
+        <javadoc
+             access="public" 
+             destdir="${basedir}/docs/api"
+             doclet="ExcludeDoclet"
+             docletpathref="javadoc.classpath"
+             author="false"
+             version="true"
+             use="true"
+             sourcePath="${common.src};${module.src};${remoting.src};${proxy.src};${opt.src}/jrun;${opt.src}/oracle;${opt.src}/tomcat;${opt.src}/weblogic;${opt.src}/websphere"
+             classpathref="javadoc.classpath"
+             packageNames="flex.*"
+             failonerror="true"
+             windowtitle="${manifest.Implementation-Title} - Public APIs">
+ 
+             <doctitle><![CDATA[<h1>${manifest.Implementation-Title} - Public APIs</h1><h2>Build: ${manifest.Implementation-Version}.${build.number}</h2>]]></doctitle>
+             <bottom><![CDATA[<i>Copyright &#169; 2008 Adobe Systems Inc. All Rights Reserved.</i>]]></bottom>
+             <group title="Messaging APIs" packages="flex.messaging:flex.messaging.services"/>
+             <group title="AMF Serialization APIs" packages="flex.messaging.io.amf"/>
+             <group title="Logging and Debugging APIs" packages="flex.messaging.log"/>
+             <group title="Configuration APIs" packages="flex.messaging.config:flex.messaging.security"/>
+             <group title="Management APIs" packages="flex.management, flex.management.jmx, flex.management.runtime.*"/>
+             <link offline="false" href="http://java.sun.com/j2se/1.5.0/docs/api/" packagelistLoc="C:\tmp"/>
+</javadoc>
+  <zip destfile="${basedir}/docs/javadoc.zip" basedir="${basedir}/docs/api" />
+</target>
+
+</project>
+

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
new file mode 100755
index 0000000..8488733
--- /dev/null
+++ b/modules/core/pom.xml
@@ -0,0 +1,101 @@
+<!--
+
+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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>com.adobe.blazeds</groupId>
+		<artifactId>blazeds</artifactId>
+		<version>4.5.0.0-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+
+	<artifactId>flex-messaging-core</artifactId>
+	<name>${project.artifactId}</name>
+	<description>${project.groupId} ${project.artifactId}</description>
+
+	<dependencies>
+		<dependency>
+			<groupId>com.adobe.blazeds</groupId>
+			<artifactId>flex-messaging-common</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>jgroups</groupId>
+			<artifactId>jgroups</artifactId>
+			<version>2.9.0.GA</version>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>servlet-api</artifactId>
+			<version>2.5</version>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>javax.jms</groupId>
+			<artifactId>jms</artifactId>
+			<version>1.1</version>
+			<scope>provided</scope>
+		</dependency>
+
+
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>3.8.2</version>
+			<scope>test</scope>
+		</dependency>
+
+
+	</dependencies>
+
+	<build>
+		<sourceDirectory>src</sourceDirectory>
+		<testSourceDirectory>test/src</testSourceDirectory>
+		<plugins>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>javacc-maven-plugin</artifactId>
+				<version>2.5</version>
+				<executions>
+					<execution>
+						<phase>generate-sources</phase>
+						<id>javacc</id>
+						<goals>
+							<goal>javacc</goal>
+						</goals>
+						<configuration>
+							<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+							<outputDirectory>${project.build.sourceDirectory}</outputDirectory>
+							<!--
+								it will generate the source in the same folder, the generated
+								files need to be added to .svn:ignore
+							-->
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/BaseControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/BaseControl.java b/modules/core/src/flex/management/BaseControl.java
new file mode 100755
index 0000000..321649f
--- /dev/null
+++ b/modules/core/src/flex/management/BaseControl.java
@@ -0,0 +1,512 @@
+/*
+ * 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.management;
+
+import flex.management.runtime.AdminConsoleDisplayRegistrar;
+import flex.messaging.FlexContext;
+
+import java.util.Date;
+import java.util.List;
+import java.util.ArrayList;
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.MalformedObjectNameException;
+import javax.management.MBeanRegistration;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServer;
+import javax.management.NotCompliantMBeanException;
+import javax.management.ObjectName;
+import javax.servlet.ServletConfig;
+
+/**
+ * The implementation of the <code>BaseControlMBean</code> interface. This
+ * abstract class provides the core functionality that all Flex control MBeans
+ * require.
+ * <p>
+ * Defining concrete implementations of <code>getId()</code> and
+ * <code>getType()</code> are left to subclasses, but this base class does
+ * provide access to the parent MBean for each instance. This class also
+ * implements the <code>MBeanRegistration</code> interface, and it
+ * automatically stores a reference to the MBean server in each instance upon
+ * registration. Subclasses may choose to override none, any, or all of the
+ * methods defined by the <code>MBeanRegistration</code> interface, but any
+ * overrides should be sure to invoke the overridden method with a call to their
+ * superclass.
+ * </p><p>
+ * The <code>register()</code> method provides a simple and consistent way to
+ * register instances with the MBean server, and the
+ * <code>getObjectName()</code> method gaurantees consistent, well-formed
+ * <code>ObjectName</code>s for all MBean instances.</p>
+ *
+ * @author shodgson
+ */
+public abstract class BaseControl implements BaseControlMBean,
+        MBeanRegistration
+{
+    /**
+     * The prefix used for the domain part of control MBean names.
+     */
+    public static final String DOMAIN_PREFIX = "flex.runtime";
+    private static final int MALFORMED_OBJECTNAME = 10400;
+    private static final int UNREG_EXCEPTION = 10401;
+    private static final int UNREG_NOTFOUND = 10402;
+    private static final int REG_EXCEPTION = 10403;
+    private static final int REG_ALREADYEXISTS = 10404;
+    private static final int REG_NOTCOMPLIANT = 10405;
+    private static final int DISABLE_MANAGEMENT = 10426;    
+
+    protected Date startTimestamp;
+    private BaseControl parent;
+    private ObjectName objectName;
+    private ObjectName registeredObjectName;
+    private MBeanServer server;
+    private boolean registered = false;
+
+    private AdminConsoleDisplayRegistrar registrar;
+
+    // Implements flex.management.BaseControlMBean.getId; inherits javadoc
+    // specification.
+    public abstract String getId();
+
+    // Implements flex.management.BaseControlMBean.getType; inherits javadoc
+    // specification.
+    public abstract String getType();
+
+    // Implements flex.management.BaseControlMBean.getParent; inherits javadoc
+    // specification.
+    public final ObjectName getParent()
+    {
+        return (parent != null) ? parent.getObjectName() : null;
+    }
+
+    /**
+     * Returns an identifier for the application that hosts the component that
+     * this control manages.
+     *
+     * @return An identifier for the application that hosts the component this
+     *         control manages.
+     */
+    public String getApplicationId()
+    {
+        String id = null;
+        // Our base implementation attempts to use the current servlet context
+        // name as our application identifier.
+        ServletConfig config = FlexContext.getServletConfig();
+        if (config != null)
+        {
+            id = config.getServletContext().getServletContextName();
+        }
+        return (id != null) ? id.replace(":", "") : "";
+    }
+
+    /**
+     * Set the register object. 
+     * @param registar the registrar to set
+     */
+    protected void setRegistrar(AdminConsoleDisplayRegistrar registrar)
+    {
+        this.registrar = registrar;
+    }
+
+    /**
+     * Return the registar object.
+     * @return the registrar
+     */
+    public AdminConsoleDisplayRegistrar getRegistrar()
+    {
+        if ((parent == null) && (this.registrar == null))
+        {
+            return new AdminConsoleDisplayRegistrar(null);
+        }
+
+        return (this.registrar != null) ? this.registrar : parent.getRegistrar();
+    }
+
+    /**
+     * Constructs a <code>BaseControl</code> instance that references its
+     * parent; the parent may be null for root control MBeans.
+     *
+     * @param parent The parent <code>BaseControl</code> for this instance or
+     *        null if this instance is the root of a control hierarchy.
+     */
+    public BaseControl(BaseControl parent)
+    {
+        this.parent = parent;
+    }
+
+    /**
+     * Returns the parent <code>BaseControl</code> of this instance.
+     *
+     * @return The parent <code>BaseControl</code>.
+     */
+    public final BaseControl getParentControl()
+    {
+        return parent;
+    }
+
+    /**
+     * The <code>MBeanServer</code> that this instance is registered with. If
+     * this instance has not been registered this method returns
+     * <code>null</code>.
+     *
+     * @return The <code>MBeanServer</code> that this instance is registered
+     *         with.
+     */
+    public final MBeanServer getMBeanServer()
+    {
+        return server;
+    }
+
+    /**
+     * Registers this instance with the MBean server.
+     *
+     * It may throw ManagementException If an <code>MBeanRegistrationException</code>
+     *         or <code>InstanceAlreadyExistsException</code> is thrown while
+     *         registering this MBean, the typed exception is wrapped in a
+     *         runtime <code>ManagementException</code> and rethrown.
+     */
+    public final void register()
+    {
+        if (!registered)
+        {
+            MBeanServer server = MBeanServerLocatorFactory.getMBeanServerLocator().getMBeanServer();
+            ObjectName name = getObjectName();
+            try
+            {
+                if (server.isRegistered(name))
+                {
+                    server.unregisterMBean(name);
+                }
+
+                registeredObjectName = server.registerMBean(this, name).getObjectName();
+                registered = true;
+                onRegistrationComplete();
+
+            }
+            catch (ManagementException me)
+            {
+                throw me;
+            }
+            catch (MBeanRegistrationException mre)
+            {
+                // Rethrow with useful message if this ever happens.
+                ManagementException me = new ManagementException();
+                me.setMessage(REG_EXCEPTION, new Object[] {name.toString()});
+                me.setRootCause(mre);
+                throw me;
+            }
+            catch (InstanceAlreadyExistsException iaee)
+            {
+                // If registration is not working at all, inform the user that
+                // they may
+                // work around the issue by disabling management (no MBeans will
+                // be registered).
+                if (!server.isRegistered(name))
+                {
+                    ManagementException me = new ManagementException();
+                    me.setMessage(DISABLE_MANAGEMENT, new Object[] {name.toString()});
+                    throw me;
+                }
+                else
+                {
+                    // Rethrow with useful message if this ever happens.
+                    ManagementException me = new ManagementException();
+                    me.setMessage(REG_ALREADYEXISTS, new Object[] {name.toString()});
+                    throw me;
+                }
+            }
+            catch (NotCompliantMBeanException ncme)
+            {
+                // Rethrow with useful message if this ever happens.
+                ManagementException me = new ManagementException();
+                me.setMessage(REG_NOTCOMPLIANT, new Object[] {name.toString()});
+                throw me;
+            }
+            catch (InstanceNotFoundException infe)
+            {
+                // Rethrow with useful message if this ever happens.
+                ManagementException me = new ManagementException();
+                me.setMessage(UNREG_NOTFOUND, new Object[] {name.toString()});
+                throw me;
+            }
+        }
+    }
+
+    /**
+     * This method is called after the MBean has been registered and after the
+     * MBean server has returned the registeredObjectName. Classes that need
+     * access to the actual Object name should override this method rather than
+     * the postRegister method.
+     */
+    protected void onRegistrationComplete()
+    {
+
+    }
+
+    /**
+     * Unregisters this instance from the MBean server if it has been registered
+     * previously.
+     */
+    public final void unregister()
+    {
+        if (registered)
+        {
+            // This method may be called when the JVM is being unloaded, so if
+            // our
+            // external error strings are loaded as missing, fall back to
+            // hard-coded
+            // strings.
+            try
+            {
+                if (server.isRegistered(registeredObjectName))
+                {
+                    server.unregisterMBean(registeredObjectName);
+                }
+
+                registeredObjectName = null;
+                registered = false;
+            }
+            catch (ManagementException me)
+            {
+                throw me;
+            }
+            catch (MBeanRegistrationException mre)
+            {
+                // Rethrow with useful message if this ever happens.
+                ManagementException me = new ManagementException();
+                me.setMessage(UNREG_EXCEPTION, new Object[] {registeredObjectName.toString()});
+                if (me.getMessage().indexOf(Integer.toString(UNREG_EXCEPTION)) != -1)
+                {
+                    me.setMessage("The MBean named, '" + registeredObjectName.toString() + "', could not be unregistered because its preDeregister() method threw an exception.");
+                }
+                me.setRootCause(mre);
+                throw me;
+            }
+            catch (InstanceNotFoundException infe)
+            {
+                // Rethrow with useful message if this ever happens.
+                ManagementException me = new ManagementException();
+                me.setMessage(UNREG_NOTFOUND, new Object[] {registeredObjectName.toString()});
+                if (me.getMessage().indexOf(Integer.toString(UNREG_NOTFOUND)) != -1)
+                {
+                    me.setMessage("The MBean named, '" + registeredObjectName.toString() + "', could not be unregistered because it is not currently registered.");
+                }
+                throw me;
+            }
+        }
+    }
+
+    /**
+     * Returns the <code>ObjectName</code> for this instance, according to the
+     * following format:
+     * <code>{domain}[&amp;#46;{appId}]:type={type}[&amp;#44;{parent type}={parent id}]*[&amp;#44;server={server}]&amp;#63;&amp;#44;id={id}</code>.
+     * <ul>
+     * <li><code>domain</code>: The domain specified by the DOMAIN_PREFIX
+     * constant followed by the application identifier if one is available.</li>
+     * <li><code>type</code>: The short type name of the resource managed by
+     * the MBean.<br /> - The <code>MessageBrokerControlMBean</code> manages
+     * the <code>flex.messaging.MessageBroker</code> so:
+     * <code>type=MessageBroker</code> </li>
+     * <li><code>id</code>: The id value for the resource managed by this
+     * MBean. If no name or id is available on the resource, an id will be
+     * fabricated according to this strategy:<br />
+     * <em>id = {type} + N</em> (where N is a numeric increment for instances
+     * of this type) </li>
+     * <li>* optional containment keys</li>
+     * </ul>
+     * The runtime MBean model is hierarchical, with all MBeans ultimately
+     * contained by the root <code>MessageBrokerControlMBean</code>. The 
+     * <code>ObjectName</code>s used for these MBeans describe this
+     * containment in the following fashion. First, the 'type' key for a
+     * contained MBean indicates the containment hierarchy for the bean. So, the
+     * <code>ObjectName</code> for an <code>RTMPEndpointControlMBean</code>
+     * would be: <code>type=MessageBroker.RTMPEndpoint</code><br />
+     * In addition to the hierarchical 'type' key, the full
+     * <code>ObjectName</code> for this <code>RTMPEndpointControlMBean</code>
+     * also contains a containment key:
+     * <code>MessageBroker=MessageBroker1</code><br />
+     * Optional containment keys have the format:
+     * <em>{parent type}={parent name}</em>. A containment key is added for
+     * each ancestor up to the root of the hierarchy and these keys allow the
+     * <code>ObjectName</code> for any MBean instance to fully describe its
+     * specific location in the hierarchy. To complete the example, the full
+     * <code>ObjectName</code> for the example
+     * <code>RTMPEndpointControlMBean</code> would be:
+     * <code>flex:type=MessageBroker.RTMPEndpoint,MessageBroker=MessageBroker1,id=RTMPEndpoint1</code>
+     * <p>
+     * If the MBean is registered with the MBean server, this method returns the
+     * <code>ObjectName</code> that the MBean was registered under and this
+     * value may contain additional key-value pairs injected by the container or
+     * MBean server.
+     * </p>
+     *
+     * @return The <code>ObjectName</code> for this instance.
+     */
+    public final ObjectName getObjectName()
+    {
+        if (registered)
+            return registeredObjectName;
+
+        if (objectName == null)
+        {
+            StringBuffer buffer = new StringBuffer();
+            buffer.append(DOMAIN_PREFIX);
+            String appId = getApplicationId();
+            if (appId != null && appId.length() > 0)
+            {
+                buffer.append('.');
+                buffer.append(appId);
+            }
+            buffer.append(":type=");
+            // Build hierarchical type value.
+            List types = new ArrayList();
+            List ids = new ArrayList();
+            types.add(getType());
+            ids.add(getId());
+            BaseControl ancestor = parent;
+            while (ancestor != null)
+            {
+                types.add(ancestor.getType());
+                ids.add(ancestor.getId());
+                ancestor = ancestor.getParentControl();
+            }
+            for (int i = types.size() - 1; i >= 0; --i)
+            {
+                buffer.append((String)types.get(i));
+                if (i > 0)
+                {
+                    buffer.append('.');
+                }
+            }
+            buffer.append(',');
+            // Add containment keys.
+            for (int i = ids.size() - 1; i >= 1; --i)
+            {
+                buffer.append((String)types.get(i));
+                buffer.append('=');
+                buffer.append((String)ids.get(i));
+                buffer.append(',');
+            }
+            buffer.append("id=");
+            buffer.append(getId());
+            String name = buffer.toString();
+            // TODO: Seth: add server identifier key if we're running in a
+            // cluster?
+            try
+            {
+                objectName = new ObjectName(name);
+            }
+            catch (MalformedObjectNameException mone)
+            {
+                // Rethrow with useful message if this ever happens.
+                ManagementException me = new ManagementException();
+                me.setMessage(MALFORMED_OBJECTNAME, new Object[] {name});
+                throw me;
+            }
+        }
+        return objectName;
+    }
+
+    /**
+     * Implements <code>javax.management.MBeanRegistration.preRegister</code>.
+     * Allows the MBean to perform any operations it needs before being
+     * registered in the MBean server. This base implementation stores a
+     * reference to the MBean server that may be accessed via
+     * <code>getMBeanServer()</code>. If subclasses override, they must call
+     * <code>super.preRegister()</code>.
+     *
+     * @param server The Mbean server in which the MBean will be registered.
+     * @param name The object name of the MBean.
+     * @return The name the MBean will be registered under.
+     * @throws Exception when the process failed
+     */
+    public ObjectName preRegister(MBeanServer server, ObjectName name)
+            throws Exception
+    {
+        this.server = server;
+        return (name == null) ? getObjectName() : name;
+    }
+
+    /**
+     * Implements <code>javax.management.MBeanRegistration.postRegister</code>.
+     * Allows the MBean to perform any operations needed after having been
+     * registered in the MBean server or after the registration has failed. This
+     * base implementation is a no-op that may be overridden.
+     *
+     * @param registrationDone Indicates whether or not the MBean was
+     *        successfully registered in the MBean server.
+     */
+    public void postRegister(Boolean registrationDone)
+    {
+        // No-op.
+    }
+
+    /**
+     * Implements <code>javax.management.MBeanRegistration.preDeregister</code>.
+     * Allows the MBean to perform any operations needed after having been
+     * unregistered in the MBean server. This base implementation is a no-op
+     * that may be overridden.
+     * @throws Exception when the process failed
+     */
+    public void preDeregister() throws Exception
+    {
+        // No-op.
+    }
+
+    /**
+     * Implements <code>javax.management.MBeanRegistration.postDeregister</code>.
+     * Allows the MBean to perform any operations it needs before being
+     * unregistered by the MBean server. This base implementation is a no-op
+     * that may be overridden.
+     */
+    public void postDeregister()
+    {
+        // No-op.
+    }
+
+    /**
+     * Sets the start timestamp for the managed component.
+     *
+     * @param value The start timestamp for the managed component.
+     */
+    public void setStartTimestamp(Date value)
+    {
+        startTimestamp = value;
+    }
+
+    /**
+     * @exclude Returns the difference between a start and end timestamps in
+     *          minutes. Differences of less than one minute are rounded up to
+     *          one minute to avoid frequency calculations reporting infinite
+     *          message frequencies.
+     * @param startTime The start timestamp in milliseconds.
+     * @param endTime The end timestamp in milliseconds.
+     * @return The difference between a start and end timestamps in minutes.
+     */
+    protected double differenceInMinutes(long startTime, long endTime)
+    {
+        double minutes = (endTime - startTime) / 60000d;
+        if (minutes > 1d)
+        {
+            return minutes;
+        }
+        else
+        {
+            return 1d;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/BaseControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/BaseControlMBean.java b/modules/core/src/flex/management/BaseControlMBean.java
new file mode 100755
index 0000000..09ab6fe
--- /dev/null
+++ b/modules/core/src/flex/management/BaseControlMBean.java
@@ -0,0 +1,57 @@
+/*
+ * 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.management;
+
+import java.io.IOException;
+import javax.management.ObjectName;
+
+/**
+ * The base MBean interface for management beans that control aspects of
+ * Flex behavior on the server.
+ *
+ * @author shodgson
+ */
+public interface BaseControlMBean
+{
+    /**
+     * Returns the id for this MBean. This is the value that is set for the
+     * <code>id</code> key in the <code>ObjectName</code> for this MBean.
+     *
+     * @return The MBean instance id.
+     * @throws IOException Throws IOException.
+     */
+    String getId() throws IOException;
+
+    /**
+     * Returns the type for this MBean. This is the value that is set for the
+     * <code>type</code> key in the <code>ObjectName</code> for this MBean.
+     *
+     * @return The MBean instance type.
+     * @throws IOException Throws IOException.
+     */
+    String getType() throws IOException;
+
+    /**
+     * Returns the parent for this MBean. The value is the <code>ObjectName</code>
+     * for the parent MBean that conceptually contains this MBean instance. If no
+     * parent exists, this method returns <code>null</code>.
+     *
+     * @return The <code>ObjectName</code> for the parent of this MBean instance.
+     * @throws IOException Throws IOException.
+     */
+    ObjectName getParent() throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/MBeanLifecycleManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/MBeanLifecycleManager.java b/modules/core/src/flex/management/MBeanLifecycleManager.java
new file mode 100755
index 0000000..4bbfea9
--- /dev/null
+++ b/modules/core/src/flex/management/MBeanLifecycleManager.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.management;
+
+import flex.messaging.MessageBroker;
+
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+/**
+ * Helper class for managing MBean lifecycles externally from the core server
+ * components where necessary.
+ * 
+ * @author shodgson
+ */
+public class MBeanLifecycleManager
+{
+    /**
+     * Unregisters all runtime MBeans that are registered in the same domain as the 
+     * MessageBrokerControl for the target MessageBroker. 
+     *  
+     * @param broker The MessageBroker component that has been stopped.
+     */
+    public static void unregisterRuntimeMBeans(MessageBroker broker)
+    {        
+        MBeanServer server = MBeanServerLocatorFactory.getMBeanServerLocator().getMBeanServer();
+        ObjectName brokerMBean = broker.getControl().getObjectName();
+        String domain = brokerMBean.getDomain();
+        try
+        {
+            ObjectName pattern = new ObjectName(domain + ":*");
+            Set names = server.queryNames(pattern, null);
+            Iterator iter = names.iterator();
+            while (iter.hasNext())
+            {
+                ObjectName on = (ObjectName)iter.next();
+                server.unregisterMBean(on);
+            }
+        }
+        catch (Exception e)
+        {
+            // We're generally unregistering these during shutdown (possibly JVM shutdown)
+            // so there's nothing to really do here because we aren't guaranteed access to
+            // resources like system log files, localized messaging, etc.
+        }
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/MBeanServerLocator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/MBeanServerLocator.java b/modules/core/src/flex/management/MBeanServerLocator.java
new file mode 100755
index 0000000..af3676f
--- /dev/null
+++ b/modules/core/src/flex/management/MBeanServerLocator.java
@@ -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 flex.management;
+
+import javax.management.MBeanServer;
+
+/**
+ * Interface for classes that locate MBeanServers to register MBeans with.
+ * 
+ * @author shodgson
+ */
+public interface MBeanServerLocator
+{
+    /**
+     * Returns the MBeanServer to register our management MBeans with.
+     * 
+     * @return The MBeanServer to register our management MBeans with.
+     */
+    MBeanServer getMBeanServer();
+    
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/MBeanServerLocatorFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/MBeanServerLocatorFactory.java b/modules/core/src/flex/management/MBeanServerLocatorFactory.java
new file mode 100755
index 0000000..f69da6d
--- /dev/null
+++ b/modules/core/src/flex/management/MBeanServerLocatorFactory.java
@@ -0,0 +1,125 @@
+/*
+ * 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.management;
+
+import flex.messaging.log.Log;
+import flex.messaging.log.LogCategories;
+import flex.messaging.util.ClassUtil;
+
+/**
+ * Factory to get a <code>MBeanServerLocator</code>.
+ * 
+ * @author shodgson
+ */
+public class MBeanServerLocatorFactory
+{
+    //--------------------------------------------------------------------------
+    //
+    // Private Static Variables
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     * The MBeanServerLocator impl to use; lazily init'ed on first access.
+     */
+    private static MBeanServerLocator locator;
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Static Methods
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     * Returns a <code>MBeanServerLocator</code> that exposes the <code>MBeanServer</code> to register MBeans with.
+     * 
+     * @return The <code>MBeanServerLocator</code> that exposes the <code>MBeanServer</code> to register MBeans with.
+     */
+    public static synchronized MBeanServerLocator getMBeanServerLocator()
+    {
+        if (locator == null)
+        {
+            // Try app-server specific locators.
+            // WebSphere provides access to its MBeanServer via a custom admin API.
+            instantiateLocator("flex.management.WebSphereMBeanServerLocator", new String[] {"com.ibm.websphere.management.AdminServiceFactory"});
+
+            // Sun JRE 1.5 based implementation
+            if (locator == null)
+                locator =  new PlatformMBeanServerLocator();
+            
+            if (Log.isDebug())
+                Log.getLogger(LogCategories.MANAGEMENT_GENERAL).debug("Using MBeanServerLocator: " + locator.getClass().getName());
+        }
+        return locator;
+    }
+    
+    /**
+     * Release static MBeanServerLocator
+     * Called on MessageBroker shutdown.
+     */
+    public static void clear()
+    {
+        locator = null;
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    // Private Static Methods
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     * Helper method that attempts to load a specific MBeanServerLocator.
+     * 
+     * @param locatorClassName The classname of the desired MBeanServerLocator.
+     * @param dependencyClassNames Any additional dependent classnames that the desired locator depends upon
+     *                            that should also be tested for availability.
+     */
+    private static void instantiateLocator(String locatorClassName, String[] dependencyClassNames)
+    {
+        try
+        {
+            if (dependencyClassNames != null)
+            {
+                for (int i = 0; i < dependencyClassNames.length; i++)
+                    ClassUtil.createClass(dependencyClassNames[i]);
+            }
+            
+            Class locatorClass = ClassUtil.createClass(locatorClassName);
+            locator = (MBeanServerLocator)locatorClass.newInstance();
+        }
+        catch (Throwable t)
+        {
+            if (Log.isDebug())
+                Log.getLogger(LogCategories.MANAGEMENT_MBEANSERVER).debug("Not using MBeanServerLocator: " + locatorClassName + ". Reason: " + t.getMessage());
+        }
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     * Direct instantiation is not allowed.
+     * Use <code>getMBeanServerLocator()</code> to obtain a <code>MBeanServerLocator</code> 
+     * instance to lookup the proper MBean server to use.
+     */
+    private MBeanServerLocatorFactory() {}
+    
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/Manageable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/Manageable.java b/modules/core/src/flex/management/Manageable.java
new file mode 100755
index 0000000..0da2890
--- /dev/null
+++ b/modules/core/src/flex/management/Manageable.java
@@ -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 flex.management;
+
+/**
+ * Manageability of a class is enabled by implementing this interface. The
+ * specific level of manageability is defined by the relationship between
+ * a manageable component and its corresponding control.
+ * 
+ * @author shodgson
+ */
+public interface Manageable
+{
+    /**
+     * Returns <code>true</code> if the component is enabled for management.
+     * 
+     * @return <code>true</code> if the component is enabled for management.
+     */
+    boolean isManaged();
+    
+    /**
+     * Enables or disables management for the component.
+     * 
+     * @param enableManagement <code>true</code> to enable management, <code>false</code> to disable management.
+     */
+    void setManaged(boolean enableManagement);
+    
+    /**
+     * Returns the control MBean used to manage the component.
+     * 
+     * @return The control MBean used to manage the component.
+     */
+    BaseControl getControl();
+    
+    /**
+     * Set the control MBean used to manage the component.
+     * 
+     * @param control The <code>BaseControl</code> MBean used to manage the component.
+     */
+    void setControl(BaseControl control);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/ManageableComponent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/ManageableComponent.java b/modules/core/src/flex/management/ManageableComponent.java
new file mode 100755
index 0000000..71d07de
--- /dev/null
+++ b/modules/core/src/flex/management/ManageableComponent.java
@@ -0,0 +1,421 @@
+/*
+ * 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.management;
+
+import java.util.Date;
+
+import flex.messaging.FlexComponent;
+import flex.messaging.config.ConfigMap;
+import flex.messaging.config.ConfigurationException;
+import flex.messaging.log.Log;
+
+/**
+ * An abstract base class that implements the <code>Manageable</code> and <code>FlexComponent</code> interfaces.
+ * This is an excellent starting point for a server component that may be instantiated, initialized, started and
+ * stopped, as well as exposing an optional management interface via a peer MBean.
+ * <p>Support for changing component properties while the component is
+ * started should be determined on a per-property basis, and the started property is volatile to ensure consistent
+ * reads of the start state of the component across threads. This class performs no synchronization and is not safe for modification by multiple concurrent threads
+ * in the absence of external synchronization.
+ * </p>
+ */
+public abstract class ManageableComponent implements Manageable, FlexComponent
+{
+    //--------------------------------------------------------------------------
+    //
+    // Protected Static Constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Error code for attempting to change a property after starting.
+     */
+    protected static final int PROPERTY_CHANGE_AFTER_STARTUP = 11115;
+
+    /**
+     * Error code to alert the user that a required component property is null.
+     */
+    protected static final int NULL_COMPONENT_PROPERTY = 11116;
+
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Constructs a <code>ManageableComponent</code> instance, specifying
+     * whether to enable management.
+     * Enabling management will trigger the creation of a peer MBean that exposes the
+     * management interface for this component.
+     *
+     * @param enableManagement <code>true</code> to enable management, <code>false</code> to disable
+     * management.
+     */
+    public ManageableComponent(boolean enableManagement)
+    {
+        setManaged(enableManagement);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  control
+    //----------------------------------
+
+    /**
+     * The peer MBean of the <code>ManageableComponent</code> that exposes a management interface.
+     */
+    protected BaseControl control;
+
+    /**
+     * (non-JavaDoc)
+     * @see Manageable#getControl()
+     */
+    public BaseControl getControl()
+    {
+        return control;
+    }
+
+    /**
+     * (non-JavaDoc)
+     * @see Manageable#setControl(BaseControl)
+     */
+    public void setControl(BaseControl control)
+    {
+        this.control = control;
+    }
+
+    //----------------------------------
+    //  id
+    //----------------------------------
+
+    /**
+     * The internal id value of the <code>ManageableComponent</code>.
+     */
+    protected String id;
+
+    /**
+     * Returns the id of the <code>ManageableComponent</code>.
+     *
+     * @return The id of the <code>ManageableComponent</code>.
+     */
+    public String getId()
+    {
+        return id;
+    }
+
+    /**
+     * Sets the id of the <code>ManageableComponent</code>. The id cannot be
+     * null and it cannot be changed after startup.
+     *
+     * @param id The id of the <code>ManageableComponent</code>.
+     */
+    public void setId(String id)
+    {
+        if (isStarted())
+        {
+            blockAssignmentWhileStarted("id");
+        }
+        if (id == null)
+        {
+            // Id of a component cannot be null.
+            blockNullAssignment("id");
+        }
+        this.id = id;
+    }
+
+    //----------------------------------
+    //  managed
+    //----------------------------------
+
+    /**
+     * The internal managed flag of the <code>ManageableComponent</code>.
+     */
+    protected volatile boolean managed;
+
+    /**
+     * (non-JavaDoc)
+     * @see Manageable#isManaged()
+     */
+    public boolean isManaged()
+    {
+        return managed;
+    }
+
+    /**
+     * Enables or disables management for the component. Management cannot be
+     * changed once the component is started and management cannot be
+     * <code>true</code> if the parent of the component is not managed.
+     *
+     * @param enableManagement <code>true</code> to enable management, <code>false</code> to disable management.
+     */
+    public void setManaged(boolean enableManagement)
+    {
+        if (isStarted() && control != null)
+        {
+            blockAssignmentWhileStarted("managed");
+        }
+        if (enableManagement && parent != null && !parent.isManaged())
+        {
+            if (Log.isWarn())
+            {
+                Log.getLogger(getLogCategory()).warn("Component: '" + id + "' cannot be managed" +
+                " since its parent is unmanaged.");
+            }
+            return;
+        }
+        managed = enableManagement;
+    }
+
+    //----------------------------------
+    //  parent
+    //----------------------------------
+
+    /**
+     * The internal reference to the parent component (if any) of the <code>ManageableComponent</code>.
+     */
+    protected Manageable parent;
+
+    /**
+     * Returns the parent of the component.
+     *
+     * @return The parent of the component.
+     */
+    public Manageable getParent()
+    {
+        return parent;
+    }
+
+    /**
+     * Sets the parent of the component. The parent cannot be changed
+     * after component startup and it cannot be null.
+     *
+     * @param parent The parent of the component.
+     */
+    public void setParent(Manageable parent)
+    {
+        if (isStarted())
+        {
+            blockAssignmentWhileStarted("parent");
+        }
+        if (parent == null)
+        {
+            // Parent of a component cannot be null.
+            blockNullAssignment("parent");
+        }
+        if (!parent.isManaged() && isManaged())
+        {
+            if (Log.isWarn())
+            {
+                Log.getLogger(getLogCategory()).warn("Component: '" + id + "' cannot be managed" +
+                        " since its parent is unmanaged.");
+            }
+            setManaged(false);
+        }
+        this.parent = parent;
+    }
+
+    //----------------------------------
+    //  started
+    //----------------------------------
+
+    /**
+     * The internal started flag of the <code>ManageableComponent</code>.
+     */
+    protected volatile boolean started;
+
+    /**
+     * Returns if the component is started or not.
+     *
+     * @return <code>true</code> if the component is started.
+     */
+    public boolean isStarted()
+    {
+        return started;
+    }
+
+    /**
+     * Sets if the component is started.
+     *
+     * @param started
+     */
+    protected void setStarted(boolean started)
+    {
+        if (this.started != started)
+        {
+            this.started = started;
+            if (started && control != null)
+            {
+                control.setStartTimestamp(new Date());
+            }
+        }
+    }
+
+    //----------------------------------
+    //  valid
+    //----------------------------------
+
+    /**
+     * The internal valid flag of the <code>ManageableComponent</code>.
+     */
+    protected boolean valid;
+
+    /**
+     * Returns if the component is valid.
+     *
+     * @return <code>true</code> if the component is valid.
+     */
+    public boolean isValid()
+    {
+        return valid;
+    }
+
+    /**
+     * Sets if the component is valid.
+     *
+     * @param valid
+     */
+    protected void setValid(boolean valid)
+    {
+        this.valid = valid;
+    }
+
+    //----------------------------------
+    //  logCategory
+    //----------------------------------
+
+    /**
+     * Returns the log category of the component. Subclasses must provide an
+     * implementation that returns their desired log category.
+     *
+     * @return The log category of the component.
+     */
+    protected abstract String getLogCategory();
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Invoked to initialize the <code>ManageableComponent</code>.
+     * This base implementation calls <code>setId()</code> passing the provided
+     * id and ignores the properties map argument.
+     * Subclasses should call <code>super.initialize()</code>.
+     *
+     * @param id Id of the <code>ManageableComponent</code>.
+     * @param properties Properties for the <code>ManageableComponent</code>.
+     */
+    public void initialize(String id, ConfigMap properties)
+    {
+        setId(id);
+    }
+
+    /**
+     * Validates and starts the component.
+     *
+     * Subclasses should call <code>super.start()</code>.
+     */
+    public void start()
+    {
+        validate();
+        setStarted(true);
+    }
+
+    /**
+     * Invalidates and stops the component.
+     *
+     * Subclasses should call <code>super.stop()</code>.
+     */
+    public void stop()
+    {
+        invalidate();
+        setStarted(false);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Protocted Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Convenience method that may be used to generate and throw an Exception for an attempt to set the specified property if the
+     * component is started.
+     *
+     * @param propertyName The name of the property being incorrectly assigned; included in the Exception message.
+     */
+    protected void blockAssignmentWhileStarted(String propertyName)
+    {
+        ConfigurationException ce = new ConfigurationException();
+        ce.setMessage(PROPERTY_CHANGE_AFTER_STARTUP, new Object[]{propertyName});
+        throw ce;
+    }
+
+    /**
+     * Convenience method that may be used to generate and throw an Exception for an attempt to assign a null value to a property that
+     * requires non-null values.
+     *
+     * @param propertyName The name of the property being incorrectly assigned.
+     */
+    protected void blockNullAssignment(String propertyName)
+    {
+        ConfigurationException ce = new ConfigurationException();
+        ce.setMessage(NULL_COMPONENT_PROPERTY, new Object[]{propertyName});
+        throw ce;
+    }
+
+    /**
+     * Invoked from within the <code>stop()</code> method to invalidate the component as part of shutdown.
+     * This base implementation sets the valid property to false.
+     * Subclasses should call <code>super.invalidate()</code>.
+     */
+    protected void invalidate()
+    {
+        setValid(false);
+    }
+
+    /**
+     * Hook method invoked from within the <code>start()</code> method to validate that the component is in a
+     * startable state.
+     * This base implementation validates the component by ensuring it has an id and a parent and then sets
+     * the valid property to true.
+     * If the component is not in a valid, startable state an Exception is thrown.
+     * Subclasses should call <code>super.validate()</code>.
+     */
+    protected void validate()
+    {
+        if (getId() == null)
+        {
+            // Id of a component cannot be null.
+            blockNullAssignment("id");
+        }
+        if (getParent() == null)
+        {
+            // Parent of a component cannot be null.
+            blockNullAssignment("parent");
+        }
+        setValid(true);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/ManagementException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/ManagementException.java b/modules/core/src/flex/management/ManagementException.java
new file mode 100755
index 0000000..93157ed
--- /dev/null
+++ b/modules/core/src/flex/management/ManagementException.java
@@ -0,0 +1,32 @@
+/*
+ * 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.management;
+
+import flex.messaging.MessageException;
+
+/**
+ * This exception type is thrown when errors occur generating 
+ * <code>ObjectName</code>s for MBeans, or when registering them or
+ * accessing them via the MBean server.
+ * 
+ * @author shodgson
+ */
+public class ManagementException extends MessageException
+{
+    // Inherits all functionality from MessageException.
+    static final long serialVersionUID = 1296149563830613956L;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/PlatformMBeanServerLocator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/PlatformMBeanServerLocator.java b/modules/core/src/flex/management/PlatformMBeanServerLocator.java
new file mode 100755
index 0000000..ae7f528
--- /dev/null
+++ b/modules/core/src/flex/management/PlatformMBeanServerLocator.java
@@ -0,0 +1,39 @@
+/*
+ * 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.management;
+
+import java.lang.management.ManagementFactory;
+import javax.management.MBeanServer;
+
+import flex.messaging.log.Log;
+import flex.messaging.log.LogCategories;
+
+/**
+ * The platform implementation of an MBeanServerLocator for Java 1.5+.
+ * This locator exposes the platform MBeanServer.
+ *
+ * @author shodgson
+ */
+public class PlatformMBeanServerLocator implements MBeanServerLocator
+{
+    /** {@inheritDoc} */
+    public synchronized MBeanServer getMBeanServer()
+    {
+        return ManagementFactory.getPlatformMBeanServer();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/jmx/Attribute.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/jmx/Attribute.java b/modules/core/src/flex/management/jmx/Attribute.java
new file mode 100755
index 0000000..f4cce01
--- /dev/null
+++ b/modules/core/src/flex/management/jmx/Attribute.java
@@ -0,0 +1,63 @@
+/*
+ * 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.management.jmx;
+
+/**
+ * Remotable <code>Attribute</code> class that complies with Flash serialization requirements.
+ *
+ * @author shodgson
+ */
+public class Attribute
+{
+    /**
+     * The name of the attribute.
+     */
+    public String name;
+    
+    /**
+     * The value of the attribute.
+     */
+    public Object value;
+    
+    /**
+     * Constructs an empty <code>Attribute</code> instance.
+     *
+     */
+    public Attribute()
+    {}
+    
+    /**
+     * Constructs an <code>Attribute</code> instance based upon a <code>javax.management.Attribute</code> instance.
+     * 
+     * @param attribute The JMX <code>Attribute</code> to base this instance on.
+     */
+    public Attribute(javax.management.Attribute attribute)
+    {
+        name = attribute.getName();
+        value = attribute.getValue();
+    }
+    
+    /**
+     * Utility method to convert this <code>Attribute</code> instance to a <code>javax.management.Attribute</code> instance.
+     * 
+     * @return A JMX <code>Attribute</code> based upon this instance.
+     */
+    public javax.management.Attribute toAttribute()
+    {
+        return new javax.management.Attribute(name, value);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/jmx/MBeanAttributeInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/jmx/MBeanAttributeInfo.java b/modules/core/src/flex/management/jmx/MBeanAttributeInfo.java
new file mode 100755
index 0000000..a60937e
--- /dev/null
+++ b/modules/core/src/flex/management/jmx/MBeanAttributeInfo.java
@@ -0,0 +1,96 @@
+/*
+ * 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.management.jmx;
+
+/**
+ * Remotable <code>MBeanAttributeInfo</code> class that complies with Flash serialization requirements. 
+ * The <code>isIs</code> property is not named <code>is</code> because <code>is</code> is 
+ * an ActionScript keyword.
+ *
+ * @author shodgson
+ */
+public class MBeanAttributeInfo
+{
+    /**
+     * The name of the attribute.
+     */
+    public String name;
+    
+    /**
+     * The class name of the attribute.
+     */
+    public String type;
+    
+    /**
+     * The description of the attribute.
+     */
+    public String description;
+
+    /**
+     * Whether the attribute can be read.
+     */
+    public boolean readable;
+    
+    /**
+     * Whether the attribute can be written.
+     */
+    public boolean writable; 
+    
+    /**
+     * Whether the attribute has an "is" getter.
+     */
+    public boolean isIs;
+    
+    /**
+     * Constructs an empty <code>MBeanAttributeInfo</code> instance.
+     */
+    public MBeanAttributeInfo()
+    {}
+    
+    /**
+     * Constructs a <code>MBeanAttributeInfo</code> instance based upon a
+     * <code>javax.management.MBeanAttributeInfo</code> instance.
+     * 
+     * @param mbeanAttributeInfo The JMX <code>MBeanAttributeInfo</code> instance to base this instance on.
+     */
+    public MBeanAttributeInfo(javax.management.MBeanAttributeInfo mbeanAttributeInfo)
+    {
+        name = mbeanAttributeInfo.getName();
+        type = mbeanAttributeInfo.getType();
+        description = mbeanAttributeInfo.getDescription();
+        readable = mbeanAttributeInfo.isReadable();
+        writable = mbeanAttributeInfo.isWritable();
+        isIs = mbeanAttributeInfo.isIs();
+    }
+    
+    /**
+     * Utility method to convert this <code>MBeanAttributeInfo</code> to a
+     * <code>javax.management.MBeanAttributeInfo</code> instance.
+     * 
+     * @return A JMX <code>MBeanAttributeInfo</code> based upon this instance.
+     */
+    public javax.management.MBeanAttributeInfo toMBeanAttributeInfo()
+    {
+        return new javax.management.MBeanAttributeInfo(name,
+                                                       type,
+                                                       description,
+                                                       readable,
+                                                       writable,
+                                                       isIs);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/jmx/MBeanConstructorInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/jmx/MBeanConstructorInfo.java b/modules/core/src/flex/management/jmx/MBeanConstructorInfo.java
new file mode 100755
index 0000000..105a25f
--- /dev/null
+++ b/modules/core/src/flex/management/jmx/MBeanConstructorInfo.java
@@ -0,0 +1,106 @@
+/*
+ * 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.management.jmx;
+
+/**
+ * Remotable <code>MBeanConstructorInfo</code> class that complies with Flash serialization requirements.
+ *
+ * @author shodgson
+ */
+public class MBeanConstructorInfo
+{
+    /**
+     * The name of the constructor.
+     */
+    public String name;
+    
+    /**
+     * The description of the constructor.
+     */
+    public String description;
+    
+    /**
+     * The constructor's parameter signature.
+     */
+    public MBeanParameterInfo[] signature;
+    
+    /**
+     * Constructs an empty <code>MBeanConstructorInfo</code> instance.
+     *
+     */
+    public MBeanConstructorInfo()
+    {}
+    
+    /**
+     * Constructs a <code>MBeanConstructorInfo</code> instance based upon a
+     * <code>javax.management.MBeanConstructorInfo</code> instance.
+     * 
+     * @param mbeanConstructorInfo The <code>javax.management.MBeanConstructorInfo</code> to base this instance on.
+     */
+    public MBeanConstructorInfo(javax.management.MBeanConstructorInfo mbeanConstructorInfo)
+    {
+        name = mbeanConstructorInfo.getName();
+        description = mbeanConstructorInfo.getDescription();
+        signature = convertSignature(mbeanConstructorInfo.getSignature());
+    }
+    
+    /**
+     * Utility method to convert this <code>MBeanConstructorInfo</code> instance to a
+     * <code>javax.management.MBeanConstructorInfo</code> instance.
+     * 
+     * @return A JMX <code>MBeanConstructorInfo</code> based upon this instance.
+     */
+    public javax.management.MBeanConstructorInfo toMBeanConstructorInfo()
+    {
+        return new javax.management.MBeanConstructorInfo(name,
+                                                         description,
+                                                         convertSignature(signature));
+    }    
+    
+    /**
+     * Utility method to convert the JMX constructor signature to our Flash friendly param type.
+     * 
+     * @param source The JMX constructor signature params.
+     * @return Flash friendly signature params.
+     */
+    private MBeanParameterInfo[] convertSignature(javax.management.MBeanParameterInfo[] source)
+    {
+        MBeanParameterInfo[] signature = new MBeanParameterInfo[source.length];
+        for (int i = 0; i < source.length; i++)
+        {
+            signature[i] = new MBeanParameterInfo(source[i]);
+        }
+        return signature;
+    }
+    
+    /**
+     * Utility method to convert a Flash friendly construtor param signature to the JMX params.
+     * 
+     * @param source The Flash friendly signature params.
+     * @return The JMX constructor signature params.
+     */
+    private javax.management.MBeanParameterInfo[] convertSignature(MBeanParameterInfo[] source)
+    {
+        javax.management.MBeanParameterInfo[] signature = new javax.management.MBeanParameterInfo[source.length];
+        for (int i = 0; i < source.length; i++)
+        {
+            signature[i] = source[i].toMBeanParameterInfo();
+        }
+        return signature;
+    }   
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/jmx/MBeanInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/jmx/MBeanInfo.java b/modules/core/src/flex/management/jmx/MBeanInfo.java
new file mode 100755
index 0000000..bc3eb44
--- /dev/null
+++ b/modules/core/src/flex/management/jmx/MBeanInfo.java
@@ -0,0 +1,186 @@
+/*
+ * 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.management.jmx;
+
+/**
+ * Remotable MBeanInfo class that complies with Flash serialization requirements. 
+ * MBean Notifications are not currently supported.
+ *
+ * @author shodgson
+ */
+public class MBeanInfo
+{
+    /**
+     * The Java class name for the MBean object.
+     */
+    public String className;
+    
+    /**
+     * The description of the MBean.
+     */
+    public String description;
+    
+    /**
+     * The attributes exposed for management.
+     */
+    public MBeanAttributeInfo[] attributes;
+    
+    /**
+     * The public constructors for the MBean.
+     */
+    public MBeanConstructorInfo[] constructors;
+    
+    /**
+     * The operations exposed by the MBean.
+     */
+    public MBeanOperationInfo[] operations;
+        
+    /**
+     * Constructs an empty <code>MBeanInfo</code> instance.
+     */
+    public MBeanInfo()
+    {}
+    
+    /**
+     * Constructs a <code>MBeanInfo</code> instance based upon a
+     * <code>javax.management.MBeanInfo</code> instance.
+     * 
+     * @param mbeanInfo The JMX <code>MBeanInfo</code> instance to base this instance on.
+     */
+    public MBeanInfo(javax.management.MBeanInfo mbeanInfo)
+    {
+        className = mbeanInfo.getClassName();
+        description = mbeanInfo.getDescription();
+        attributes = convertAttributes(mbeanInfo.getAttributes());
+        constructors = convertConstructors(mbeanInfo.getConstructors());
+        operations = convertOperations(mbeanInfo.getOperations());
+    }
+    
+    /**
+     * Utility method to convert this <code>MBeanInfo</code> to a
+     * <code>javax.management.MBeanInfo</code> instance.
+     * 
+     * @return A JMX <code>MBeanInfo</code> based upon this instance.
+     */
+    public javax.management.MBeanInfo toMBeanInfo()
+    {
+        return new javax.management.MBeanInfo(className,
+                                              description,
+                                              convertAttributes(attributes),
+                                              convertConstructors(constructors),
+                                              convertOperations(operations),
+                                              null);
+    }      
+    
+    /**
+     * Utility method to convert JMX attribute info instances to Flash friendly instances.
+     * 
+     * @param source JMX attribute info instances.
+     * @return Flash friendly attribute info instances.
+     */
+    private MBeanAttributeInfo[] convertAttributes(javax.management.MBeanAttributeInfo[] source)
+    {
+        MBeanAttributeInfo[] attributes = new MBeanAttributeInfo[source.length];
+        for (int i = 0; i < source.length; i++)
+        {
+            attributes[i] = new MBeanAttributeInfo(source[i]);
+        }
+        return attributes;
+    }    
+    
+    /**
+     * Utility method to convert Flash friendly attribute info instances to JMX attribute info instances.
+     * 
+     * @param source Flash friendly attribute info instances.
+     * @return JMX attribute info instances.
+     */
+    private javax.management.MBeanAttributeInfo[] convertAttributes(MBeanAttributeInfo[] source)
+    {
+        javax.management.MBeanAttributeInfo[] attributes = new javax.management.MBeanAttributeInfo[source.length];
+        for (int i = 0; i < source.length; i++)
+        {
+            attributes[i] = source[i].toMBeanAttributeInfo();
+        }
+        return attributes;
+    }
+    
+    /**
+     * Utility method to convert JMX constructor info instances to Flash friendly constructor info
+     * instances.
+     * 
+     * @param source JMX constructor info instances.
+     * @return Flash friendly constructor info instances.
+     */
+    private MBeanConstructorInfo[] convertConstructors(javax.management.MBeanConstructorInfo[] source)
+    {
+        MBeanConstructorInfo[] constructors = new MBeanConstructorInfo[source.length];
+        for (int i = 0; i < source.length; i++)
+        {
+            constructors[i] = new MBeanConstructorInfo(source[i]);            
+        }
+        return constructors;
+    }
+    
+    /**
+     * Utility method to convert Flash friendly constructor info instances to JMX constructor info instances.
+     * 
+     * @param source Flash friendly constructor info instances.
+     * @return JMX constructor info instances.
+     */
+    private javax.management.MBeanConstructorInfo[] convertConstructors(MBeanConstructorInfo[] source)
+    {
+        javax.management.MBeanConstructorInfo[] constructors = new javax.management.MBeanConstructorInfo[source.length];
+        for (int i = 0; i < source.length; i++)
+        {
+            constructors[i] = source[i].toMBeanConstructorInfo();
+        }
+        return constructors;
+    }
+    
+    /**
+     * Utility method to convert JMX operation info instances to Flash friendly operation info instances.
+     * 
+     * @param source JMX opereration info instances.
+     * @return Flash friendly operation info instances.
+     */
+    private MBeanOperationInfo[] convertOperations(javax.management.MBeanOperationInfo[] source)
+    {
+        MBeanOperationInfo[] operations = new MBeanOperationInfo[source.length];
+        for (int i = 0; i < source.length; i++)
+        {
+            operations[i] = new MBeanOperationInfo(source[i]);
+        }
+        return operations;
+    }
+    
+    /**
+     * Utility method to convert Flash friendly operation info instances to JMX operation info instances.
+     * 
+     * @param source Flash friendly operation info instances. 
+     * @return JMX operation info instances.
+     */
+    private javax.management.MBeanOperationInfo[] convertOperations(MBeanOperationInfo[] source)
+    {
+        javax.management.MBeanOperationInfo[] operations = new javax.management.MBeanOperationInfo[source.length];
+        for (int i = 0; i < source.length; i++)
+        {
+            operations[i] = source[i].toMBeanOperationInfo();
+        }
+        return operations;
+    }
+    
+}


[21/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/IDEA/projects/java/common.iml
----------------------------------------------------------------------
diff --git a/development/IDEA/projects/java/common.iml b/development/IDEA/projects/java/common.iml
new file mode 100755
index 0000000..fd39fe7
--- /dev/null
+++ b/development/IDEA/projects/java/common.iml
@@ -0,0 +1,224 @@
+<?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.
+
+-->
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_4" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/../../../../modules/common/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../modules/common">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../modules/common/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../lib/xalan.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+  </component>
+  <component name="org.twodividedbyzero.idea.findbugs">
+    <option name="_basePreferences">
+      <map>
+        <entry key="property.analysisEffortLevel" value="default" />
+        <entry key="property.analyzeAfterCompile" value="false" />
+        <entry key="property.minPriorityToReport" value="Medium" />
+        <entry key="property.runAnalysisInBackground" value="false" />
+        <entry key="property.showHiddenDetectors" value="false" />
+        <entry key="property.toolWindowToFront" value="true" />
+      </map>
+    </option>
+    <option name="_detectors">
+      <map>
+        <entry key="AppendingToAnObjectOutputStream" value="true" />
+        <entry key="BCPMethodReturnCheck" value="false" />
+        <entry key="BadAppletConstructor" value="false" />
+        <entry key="BadResultSetAccess" value="true" />
+        <entry key="BadSyntaxForRegularExpression" value="true" />
+        <entry key="BadUseOfReturnValue" value="true" />
+        <entry key="BadlyOverriddenAdapter" value="true" />
+        <entry key="BooleanReturnNull" value="true" />
+        <entry key="BuildInterproceduralCallGraph" value="false" />
+        <entry key="BuildObligationPolicyDatabase" value="true" />
+        <entry key="CallToUnsupportedMethod" value="false" />
+        <entry key="CalledMethods" value="true" />
+        <entry key="CheckCalls" value="false" />
+        <entry key="CheckExpectedWarnings" value="false" />
+        <entry key="CheckImmutableAnnotation" value="true" />
+        <entry key="CheckTypeQualifiers" value="true" />
+        <entry key="CloneIdiom" value="true" />
+        <entry key="ComparatorIdiom" value="true" />
+        <entry key="ConfusedInheritance" value="true" />
+        <entry key="ConfusionBetweenInheritedAndOuterMethod" value="true" />
+        <entry key="CrossSiteScripting" value="true" />
+        <entry key="DoInsideDoPrivileged" value="true" />
+        <entry key="DontCatchIllegalMonitorStateException" value="true" />
+        <entry key="DontIgnoreResultOfPutIfAbsent" value="true" />
+        <entry key="DontUseEnum" value="true" />
+        <entry key="DroppedException" value="true" />
+        <entry key="DumbMethodInvocations" value="true" />
+        <entry key="DumbMethods" value="true" />
+        <entry key="DuplicateBranches" value="true" />
+        <entry key="EmptyZipFileEntry" value="true" />
+        <entry key="EqStringTest" value="false" />
+        <entry key="EqualsOperandShouldHaveClassCompatibleWithThis" value="true" />
+        <entry key="FieldItemSummary" value="true" />
+        <entry key="FinalizerNullsFields" value="true" />
+        <entry key="FindBadCast" value="false" />
+        <entry key="FindBadCast2" value="true" />
+        <entry key="FindBadEqualsImplementation" value="false" />
+        <entry key="FindBadForLoop" value="true" />
+        <entry key="FindBugsSummaryStats" value="true" />
+        <entry key="FindCircularDependencies" value="false" />
+        <entry key="FindDeadLocalStores" value="true" />
+        <entry key="FindDoubleCheck" value="true" />
+        <entry key="FindEmptySynchronizedBlock" value="true" />
+        <entry key="FindFieldSelfAssignment" value="true" />
+        <entry key="FindFinalizeInvocations" value="true" />
+        <entry key="FindFloatEquality" value="true" />
+        <entry key="FindFloatMath" value="false" />
+        <entry key="FindHEmismatch" value="true" />
+        <entry key="FindInconsistentSync2" value="true" />
+        <entry key="FindJSR166LockMonitorenter" value="true" />
+        <entry key="FindLocalSelfAssignment2" value="true" />
+        <entry key="FindMaskedFields" value="true" />
+        <entry key="FindMismatchedWaitOrNotify" value="true" />
+        <entry key="FindNakedNotify" value="true" />
+        <entry key="FindNonSerializableStoreIntoSession" value="true" />
+        <entry key="FindNonSerializableValuePassedToWriteObject" value="true" />
+        <entry key="FindNonShortCircuit" value="true" />
+        <entry key="FindNullDeref" value="true" />
+        <entry key="FindNullDerefsInvolvingNonShortCircuitEvaluation" value="true" />
+        <entry key="FindOpenStream" value="true" />
+        <entry key="FindPuzzlers" value="true" />
+        <entry key="FindRefComparison" value="true" />
+        <entry key="FindReturnRef" value="true" />
+        <entry key="FindRunInvocations" value="true" />
+        <entry key="FindSelfComparison" value="true" />
+        <entry key="FindSelfComparison2" value="true" />
+        <entry key="FindSleepWithLockHeld" value="true" />
+        <entry key="FindSpinLoop" value="true" />
+        <entry key="FindSqlInjection" value="true" />
+        <entry key="FindTwoLockWait" value="true" />
+        <entry key="FindUncalledPrivateMethods" value="true" />
+        <entry key="FindUnconditionalWait" value="true" />
+        <entry key="FindUninitializedGet" value="true" />
+        <entry key="FindUnrelatedTypesInGenericContainer" value="true" />
+        <entry key="FindUnreleasedLock" value="true" />
+        <entry key="FindUnsatisfiedObligation" value="true" />
+        <entry key="FindUnsyncGet" value="true" />
+        <entry key="FindUselessControlFlow" value="true" />
+        <entry key="FormatStringChecker" value="true" />
+        <entry key="HugeSharedStringConstants" value="true" />
+        <entry key="IDivResultCastToDouble" value="true" />
+        <entry key="IncompatMask" value="true" />
+        <entry key="InconsistentAnnotations" value="true" />
+        <entry key="InefficientMemberAccess" value="false" />
+        <entry key="InefficientToArray" value="true" />
+        <entry key="InfiniteLoop" value="true" />
+        <entry key="InfiniteRecursiveLoop" value="true" />
+        <entry key="InfiniteRecursiveLoop2" value="false" />
+        <entry key="InheritanceUnsafeGetResource" value="true" />
+        <entry key="InitializationChain" value="true" />
+        <entry key="InstantiateStaticClass" value="true" />
+        <entry key="InvalidJUnitTest" value="true" />
+        <entry key="IteratorIdioms" value="true" />
+        <entry key="LazyInit" value="true" />
+        <entry key="LoadOfKnownNullValue" value="true" />
+        <entry key="LockedFields" value="false" />
+        <entry key="LostLoggerDueToWeakReference" value="true" />
+        <entry key="MethodReturnCheck" value="true" />
+        <entry key="Methods" value="true" />
+        <entry key="MultithreadedInstanceAccess" value="true" />
+        <entry key="MutableLock" value="true" />
+        <entry key="MutableStaticFields" value="true" />
+        <entry key="Naming" value="true" />
+        <entry key="Noise" value="false" />
+        <entry key="NoiseNullDeref" value="false" />
+        <entry key="NoteAnnotationRetention" value="true" />
+        <entry key="NoteCheckReturnValue" value="true" />
+        <entry key="NoteCheckReturnValueAnnotations" value="true" />
+        <entry key="NoteDirectlyRelevantTypeQualifiers" value="true" />
+        <entry key="NoteJCIPAnnotation" value="true" />
+        <entry key="NoteNonNullAnnotations" value="true" />
+        <entry key="NoteNonnullReturnValues" value="true" />
+        <entry key="NoteSuppressedWarnings" value="true" />
+        <entry key="NoteUnconditionalParamDerefs" value="true" />
+        <entry key="NumberConstructor" value="true" />
+        <entry key="OverridingEqualsNotSymmetrical" value="true" />
+        <entry key="PreferZeroLengthArrays" value="true" />
+        <entry key="PublicSemaphores" value="false" />
+        <entry key="QuestionableBooleanAssignment" value="true" />
+        <entry key="ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass" value="true" />
+        <entry key="ReadReturnShouldBeChecked" value="true" />
+        <entry key="RedundantInterfaces" value="true" />
+        <entry key="ReflectiveClasses" value="true" />
+        <entry key="RepeatedConditionals" value="true" />
+        <entry key="ResolveAllReferences" value="false" />
+        <entry key="RuntimeExceptionCapture" value="true" />
+        <entry key="SerializableIdiom" value="true" />
+        <entry key="StartInConstructor" value="true" />
+        <entry key="StaticCalendarDetector" value="true" />
+        <entry key="StringConcatenation" value="true" />
+        <entry key="SuperfluousInstanceOf" value="true" />
+        <entry key="SuspiciousThreadInterrupted" value="true" />
+        <entry key="SwitchFallthrough" value="true" />
+        <entry key="SynchronizationOnSharedBuiltinConstant" value="true" />
+        <entry key="SynchronizeAndNullCheckField" value="true" />
+        <entry key="SynchronizeOnClassLiteralNotGetClass" value="true" />
+        <entry key="SynchronizingOnContentsOfFieldToProtectField" value="true" />
+        <entry key="TestASM" value="false" />
+        <entry key="TestDataflowAnalysis" value="false" />
+        <entry key="TestingGround" value="false" />
+        <entry key="TrainFieldStoreTypes" value="true" />
+        <entry key="TrainNonNullAnnotations" value="true" />
+        <entry key="TrainUnconditionalDerefParams" value="true" />
+        <entry key="URLProblems" value="true" />
+        <entry key="UncallableMethodOfAnonymousClass" value="true" />
+        <entry key="UnnecessaryMath" value="true" />
+        <entry key="UnreadFields" value="true" />
+        <entry key="UseObjectEquals" value="false" />
+        <entry key="UselessSubclassMethod" value="false" />
+        <entry key="VarArgsProblems" value="true" />
+        <entry key="VolatileUsage" value="true" />
+        <entry key="WaitInLoop" value="true" />
+        <entry key="WrongMapIterator" value="true" />
+        <entry key="XMLFactoryBypass" value="true" />
+      </map>
+    </option>
+    <option name="_reportCategories">
+      <map>
+        <entry key="BAD_PRACTICE" value="true" />
+        <entry key="CORRECTNESS" value="true" />
+        <entry key="EXPERIMENTAL" value="true" />
+        <entry key="I18N" value="true" />
+        <entry key="MALICIOUS_CODE" value="true" />
+        <entry key="MT_CORRECTNESS" value="true" />
+        <entry key="NOISE" value="false" />
+        <entry key="PERFORMANCE" value="true" />
+        <entry key="SECURITY" value="true" />
+        <entry key="STYLE" value="true" />
+      </map>
+    </option>
+  </component>
+</module>
+

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/IDEA/projects/java/core.iml
----------------------------------------------------------------------
diff --git a/development/IDEA/projects/java/core.iml b/development/IDEA/projects/java/core.iml
new file mode 100755
index 0000000..80b7e56
--- /dev/null
+++ b/development/IDEA/projects/java/core.iml
@@ -0,0 +1,263 @@
+<?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.
+
+-->
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/../../../../modules/core/classes" />
+    <output-test url="file://$MODULE_DIR$/../../../../modules/core/test/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../modules/core">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../modules/core/src" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../../modules/core/test/src" isTestSource="true" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../lib/jms.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../lib/xalan.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../lib/servlet.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../lib/jgroups-core-2.9.0GA.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="common" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$APPLICATION_HOME_DIR$/lib/junit.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+  </component>
+  <component name="org.twodividedbyzero.idea.findbugs">
+    <option name="_basePreferences">
+      <map>
+        <entry key="property.analysisEffortLevel" value="default" />
+        <entry key="property.analyzeAfterCompile" value="false" />
+        <entry key="property.minPriorityToReport" value="Medium" />
+        <entry key="property.runAnalysisInBackground" value="false" />
+        <entry key="property.showHiddenDetectors" value="false" />
+        <entry key="property.toolWindowToFront" value="true" />
+      </map>
+    </option>
+    <option name="_detectors">
+      <map>
+        <entry key="AppendingToAnObjectOutputStream" value="true" />
+        <entry key="BCPMethodReturnCheck" value="false" />
+        <entry key="BadAppletConstructor" value="false" />
+        <entry key="BadResultSetAccess" value="true" />
+        <entry key="BadSyntaxForRegularExpression" value="true" />
+        <entry key="BadUseOfReturnValue" value="true" />
+        <entry key="BadlyOverriddenAdapter" value="true" />
+        <entry key="BooleanReturnNull" value="true" />
+        <entry key="BuildInterproceduralCallGraph" value="false" />
+        <entry key="BuildObligationPolicyDatabase" value="true" />
+        <entry key="CallToUnsupportedMethod" value="false" />
+        <entry key="CalledMethods" value="true" />
+        <entry key="CheckCalls" value="false" />
+        <entry key="CheckExpectedWarnings" value="false" />
+        <entry key="CheckImmutableAnnotation" value="true" />
+        <entry key="CheckTypeQualifiers" value="true" />
+        <entry key="CloneIdiom" value="true" />
+        <entry key="ComparatorIdiom" value="true" />
+        <entry key="ConfusedInheritance" value="true" />
+        <entry key="ConfusionBetweenInheritedAndOuterMethod" value="true" />
+        <entry key="CrossSiteScripting" value="true" />
+        <entry key="DoInsideDoPrivileged" value="true" />
+        <entry key="DontCatchIllegalMonitorStateException" value="true" />
+        <entry key="DontIgnoreResultOfPutIfAbsent" value="true" />
+        <entry key="DontUseEnum" value="true" />
+        <entry key="DroppedException" value="true" />
+        <entry key="DumbMethodInvocations" value="true" />
+        <entry key="DumbMethods" value="true" />
+        <entry key="DuplicateBranches" value="true" />
+        <entry key="EmptyZipFileEntry" value="true" />
+        <entry key="EqStringTest" value="false" />
+        <entry key="EqualsOperandShouldHaveClassCompatibleWithThis" value="true" />
+        <entry key="FieldItemSummary" value="true" />
+        <entry key="FinalizerNullsFields" value="true" />
+        <entry key="FindBadCast" value="false" />
+        <entry key="FindBadCast2" value="true" />
+        <entry key="FindBadEqualsImplementation" value="false" />
+        <entry key="FindBadForLoop" value="true" />
+        <entry key="FindBugsSummaryStats" value="true" />
+        <entry key="FindCircularDependencies" value="false" />
+        <entry key="FindDeadLocalStores" value="true" />
+        <entry key="FindDoubleCheck" value="true" />
+        <entry key="FindEmptySynchronizedBlock" value="true" />
+        <entry key="FindFieldSelfAssignment" value="true" />
+        <entry key="FindFinalizeInvocations" value="true" />
+        <entry key="FindFloatEquality" value="true" />
+        <entry key="FindFloatMath" value="false" />
+        <entry key="FindHEmismatch" value="true" />
+        <entry key="FindInconsistentSync2" value="true" />
+        <entry key="FindJSR166LockMonitorenter" value="true" />
+        <entry key="FindLocalSelfAssignment2" value="true" />
+        <entry key="FindMaskedFields" value="true" />
+        <entry key="FindMismatchedWaitOrNotify" value="true" />
+        <entry key="FindNakedNotify" value="true" />
+        <entry key="FindNonSerializableStoreIntoSession" value="true" />
+        <entry key="FindNonSerializableValuePassedToWriteObject" value="true" />
+        <entry key="FindNonShortCircuit" value="true" />
+        <entry key="FindNullDeref" value="true" />
+        <entry key="FindNullDerefsInvolvingNonShortCircuitEvaluation" value="true" />
+        <entry key="FindOpenStream" value="true" />
+        <entry key="FindPuzzlers" value="true" />
+        <entry key="FindRefComparison" value="true" />
+        <entry key="FindReturnRef" value="true" />
+        <entry key="FindRunInvocations" value="true" />
+        <entry key="FindSelfComparison" value="true" />
+        <entry key="FindSelfComparison2" value="true" />
+        <entry key="FindSleepWithLockHeld" value="true" />
+        <entry key="FindSpinLoop" value="true" />
+        <entry key="FindSqlInjection" value="true" />
+        <entry key="FindTwoLockWait" value="true" />
+        <entry key="FindUncalledPrivateMethods" value="true" />
+        <entry key="FindUnconditionalWait" value="true" />
+        <entry key="FindUninitializedGet" value="true" />
+        <entry key="FindUnrelatedTypesInGenericContainer" value="true" />
+        <entry key="FindUnreleasedLock" value="true" />
+        <entry key="FindUnsatisfiedObligation" value="true" />
+        <entry key="FindUnsyncGet" value="true" />
+        <entry key="FindUselessControlFlow" value="true" />
+        <entry key="FormatStringChecker" value="true" />
+        <entry key="HugeSharedStringConstants" value="true" />
+        <entry key="IDivResultCastToDouble" value="true" />
+        <entry key="IncompatMask" value="true" />
+        <entry key="InconsistentAnnotations" value="true" />
+        <entry key="InefficientMemberAccess" value="false" />
+        <entry key="InefficientToArray" value="true" />
+        <entry key="InfiniteLoop" value="true" />
+        <entry key="InfiniteRecursiveLoop" value="true" />
+        <entry key="InfiniteRecursiveLoop2" value="false" />
+        <entry key="InheritanceUnsafeGetResource" value="true" />
+        <entry key="InitializationChain" value="true" />
+        <entry key="InstantiateStaticClass" value="true" />
+        <entry key="InvalidJUnitTest" value="true" />
+        <entry key="IteratorIdioms" value="true" />
+        <entry key="LazyInit" value="true" />
+        <entry key="LoadOfKnownNullValue" value="true" />
+        <entry key="LockedFields" value="false" />
+        <entry key="LostLoggerDueToWeakReference" value="true" />
+        <entry key="MethodReturnCheck" value="true" />
+        <entry key="Methods" value="true" />
+        <entry key="MultithreadedInstanceAccess" value="true" />
+        <entry key="MutableLock" value="true" />
+        <entry key="MutableStaticFields" value="true" />
+        <entry key="Naming" value="true" />
+        <entry key="Noise" value="false" />
+        <entry key="NoiseNullDeref" value="false" />
+        <entry key="NoteAnnotationRetention" value="true" />
+        <entry key="NoteCheckReturnValue" value="true" />
+        <entry key="NoteCheckReturnValueAnnotations" value="true" />
+        <entry key="NoteDirectlyRelevantTypeQualifiers" value="true" />
+        <entry key="NoteJCIPAnnotation" value="true" />
+        <entry key="NoteNonNullAnnotations" value="true" />
+        <entry key="NoteNonnullReturnValues" value="true" />
+        <entry key="NoteSuppressedWarnings" value="true" />
+        <entry key="NoteUnconditionalParamDerefs" value="true" />
+        <entry key="NumberConstructor" value="true" />
+        <entry key="OverridingEqualsNotSymmetrical" value="true" />
+        <entry key="PreferZeroLengthArrays" value="true" />
+        <entry key="PublicSemaphores" value="false" />
+        <entry key="QuestionableBooleanAssignment" value="true" />
+        <entry key="ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass" value="true" />
+        <entry key="ReadReturnShouldBeChecked" value="true" />
+        <entry key="RedundantInterfaces" value="true" />
+        <entry key="ReflectiveClasses" value="true" />
+        <entry key="RepeatedConditionals" value="true" />
+        <entry key="ResolveAllReferences" value="false" />
+        <entry key="RuntimeExceptionCapture" value="true" />
+        <entry key="SerializableIdiom" value="true" />
+        <entry key="StartInConstructor" value="true" />
+        <entry key="StaticCalendarDetector" value="true" />
+        <entry key="StringConcatenation" value="true" />
+        <entry key="SuperfluousInstanceOf" value="true" />
+        <entry key="SuspiciousThreadInterrupted" value="true" />
+        <entry key="SwitchFallthrough" value="true" />
+        <entry key="SynchronizationOnSharedBuiltinConstant" value="true" />
+        <entry key="SynchronizeAndNullCheckField" value="true" />
+        <entry key="SynchronizeOnClassLiteralNotGetClass" value="true" />
+        <entry key="SynchronizingOnContentsOfFieldToProtectField" value="true" />
+        <entry key="TestASM" value="false" />
+        <entry key="TestDataflowAnalysis" value="false" />
+        <entry key="TestingGround" value="false" />
+        <entry key="TrainFieldStoreTypes" value="true" />
+        <entry key="TrainNonNullAnnotations" value="true" />
+        <entry key="TrainUnconditionalDerefParams" value="true" />
+        <entry key="URLProblems" value="true" />
+        <entry key="UncallableMethodOfAnonymousClass" value="true" />
+        <entry key="UnnecessaryMath" value="true" />
+        <entry key="UnreadFields" value="true" />
+        <entry key="UseObjectEquals" value="false" />
+        <entry key="UselessSubclassMethod" value="false" />
+        <entry key="VarArgsProblems" value="true" />
+        <entry key="VolatileUsage" value="true" />
+        <entry key="WaitInLoop" value="true" />
+        <entry key="WrongMapIterator" value="true" />
+        <entry key="XMLFactoryBypass" value="true" />
+      </map>
+    </option>
+    <option name="_reportCategories">
+      <map>
+        <entry key="BAD_PRACTICE" value="true" />
+        <entry key="CORRECTNESS" value="true" />
+        <entry key="EXPERIMENTAL" value="true" />
+        <entry key="I18N" value="true" />
+        <entry key="MALICIOUS_CODE" value="true" />
+        <entry key="MT_CORRECTNESS" value="true" />
+        <entry key="NOISE" value="false" />
+        <entry key="PERFORMANCE" value="true" />
+        <entry key="SECURITY" value="true" />
+        <entry key="STYLE" value="true" />
+      </map>
+    </option>
+  </component>
+</module>
+

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/IDEA/projects/java/opt.iml
----------------------------------------------------------------------
diff --git a/development/IDEA/projects/java/opt.iml b/development/IDEA/projects/java/opt.iml
new file mode 100755
index 0000000..aef3ce3
--- /dev/null
+++ b/development/IDEA/projects/java/opt.iml
@@ -0,0 +1,329 @@
+<?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.
+
+-->
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/../../../../modules/opt/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../modules/opt">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../modules/opt/src/jrun" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../../modules/opt/src/oracle" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../../modules/opt/src/tomcat" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../../modules/opt/src/weblogic" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../../modules/opt/src/websphere" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../modules/opt/lib/jazncore.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../modules/opt/lib/asynchbeans.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../modules/opt/lib/weblogic.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../modules/opt/lib/oc4j-api.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../modules/opt/lib/sas.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../modules/opt/lib/catalina.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../modules/opt/lib/wsexception.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../modules/opt/lib/servlet.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../modules/opt/lib/mx4j-jmx.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../modules/opt/lib/catalina-4150.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../modules/opt/lib/jrun.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../lib/servlet.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="common" />
+    <orderEntry type="module" module-name="core" />
+  </component>
+  <component name="org.twodividedbyzero.idea.findbugs">
+    <option name="_basePreferences">
+      <map>
+        <entry key="property.analysisEffortLevel" value="default" />
+        <entry key="property.analyzeAfterCompile" value="false" />
+        <entry key="property.minPriorityToReport" value="Medium" />
+        <entry key="property.runAnalysisInBackground" value="false" />
+        <entry key="property.showHiddenDetectors" value="false" />
+        <entry key="property.toolWindowToFront" value="true" />
+      </map>
+    </option>
+    <option name="_detectors">
+      <map>
+        <entry key="AppendingToAnObjectOutputStream" value="true" />
+        <entry key="BCPMethodReturnCheck" value="false" />
+        <entry key="BadAppletConstructor" value="false" />
+        <entry key="BadResultSetAccess" value="true" />
+        <entry key="BadSyntaxForRegularExpression" value="true" />
+        <entry key="BadUseOfReturnValue" value="true" />
+        <entry key="BadlyOverriddenAdapter" value="true" />
+        <entry key="BooleanReturnNull" value="true" />
+        <entry key="BuildInterproceduralCallGraph" value="false" />
+        <entry key="BuildObligationPolicyDatabase" value="true" />
+        <entry key="CallToUnsupportedMethod" value="false" />
+        <entry key="CalledMethods" value="true" />
+        <entry key="CheckCalls" value="false" />
+        <entry key="CheckExpectedWarnings" value="false" />
+        <entry key="CheckImmutableAnnotation" value="true" />
+        <entry key="CheckTypeQualifiers" value="true" />
+        <entry key="CloneIdiom" value="true" />
+        <entry key="ComparatorIdiom" value="true" />
+        <entry key="ConfusedInheritance" value="true" />
+        <entry key="ConfusionBetweenInheritedAndOuterMethod" value="true" />
+        <entry key="CrossSiteScripting" value="true" />
+        <entry key="DoInsideDoPrivileged" value="true" />
+        <entry key="DontCatchIllegalMonitorStateException" value="true" />
+        <entry key="DontIgnoreResultOfPutIfAbsent" value="true" />
+        <entry key="DontUseEnum" value="true" />
+        <entry key="DroppedException" value="true" />
+        <entry key="DumbMethodInvocations" value="true" />
+        <entry key="DumbMethods" value="true" />
+        <entry key="DuplicateBranches" value="true" />
+        <entry key="EmptyZipFileEntry" value="true" />
+        <entry key="EqStringTest" value="false" />
+        <entry key="EqualsOperandShouldHaveClassCompatibleWithThis" value="true" />
+        <entry key="FieldItemSummary" value="true" />
+        <entry key="FinalizerNullsFields" value="true" />
+        <entry key="FindBadCast" value="false" />
+        <entry key="FindBadCast2" value="true" />
+        <entry key="FindBadEqualsImplementation" value="false" />
+        <entry key="FindBadForLoop" value="true" />
+        <entry key="FindBugsSummaryStats" value="true" />
+        <entry key="FindCircularDependencies" value="false" />
+        <entry key="FindDeadLocalStores" value="true" />
+        <entry key="FindDoubleCheck" value="true" />
+        <entry key="FindEmptySynchronizedBlock" value="true" />
+        <entry key="FindFieldSelfAssignment" value="true" />
+        <entry key="FindFinalizeInvocations" value="true" />
+        <entry key="FindFloatEquality" value="true" />
+        <entry key="FindFloatMath" value="false" />
+        <entry key="FindHEmismatch" value="true" />
+        <entry key="FindInconsistentSync2" value="true" />
+        <entry key="FindJSR166LockMonitorenter" value="true" />
+        <entry key="FindLocalSelfAssignment2" value="true" />
+        <entry key="FindMaskedFields" value="true" />
+        <entry key="FindMismatchedWaitOrNotify" value="true" />
+        <entry key="FindNakedNotify" value="true" />
+        <entry key="FindNonSerializableStoreIntoSession" value="true" />
+        <entry key="FindNonSerializableValuePassedToWriteObject" value="true" />
+        <entry key="FindNonShortCircuit" value="true" />
+        <entry key="FindNullDeref" value="true" />
+        <entry key="FindNullDerefsInvolvingNonShortCircuitEvaluation" value="true" />
+        <entry key="FindOpenStream" value="true" />
+        <entry key="FindPuzzlers" value="true" />
+        <entry key="FindRefComparison" value="true" />
+        <entry key="FindReturnRef" value="true" />
+        <entry key="FindRunInvocations" value="true" />
+        <entry key="FindSelfComparison" value="true" />
+        <entry key="FindSelfComparison2" value="true" />
+        <entry key="FindSleepWithLockHeld" value="true" />
+        <entry key="FindSpinLoop" value="true" />
+        <entry key="FindSqlInjection" value="true" />
+        <entry key="FindTwoLockWait" value="true" />
+        <entry key="FindUncalledPrivateMethods" value="true" />
+        <entry key="FindUnconditionalWait" value="true" />
+        <entry key="FindUninitializedGet" value="true" />
+        <entry key="FindUnrelatedTypesInGenericContainer" value="true" />
+        <entry key="FindUnreleasedLock" value="true" />
+        <entry key="FindUnsatisfiedObligation" value="true" />
+        <entry key="FindUnsyncGet" value="true" />
+        <entry key="FindUselessControlFlow" value="true" />
+        <entry key="FormatStringChecker" value="true" />
+        <entry key="HugeSharedStringConstants" value="true" />
+        <entry key="IDivResultCastToDouble" value="true" />
+        <entry key="IncompatMask" value="true" />
+        <entry key="InconsistentAnnotations" value="true" />
+        <entry key="InefficientMemberAccess" value="false" />
+        <entry key="InefficientToArray" value="true" />
+        <entry key="InfiniteLoop" value="true" />
+        <entry key="InfiniteRecursiveLoop" value="true" />
+        <entry key="InfiniteRecursiveLoop2" value="false" />
+        <entry key="InheritanceUnsafeGetResource" value="true" />
+        <entry key="InitializationChain" value="true" />
+        <entry key="InstantiateStaticClass" value="true" />
+        <entry key="InvalidJUnitTest" value="true" />
+        <entry key="IteratorIdioms" value="true" />
+        <entry key="LazyInit" value="true" />
+        <entry key="LoadOfKnownNullValue" value="true" />
+        <entry key="LockedFields" value="false" />
+        <entry key="LostLoggerDueToWeakReference" value="true" />
+        <entry key="MethodReturnCheck" value="true" />
+        <entry key="Methods" value="true" />
+        <entry key="MultithreadedInstanceAccess" value="true" />
+        <entry key="MutableLock" value="true" />
+        <entry key="MutableStaticFields" value="true" />
+        <entry key="Naming" value="true" />
+        <entry key="Noise" value="false" />
+        <entry key="NoiseNullDeref" value="false" />
+        <entry key="NoteAnnotationRetention" value="true" />
+        <entry key="NoteCheckReturnValue" value="true" />
+        <entry key="NoteCheckReturnValueAnnotations" value="true" />
+        <entry key="NoteDirectlyRelevantTypeQualifiers" value="true" />
+        <entry key="NoteJCIPAnnotation" value="true" />
+        <entry key="NoteNonNullAnnotations" value="true" />
+        <entry key="NoteNonnullReturnValues" value="true" />
+        <entry key="NoteSuppressedWarnings" value="true" />
+        <entry key="NoteUnconditionalParamDerefs" value="true" />
+        <entry key="NumberConstructor" value="true" />
+        <entry key="OverridingEqualsNotSymmetrical" value="true" />
+        <entry key="PreferZeroLengthArrays" value="true" />
+        <entry key="PublicSemaphores" value="false" />
+        <entry key="QuestionableBooleanAssignment" value="true" />
+        <entry key="ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass" value="true" />
+        <entry key="ReadReturnShouldBeChecked" value="true" />
+        <entry key="RedundantInterfaces" value="true" />
+        <entry key="ReflectiveClasses" value="true" />
+        <entry key="RepeatedConditionals" value="true" />
+        <entry key="ResolveAllReferences" value="false" />
+        <entry key="RuntimeExceptionCapture" value="true" />
+        <entry key="SerializableIdiom" value="true" />
+        <entry key="StartInConstructor" value="true" />
+        <entry key="StaticCalendarDetector" value="true" />
+        <entry key="StringConcatenation" value="true" />
+        <entry key="SuperfluousInstanceOf" value="true" />
+        <entry key="SuspiciousThreadInterrupted" value="true" />
+        <entry key="SwitchFallthrough" value="true" />
+        <entry key="SynchronizationOnSharedBuiltinConstant" value="true" />
+        <entry key="SynchronizeAndNullCheckField" value="true" />
+        <entry key="SynchronizeOnClassLiteralNotGetClass" value="true" />
+        <entry key="SynchronizingOnContentsOfFieldToProtectField" value="true" />
+        <entry key="TestASM" value="false" />
+        <entry key="TestDataflowAnalysis" value="false" />
+        <entry key="TestingGround" value="false" />
+        <entry key="TrainFieldStoreTypes" value="true" />
+        <entry key="TrainNonNullAnnotations" value="true" />
+        <entry key="TrainUnconditionalDerefParams" value="true" />
+        <entry key="URLProblems" value="true" />
+        <entry key="UncallableMethodOfAnonymousClass" value="true" />
+        <entry key="UnnecessaryMath" value="true" />
+        <entry key="UnreadFields" value="true" />
+        <entry key="UseObjectEquals" value="false" />
+        <entry key="UselessSubclassMethod" value="false" />
+        <entry key="VarArgsProblems" value="true" />
+        <entry key="VolatileUsage" value="true" />
+        <entry key="WaitInLoop" value="true" />
+        <entry key="WrongMapIterator" value="true" />
+        <entry key="XMLFactoryBypass" value="true" />
+      </map>
+    </option>
+    <option name="_reportCategories">
+      <map>
+        <entry key="BAD_PRACTICE" value="true" />
+        <entry key="CORRECTNESS" value="true" />
+        <entry key="EXPERIMENTAL" value="true" />
+        <entry key="I18N" value="true" />
+        <entry key="MALICIOUS_CODE" value="true" />
+        <entry key="MT_CORRECTNESS" value="true" />
+        <entry key="NOISE" value="false" />
+        <entry key="PERFORMANCE" value="true" />
+        <entry key="SECURITY" value="true" />
+        <entry key="STYLE" value="true" />
+      </map>
+    </option>
+  </component>
+</module>
+

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/IDEA/projects/java/proxy.iml
----------------------------------------------------------------------
diff --git a/development/IDEA/projects/java/proxy.iml b/development/IDEA/projects/java/proxy.iml
new file mode 100755
index 0000000..f1045e3
--- /dev/null
+++ b/development/IDEA/projects/java/proxy.iml
@@ -0,0 +1,235 @@
+<?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.
+
+-->
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/../../../../modules/proxy/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/../../../../modules/proxy">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../modules/proxy/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../lib/servlet.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../lib/commons-httpclient-3.1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="common" />
+    <orderEntry type="module" module-name="core" />
+  </component>
+  <component name="org.twodividedbyzero.idea.findbugs">
+    <option name="_basePreferences">
+      <map>
+        <entry key="property.analysisEffortLevel" value="default" />
+        <entry key="property.analyzeAfterCompile" value="false" />
+        <entry key="property.minPriorityToReport" value="Medium" />
+        <entry key="property.runAnalysisInBackground" value="false" />
+        <entry key="property.showHiddenDetectors" value="false" />
+        <entry key="property.toolWindowToFront" value="true" />
+      </map>
+    </option>
+    <option name="_detectors">
+      <map>
+        <entry key="AppendingToAnObjectOutputStream" value="true" />
+        <entry key="BCPMethodReturnCheck" value="false" />
+        <entry key="BadAppletConstructor" value="false" />
+        <entry key="BadResultSetAccess" value="true" />
+        <entry key="BadSyntaxForRegularExpression" value="true" />
+        <entry key="BadUseOfReturnValue" value="true" />
+        <entry key="BadlyOverriddenAdapter" value="true" />
+        <entry key="BooleanReturnNull" value="true" />
+        <entry key="BuildInterproceduralCallGraph" value="false" />
+        <entry key="BuildObligationPolicyDatabase" value="true" />
+        <entry key="CallToUnsupportedMethod" value="false" />
+        <entry key="CalledMethods" value="true" />
+        <entry key="CheckCalls" value="false" />
+        <entry key="CheckExpectedWarnings" value="false" />
+        <entry key="CheckImmutableAnnotation" value="true" />
+        <entry key="CheckTypeQualifiers" value="true" />
+        <entry key="CloneIdiom" value="true" />
+        <entry key="ComparatorIdiom" value="true" />
+        <entry key="ConfusedInheritance" value="true" />
+        <entry key="ConfusionBetweenInheritedAndOuterMethod" value="true" />
+        <entry key="CrossSiteScripting" value="true" />
+        <entry key="DoInsideDoPrivileged" value="true" />
+        <entry key="DontCatchIllegalMonitorStateException" value="true" />
+        <entry key="DontIgnoreResultOfPutIfAbsent" value="true" />
+        <entry key="DontUseEnum" value="true" />
+        <entry key="DroppedException" value="true" />
+        <entry key="DumbMethodInvocations" value="true" />
+        <entry key="DumbMethods" value="true" />
+        <entry key="DuplicateBranches" value="true" />
+        <entry key="EmptyZipFileEntry" value="true" />
+        <entry key="EqStringTest" value="false" />
+        <entry key="EqualsOperandShouldHaveClassCompatibleWithThis" value="true" />
+        <entry key="FieldItemSummary" value="true" />
+        <entry key="FinalizerNullsFields" value="true" />
+        <entry key="FindBadCast" value="false" />
+        <entry key="FindBadCast2" value="true" />
+        <entry key="FindBadEqualsImplementation" value="false" />
+        <entry key="FindBadForLoop" value="true" />
+        <entry key="FindBugsSummaryStats" value="true" />
+        <entry key="FindCircularDependencies" value="false" />
+        <entry key="FindDeadLocalStores" value="true" />
+        <entry key="FindDoubleCheck" value="true" />
+        <entry key="FindEmptySynchronizedBlock" value="true" />
+        <entry key="FindFieldSelfAssignment" value="true" />
+        <entry key="FindFinalizeInvocations" value="true" />
+        <entry key="FindFloatEquality" value="true" />
+        <entry key="FindFloatMath" value="false" />
+        <entry key="FindHEmismatch" value="true" />
+        <entry key="FindInconsistentSync2" value="true" />
+        <entry key="FindJSR166LockMonitorenter" value="true" />
+        <entry key="FindLocalSelfAssignment2" value="true" />
+        <entry key="FindMaskedFields" value="true" />
+        <entry key="FindMismatchedWaitOrNotify" value="true" />
+        <entry key="FindNakedNotify" value="true" />
+        <entry key="FindNonSerializableStoreIntoSession" value="true" />
+        <entry key="FindNonSerializableValuePassedToWriteObject" value="true" />
+        <entry key="FindNonShortCircuit" value="true" />
+        <entry key="FindNullDeref" value="true" />
+        <entry key="FindNullDerefsInvolvingNonShortCircuitEvaluation" value="true" />
+        <entry key="FindOpenStream" value="true" />
+        <entry key="FindPuzzlers" value="true" />
+        <entry key="FindRefComparison" value="true" />
+        <entry key="FindReturnRef" value="true" />
+        <entry key="FindRunInvocations" value="true" />
+        <entry key="FindSelfComparison" value="true" />
+        <entry key="FindSelfComparison2" value="true" />
+        <entry key="FindSleepWithLockHeld" value="true" />
+        <entry key="FindSpinLoop" value="true" />
+        <entry key="FindSqlInjection" value="true" />
+        <entry key="FindTwoLockWait" value="true" />
+        <entry key="FindUncalledPrivateMethods" value="true" />
+        <entry key="FindUnconditionalWait" value="true" />
+        <entry key="FindUninitializedGet" value="true" />
+        <entry key="FindUnrelatedTypesInGenericContainer" value="true" />
+        <entry key="FindUnreleasedLock" value="true" />
+        <entry key="FindUnsatisfiedObligation" value="true" />
+        <entry key="FindUnsyncGet" value="true" />
+        <entry key="FindUselessControlFlow" value="true" />
+        <entry key="FormatStringChecker" value="true" />
+        <entry key="HugeSharedStringConstants" value="true" />
+        <entry key="IDivResultCastToDouble" value="true" />
+        <entry key="IncompatMask" value="true" />
+        <entry key="InconsistentAnnotations" value="true" />
+        <entry key="InefficientMemberAccess" value="false" />
+        <entry key="InefficientToArray" value="true" />
+        <entry key="InfiniteLoop" value="true" />
+        <entry key="InfiniteRecursiveLoop" value="true" />
+        <entry key="InfiniteRecursiveLoop2" value="false" />
+        <entry key="InheritanceUnsafeGetResource" value="true" />
+        <entry key="InitializationChain" value="true" />
+        <entry key="InstantiateStaticClass" value="true" />
+        <entry key="InvalidJUnitTest" value="true" />
+        <entry key="IteratorIdioms" value="true" />
+        <entry key="LazyInit" value="true" />
+        <entry key="LoadOfKnownNullValue" value="true" />
+        <entry key="LockedFields" value="false" />
+        <entry key="LostLoggerDueToWeakReference" value="true" />
+        <entry key="MethodReturnCheck" value="true" />
+        <entry key="Methods" value="true" />
+        <entry key="MultithreadedInstanceAccess" value="true" />
+        <entry key="MutableLock" value="true" />
+        <entry key="MutableStaticFields" value="true" />
+        <entry key="Naming" value="true" />
+        <entry key="Noise" value="false" />
+        <entry key="NoiseNullDeref" value="false" />
+        <entry key="NoteAnnotationRetention" value="true" />
+        <entry key="NoteCheckReturnValue" value="true" />
+        <entry key="NoteCheckReturnValueAnnotations" value="true" />
+        <entry key="NoteDirectlyRelevantTypeQualifiers" value="true" />
+        <entry key="NoteJCIPAnnotation" value="true" />
+        <entry key="NoteNonNullAnnotations" value="true" />
+        <entry key="NoteNonnullReturnValues" value="true" />
+        <entry key="NoteSuppressedWarnings" value="true" />
+        <entry key="NoteUnconditionalParamDerefs" value="true" />
+        <entry key="NumberConstructor" value="true" />
+        <entry key="OverridingEqualsNotSymmetrical" value="true" />
+        <entry key="PreferZeroLengthArrays" value="true" />
+        <entry key="PublicSemaphores" value="false" />
+        <entry key="QuestionableBooleanAssignment" value="true" />
+        <entry key="ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass" value="true" />
+        <entry key="ReadReturnShouldBeChecked" value="true" />
+        <entry key="RedundantInterfaces" value="true" />
+        <entry key="ReflectiveClasses" value="true" />
+        <entry key="RepeatedConditionals" value="true" />
+        <entry key="ResolveAllReferences" value="false" />
+        <entry key="RuntimeExceptionCapture" value="true" />
+        <entry key="SerializableIdiom" value="true" />
+        <entry key="StartInConstructor" value="true" />
+        <entry key="StaticCalendarDetector" value="true" />
+        <entry key="StringConcatenation" value="true" />
+        <entry key="SuperfluousInstanceOf" value="true" />
+        <entry key="SuspiciousThreadInterrupted" value="true" />
+        <entry key="SwitchFallthrough" value="true" />
+        <entry key="SynchronizationOnSharedBuiltinConstant" value="true" />
+        <entry key="SynchronizeAndNullCheckField" value="true" />
+        <entry key="SynchronizeOnClassLiteralNotGetClass" value="true" />
+        <entry key="SynchronizingOnContentsOfFieldToProtectField" value="true" />
+        <entry key="TestASM" value="false" />
+        <entry key="TestDataflowAnalysis" value="false" />
+        <entry key="TestingGround" value="false" />
+        <entry key="TrainFieldStoreTypes" value="true" />
+        <entry key="TrainNonNullAnnotations" value="true" />
+        <entry key="TrainUnconditionalDerefParams" value="true" />
+        <entry key="URLProblems" value="true" />
+        <entry key="UncallableMethodOfAnonymousClass" value="true" />
+        <entry key="UnnecessaryMath" value="true" />
+        <entry key="UnreadFields" value="true" />
+        <entry key="UseObjectEquals" value="false" />
+        <entry key="UselessSubclassMethod" value="false" />
+        <entry key="VarArgsProblems" value="true" />
+        <entry key="VolatileUsage" value="true" />
+        <entry key="WaitInLoop" value="true" />
+        <entry key="WrongMapIterator" value="true" />
+        <entry key="XMLFactoryBypass" value="true" />
+      </map>
+    </option>
+    <option name="_reportCategories">
+      <map>
+        <entry key="BAD_PRACTICE" value="true" />
+        <entry key="CORRECTNESS" value="true" />
+        <entry key="EXPERIMENTAL" value="true" />
+        <entry key="I18N" value="true" />
+        <entry key="MALICIOUS_CODE" value="true" />
+        <entry key="MT_CORRECTNESS" value="true" />
+        <entry key="NOISE" value="false" />
+        <entry key="PERFORMANCE" value="true" />
+        <entry key="SECURITY" value="true" />
+        <entry key="STYLE" value="true" />
+      </map>
+    </option>
+  </component>
+</module>
+

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/IDEA/projects/java/remoting.iml
----------------------------------------------------------------------
diff --git a/development/IDEA/projects/java/remoting.iml b/development/IDEA/projects/java/remoting.iml
new file mode 100755
index 0000000..f753da6
--- /dev/null
+++ b/development/IDEA/projects/java/remoting.iml
@@ -0,0 +1,216 @@
+<?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.
+
+-->
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/../../../../modules/remoting/classes" />
+    <content url="file://$MODULE_DIR$/../../../../modules/remoting">
+      <sourceFolder url="file://$MODULE_DIR$/../../../../modules/remoting/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="common" />
+    <orderEntry type="module" module-name="core" />
+  </component>
+  <component name="org.twodividedbyzero.idea.findbugs">
+    <option name="_basePreferences">
+      <map>
+        <entry key="property.analysisEffortLevel" value="default" />
+        <entry key="property.analyzeAfterCompile" value="false" />
+        <entry key="property.minPriorityToReport" value="Medium" />
+        <entry key="property.runAnalysisInBackground" value="false" />
+        <entry key="property.showHiddenDetectors" value="false" />
+        <entry key="property.toolWindowToFront" value="true" />
+      </map>
+    </option>
+    <option name="_detectors">
+      <map>
+        <entry key="AppendingToAnObjectOutputStream" value="true" />
+        <entry key="BCPMethodReturnCheck" value="false" />
+        <entry key="BadAppletConstructor" value="false" />
+        <entry key="BadResultSetAccess" value="true" />
+        <entry key="BadSyntaxForRegularExpression" value="true" />
+        <entry key="BadUseOfReturnValue" value="true" />
+        <entry key="BadlyOverriddenAdapter" value="true" />
+        <entry key="BooleanReturnNull" value="true" />
+        <entry key="BuildInterproceduralCallGraph" value="false" />
+        <entry key="BuildObligationPolicyDatabase" value="true" />
+        <entry key="CallToUnsupportedMethod" value="false" />
+        <entry key="CalledMethods" value="true" />
+        <entry key="CheckCalls" value="false" />
+        <entry key="CheckExpectedWarnings" value="false" />
+        <entry key="CheckImmutableAnnotation" value="true" />
+        <entry key="CheckTypeQualifiers" value="true" />
+        <entry key="CloneIdiom" value="true" />
+        <entry key="ComparatorIdiom" value="true" />
+        <entry key="ConfusedInheritance" value="true" />
+        <entry key="ConfusionBetweenInheritedAndOuterMethod" value="true" />
+        <entry key="CrossSiteScripting" value="true" />
+        <entry key="DoInsideDoPrivileged" value="true" />
+        <entry key="DontCatchIllegalMonitorStateException" value="true" />
+        <entry key="DontIgnoreResultOfPutIfAbsent" value="true" />
+        <entry key="DontUseEnum" value="true" />
+        <entry key="DroppedException" value="true" />
+        <entry key="DumbMethodInvocations" value="true" />
+        <entry key="DumbMethods" value="true" />
+        <entry key="DuplicateBranches" value="true" />
+        <entry key="EmptyZipFileEntry" value="true" />
+        <entry key="EqStringTest" value="false" />
+        <entry key="EqualsOperandShouldHaveClassCompatibleWithThis" value="true" />
+        <entry key="FieldItemSummary" value="true" />
+        <entry key="FinalizerNullsFields" value="true" />
+        <entry key="FindBadCast" value="false" />
+        <entry key="FindBadCast2" value="true" />
+        <entry key="FindBadEqualsImplementation" value="false" />
+        <entry key="FindBadForLoop" value="true" />
+        <entry key="FindBugsSummaryStats" value="true" />
+        <entry key="FindCircularDependencies" value="false" />
+        <entry key="FindDeadLocalStores" value="true" />
+        <entry key="FindDoubleCheck" value="true" />
+        <entry key="FindEmptySynchronizedBlock" value="true" />
+        <entry key="FindFieldSelfAssignment" value="true" />
+        <entry key="FindFinalizeInvocations" value="true" />
+        <entry key="FindFloatEquality" value="true" />
+        <entry key="FindFloatMath" value="false" />
+        <entry key="FindHEmismatch" value="true" />
+        <entry key="FindInconsistentSync2" value="true" />
+        <entry key="FindJSR166LockMonitorenter" value="true" />
+        <entry key="FindLocalSelfAssignment2" value="true" />
+        <entry key="FindMaskedFields" value="true" />
+        <entry key="FindMismatchedWaitOrNotify" value="true" />
+        <entry key="FindNakedNotify" value="true" />
+        <entry key="FindNonSerializableStoreIntoSession" value="true" />
+        <entry key="FindNonSerializableValuePassedToWriteObject" value="true" />
+        <entry key="FindNonShortCircuit" value="true" />
+        <entry key="FindNullDeref" value="true" />
+        <entry key="FindNullDerefsInvolvingNonShortCircuitEvaluation" value="true" />
+        <entry key="FindOpenStream" value="true" />
+        <entry key="FindPuzzlers" value="true" />
+        <entry key="FindRefComparison" value="true" />
+        <entry key="FindReturnRef" value="true" />
+        <entry key="FindRunInvocations" value="true" />
+        <entry key="FindSelfComparison" value="true" />
+        <entry key="FindSelfComparison2" value="true" />
+        <entry key="FindSleepWithLockHeld" value="true" />
+        <entry key="FindSpinLoop" value="true" />
+        <entry key="FindSqlInjection" value="true" />
+        <entry key="FindTwoLockWait" value="true" />
+        <entry key="FindUncalledPrivateMethods" value="true" />
+        <entry key="FindUnconditionalWait" value="true" />
+        <entry key="FindUninitializedGet" value="true" />
+        <entry key="FindUnrelatedTypesInGenericContainer" value="true" />
+        <entry key="FindUnreleasedLock" value="true" />
+        <entry key="FindUnsatisfiedObligation" value="true" />
+        <entry key="FindUnsyncGet" value="true" />
+        <entry key="FindUselessControlFlow" value="true" />
+        <entry key="FormatStringChecker" value="true" />
+        <entry key="HugeSharedStringConstants" value="true" />
+        <entry key="IDivResultCastToDouble" value="true" />
+        <entry key="IncompatMask" value="true" />
+        <entry key="InconsistentAnnotations" value="true" />
+        <entry key="InefficientMemberAccess" value="false" />
+        <entry key="InefficientToArray" value="true" />
+        <entry key="InfiniteLoop" value="true" />
+        <entry key="InfiniteRecursiveLoop" value="true" />
+        <entry key="InfiniteRecursiveLoop2" value="false" />
+        <entry key="InheritanceUnsafeGetResource" value="true" />
+        <entry key="InitializationChain" value="true" />
+        <entry key="InstantiateStaticClass" value="true" />
+        <entry key="InvalidJUnitTest" value="true" />
+        <entry key="IteratorIdioms" value="true" />
+        <entry key="LazyInit" value="true" />
+        <entry key="LoadOfKnownNullValue" value="true" />
+        <entry key="LockedFields" value="false" />
+        <entry key="LostLoggerDueToWeakReference" value="true" />
+        <entry key="MethodReturnCheck" value="true" />
+        <entry key="Methods" value="true" />
+        <entry key="MultithreadedInstanceAccess" value="true" />
+        <entry key="MutableLock" value="true" />
+        <entry key="MutableStaticFields" value="true" />
+        <entry key="Naming" value="true" />
+        <entry key="Noise" value="false" />
+        <entry key="NoiseNullDeref" value="false" />
+        <entry key="NoteAnnotationRetention" value="true" />
+        <entry key="NoteCheckReturnValue" value="true" />
+        <entry key="NoteCheckReturnValueAnnotations" value="true" />
+        <entry key="NoteDirectlyRelevantTypeQualifiers" value="true" />
+        <entry key="NoteJCIPAnnotation" value="true" />
+        <entry key="NoteNonNullAnnotations" value="true" />
+        <entry key="NoteNonnullReturnValues" value="true" />
+        <entry key="NoteSuppressedWarnings" value="true" />
+        <entry key="NoteUnconditionalParamDerefs" value="true" />
+        <entry key="NumberConstructor" value="true" />
+        <entry key="OverridingEqualsNotSymmetrical" value="true" />
+        <entry key="PreferZeroLengthArrays" value="true" />
+        <entry key="PublicSemaphores" value="false" />
+        <entry key="QuestionableBooleanAssignment" value="true" />
+        <entry key="ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass" value="true" />
+        <entry key="ReadReturnShouldBeChecked" value="true" />
+        <entry key="RedundantInterfaces" value="true" />
+        <entry key="ReflectiveClasses" value="true" />
+        <entry key="RepeatedConditionals" value="true" />
+        <entry key="ResolveAllReferences" value="false" />
+        <entry key="RuntimeExceptionCapture" value="true" />
+        <entry key="SerializableIdiom" value="true" />
+        <entry key="StartInConstructor" value="true" />
+        <entry key="StaticCalendarDetector" value="true" />
+        <entry key="StringConcatenation" value="true" />
+        <entry key="SuperfluousInstanceOf" value="true" />
+        <entry key="SuspiciousThreadInterrupted" value="true" />
+        <entry key="SwitchFallthrough" value="true" />
+        <entry key="SynchronizationOnSharedBuiltinConstant" value="true" />
+        <entry key="SynchronizeAndNullCheckField" value="true" />
+        <entry key="SynchronizeOnClassLiteralNotGetClass" value="true" />
+        <entry key="SynchronizingOnContentsOfFieldToProtectField" value="true" />
+        <entry key="TestASM" value="false" />
+        <entry key="TestDataflowAnalysis" value="false" />
+        <entry key="TestingGround" value="false" />
+        <entry key="TrainFieldStoreTypes" value="true" />
+        <entry key="TrainNonNullAnnotations" value="true" />
+        <entry key="TrainUnconditionalDerefParams" value="true" />
+        <entry key="URLProblems" value="true" />
+        <entry key="UncallableMethodOfAnonymousClass" value="true" />
+        <entry key="UnnecessaryMath" value="true" />
+        <entry key="UnreadFields" value="true" />
+        <entry key="UseObjectEquals" value="false" />
+        <entry key="UselessSubclassMethod" value="false" />
+        <entry key="VarArgsProblems" value="true" />
+        <entry key="VolatileUsage" value="true" />
+        <entry key="WaitInLoop" value="true" />
+        <entry key="WrongMapIterator" value="true" />
+        <entry key="XMLFactoryBypass" value="true" />
+      </map>
+    </option>
+    <option name="_reportCategories">
+      <map>
+        <entry key="BAD_PRACTICE" value="true" />
+        <entry key="CORRECTNESS" value="true" />
+        <entry key="EXPERIMENTAL" value="true" />
+        <entry key="I18N" value="true" />
+        <entry key="MALICIOUS_CODE" value="true" />
+        <entry key="MT_CORRECTNESS" value="true" />
+        <entry key="NOISE" value="false" />
+        <entry key="PERFORMANCE" value="true" />
+        <entry key="SECURITY" value="true" />
+        <entry key="STYLE" value="true" />
+      </map>
+    </option>
+  </component>
+</module>
+

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/flex/3.0/framework/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/flex/3.0/framework/.actionScriptProperties b/development/eclipse/projects/flex/3.0/framework/.actionScriptProperties
new file mode 100755
index 0000000..eb2f42d
--- /dev/null
+++ b/development/eclipse/projects/flex/3.0/framework/.actionScriptProperties
@@ -0,0 +1,35 @@
+<?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.
+
+-->
+<actionScriptProperties mainApplicationPath="framework.as" version="3">
+<compiler additionalCompilerArguments="-locale=en_US,ja_JP" copyDependentFiles="false" enableModuleDebug="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="10.0.0" htmlPlayerVersionCheck="true" outputFolderPath="libs" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
+<compilerSourcePath>
+<compilerSourcePathEntry kind="1" linkType="1" path="${FLEX_SDK}/frameworks/projects/framework/src"/>
+<compilerSourcePathEntry kind="1" linkType="1" path="${FLEX_SDK}/frameworks/projects/framework/bundles/en_US"/>
+<compilerSourcePathEntry kind="1" linkType="1" path="${FLEX_SDK}/frameworks/projects/framework/bundles/ja_JP"/>
+</compilerSourcePath>
+<libraryPath defaultLinkType="1">
+<libraryPathEntry kind="3" linkType="2" path="${FLEX_SDK}/frameworks/libs/player/10/playerglobal.swc" useDefaultLinkType="false"/>
+</libraryPath>
+<sourceAttachmentPath/>
+</compiler>
+<applications/>
+<modules/>
+<buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/flex/3.0/framework/.flexLibProperties
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/flex/3.0/framework/.flexLibProperties b/development/eclipse/projects/flex/3.0/framework/.flexLibProperties
new file mode 100755
index 0000000..9b36c8a
--- /dev/null
+++ b/development/eclipse/projects/flex/3.0/framework/.flexLibProperties
@@ -0,0 +1,30 @@
+<?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.
+
+-->
+<flexLibProperties version="1">
+<includeClasses>
+<classEntry path="[source path] framework-src/FrameworkClasses"/>
+</includeClasses>
+<includeResources>
+<resourceEntry destPath="assets/Assets.swf" sourcePath="assets/Assets.swf"/>
+</includeResources>
+<namespaceManifests>
+<namespaceManifestEntry manifest="manifest.xml" namespace="http://www.adobe.com/2006/mxml"/>
+</namespaceManifests>
+</flexLibProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/flex/3.0/framework/.project
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/flex/3.0/framework/.project b/development/eclipse/projects/flex/3.0/framework/.project
new file mode 100755
index 0000000..306da15
--- /dev/null
+++ b/development/eclipse/projects/flex/3.0/framework/.project
@@ -0,0 +1,73 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>framework</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexlibnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+	<linkedResources>
+		<link>
+			<name>Assets.swf</name>
+			<type>1</type>
+			<locationURI>FLEX_SDK/frameworks/projects/framework/assets/Assets.swf</locationURI>
+		</link>
+		<link>
+			<name>[source path] en_US</name>
+			<type>2</type>
+			<locationURI>FLEX_SDK/frameworks/projects/framework/bundles/en_US</locationURI>
+		</link>
+		<link>
+			<name>[source path] ja_JP</name>
+			<type>2</type>
+			<locationURI>FLEX_SDK/frameworks/projects/framework/bundles/ja_JP</locationURI>
+		</link>
+		<link>
+			<name>[source path] src</name>
+			<type>2</type>
+			<locationURI>FLEX_SDK/frameworks/projects/framework/src</locationURI>
+		</link>
+		<link>
+			<name>build.xml</name>
+			<type>1</type>
+			<locationURI>FLEX_SDK/build.xml</locationURI>
+		</link>
+		<link>
+			<name>defaults.css</name>
+			<type>1</type>
+			<locationURI>FLEX_SDK/frameworks/projects/framework/defaults.css</locationURI>
+		</link>
+		<link>
+			<name>manifest.xml</name>
+			<type>1</type>
+			<locationURI>FLEX_SDK/frameworks/projects/framework/manifest.xml</locationURI>
+		</link>
+	</linkedResources>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/flex/3.0/rpc/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/flex/3.0/rpc/.actionScriptProperties b/development/eclipse/projects/flex/3.0/rpc/.actionScriptProperties
new file mode 100755
index 0000000..fa81857
--- /dev/null
+++ b/development/eclipse/projects/flex/3.0/rpc/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="rpc.as" version="3">
+  <compiler additionalCompilerArguments="-locale=en_US,ja_JP" copyDependentFiles="false" enableModuleDebug="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.0" htmlPlayerVersionCheck="true" outputFolderPath="libs" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
+    <compilerSourcePath>
+      <compilerSourcePathEntry kind="1" linkType="1" path="${FLEX_SDK}/frameworks/projects/rpc/src"/>
+      <compilerSourcePathEntry kind="1" linkType="1" path="${FLEX_SDK}/frameworks/projects/rpc/bundles/en_US"/>
+      <compilerSourcePathEntry kind="1" linkType="1" path="${FLEX_SDK}/frameworks/projects/rpc/bundles/ja_JP"/>
+    </compilerSourcePath>
+    <libraryPath defaultLinkType="1">
+      <libraryPathEntry kind="3" linkType="2" path="${FLEX_SDK}/frameworks/libs/player/10/playerglobal.swc" useDefaultLinkType="false"/>
+      <libraryPathEntry kind="3" linkType="2" path="${FLEX_SDK}/frameworks/libs/framework.swc" sourcepath="${FLEX_SDK}/frameworks/projects/framework/src" useDefaultLinkType="false"/>
+    </libraryPath>
+    <sourceAttachmentPath>
+      <sourceAttachmentPathEntry kind="3" linkType="2" path="${FLEX_SDK}/frameworks/libs/framework.swc" sourcepath="${FLEX_SDK}/frameworks/projects/framework/src" useDefaultLinkType="false"/>
+    </sourceAttachmentPath>
+  </compiler>
+  <applications/>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/flex/3.0/rpc/.flexLibProperties
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/flex/3.0/rpc/.flexLibProperties b/development/eclipse/projects/flex/3.0/rpc/.flexLibProperties
new file mode 100755
index 0000000..5547159
--- /dev/null
+++ b/development/eclipse/projects/flex/3.0/rpc/.flexLibProperties
@@ -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.
+
+-->
+<flexLibProperties version="1">
+<includeClasses>
+<classEntry path="[source path] rpc-src/RPCClasses"/>
+</includeClasses>
+<includeResources/>
+<namespaceManifests>
+<namespaceManifestEntry manifest="manifest.xml" namespace="http://www.adobe.com/2006/mxml"/>
+</namespaceManifests>
+</flexLibProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/flex/3.0/rpc/.project
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/flex/3.0/rpc/.project b/development/eclipse/projects/flex/3.0/rpc/.project
new file mode 100755
index 0000000..a84df89
--- /dev/null
+++ b/development/eclipse/projects/flex/3.0/rpc/.project
@@ -0,0 +1,69 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>rpc</name>
+	<comment></comment>
+	<projects>
+		<project>framework</project>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexlibnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+	<linkedResources>
+		<link>
+			<name>[source path] src</name>
+			<type>2</type>
+			<locationURI>FLEX_SDK/frameworks/projects/rpc/src</locationURI>
+		</link>
+		<link>
+			<name>[source path] ja_JP</name>
+			<type>2</type>
+			<locationURI>FLEX_SDK/frameworks/projects/rpc/bundles/ja_JP</locationURI>
+		</link>
+		<link>
+			<name>build.xml</name>
+			<type>1</type>
+			<locationURI>FLEX_SDK/frameworks/projects/rpc/build.xml</locationURI>
+		</link>
+		<link>
+			<name>[source path] en_US</name>
+			<type>2</type>
+			<locationURI>FLEX_SDK/frameworks/projects/rpc/bundles/en_US</locationURI>
+		</link>
+		<link>
+			<name>build.properties</name>
+			<type>1</type>
+			<locationURI>FLEX_SDK/frameworks/projects/rpc/build.properties</locationURI>
+		</link>
+		<link>
+			<name>manifest.xml</name>
+			<type>1</type>
+			<locationURI>FLEX_SDK/frameworks/projects/rpc/manifest.xml</locationURI>
+		</link>
+	</linkedResources>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/blazeds-common/.classpath
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/blazeds-common/.classpath b/development/eclipse/projects/java/blazeds-common/.classpath
new file mode 100755
index 0000000..88aa4f3
--- /dev/null
+++ b/development/eclipse/projects/java/blazeds-common/.classpath
@@ -0,0 +1,25 @@
+<?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.
+
+-->
+<classpath>
+	<classpathentry kind="src" path="java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+        <classpathentry kind="var" path="BLAZEDS_HOME/lib/xalan.jar"/>
+	<classpathentry kind="output" path="classes"/>
+</classpath>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/blazeds-common/.project
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/blazeds-common/.project b/development/eclipse/projects/java/blazeds-common/.project
new file mode 100755
index 0000000..bb38b19
--- /dev/null
+++ b/development/eclipse/projects/java/blazeds-common/.project
@@ -0,0 +1,52 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>blazeds-common</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+	<linkedResources>
+		<link>
+			<name>classes</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/common/classes</locationURI>
+		</link>
+		<link>
+			<name>build.xml</name>
+			<type>1</type>
+			<locationURI>BLAZEDS_HOME/modules/common/build.xml</locationURI>
+		</link>
+		<link>
+			<name>java</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/common/src</locationURI>
+		</link>
+	</linkedResources>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/blazeds-core/.classpath
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/blazeds-core/.classpath b/development/eclipse/projects/java/blazeds-core/.classpath
new file mode 100755
index 0000000..16b0bf1
--- /dev/null
+++ b/development/eclipse/projects/java/blazeds-core/.classpath
@@ -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.
+
+-->
+<classpath>
+	<classpathentry kind="src" path="java"/>
+    <classpathentry kind="src" path="test"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/blazeds-common"/>
+	<classpathentry kind="var" path="BLAZEDS_HOME/lib/jgroups-core-2.9.0GA.jar"/>
+	<classpathentry kind="var" path="BLAZEDS_HOME/lib/xalan.jar"/>
+	<classpathentry kind="var" path="BLAZEDS_HOME/lib/jms.jar"/>
+	<classpathentry kind="var" path="BLAZEDS_HOME/lib/servlet.jar"/>
+	<classpathentry kind="output" path="classes"/>
+</classpath>


[09/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FlexSession.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FlexSession.java b/modules/core/src/flex/messaging/FlexSession.java
new file mode 100755
index 0000000..2aa3e9c
--- /dev/null
+++ b/modules/core/src/flex/messaging/FlexSession.java
@@ -0,0 +1,1062 @@
+/*
+ * 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.messaging;
+
+import flex.messaging.client.FlexClient;
+import flex.messaging.client.FlexClientListener;
+import flex.messaging.log.LogCategories;
+import flex.messaging.messages.Message;
+import flex.messaging.util.TimeoutAbstractObject;
+
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * The base for FlexSession implementations.
+ */
+public abstract class FlexSession extends TimeoutAbstractObject implements FlexClientListener, MessageClientListener
+{
+    //--------------------------------------------------------------------------
+    //
+    // Public Static Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Log category for FlexSession related messages.
+     */
+    public static final String FLEX_SESSION_LOG_CATEGORY = LogCategories.ENDPOINT_FLEXSESSION;
+
+    /**
+     * @exclude
+     */
+    public static final int MAX_CONNECTIONS_PER_SESSION_UNLIMITED = -1;
+
+    //--------------------------------------------------------------------------
+    //
+    // Private Static Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * The set of session created listeners to notify upon a new session creation.
+     */
+    private static final CopyOnWriteArrayList<FlexSessionListener> createdListeners = new CopyOnWriteArrayList<FlexSessionListener>();
+
+    /**
+     * Error string constants.
+     */
+    private static final int FLEX_SESSION_INVALIDATED = 10019;
+
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @exclude
+     * @deprecated Post 2.6.1 releases require use of the constructor that takes an <tt>AbstractFlexSessionProvider</tt> argument.
+     */
+    public FlexSession()
+    {
+        this(null);
+    }
+
+    /**
+     * @exclude
+     * Constructs a new FlexSession instance.
+     *
+     * @param sessionProvider The provider that instantiated this instance.
+     */
+    public FlexSession(AbstractFlexSessionProvider sessionProvider)
+    {
+        this.sessionProvider = sessionProvider;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Static Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Adds a session created listener that will be notified when new sessions
+     * are created.
+     *
+     * @see flex.messaging.FlexSessionListener
+     *
+     * @param listener The listener to add.
+     */
+    public static void addSessionCreatedListener(FlexSessionListener listener)
+    {
+        if (listener != null)
+            createdListeners.addIfAbsent(listener);
+    }
+
+    /**
+     * Removes a session created listener.
+     *
+     * @see flex.messaging.FlexSessionListener
+     *
+     * @param listener The listener to remove.
+     */
+    public static void removeSessionCreatedListener(FlexSessionListener listener)
+    {
+        if (listener != null)
+            createdListeners.remove(listener);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Flag used to break cycles during invalidation.
+     */
+    protected boolean invalidating;
+
+    /**
+     * Instance level lock to sync for state changes.
+     */
+    protected final Object lock = new Object();
+
+    /**
+     * Flag indicated whether the session has been invalidated/destroyed.
+     */
+    protected boolean valid = true;
+
+    /**
+     * The attributes associated with this session.
+     */
+    private Map<String, Object> attributes;
+
+    /**
+     * Registered attribute listeners for the session.
+     */
+    private volatile CopyOnWriteArrayList<FlexSessionAttributeListener> attributeListeners;
+
+    /**
+     * Flag indicating whether creation notification has been completed.
+     */
+    private boolean creationNotified;
+
+    /**
+     * The set of session destroy listeners to notify when the session is destroyed.
+     */
+    private volatile CopyOnWriteArrayList<FlexSessionListener> destroyedListeners;
+
+    /**
+     * The associated FlexClients.
+     */
+    private final CopyOnWriteArrayList<FlexClient> flexClients = new CopyOnWriteArrayList<FlexClient>();
+
+    /**
+     * List of associated MessageClients created while this session was active (thread local).
+     */
+    private volatile CopyOnWriteArrayList<MessageClient> messageClients;
+
+    /**
+     * Storage for remote credentials associated with the session; used by the HTTPProxyService
+     * when requests are made to a secured remote endpoint.
+     */
+    private volatile Map remoteCredentials;
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  asyncPollMap
+    //----------------------------------
+
+    /**
+     * @exclude
+     * Used internally to manage async long-polls; not for public use.
+     *
+     * A map of endpoint to async poll objects that keeps track of what
+     * client is parked on a long-poll with what endpoint.
+     * We only want an endpoint to have a single connection to a client.
+     * Normally, the server leaves an async long-poll in place until
+     * data arrives to push to the client or a timeout is reached.
+     * However, if two or more browser tabs/windows are sharing the same server session and are both attempting
+     * async long-polling, we alternate their parked requests to avoid locking up the browser process by holding too many
+     * Http connections open at once.
+     * This also aids with closing out 'orphaned' long polls following a browser page reload.
+     * Generically typed as <code>Object</code>; using this reference is left up to async poll
+     * implementation code.
+     */
+    public volatile HashMap<String, FlexClient.AsyncPollWithTimeout> asyncPollMap;
+
+    //----------------------------------
+    //  flexSessionProvider
+    //----------------------------------
+
+    private final AbstractFlexSessionProvider sessionProvider;
+
+    /**
+     * @exclude
+     * Returns the session provider that created this instance.
+     *
+     * @return The session provider that created this instance.
+     */
+    public AbstractFlexSessionProvider getFlexSessionProvider()
+    {
+        return sessionProvider;
+    }
+
+    //----------------------------------
+    //  principal
+    //----------------------------------
+
+    /**
+     * The principal associated with the session.
+     */
+    private Principal userPrincipal;
+
+    /**
+     * This method should be called on FlexContext and not on this class.  Keeping
+     * this method for backwards compatibility.  This method will produce
+     * correct results when perClientAuthentication is false.  However, it will
+     * not return correct results when perClientAuthentication is true.
+     *
+     * Returns the principal associated with the session. If the client has not
+     * authenticated the principal will be null.
+     *
+     * @return The principal associated with the session.
+     */
+    public Principal getUserPrincipal()
+    {
+        synchronized (lock)
+        {
+            checkValid();
+            return userPrincipal;
+        }
+    }
+
+    /**
+     * This method should be called on FlexContext and not on this class.  Keeping
+     * this method for backwards compatibility.  Calling this when perClientAuthentication
+     * is true will not correctly set the UserPrincipal.
+     *
+     * @param userPrincipal The principal to associate with the session.
+     */
+    public void setUserPrincipal(Principal userPrincipal)
+    {
+        synchronized (lock)
+        {
+            checkValid();
+            this.userPrincipal = userPrincipal;
+        }
+    }
+
+    //----------------------------------
+    //  canStream
+    //----------------------------------
+
+    /**
+     * @exclude
+     * Used internally by streaming endpoints to enforce session level streaming
+     * connection limits; not for public use.
+     * This flag is volatile to allow for consistent reads across thread without
+     * needing to pay the cost for a synchronized lock for each read.
+     */
+    public volatile boolean canStream = true;
+
+    //----------------------------------
+    //  maxConnectionsPerSession
+    //----------------------------------
+
+    /**
+     * @exclude
+     * Used internally by streaming and long polling endpoints to enforce session
+     * level streaming connection limits; not for public use. Default value is -1
+     * (limitless)
+     */
+    public int maxConnectionsPerSession = MAX_CONNECTIONS_PER_SESSION_UNLIMITED;
+
+    //----------------------------------
+    //  streamingClientsCount
+    //----------------------------------
+
+    /**
+     * @exclude
+     * Used internally by streaming and long polling endpoints to enforce
+     * session level streaming connection limits; not for public use.
+     *
+     * Some browsers put limits on the number of connections per session. For
+     * example, Firefox has network.http.max-connections-per-server=8 limit which
+     * limits the number of streaming connections per session to 7. Similarly,
+     * IE has a limit of 2 per session.
+     *
+     * This variable is used by streaming and long polling endpoint to keep
+     * track of open connections per session and disallow them when needed.
+     *
+     */
+    public int streamingConnectionsCount;
+
+    //----------------------------------
+    //  useSmallMessages
+    //----------------------------------
+
+    /**
+     * @exclude
+     */
+    private boolean useSmallMessages;
+
+    /**
+     * @exclude
+     * Determines whether the server can attempt to send small messages
+     * for those messages that have a small form. This setting can be overridden
+     * by an endpoint's enableSmallMessages switch which controls whether
+     * small messages should be sent, even if they are supported.
+     *
+     * The default is false.
+     */
+    public boolean useSmallMessages()
+    {
+        return useSmallMessages;
+    }
+
+    /**
+     * @exclude
+     */
+    public void setUseSmallMessages(boolean value)
+    {
+        useSmallMessages = value;
+    }
+
+    //----------------------------------
+    //  waitMonitor
+    //----------------------------------
+
+    /**
+     * @exclude
+     * Used internally to manage wait()-based long-polls; not for public use.
+     *
+     * This is the monitor that a request handling thread associated with this
+     * FlexSession is waiting on. Normally, the waiting request handling thread will wait until
+     * a new message arrives that can be returned in a poll response or its wait interval times out.
+     * This also aids with closing out 'orphaned' long polls following a browser page reload.
+     */
+    public volatile HashMap<String, FlexClient.EndpointQueue> waitMonitor;
+
+    //--------------------------------------------------------------------------
+    //
+    // Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Adds a session attribute listener that will be notified when an
+     * attribute is added, removed or changed.
+     *
+     * @param listener The listener to add.
+     */
+    public void addSessionAttributeListener(FlexSessionAttributeListener listener)
+    {
+        if (listener != null)
+        {
+            checkValid();
+
+            if (attributeListeners == null)
+            {
+                synchronized (lock)
+                {
+                    if (attributeListeners == null)
+                        attributeListeners = new CopyOnWriteArrayList<FlexSessionAttributeListener>();
+                }
+            }
+
+            attributeListeners.addIfAbsent(listener);
+        }
+    }
+
+    /**
+     * Adds a session destroy listener that will be notified when the session
+     * is destroyed. Session destroy listeners are notified after all attributes
+     * have been unbound from the session and any FlexSessionBindingListeners
+     * and FlexSessionAttributeListeners have been notified.
+     *
+     * @see flex.messaging.FlexSessionListener
+     *
+     * @param listener The listener to add.
+     */
+    public void addSessionDestroyedListener(FlexSessionListener listener)
+    {
+        if (listener != null)
+        {
+            checkValid();
+
+            if (destroyedListeners == null)
+            {
+                synchronized (lock)
+                {
+                    if (destroyedListeners == null)
+                        destroyedListeners = new CopyOnWriteArrayList<FlexSessionListener>();
+                }
+            }
+
+            destroyedListeners.addIfAbsent(listener);
+        }
+    }
+
+    /**
+     * Returns the attribute bound to the specified name in the session, or null
+     * if no attribute is bound under the name.
+     *
+     * @param name The name the target attribute is bound to.
+     * @return The attribute bound to the specified name.
+     */
+    public Object getAttribute(String name)
+    {
+        synchronized (lock)
+        {
+            checkValid();
+
+            return (attributes == null) ? null : attributes.get(name);
+        }
+    }
+
+    /**
+     * Returns a snapshot of the names of all attributes bound to the session.
+     *
+     * @return A snapshot of the names of all attributes bound to the session.
+     */
+    public Enumeration<String> getAttributeNames()
+    {
+        synchronized (lock)
+        {
+            checkValid();
+
+            if (attributes == null)
+                return Collections.enumeration(Collections.<String>emptyList());
+
+            // Return a copy so we do not run into concurrent modification problems if
+            // someone adds to the attributes while iterating through the returned enumeration.
+            return Collections.enumeration(new ArrayList<String>(attributes.keySet()));
+        }
+    }
+
+    /**
+     * @exclude
+     * Implements MessageClientListener.
+     * Handling created events is a no-op.
+     *
+     * @messageClient The new MessageClient.
+     */
+    public void messageClientCreated(MessageClient messageClient) {}
+
+    /**
+     * @exclude
+     * Implements MessageClientListener.
+     * Notification that an associated MessageClient was destroyed.
+     *
+     * @param messageClient The MessageClient that was destroyed.
+     */
+    public void messageClientDestroyed(MessageClient messageClient)
+    {
+        unregisterMessageClient(messageClient);
+    }
+
+    /**
+     * @exclude
+     * FlexClient invokes this to determine whether the session can be used to push messages
+     * to the client.
+     *
+     * @return true if the FlexSession supports direct push; otherwise false (polling is assumed).
+     */
+    public abstract boolean isPushSupported();
+
+    /**
+     * @exclude
+     * FlexClient invokes this to push a message to a remote client.
+     *
+     * @param message The message to push.
+     */
+    public void push(Message message)
+    {
+        throw new UnsupportedOperationException("Push not supported.");
+    }
+
+    /**
+     * Removes the attribute bound to the specified name in the session.
+     *
+     * @param name The name of the attribute to remove.
+     */
+    public void removeAttribute(String name)
+    {
+        Object value; // Used for event dispatch after the attribute is removed.
+
+        synchronized (lock)
+        {
+            checkValid(); // Re-enters lock but should be fast because we're already holding it.
+
+            value = (attributes != null) ? attributes.remove(name) : null;
+        }
+
+        // If no value was bound under this name it's a no-op.
+        if (value == null)
+            return;
+
+        notifyAttributeUnbound(name, value);
+        notifyAttributeRemoved(name, value);
+    }
+
+    /**
+     * Removes a session attribute listener.
+     *
+     * @param listener The listener to remove.
+     */
+    public void removeSessionAttributeListener(FlexSessionAttributeListener listener)
+    {
+        // No need to check validity; removing a listener is always ok.
+        if (listener != null && attributeListeners != null)
+            attributeListeners.remove(listener);
+    }
+
+    /**
+     * Removes a session destroy listener.
+     *
+     * @see flex.messaging.FlexSessionListener
+     *
+     * @param listener The listener to remove.
+     */
+    public void removeSessionDestroyedListener(FlexSessionListener listener)
+    {
+        // No need to check validity; removing a listener is always ok.
+        if (listener != null && destroyedListeners != null)
+            destroyedListeners.remove(listener);
+    }
+
+    /**
+     * Binds an attribute value to the session under the specified name.
+     *
+     * @param name The name to bind the attribute under.
+     * @param value The value of the attribute.
+     */
+    public void setAttribute(String name, Object value)
+    {
+        // Null value is the same as removeAttribute().
+        if (value == null)
+        {
+            removeAttribute(name);
+            return;
+        }
+
+        Object oldValue; // Used to determine which events to dispatch after the set is performed.
+
+        // Only synchronize for the attribute mutation; event dispatch doesn't require it.
+        synchronized (lock)
+        {
+            checkValid(); // Re-enters lock but should be fast because we're already holding it.
+
+            if (attributes == null)
+                attributes = new HashMap<String, Object>();
+
+            oldValue = attributes.put(name, value);
+        }
+
+        if (oldValue == null)
+        {
+            notifyAttributeBound(name, value);
+            notifyAttributeAdded(name, value);
+        }
+        else
+        {
+            notifyAttributeUnbound(name, oldValue);
+            notifyAttributeReplaced(name, oldValue);
+            notifyAttributeBound(name, value);
+        }
+    }
+
+    /**
+     * Stores remote credentials in the session for proxied calls to remote systems.
+     *
+     * @param credentials The remote credentials.
+     */
+    public void putRemoteCredentials(FlexRemoteCredentials credentials)
+    {
+        if (credentials != null)
+        {
+            // We only need to hold the lock to lazy-init the remoteCredentials variable.
+            if (remoteCredentials == null)
+            {
+                synchronized (lock)
+                {
+                    // Init size to 4 because that's the number of shipping service types
+                    // (messaging, remoting, proxy, data management).
+                    if (remoteCredentials == null)
+                        remoteCredentials = new HashMap(4);
+                }
+            }
+            synchronized (remoteCredentials)
+            {
+                Map serviceMap = (Map)remoteCredentials.get(credentials.getService());
+                if (serviceMap == null)
+                {
+                    // Init size to half the normal number of buckets; most services won't have a large
+                    // number of destinations with remote credentials.
+                    serviceMap = new HashMap(7);
+                    remoteCredentials.put(credentials.getService(), serviceMap);
+                }
+                serviceMap.put(credentials.getDestination(), credentials);
+            }
+        }
+    }
+
+    /**
+     * Returns the remote credentials stored in the session for the specified service destination.
+     *
+     * @param serviceId The service id.
+     * @param destinationId The destination id.
+     * @return The stored remote credentials for the specified service destination.
+     */
+    public FlexRemoteCredentials getRemoteCredentials(String serviceId, String destinationId)
+    {
+        if (serviceId != null && destinationId != null)
+        {
+            if (remoteCredentials == null)
+                return null;
+            synchronized (remoteCredentials)
+            {
+                Map serviceMap = (Map)remoteCredentials.get(serviceId);
+                return (serviceMap != null) ? (FlexRemoteCredentials)serviceMap.get(destinationId) : null;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Clears any stored remote credentials from the session for the specified service destination.
+     *
+     * @param serviceId The service Id.
+     * @param destinationId The destination Id.
+     */
+    public void clearRemoteCredentials(String serviceId, String destinationId)
+    {
+        if (serviceId != null && destinationId != null)
+        {
+            if (remoteCredentials == null)
+                return;
+            synchronized (remoteCredentials)
+            {
+                Map serviceMap = (Map)remoteCredentials.get(serviceId);
+                if (serviceMap != null)
+                {
+                    serviceMap.put(destinationId, null);
+                }
+            }
+        }
+    }
+
+    /**
+     * Invalidates the FlexSession.
+     */
+    public void invalidate()
+    {
+        synchronized (lock)
+        {
+            if (!valid || invalidating)
+                return; // Already shutting down.
+
+            invalidating = true; // This thread gets to shut the FlexSession down.
+            cancelTimeout();
+            if (sessionProvider != null)
+                sessionProvider.removeFlexSession(this);
+        }
+
+        // Unregister all FlexClients.
+        if (!flexClients.isEmpty())
+        {
+            for (FlexClient flexClient :  flexClients)
+                unregisterFlexClient(flexClient);
+        }
+
+        // Invalidate associated MessageClient subscriptions.
+        if (messageClients != null && !messageClients.isEmpty())
+        {
+            for (Iterator<MessageClient> iter = messageClients.iterator(); iter.hasNext();)
+            {
+                MessageClient messageClient = iter.next();
+                messageClient.removeMessageClientDestroyedListener(this);
+                messageClient.invalidate();
+            }
+            messageClients.clear();
+        }
+
+
+        // Notify destroy listeners that we're shutting the FlexSession down.
+        if (destroyedListeners != null && !destroyedListeners.isEmpty())
+        {
+            for (FlexSessionListener destroyListener : destroyedListeners)
+            {
+                destroyListener.sessionDestroyed(this);
+            }
+            destroyedListeners.clear();
+        }
+
+        // Unbind all attributes.
+        if (attributes != null && !attributes.isEmpty())
+        {
+            Set<String> keySet = attributes.keySet();
+            String[] keys = keySet.toArray(new String[keySet.size()]);
+            for (String key : keys)
+                removeAttribute(key);
+
+            attributes = null;
+        }
+
+        internalInvalidate();
+
+        synchronized (lock)
+        {
+            valid = false;
+            invalidating = false;
+        }
+
+        // Notify any waiting threads.
+        if (waitMonitor != null)
+        {
+            for (FlexClient.EndpointQueue endpointQueue : waitMonitor.values())
+            {
+                synchronized (endpointQueue)
+                {
+                    endpointQueue.notifyAll();
+                }
+            }
+        }
+    }
+
+    /**
+     * Hook for subclasses to perform any custom shutdown.
+     * Invoked after the FlexSession has performed generic shutdown but right before the session's valid
+     * property flips to false.
+     */
+    protected void internalInvalidate() {}
+
+    /**
+     * Returns a snapshot of the FlexClients associated with the FlexSession
+     * when this method is invoked.
+     * This list is not guaranteed to remain consistent with the actual list
+     * of active FlexClients associated with the FlexSession over time.
+     *
+     * @return A snapshot of the current list of FlexSessions associated with the FlexClient.
+     */
+    public List<FlexClient> getFlexClients()
+    {
+        List<FlexClient> currentFlexClients = null;
+        synchronized (lock)
+        {
+            checkValid(); // Re-enters lock but should be fast because we're already holding it.
+
+            currentFlexClients = new ArrayList<FlexClient>(flexClients); // Make a copy of the current list to return.
+        }
+        return currentFlexClients;
+    }
+
+    /**
+     * Returns a snapshot of the MessageClients (subscriptions) associated with the FlexSession
+     * when this method is invoked.
+     * This list is not guaranteed to remain consistent with the actual list
+     * of active MessageClients associated with the FlexSession over time.
+     *
+     * @return A snapshot of the current list of MessageClients associated with the FlexSession.
+     */
+    public List<MessageClient> getMessageClients()
+    {
+        List<MessageClient> currentMessageClients = null;
+        synchronized (lock)
+        {
+            checkValid(); // Re-enters lock but should be fast because we're already holding it.
+
+            currentMessageClients = (messageClients != null) ? new ArrayList<MessageClient>(messageClients) // Make a copy of the current list to return.
+                                                             : new ArrayList<MessageClient>(); // Return an empty list.
+        }
+        return currentMessageClients;
+    }
+
+    /**
+     * Returns the Id for the session.
+     *
+     * @return The Id for the session.
+     */
+    public abstract String getId();
+
+    /**
+     * Returns whether the current user is in the specified role.
+     *
+     * @param role The role to test.
+     * @return true if the user is in the role; otherwise false.
+     */
+    public boolean isUserInRole(String role)
+    {
+        ArrayList list = new ArrayList();
+        list.add(role);
+        return FlexContext.getMessageBroker().getLoginManager().checkRoles(userPrincipal, list);
+    }
+
+    /**
+     * Returns whether the session is valid.
+     *
+     * @return true if the session is valid; otherwise false.
+     */
+    public boolean isValid()
+    {
+        synchronized (lock)
+        {
+            return valid;
+        }
+    }
+
+    /**
+     * @exclude
+     * Implements FlexClientListener interface.
+     * Notification that a FlexClient was created.
+     * This is a no-op because the FlexSession is never added as a static FlexClient created listener
+     * but this method is required by the interface. We only listen for the destroyed event from
+     * associated FlexClients.
+     *
+     * @param flexClient The FlexClient that was created.
+     */
+    public void clientCreated(FlexClient flexClient) {}
+
+    /**
+     * @exclude
+     * Implements FlexClientListener interface.
+     * Notification that an associated FlexClient was destroyed.
+     *
+     * @param flexClient The FlexClient that was destroyed.
+     */
+    public void clientDestroyed(FlexClient flexClient)
+    {
+        unregisterFlexClient(flexClient);
+    }
+
+    /**
+     * @exclude
+     * Used internally to associate a FlexClient with the FlexSession.
+     *
+     * @param flexClient The FlexClient to assocaite with the session.
+     */
+    public void registerFlexClient(FlexClient flexClient)
+    {
+        if (flexClients.addIfAbsent(flexClient))
+        {
+            flexClient.addClientDestroyedListener(this);
+            flexClient.registerFlexSession(this);
+        }
+    }
+
+    /**
+     * @exclude
+     * Used internally to disassociate a FlexClient from the FlexSession.
+     *
+     * @param flexClient The FlexClient to disassociate from the session.
+     */
+    public void unregisterFlexClient(FlexClient flexClient)
+    {
+        if (flexClients.remove(flexClient))
+        {
+            flexClient.removeClientDestroyedListener(this);
+            flexClient.unregisterFlexSession(this);
+        }
+    }
+
+    /**
+     * @exclude
+     * Used internally to associate a MessagClient (subscription) with the FlexSession.
+     *
+     * @param messageClient The MessageClient to associate with the session.
+     */
+    public void registerMessageClient(MessageClient messageClient)
+    {
+        if (messageClients == null)
+        {
+            synchronized (lock)
+            {
+                if (messageClients == null)
+                    messageClients = new CopyOnWriteArrayList<MessageClient>();
+            }
+        }
+
+        if (messageClients.addIfAbsent(messageClient))
+            messageClient.addMessageClientDestroyedListener(this);
+    }
+
+    /**
+     * @exclude
+     * Used internally to disassociate a MessageClient (subscription) from a FlexSession.
+     *
+     * @param messageClient The MessageClient to disassociate from the session.
+     */
+    public void unregisterMessageClient(MessageClient messageClient)
+    {
+        if (messageClients != null && messageClients.remove(messageClient))
+            messageClient.removeMessageClientDestroyedListener(this);
+    }
+
+    /**
+     * Default implementation invokes <code>invalidate()</code> upon timeout.
+     *
+     * @see flex.messaging.util.TimeoutCapable#timeout()
+     */
+    public void timeout()
+    {
+        invalidate();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Protected Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Ensures that the session has not been invalidated.
+     */
+    protected void checkValid()
+    {
+        synchronized (lock)
+        {
+            if (!valid)
+            {
+                LocalizedException e = new LocalizedException();
+                e.setMessage(FLEX_SESSION_INVALIDATED);
+                throw e;
+            }
+        }
+    }
+
+    /**
+     * Notify attribute listeners that an attribute has been added.
+     *
+     * @param name The name of the attribute.
+     * @param value The new value of the attribute.
+     */
+    protected void notifyAttributeAdded(String name, Object value)
+    {
+        if (attributeListeners != null && !attributeListeners.isEmpty())
+        {
+            FlexSessionBindingEvent event = new FlexSessionBindingEvent(this, name, value);
+            // CopyOnWriteArrayList is iteration-safe from ConcurrentModificationExceptions.
+            for (FlexSessionAttributeListener attribListener : attributeListeners)
+                attribListener.attributeAdded(event);
+        }
+    }
+
+    /**
+     * Notify binding listener that it has been bound to the session.
+     *
+     * @param name The attribute name.
+     * @param value The attribute that has been bound.
+     */
+    protected void notifyAttributeBound(String name, Object value)
+    {
+        if ((value != null) && (value instanceof FlexSessionBindingListener))
+        {
+            FlexSessionBindingEvent bindingEvent = new FlexSessionBindingEvent(this, name);
+            ((FlexSessionBindingListener)value).valueBound(bindingEvent);
+        }
+    }
+
+    /**
+     * Notify attribute listeners that an attribute has been removed.
+     *
+     * @param name The name of the attribute.
+     * @param value The previous value of the attribute.
+     */
+    protected void notifyAttributeRemoved(String name, Object value)
+    {
+        if (attributeListeners != null && !attributeListeners.isEmpty())
+        {
+            FlexSessionBindingEvent event = new FlexSessionBindingEvent(this, name, value);
+            // CopyOnWriteArrayList is iteration-safe from ConcurrentModificationExceptions.
+            for (FlexSessionAttributeListener attribListener : attributeListeners)
+                attribListener.attributeRemoved(event);
+        }
+    }
+
+    /**
+     * Notify attribute listeners that an attribute has been replaced.
+     *
+     * @param name The name of the attribute.
+     * @param value The previous value of the attribute.
+     */
+    protected void notifyAttributeReplaced(String name, Object value)
+    {
+        if (attributeListeners != null && !attributeListeners.isEmpty())
+        {
+            FlexSessionBindingEvent event = new FlexSessionBindingEvent(this, name, value);
+            // CopyOnWriteArrayList is iteration-safe from ConcurrentModificationExceptions.
+            for (FlexSessionAttributeListener attribListener : attributeListeners)
+                attribListener.attributeReplaced(event);
+        }
+    }
+
+    /**
+     * Notify binding listener that it has been unbound from the session.
+     *
+     * @param name The attribute name.
+     * @param value The attribute that has been unbound.
+     */
+    protected void notifyAttributeUnbound(String name, Object value)
+    {
+        if ((value != null) && (value instanceof FlexSessionBindingListener))
+        {
+            FlexSessionBindingEvent bindingEvent = new FlexSessionBindingEvent(this, name);
+            ((FlexSessionBindingListener)value).valueUnbound(bindingEvent);
+        }
+    }
+
+    /**
+     * Invoked by subclass upon session creation to notify all registered
+     * session create listeners of the event.
+     * This method must be invoked in the subclass constructor.
+     */
+    protected void notifyCreated()
+    {
+        // This guard is here only to prevent duplicate notifications if there's a coding error
+        // in the subclass. Not likely..
+        synchronized (lock)
+        {
+            if (creationNotified)
+                return;
+
+            creationNotified = true;
+        }
+
+        if (!createdListeners.isEmpty())
+        {
+            // CopyOnWriteArrayList is iteration-safe from ConcurrentModificationExceptions.
+            for (Iterator<FlexSessionListener> iter = createdListeners.iterator(); iter.hasNext();)
+                iter.next().sessionCreated(this);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FlexSessionAttributeListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FlexSessionAttributeListener.java b/modules/core/src/flex/messaging/FlexSessionAttributeListener.java
new file mode 100755
index 0000000..b889d67
--- /dev/null
+++ b/modules/core/src/flex/messaging/FlexSessionAttributeListener.java
@@ -0,0 +1,47 @@
+/*
+ * 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.messaging;
+
+/**
+ * Interface for Flex session attribute listeners.
+ */
+public interface FlexSessionAttributeListener
+{
+    /**
+     * Callback invoked after an attribute is added to the session.
+     * 
+     * @param event The event containing the associated session and attribute
+     *              information.
+     */
+    void attributeAdded(FlexSessionBindingEvent event);
+    
+    /**
+     * Callback invoked after an attribute is removed from the session.
+     * 
+     * @param event The event containing the associated session and attribute
+     *              information.
+     */
+    void attributeRemoved(FlexSessionBindingEvent event);
+    
+    /**
+     * Callback invoked after an attribute has been replaced with a new value.
+     * 
+     * @param event The event containing the associated session and attribute
+     *              information.
+     */
+    void attributeReplaced(FlexSessionBindingEvent event);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FlexSessionBindingEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FlexSessionBindingEvent.java b/modules/core/src/flex/messaging/FlexSessionBindingEvent.java
new file mode 100755
index 0000000..872fa9c
--- /dev/null
+++ b/modules/core/src/flex/messaging/FlexSessionBindingEvent.java
@@ -0,0 +1,114 @@
+/*
+ * 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.messaging;
+
+/**
+ * Event used to notify FlexSessionAttributeListeners of changes to session
+ * attributes.
+ */
+public class FlexSessionBindingEvent
+{
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Constructs an event for an attribute that is bound or unbound from a session.
+     * 
+     * @param session The associated session.
+     * @param name The attribute name.
+     */
+    public FlexSessionBindingEvent(FlexSession session, String name)
+    {
+        this.session = session;
+        this.name = name;
+    }
+    
+    /**
+     * Constructs an event for an attribute that is added to a session or 
+     * replaced by a new value.
+     * 
+     * @param session The associated session.
+     * @param name The attribute name.
+     * @param value The attribute value.
+     */
+    public FlexSessionBindingEvent(FlexSession session, String name, Object value)
+    {
+        this.session = session;
+        this.name = name;
+        this.value = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * The session that generated the event.
+     */
+    private FlexSession session;
+    
+    /**
+     * The name of the attribute associated with the event.
+     */
+    private String name;
+    
+    /**
+     * The value of the attribute associated with the event.
+     */
+    private Object value;
+    
+    //--------------------------------------------------------------------------
+    //
+    // Methods
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     * Returns the Flex session that generated the event.
+     * 
+     * @return The Flex session that generated the event.
+     */
+    public FlexSession getSession()
+    {
+        return session;
+    }
+    
+    /**
+     * Returns the name of the attribute associated with the event.
+     * 
+     * @return The name of the attribute associated with the event.
+     */
+    public String getName()
+    {
+        return name;
+    }
+    
+    /**
+     * Returns the value of the attribute associated with the event.
+     * 
+     * @return The value of the attribute associated with the event.
+     */
+    public Object getValue()
+    {
+        return value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FlexSessionBindingListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FlexSessionBindingListener.java b/modules/core/src/flex/messaging/FlexSessionBindingListener.java
new file mode 100755
index 0000000..426f852
--- /dev/null
+++ b/modules/core/src/flex/messaging/FlexSessionBindingListener.java
@@ -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 flex.messaging;
+
+/**
+ * Interface to be notified when the object is bound or unbound from the Flex
+ * session.
+ */
+public interface FlexSessionBindingListener
+{
+    /**
+     * Callback invoked when the object is bound to a Flex session.
+     * 
+     * @param event The event containing the associated session and attribute
+     *              information.
+     */
+    void valueBound(FlexSessionBindingEvent event);
+    
+    /**
+     * Callback invoked when the object is unbound from a Flex session.
+     * 
+     * @param event The event containing the associated session and attribute
+     *              information.
+     */
+    void valueUnbound(FlexSessionBindingEvent event);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FlexSessionConnectivityEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FlexSessionConnectivityEvent.java b/modules/core/src/flex/messaging/FlexSessionConnectivityEvent.java
new file mode 100755
index 0000000..523b61d
--- /dev/null
+++ b/modules/core/src/flex/messaging/FlexSessionConnectivityEvent.java
@@ -0,0 +1,50 @@
+/*
+ * 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.messaging;
+
+import java.util.EventObject;
+
+/**
+ * An event dispatched when the connection state for a session changes.
+ */
+public class FlexSessionConnectivityEvent extends EventObject
+{
+    /**
+     * @exclude
+     */
+    private static final long serialVersionUID = 8622680412552475829L;
+
+    /**
+     * Constructs a new <tt>FlexSessionConnectivityEvent</tt> using the supplied source <tt>ConnectionAwareSession</tt>.
+     * 
+     * @param session The session whose connection state has changed.
+     */
+    public FlexSessionConnectivityEvent(ConnectionAwareSession session)
+    {
+        super(session);
+    }
+    
+    /**
+     * Returns the session whose connection state has changed.
+     * 
+     * @return The session whose connection state has changed.
+     */
+    public ConnectionAwareSession getFlexSession()
+    {
+        return (ConnectionAwareSession)getSource();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FlexSessionConnectivityListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FlexSessionConnectivityListener.java b/modules/core/src/flex/messaging/FlexSessionConnectivityListener.java
new file mode 100755
index 0000000..a5b0be6
--- /dev/null
+++ b/modules/core/src/flex/messaging/FlexSessionConnectivityListener.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.messaging;
+
+/**
+ * The listener interface for receiving FlexSession connectivity events.
+ */
+
+public interface FlexSessionConnectivityListener
+{
+    /**
+     * Invoked when the session has connected to the remote host.
+     * 
+     * @param event The <tt>FlexSessionConnectivityEvent</tt> for the connect event.
+     */
+    void sessionConnected(FlexSessionConnectivityEvent event);
+    
+    /**
+     * Invoked when the session has disconnected from or lost connectivity to the remote host.
+     * 
+     * @param event The <tt>FlexSessionConnectivityEvent</tt> for the disconnect event.
+     */
+    void sessionDisconnected(FlexSessionConnectivityEvent event);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FlexSessionListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FlexSessionListener.java b/modules/core/src/flex/messaging/FlexSessionListener.java
new file mode 100755
index 0000000..e27cbba
--- /dev/null
+++ b/modules/core/src/flex/messaging/FlexSessionListener.java
@@ -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 flex.messaging;
+
+/**
+ * Interface to be notified when a FlexSession is created or destroyed. Implementations of this interface
+ * may add themselves as session created listeners statically via <code>FlexSession.addSessionCreatedListener()</code>.
+ * To listen for FlexSession destruction, the implementation class instance must add itself as a listener to
+ * a specific FlexSession instance via the <code>addSessionDestroyedListener()</code> method.
+ */
+public interface FlexSessionListener
+{
+    /**
+     * Notification that a FlexSession was created.
+     *
+     * @param session The FlexSession that was created.
+     */
+    void sessionCreated(FlexSession session);
+
+    /**
+     * Notification that a FlexSession is about to be destroyed.
+     *
+     * @param session The FlexSession that will be destroyed.
+     */
+    void sessionDestroyed(FlexSession session);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FlexSessionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FlexSessionManager.java b/modules/core/src/flex/messaging/FlexSessionManager.java
new file mode 100755
index 0000000..22a776d
--- /dev/null
+++ b/modules/core/src/flex/messaging/FlexSessionManager.java
@@ -0,0 +1,299 @@
+/*
+ * 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.messaging;
+
+import flex.management.ManageableComponent;
+import flex.messaging.log.LogCategories;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * @exclude
+ * Manages FlexSession instances for a MessageBroker. 
+ */
+public class FlexSessionManager extends ManageableComponent
+{
+    public static final String TYPE = "FlexSessionManager";
+    
+    private static final long MILLIS_IN_HOUR = 3600000;
+    
+    //--------------------------------------------------------------------------
+    //
+    // Constructors
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     * @exclude
+     * Constructs a <tt>FlexSessionManager</tt> for the passed <tt>MessageBroker</tt>.
+     * 
+     * @param broker The root <tt>MessageBroker</tt> using this <tt>FlexSessionManager</tt>.
+     */
+    public FlexSessionManager(MessageBroker broker)
+    {
+        this(false, broker);
+    }
+    
+    /**
+     * @exclude
+     * Constructs a <tt>FlexSessionManager</tt> for the passed <tt>MessageBroker</tt> and optionally enables management.
+     * 
+     * @param enableManagement <code>true</code> if the <tt>FlexSessionManager</tt>
+     * is manageable; otherwise <code>false</code>.
+     */
+    public FlexSessionManager(boolean enableManagement, MessageBroker broker)
+    {
+        super(enableManagement);
+        
+        super.setId(TYPE);
+        
+        this.broker = broker;
+        
+        this.setParent(broker);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Instance-level lock.
+     */
+    private final Object lock = new Object();
+    
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+    
+    //----------------------------------
+    //  logCategory
+    //----------------------------------
+    
+    /**
+     * Returns the log category for this component.
+     * 
+     * @return The log category for this component.
+     */
+    @Override
+    protected String getLogCategory()
+    {
+        return LogCategories.ENDPOINT_FLEXSESSION;
+    }
+    
+    //----------------------------------
+    //  flexSessionCount
+    //----------------------------------
+    
+    private int flexSessionCount;
+    
+    /**
+     * Returns the total count of active FlexSessions.
+     * 
+     * @return The total count of active FlexSessions.
+     */
+    public int getFlexSessionCount()
+    {
+        synchronized (lock)
+        {
+            return flexSessionCount;
+        }
+    }
+
+    //----------------------------------
+    //  flexSessionProviders
+    //----------------------------------
+
+    private final ConcurrentHashMap<Class<? extends FlexSession>, AbstractFlexSessionProvider> providers = new ConcurrentHashMap<Class<? extends FlexSession>, AbstractFlexSessionProvider>();
+    
+    /**
+     * Returns the registered <tt>FlexSessionProvider</tt> implementation for the specified <tt>FlexSession</tt> type.
+     * 
+     * @param sessionClass The specific <tt>FlexSession</tt> type to get a provider for.
+     * @return The registered <tt>FlexSessionProvider</tt> or <code>null</code> if no provider is registered.
+     */
+    public AbstractFlexSessionProvider getFlexSessionProvider(Class<? extends FlexSession> sessionClass)
+    {
+        return providers.get(sessionClass);
+    }
+    
+    /**
+     * Registers a <tt>FlexSessionProvider</tt> implementation for a specified <tt>FlexSession</tt> type.
+     * 
+     * @param sessionClass The specific <tt>FlexSession</tt> type to register a provider for.
+     * @param provider The corresponding <tt>FlexSessionProvider</tt> to register.
+     * @return The previously registered provider, or <code>null</code> if no provider was registered for this session type.
+     */
+    public AbstractFlexSessionProvider registerFlexSessionProvider(Class<? extends FlexSession> sessionClass, AbstractFlexSessionProvider provider)    
+    {
+        provider.setFlexSessionManager(this);
+        AbstractFlexSessionProvider previousProvider = providers.putIfAbsent(sessionClass, provider);
+        
+        if (previousProvider != null)
+        {
+            previousProvider.stop();
+            previousProvider.setFlexSessionManager(null);
+        }
+        
+        if (isStarted())
+            provider.start();
+
+        return previousProvider;
+    }
+    
+    /**
+     * Unregisters a <tt>FlexSessionProvider</tt> implementation for a specified <tt>FlexSession</tt> type.
+     * 
+     * @param sessionClass The specific <tt>FlexSession</tt> type to unregister a provider for.
+     */
+    public void unregisterFlexSessionProvider(Class<? extends FlexSession> sessionClass)
+    {
+        AbstractFlexSessionProvider provider = providers.remove(sessionClass);
+        if (provider != null)
+        {
+            provider.stop();
+            provider.setFlexSessionManager(null);
+        }
+    }
+    
+    //----------------------------------
+    //  flexSessions
+    //----------------------------------
+    
+    /**
+     * Registers a new <tt>FlexSession</tt> with the <tt>FlexSessionManager</tt>.
+     * 
+     * @param session The new <tt>FlexSession</tt>.
+     */
+    public void registerFlexSession(FlexSession session)
+    {
+        synchronized (lock)
+        {
+            ++flexSessionCount;            
+            resetMaxFlexSessionsInCurrentHour(flexSessionCount);
+        }
+    }
+    
+    /**
+     * Unregisters an invalidated <tt>FlexSession</tt> from the <tt>FlexSessionManager</tt>.
+     * 
+     * @param session The invalidated <tt>FlexSession</tt>.
+     */
+    public void unregisterFlexSession(FlexSession session)
+    {
+        synchronized (lock)
+        {
+            --flexSessionCount;
+            resetMaxFlexSessionsInCurrentHour(flexSessionCount);            
+        }
+    }
+    
+    //----------------------------------
+    //  maxFlexSessionsInCurrentHour
+    //----------------------------------
+    
+    private int maxSessionCountInCurrentHour;
+    private long currentHourStartTimestamp = System.currentTimeMillis();
+    
+    public int getMaxFlexSessionsInCurrentHour()
+    {
+        synchronized (lock)
+        {            
+            // Make sure we report the correct value if the system has been idle across an hour transition.
+            resetMaxFlexSessionsInCurrentHour(flexSessionCount);
+            
+            return maxSessionCountInCurrentHour;
+        }
+    }
+    
+    /* Must be called within a synchronized block. */
+    private void resetMaxFlexSessionsInCurrentHour(int currentCount)
+    {
+        long offset = (System.currentTimeMillis() - currentHourStartTimestamp) / MILLIS_IN_HOUR;
+        if (offset > 0) // Shift to the current hour and reset to the current session count.
+        {
+            currentHourStartTimestamp += (MILLIS_IN_HOUR * offset);
+            maxSessionCountInCurrentHour = currentCount;
+        }
+        else if (maxSessionCountInCurrentHour < currentCount)
+        {
+            maxSessionCountInCurrentHour = currentCount;
+        }
+    }
+    
+    //----------------------------------
+    //  messageBroker
+    //----------------------------------
+
+    private final MessageBroker broker;
+
+    /**
+     * Returns the <tt>MessageBroker</tt> instance that owns this <tt>FlexSessionManager</tt>.
+     *
+     * @return The parent <tt>MessageBroker</tt> instance.
+     */
+    public MessageBroker getMessageBroker()
+    {
+        return broker;
+    }    
+    
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     * Starts the <tt>FlexSessionManager</tt>.
+     * Any registered <tt>FlexSession</tt>s providers are also started.
+     */
+    @Override
+    public void start()
+    {
+        if (isStarted())
+            return;
+        
+        for (AbstractFlexSessionProvider provider : providers.values())
+        {
+            if (!provider.isStarted())
+                provider.start();
+        }           
+        
+        super.start();
+    }
+    
+    /**
+     * Stops the <tt>FlexSessionManager</tt>.
+     * Any registered <tt>FlexSession</tt> providers are stopped and unregistered. 
+     */
+    @Override
+    public void stop()
+    {
+        if (!isStarted())
+            return;
+        
+        super.stop();
+        
+        for (Class<? extends FlexSession> sessionClass : providers.keySet())
+        {
+            unregisterFlexSessionProvider(sessionClass);
+        }
+        providers.clear();
+    }
+}


[40/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/history/history.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/history/history.js b/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/history/history.js
new file mode 100755
index 0000000..0f82450
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/history/history.js
@@ -0,0 +1,722 @@
+/*
+ * 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.
+ */
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        ie8: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+        if (browser.version == 8)
+        {
+            browser.ie = false;
+            browser.ie8 = true;
+        }
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    function hashChangeHandler()
+    {
+        currentHref = document.location.href;
+        var flexAppUrl = getHash();
+        //ADR: to fix multiple
+        if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+            var pl = getPlayers();
+            for (var i = 0; i < pl.length; i++) {
+                pl[i].browserURLChange(flexAppUrl);
+            }
+        } else {
+            getPlayer().browserURLChange(flexAppUrl);
+        }
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+        var i;
+
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+                for (i = 0; i < o.length; i++) {
+                    if (typeof o[i].browserURLChange != "undefined")
+                        return o[i];
+                }
+                for (i = 0; i < e.length; i++) {
+                    if (typeof e[i].browserURLChange != "undefined")
+                        return e[i];
+                }
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+            for (i = 0; i < e.length; i++) {
+                if (typeof e[i].browserURLChange != "undefined")
+                {
+                    return e[i];
+                }
+            }
+            for (i = 0; i < o.length; i++) {
+                if (typeof o[i].browserURLChange != "undefined")
+                {
+                    return o[i];
+                }
+            }
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var i;
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+                        currentHref = document.location.href;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                var flexAppUrl = getHash();
+                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
+                {    
+                    // If it did change and we're running Safari 3.x or earlier, 
+                    // then we have to look the old state up in our hand-maintained 
+                    // array since document.location.hash won't have changed, 
+                    // then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                    flexAppUrl = historyHash[currentHistoryLength];
+                }
+
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            iframe.src = 'javascript:false;'; 
+
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox || browser.ie8)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+
+        if (browser.ie8)        
+            document.body.onhashchange = hashChangeHandler;
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        },
+        getUserAgent: function() {
+            return navigator.userAgent;
+        },
+        getPlatform: function() {
+            return navigator.platform;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/history/historyFrame.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/history/historyFrame.html b/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/history/historyFrame.html
new file mode 100755
index 0000000..63bdd3e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/history/historyFrame.html
@@ -0,0 +1,45 @@
+<!--
+  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>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/index.template.html b/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/index.template.html
new file mode 100755
index 0000000..e3e9c81
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/swfobject.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/swfobject.js b/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/swfobject.js
new file mode 100755
index 0000000..07730fa
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/swfobject.js
@@ -0,0 +1,793 @@
+/*
+ * 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.
+ */
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+	
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+		ON_READY_STATE_CHANGE = "onreadystatechange",
+		
+		win = window,
+		doc = document,
+		nav = navigator,
+		
+		plugin = false,
+		domLoadFnArr = [main],
+		regObjArr = [],
+		objIdArr = [],
+		listenersArr = [],
+		storedAltContent,
+		storedAltContentId,
+		storedCallbackFn,
+		storedCallbackObj,
+		isDomLoaded = false,
+		isExpressInstallActive = false,
+		dynamicStylesheet,
+		dynamicStylesheetMedia,
+		autoHideShow = true,
+	
+	/* Centralized function for browser feature detection
+		- User agent string detection is only used when no good alternative is possible
+		- Is executed directly for optimal performance
+	*/	
+	ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+			u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+				plugin = true;
+				ie = false; // cascaded feature detection for Internet Explorer
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			try {
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+				if (a) { // a will return null when ActiveX is disabled
+					d = a.GetVariable("$version");
+					if (d) {
+						ie = true; // cascaded feature detection for Internet Explorer
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+			}
+			catch(e) {}
+		}
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+	}(),
+	
+	/* Cross-browser onDomLoad
+		- Will fire an event as soon as the DOM of a web page is loaded
+		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+		- Regular onload serves as fallback
+	*/ 
+	onDomLoad = function() {
+		if (!ua.w3) { return; }
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+			callDomLoadFunctions();
+		}
+		if (!isDomLoaded) {
+			if (typeof doc.addEventListener != UNDEF) {
+				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+			}		
+			if (ua.ie && ua.win) {
+				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+					if (doc.readyState == "complete") {
+						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+						callDomLoadFunctions();
+					}
+				});
+				if (win == top) { // if not inside an iframe
+					(function(){
+						if (isDomLoaded) { return; }
+						try {
+							doc.documentElement.doScroll("left");
+						}
+						catch(e) {
+							setTimeout(arguments.callee, 0);
+							return;
+						}
+						callDomLoadFunctions();
+					})();
+				}
+			}
+			if (ua.wk) {
+				(function(){
+					if (isDomLoaded) { return; }
+					if (!/loaded|complete/.test(doc.readyState)) {
+						setTimeout(arguments.callee, 0);
+						return;
+					}
+					callDomLoadFunctions();
+				})();
+			}
+			addLoadEvent(callDomLoadFunctions);
+		}
+	}();
+	
+	function callDomLoadFunctions() {
+		if (isDomLoaded) { return; }
+		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+			t.parentNode.removeChild(t);
+		}
+		catch (e) { return; }
+		isDomLoaded = true;
+		var dl = domLoadFnArr.length;
+		for (var i = 0; i < dl; i++) {
+			domLoadFnArr[i]();
+		}
+	}
+	
+	function addDomLoadEvent(fn) {
+		if (isDomLoaded) {
+			fn();
+		}
+		else { 
+			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+		}
+	}
+	
+	/* Cross-browser onload
+		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+		- Will fire an event as soon as a web page including all of its assets are loaded 
+	 */
+	function addLoadEvent(fn) {
+		if (typeof win.addEventListener != UNDEF) {
+			win.addEventListener("load", fn, false);
+		}
+		else if (typeof doc.addEventListener != UNDEF) {
+			doc.addEventListener("load", fn, false);
+		}
+		else if (typeof win.attachEvent != UNDEF) {
+			addListener(win, "onload", fn);
+		}
+		else if (typeof win.onload == "function") {
+			var fnOld = win.onload;
+			win.onload = function() {
+				fnOld();
+				fn();
+			};
+		}
+		else {
+			win.onload = fn;
+		}
+	}
+	
+	/* Main function
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
+	*/
+	function main() { 
+		if (plugin) {
+			testPlayerVersion();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Detect the Flash Player version for non-Internet Explorer browsers
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+		  a. Both release and build numbers can be detected
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+	*/
+	function testPlayerVersion() {
+		var b = doc.getElementsByTagName("body")[0];
+		var o = createElement(OBJECT);
+		o.setAttribute("type", FLASH_MIME_TYPE);
+		var t = b.appendChild(o);
+		if (t) {
+			var counter = 0;
+			(function(){
+				if (typeof t.GetVariable != UNDEF) {
+					var d = t.GetVariable("$version");
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				else if (counter < 10) {
+					counter++;
+					setTimeout(arguments.callee, 10);
+					return;
+				}
+				b.removeChild(o);
+				t = null;
+				matchVersions();
+			})();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Perform Flash Player and SWF version matching; static publishing only
+	*/
+	function matchVersions() {
+		var rl = regObjArr.length;
+		if (rl > 0) {
+			for (var i = 0; i < rl; i++) { // for each registered object element
+				var id = regObjArr[i].id;
+				var cb = regObjArr[i].callbackFn;
+				var cbObj = {success:false, id:id};
+				if (ua.pv[0] > 0) {
+					var obj = getElementById(id);
+					if (obj) {
+						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+							setVisibility(id, true);
+							if (cb) {
+								cbObj.success = true;
+								cbObj.ref = getObjectById(id);
+								cb(cbObj);
+							}
+						}
+						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+							var att = {};
+							att.data = regObjArr[i].expressInstall;
+							att.width = obj.getAttribute("width") || "0";
+							att.height = obj.getAttribute("height") || "0";
+							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+							// parse HTML object param element's name-value pairs
+							var par = {};
+							var p = obj.getElementsByTagName("param");
+							var pl = p.length;
+							for (var j = 0; j < pl; j++) {
+								if (p[j].getAttribute("name").toLowerCase() != "movie") {
+									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+								}
+							}
+							showExpressInstall(att, par, id, cb);
+						}
+						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+							displayAltContent(obj);
+							if (cb) { cb(cbObj); }
+						}
+					}
+				}
+				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+					setVisibility(id, true);
+					if (cb) {
+						var o = getObjectById(id); // test whether there is an HTML object element or not
+						if (o && typeof o.SetVariable != UNDEF) { 
+							cbObj.success = true;
+							cbObj.ref = o;
+						}
+						cb(cbObj);
+					}
+				}
+			}
+		}
+	}
+	
+	function getObjectById(objectIdStr) {
+		var r = null;
+		var o = getElementById(objectIdStr);
+		if (o && o.nodeName == "OBJECT") {
+			if (typeof o.SetVariable != UNDEF) {
+				r = o;
+			}
+			else {
+				var n = o.getElementsByTagName(OBJECT)[0];
+				if (n) {
+					r = n;
+				}
+			}
+		}
+		return r;
+	}
+	
+	/* Requirements for Adobe Express Install
+		- only one instance can be active at a time
+		- fp 6.0.65 or higher
+		- Win/Mac OS only
+		- no Webkit engines older than version 312
+	*/
+	function canExpressInstall() {
+		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+	}
+	
+	/* Show the Adobe Express Install dialog
+		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+	*/
+	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+		isExpressInstallActive = true;
+		storedCallbackFn = callbackFn || null;
+		storedCallbackObj = {success:false, id:replaceElemIdStr};
+		var obj = getElementById(replaceElemIdStr);
+		if (obj) {
+			if (obj.nodeName == "OBJECT") { // static publishing
+				storedAltContent = abstractAltContent(obj);
+				storedAltContentId = null;
+			}
+			else { // dynamic publishing
+				storedAltContent = obj;
+				storedAltContentId = replaceElemIdStr;
+			}
+			att.id = EXPRESS_INSTALL_ID;
+			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+				fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+			if (typeof par.flashvars != UNDEF) {
+				par.flashvars += "&" + fv;
+			}
+			else {
+				par.flashvars = fv;
+			}
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			if (ua.ie && ua.win && obj.readyState != 4) {
+				var newObj = createElement("div");
+				replaceElemIdStr += "SWFObjectNew";
+				newObj.setAttribute("id", replaceElemIdStr);
+				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						obj.parentNode.removeChild(obj);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			createSWF(att, par, replaceElemIdStr);
+		}
+	}
+	
+	/* Functions to abstract and display alternative content
+	*/
+	function displayAltContent(obj) {
+		if (ua.ie && ua.win && obj.readyState != 4) {
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			var el = createElement("div");
+			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+			el.parentNode.replaceChild(abstractAltContent(obj), el);
+			obj.style.display = "none";
+			(function(){
+				if (obj.readyState == 4) {
+					obj.parentNode.removeChild(obj);
+				}
+				else {
+					setTimeout(arguments.callee, 10);
+				}
+			})();
+		}
+		else {
+			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+		}
+	} 
+
+	function abstractAltContent(obj) {
+		var ac = createElement("div");
+		if (ua.win && ua.ie) {
+			ac.innerHTML = obj.innerHTML;
+		}
+		else {
+			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+			if (nestedObj) {
+				var c = nestedObj.childNodes;
+				if (c) {
+					var cl = c.length;
+					for (var i = 0; i < cl; i++) {
+						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+							ac.appendChild(c[i].cloneNode(true));
+						}
+					}
+				}
+			}
+		}
+		return ac;
+	}
+	
+	/* Cross-browser dynamic SWF creation
+	*/
+	function createSWF(attObj, parObj, id) {
+		var r, el = getElementById(id);
+		if (ua.wk && ua.wk < 312) { return r; }
+		if (el) {
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+				attObj.id = id;
+			}
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+				var att = "";
+				for (var i in attObj) {
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+						if (i.toLowerCase() == "data") {
+							parObj.movie = attObj[i];
+						}
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							att += ' class="' + attObj[i] + '"';
+						}
+						else if (i.toLowerCase() != "classid") {
+							att += ' ' + i + '="' + attObj[i] + '"';
+						}
+					}
+				}
+				var par = "";
+				for (var j in parObj) {
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+					}
+				}
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+				r = getElementById(attObj.id);	
+			}
+			else { // well-behaving browsers
+				var o = createElement(OBJECT);
+				o.setAttribute("type", FLASH_MIME_TYPE);
+				for (var m in attObj) {
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							o.setAttribute("class", attObj[m]);
+						}
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+							o.setAttribute(m, attObj[m]);
+						}
+					}
+				}
+				for (var n in parObj) {
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+						createObjParam(o, n, parObj[n]);
+					}
+				}
+				el.parentNode.replaceChild(o, el);
+				r = o;
+			}
+		}
+		return r;
+	}
+	
+	function createObjParam(el, pName, pValue) {
+		var p = createElement("param");
+		p.setAttribute("name", pName);	
+		p.setAttribute("value", pValue);
+		el.appendChild(p);
+	}
+	
+	/* Cross-browser SWF removal
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
+	*/
+	function removeSWF(id) {
+		var obj = getElementById(id);
+		if (obj && obj.nodeName == "OBJECT") {
+			if (ua.ie && ua.win) {
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						removeObjectInIE(id);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			else {
+				obj.parentNode.removeChild(obj);
+			}
+		}
+	}
+	
+	function removeObjectInIE(id) {
+		var obj = getElementById(id);
+		if (obj) {
+			for (var i in obj) {
+				if (typeof obj[i] == "function") {
+					obj[i] = null;
+				}
+			}
+			obj.parentNode.removeChild(obj);
+		}
+	}
+	
+	/* Functions to optimize JavaScript compression
+	*/
+	function getElementById(id) {
+		var el = null;
+		try {
+			el = doc.getElementById(id);
+		}
+		catch (e) {}
+		return el;
+	}
+	
+	function createElement(el) {
+		return doc.createElement(el);
+	}
+	
+	/* Updated attachEvent function for Internet Explorer
+		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+	*/	
+	function addListener(target, eventType, fn) {
+		target.attachEvent(eventType, fn);
+		listenersArr[listenersArr.length] = [target, eventType, fn];
+	}
+	
+	/* Flash Player and SWF content version matching
+	*/
+	function hasPlayerVersion(rv) {
+		var pv = ua.pv, v = rv.split(".");
+		v[0] = parseInt(v[0], 10);
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+		v[2] = parseInt(v[2], 10) || 0;
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+	}
+	
+	/* Cross-browser dynamic CSS creation
+		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+	*/	
+	function createCSS(sel, decl, media, newStyle) {
+		if (ua.ie && ua.mac) { return; }
+		var h = doc.getElementsByTagName("head")[0];
+		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+		var m = (media && typeof media == "string") ? media : "screen";
+		if (newStyle) {
+			dynamicStylesheet = null;
+			dynamicStylesheetMedia = null;
+		}
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+			// create dynamic stylesheet + get a global reference to it
+			var s = createElement("style");
+			s.setAttribute("type", "text/css");
+			s.setAttribute("media", m);
+			dynamicStylesheet = h.appendChild(s);
+			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+			}
+			dynamicStylesheetMedia = m;
+		}
+		// add style rule
+		if (ua.ie && ua.win) {
+			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+				dynamicStylesheet.addRule(sel, decl);
+			}
+		}
+		else {
+			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+			}
+		}
+	}
+	
+	function setVisibility(id, isVisible) {
+		if (!autoHideShow) { return; }
+		var v = isVisible ? "visible" : "hidden";
+		if (isDomLoaded && getElementById(id)) {
+			getElementById(id).style.visibility = v;
+		}
+		else {
+			createCSS("#" + id, "visibility:" + v);
+		}
+	}
+
+	/* Filter to avoid XSS attacks
+	*/
+	function urlEncodeIfNecessary(s) {
+		var regex = /[\\\"<>\.;]/;
+		var hasBadChars = regex.exec(s) != null;
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+	}
+	
+	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+	*/
+	var cleanup = function() {
+		if (ua.ie && ua.win) {
+			window.attachEvent("onunload", function() {
+				// remove listeners to avoid memory leaks
+				var ll = listenersArr.length;
+				for (var i = 0; i < ll; i++) {
+					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+				}
+				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+				var il = objIdArr.length;
+				for (var j = 0; j < il; j++) {
+					removeSWF(objIdArr[j]);
+				}
+				// cleanup library's main closures to avoid memory leaks
+				for (var k in ua) {
+					ua[k] = null;
+				}
+				ua = null;
+				for (var l in swfobject) {
+					swfobject[l] = null;
+				}
+				swfobject = null;
+			});
+		}
+	}();
+	
+	return {
+		/* Public API
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
+		*/ 
+		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+			if (ua.w3 && objectIdStr && swfVersionStr) {
+				var regObj = {};
+				regObj.id = objectIdStr;
+				regObj.swfVersion = swfVersionStr;
+				regObj.expressInstall = xiSwfUrlStr;
+				regObj.callbackFn = callbackFn;
+				regObjArr[regObjArr.length] = regObj;
+				setVisibility(objectIdStr, false);
+			}
+			else if (callbackFn) {
+				callbackFn({success:false, id:objectIdStr});
+			}
+		},
+		
+		getObjectById: function(objectIdStr) {
+			if (ua.w3) {
+				return getObjectById(objectIdStr);
+			}
+		},
+		
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+			var callbackObj = {success:false, id:replaceElemIdStr};
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+				setVisibility(replaceElemIdStr, false);
+				addDomLoadEvent(function() {
+					widthStr += ""; // auto-convert to string
+					heightStr += "";
+					var att = {};
+					if (attObj && typeof attObj === OBJECT) {
+						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+							att[i] = attObj[i];
+						}
+					}
+					att.data = swfUrlStr;
+					att.width = widthStr;
+					att.height = heightStr;
+					var par = {}; 
+					if (parObj && typeof parObj === OBJECT) {
+						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+							par[j] = parObj[j];
+						}
+					}
+					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+							if (typeof par.flashvars != UNDEF) {
+								par.flashvars += "&" + k + "=" + flashvarsObj[k];
+							}
+							else {
+								par.flashvars = k + "=" + flashvarsObj[k];
+							}
+						}
+					}
+					if (hasPlayerVersion(swfVersionStr)) { // create SWF
+						var obj = createSWF(att, par, replaceElemIdStr);
+						if (att.id == replaceElemIdStr) {
+							setVisibility(replaceElemIdStr, true);
+						}
+						callbackObj.success = true;
+						callbackObj.ref = obj;
+					}
+					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+						att.data = xiSwfUrlStr;
+						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+						return;
+					}
+					else { // show alternative content
+						setVisibility(replaceElemIdStr, true);
+					}
+					if (callbackFn) { callbackFn(callbackObj); }
+				});
+			}
+			else if (callbackFn) { callbackFn(callbackObj);	}
+		},
+		
+		switchOffAutoHideShow: function() {
+			autoHideShow = false;
+		},
+		
+		ua: ua,
+		
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		},
+		
+		hasFlashPlayerVersion: hasPlayerVersion,
+		
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
+			if (ua.w3) {
+				return createSWF(attObj, parObj, replaceElemIdStr);
+			}
+			else {
+				return undefined;
+			}
+		},
+		
+		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+			if (ua.w3 && canExpressInstall()) {
+				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+			}
+		},
+		
+		removeSWF: function(objElemIdStr) {
+			if (ua.w3) {
+				removeSWF(objElemIdStr);
+			}
+		},
+		
+		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+			if (ua.w3) {
+				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+			}
+		},
+		
+		addDomLoadEvent: addDomLoadEvent,
+		
+		addLoadEvent: addLoadEvent,
+		
+		getQueryParamValue: function(param) {
+			var q = doc.location.search || doc.location.hash;
+			if (q) {
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+				if (param == null) {
+					return urlEncodeIfNecessary(q);
+				}
+				var pairs = q.split("&");
+				for (var i = 0; i < pairs.length; i++) {
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+					}
+				}
+			}
+			return "";
+		},
+		
+		// For internal usage only
+		expressInstallCallback: function() {
+			if (isExpressInstallActive) {
+				var obj = getElementById(EXPRESS_INSTALL_ID);
+				if (obj && storedAltContent) {
+					obj.parentNode.replaceChild(storedAltContent, obj);
+					if (storedAltContentId) {
+						setVisibility(storedAltContentId, true);
+						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+					}
+					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+				}
+				isExpressInstallActive = false;
+			} 
+		}
+	};
+}();

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync04/src/Contact.as
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync04/src/Contact.as b/apps/samples-spring/WEB-INF/flex-src/insync04/src/Contact.as
new file mode 100755
index 0000000..003b0e0
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync04/src/Contact.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
+{
+	[Bindable]
+	[RemoteClass(alias="org.springframework.flex.samples.contact.Contact")]
+	public class Contact
+	{
+		public var id:int;
+		public var firstName:String;
+		public var lastName:String;
+		public var email:String;
+		public var phone:String;
+		public var address:String;
+		public var city:String;
+		public var state:String;
+		public var zip:String;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync04/src/ContactForm.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync04/src/ContactForm.mxml b/apps/samples-spring/WEB-INF/flex-src/insync04/src/ContactForm.mxml
new file mode 100755
index 0000000..fe7587b
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync04/src/ContactForm.mxml
@@ -0,0 +1,120 @@
+<?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:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		   xmlns:s="library://ns.adobe.com/flex/spark" 
+		   xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
+		   label="{contact.firstName+' '+contact.lastName}">
+
+	<fx:Script>
+		<![CDATA[
+
+			import mx.rpc.events.FaultEvent;
+			import mx.rpc.events.ResultEvent;
+			import mx.controls.Alert;
+			
+			[Bindable] public var contact:Contact;
+			
+			private function save():void
+			{
+				contact.firstName = firstName.text;
+				contact.lastName = lastName.text;
+				contact.email = email.text;
+				contact.phone = phone.text;
+				contact.address = address.text;
+				contact.city = city.text;
+				contact.state = state.text;
+				contact.zip = zip.text;
+				ro.update(contact);
+			}
+			
+			private function update_resultHandler(event:ResultEvent):void
+			{
+				Alert.show("Contact " + contact.id + " updated successfully");
+			}
+			
+			private function deleteItem():void
+			{
+				ro.remove(contact);		
+				closeItem();
+			}
+			
+			private function closeItem():void
+			{
+				parent.removeChild(this);
+			}
+			
+			private function remove_resultHandler(event:ResultEvent):void
+			{
+				contact = null;
+			}
+			
+			private function faultHandler(event:FaultEvent):void
+			{
+				Alert.show(event.fault.faultDetail);
+			}
+			
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<mx:RemoteObject id="ro" destination="contactService" fault="faultHandler(event)" endpoint="{&apos;http://{server.name}:{server.port}/samples-spring/messagebroker/amf&apos;}">
+			<mx:method name="update" result="update_resultHandler(event)"/>
+			<mx:method name="remove" result="remove_resultHandler(event)"/>
+		</mx:RemoteObject>
+	</fx:Declarations>
+
+	<mx:Form>
+		<mx:FormItem label="Id">
+			<mx:TextInput text="{contact.id}" enabled="false"/>
+		</mx:FormItem>
+		<mx:FormItem label="First Name">
+			<mx:TextInput id="firstName" text="{contact.firstName}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Last Name">
+			<mx:TextInput id="lastName" text="{contact.lastName}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Email">
+			<mx:TextInput id="email" text="{contact.email}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Phone">
+			<mx:TextInput id="phone" text="{contact.phone}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Address">
+			<mx:TextInput id="address" text="{contact.address}"/>
+		</mx:FormItem>
+		<mx:FormItem label="City">
+			<mx:TextInput id="city" text="{contact.city}"/>
+		</mx:FormItem>
+		<mx:FormItem label="State">
+			<mx:TextInput id="state" text="{contact.state}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Zip">
+			<mx:TextInput id="zip" text="{contact.zip}"/>
+		</mx:FormItem>
+	</mx:Form>
+	
+	<s:HGroup left="8" bottom="8">
+		<s:Button label="Close" click="closeItem()"/>
+		<s:Button label="Save" click="save()"/>
+		<s:Button label="Delete" click="deleteItem()"/>
+	</s:HGroup>
+
+</mx:Canvas>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync04/src/insync04.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync04/src/insync04.mxml b/apps/samples-spring/WEB-INF/flex-src/insync04/src/insync04.mxml
new file mode 100755
index 0000000..026021d
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync04/src/insync04.mxml
@@ -0,0 +1,88 @@
+<?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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:local="*">
+	
+	<fx:Script>
+		<![CDATA[
+			
+			import mx.collections.ArrayCollection;
+			import mx.controls.Alert;
+			import mx.rpc.events.FaultEvent;
+			import mx.rpc.events.ResultEvent;
+			
+			[Bindable] private var contacts:ArrayCollection;
+			
+			private function resultHandler(event:ResultEvent):void
+			{
+				contacts = event.result as ArrayCollection
+			}
+			
+			private function faultHandler(event:FaultEvent):void
+			{
+				Alert.show(event.fault.faultDetail);
+			}
+			
+			public function openContact(contact:Contact):void
+			{
+				var children:Array = tn.getChildren();
+				for (var i:int = 0; i<children.length; i++)
+				{
+					if (ContactForm(children[i]).contact.id == contact.id)
+					{
+						tn.selectedChild = children[i];
+						return;
+					}
+				}
+				
+				var form:ContactForm = new ContactForm();
+				tn.addChild(form);
+				form.contact = contact;
+				tn.selectedChild = form;
+			}
+
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<s:RemoteObject id="ro" destination="contactService" fault="faultHandler(event)" endpoint="{&apos;http://{server.name}:{server.port}/samples-spring/messagebroker/amf&apos;}">
+			<s:method name="findByName" result="resultHandler(event)"/>
+		</s:RemoteObject>
+	</fx:Declarations>
+	
+	<s:controlBarContent>
+		<s:TextInput id="searchStr"/>
+		<s:Button label="Search" click="ro.findByName(searchStr.text)"/>
+	</s:controlBarContent>
+	
+	<mx:HDividedBox  top="8" left="8" right="8" bottom="8">
+		<mx:DataGrid id="dg" dataProvider="{contacts}" width="30%" height="100%"
+					 doubleClickEnabled="{dg.selectedItem != null}"
+					 doubleClick="openContact(dg.selectedItem as Contact)">
+			<mx:columns>
+				<mx:DataGridColumn dataField="firstName" headerText="First Name"/>
+				<mx:DataGridColumn dataField="lastName" headerText="Last Name"/>
+			</mx:columns>
+		</mx:DataGrid>
+		<mx:TabNavigator id="tn" width="70%" height="100%"/>
+	</mx:HDividedBox>
+	
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync05/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync05/.actionScriptProperties b/apps/samples-spring/WEB-INF/flex-src/insync05/.actionScriptProperties
new file mode 100755
index 0000000..7e9cea9
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync05/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="insync05.mxml" projectUUID="af628f17-d14e-4d43-8da0-9c2b08773a27" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="insync05.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync05/.flexProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync05/.flexProperties b/apps/samples-spring/WEB-INF/flex-src/insync05/.flexProperties
new file mode 100755
index 0000000..1d99468
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync05/.flexProperties
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync05/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync05/.project b/apps/samples-spring/WEB-INF/flex-src/insync05/.project
new file mode 100755
index 0000000..7e64a27
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync05/.project
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>insync05</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync05/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync05/build.xml b/apps/samples-spring/WEB-INF/flex-src/insync05/build.xml
new file mode 100755
index 0000000..cab206e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync05/build.xml
@@ -0,0 +1,76 @@
+<?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-spring.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="context.root" value="samples-spring" />
+    <property name="application.name" value="insync05" />
+    <property name="application.file" value="insync05" />
+    <property name="application.bin.dir" value="${samples-spring.war}/insync05" />
+    <property name="application.src.dir" value="${samples-spring.war}/WEB-INF/flex-src/insync05/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-spring.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"
+            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-spring/WEB-INF/flex-src/insync05/html-template/history/history.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/history/history.css b/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/history/history.css
new file mode 100755
index 0000000..4a7f791
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync05/html-template/history/history.css
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }


[51/51] [partial] git commit: BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
BlazeDS Donation from Adobe Systems Inc


Project: http://git-wip-us.apache.org/repos/asf/flex-blazeds/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-blazeds/commit/7a58369c
Tree: http://git-wip-us.apache.org/repos/asf/flex-blazeds/tree/7a58369c
Diff: http://git-wip-us.apache.org/repos/asf/flex-blazeds/diff/7a58369c

Branch: refs/heads/master
Commit: 7a58369c4a139c55230db1e97a214c79409e8d97
Parents: 
Author: Alex Harui <ah...@apache.org>
Authored: Thu Apr 24 22:32:15 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Apr 24 22:32:15 2014 -0700

----------------------------------------------------------------------
 .../WEB-INF/classes/commons-logging.properties  |    19 +
 apps/blazeds-spring/WEB-INF/flex-servlet.xml    |    34 +
 .../WEB-INF/flex/messaging-config.xml           |    32 +
 .../WEB-INF/flex/proxy-config.xml               |    43 +
 .../WEB-INF/flex/remoting-config.xml            |    31 +
 .../WEB-INF/flex/services-config.xml            |   117 +
 .../WEB-INF/spring/app-config.xml               |    29 +
 .../WEB-INF/spring/infrastructure-config.xml    |    25 +
 .../WEB-INF/spring/security-config.xml          |    41 +
 apps/blazeds-spring/WEB-INF/web.xml             |   102 +
 apps/blazeds-spring/build.xml                   |    97 +
 apps/blazeds-spring/index.htm                   |    50 +
 .../WEB-INF/classes/commons-logging.properties  |    19 +
 apps/blazeds/WEB-INF/flex/messaging-config.xml  |    32 +
 apps/blazeds/WEB-INF/flex/proxy-config.xml      |    43 +
 apps/blazeds/WEB-INF/flex/remoting-config.xml   |    31 +
 apps/blazeds/WEB-INF/flex/services-config.xml   |   117 +
 apps/blazeds/WEB-INF/web.xml                    |    82 +
 apps/blazeds/build.xml                          |    98 +
 apps/blazeds/index.htm                          |    50 +
 apps/ds-console/ConsoleResultWindow.mxml        |    48 +
 .../ds-console/WEB-INF/flex/services-config.xml |   116 +
 apps/ds-console/WEB-INF/install-web.xml         |    48 +
 apps/ds-console/WEB-INF/web.xml                 |    57 +
 apps/ds-console/build.xml                       |   174 +
 apps/ds-console/console.mxml                    |   105 +
 apps/ds-console/console/ConsoleListener.as      |    43 +
 apps/ds-console/console/ConsoleManager.as       |  1004 +
 .../console/ConsoleTreeDataDescriptor.as        |    70 +
 .../console/containers/AdvancedPanel.as         |   169 +
 .../containers/AdvancedPanelDisplay.mxml        |    69 +
 .../console/containers/DefaultPanel.as          |    41 +
 .../console/containers/DefaultPanelDisplay.mxml |    29 +
 .../console/containers/DestinationManager.as    |   238 +
 .../containers/DestinationManagerDisplay.mxml   |    61 +
 .../console/containers/EndpointManager.as       |   149 +
 .../containers/EndpointManagerDisplay.mxml      |    56 +
 .../ds-console/console/containers/LogManager.as |   189 +
 .../console/containers/LogManagerDisplay.mxml   |    54 +
 apps/ds-console/console/containers/Operation.as |   169 +
 .../console/containers/OperationSet.as          |   149 +
 .../containers/PollableAttributeChart.as        |    42 +
 .../console/containers/ServerManager.as         |   138 +
 .../containers/ServerManagerDisplay.mxml        |    54 +
 .../console/containers/UpdateListener.as        |   109 +
 .../console/containers/UpdateManager.as         |    28 +
 .../console/data/Bindable3DHashMap.as           |   110 +
 .../events/ManagementOperationInvokeEvent.as    |    99 +
 apps/samples-spring/README.txt                  |     5 +
 .../WEB-INF/classes/commons-logging.properties  |    19 +
 apps/samples-spring/WEB-INF/flex-servlet.xml    |    70 +
 .../flex-src/chat/.actionScriptProperties       |    38 +
 .../WEB-INF/flex-src/chat/.flexProperties       |    20 +
 .../WEB-INF/flex-src/chat/.project              |    36 +
 .../WEB-INF/flex-src/chat/build.xml             |    76 +
 .../chat/html-template/history/history.css      |    22 +
 .../chat/html-template/history/history.js       |   722 +
 .../html-template/history/historyFrame.html     |    45 +
 .../chat/html-template/index.template.html      |   121 +
 .../flex-src/chat/html-template/swfobject.js    |   793 +
 .../WEB-INF/flex-src/chat/src/chat.mxml         |    86 +
 .../collaboration/.actionScriptProperties       |    38 +
 .../flex-src/collaboration/.flexProperties      |    20 +
 .../WEB-INF/flex-src/collaboration/.project     |    36 +
 .../WEB-INF/flex-src/collaboration/build.xml    |    76 +
 .../html-template/history/history.css           |    22 +
 .../html-template/history/history.js            |   722 +
 .../html-template/history/historyFrame.html     |    45 +
 .../html-template/index.template.html           |   121 +
 .../collaboration/html-template/swfobject.js    |   793 +
 .../flex-src/collaboration/src/Customer.as      |    34 +
 .../collaboration/src/collaboration.mxml        |   147 +
 .../flex-src/companymgr/.actionScriptProperties |    38 +
 .../WEB-INF/flex-src/companymgr/.flexProperties |    20 +
 .../WEB-INF/flex-src/companymgr/.project        |    36 +
 .../WEB-INF/flex-src/companymgr/build.xml       |    76 +
 .../html-template/history/history.css           |    22 +
 .../companymgr/html-template/history/history.js |   722 +
 .../html-template/history/historyFrame.html     |    45 +
 .../html-template/index.template.html           |   121 +
 .../companymgr/html-template/swfobject.js       |   793 +
 .../flex-src/companymgr/src/BindableComboBox.as |    73 +
 .../WEB-INF/flex-src/companymgr/src/Company.as  |    34 +
 .../flex-src/companymgr/src/CompanyEvent.as     |    37 +
 .../flex-src/companymgr/src/CompanyForm.mxml    |   156 +
 .../WEB-INF/flex-src/companymgr/src/Industry.as |    28 +
 .../flex-src/companymgr/src/companymgr.mxml     |   130 +
 .../feedstarter/.actionScriptProperties         |    38 +
 .../flex-src/feedstarter/.flexProperties        |    20 +
 .../WEB-INF/flex-src/feedstarter/.project       |    36 +
 .../WEB-INF/flex-src/feedstarter/build.xml      |    76 +
 .../html-template/history/history.css           |    22 +
 .../html-template/history/history.js            |   722 +
 .../html-template/history/historyFrame.html     |    45 +
 .../html-template/index.template.html           |   121 +
 .../feedstarter/html-template/swfobject.js      |   793 +
 .../flex-src/feedstarter/src/feedstarter.mxml   |    53 +
 .../flex-src/insync01/.actionScriptProperties   |    38 +
 .../WEB-INF/flex-src/insync01/.flexProperties   |    20 +
 .../WEB-INF/flex-src/insync01/.project          |    36 +
 .../WEB-INF/flex-src/insync01/build.xml         |    76 +
 .../insync01/html-template/history/history.css  |    22 +
 .../insync01/html-template/history/history.js   |   722 +
 .../html-template/history/historyFrame.html     |    45 +
 .../insync01/html-template/index.template.html  |   121 +
 .../insync01/html-template/swfobject.js         |   793 +
 .../WEB-INF/flex-src/insync01/src/insync01.mxml |    35 +
 .../flex-src/insync02/.actionScriptProperties   |    38 +
 .../WEB-INF/flex-src/insync02/.flexProperties   |    20 +
 .../WEB-INF/flex-src/insync02/.project          |    36 +
 .../WEB-INF/flex-src/insync02/build.xml         |    76 +
 .../insync02/html-template/history/history.css  |    22 +
 .../insync02/html-template/history/history.js   |   722 +
 .../html-template/history/historyFrame.html     |    45 +
 .../insync02/html-template/index.template.html  |   121 +
 .../insync02/html-template/swfobject.js         |   793 +
 .../WEB-INF/flex-src/insync02/src/insync02.mxml |    60 +
 .../flex-src/insync03/.actionScriptProperties   |    38 +
 .../WEB-INF/flex-src/insync03/.flexProperties   |    20 +
 .../WEB-INF/flex-src/insync03/.project          |    36 +
 .../WEB-INF/flex-src/insync03/build.xml         |    76 +
 .../insync03/html-template/history/history.css  |    22 +
 .../insync03/html-template/history/history.js   |   722 +
 .../html-template/history/historyFrame.html     |    45 +
 .../insync03/html-template/index.template.html  |   121 +
 .../insync03/html-template/swfobject.js         |   793 +
 .../WEB-INF/flex-src/insync03/src/Contact.as    |    35 +
 .../flex-src/insync03/src/ContactForm.mxml      |   112 +
 .../WEB-INF/flex-src/insync03/src/insync03.mxml |    71 +
 .../flex-src/insync04/.actionScriptProperties   |    38 +
 .../WEB-INF/flex-src/insync04/.flexProperties   |    20 +
 .../WEB-INF/flex-src/insync04/.project          |    36 +
 .../WEB-INF/flex-src/insync04/build.xml         |    76 +
 .../insync04/html-template/history/history.css  |    22 +
 .../insync04/html-template/history/history.js   |   722 +
 .../html-template/history/historyFrame.html     |    45 +
 .../insync04/html-template/index.template.html  |   121 +
 .../insync04/html-template/swfobject.js         |   793 +
 .../WEB-INF/flex-src/insync04/src/Contact.as    |    35 +
 .../flex-src/insync04/src/ContactForm.mxml      |   120 +
 .../WEB-INF/flex-src/insync04/src/insync04.mxml |    88 +
 .../flex-src/insync05/.actionScriptProperties   |    38 +
 .../WEB-INF/flex-src/insync05/.flexProperties   |    20 +
 .../WEB-INF/flex-src/insync05/.project          |    36 +
 .../WEB-INF/flex-src/insync05/build.xml         |    76 +
 .../insync05/html-template/history/history.css  |    22 +
 .../insync05/html-template/history/history.js   |   722 +
 .../html-template/history/historyFrame.html     |    45 +
 .../insync05/html-template/index.template.html  |   121 +
 .../insync05/html-template/swfobject.js         |   793 +
 .../WEB-INF/flex-src/insync05/src/Contact.as    |    35 +
 .../flex-src/insync05/src/ContactForm.mxml      |   133 +
 .../WEB-INF/flex-src/insync05/src/insync05.mxml |    89 +
 .../flex-src/insync06/.actionScriptProperties   |    38 +
 .../WEB-INF/flex-src/insync06/.flexProperties   |    20 +
 .../WEB-INF/flex-src/insync06/.project          |    36 +
 .../WEB-INF/flex-src/insync06/build.xml         |    76 +
 .../insync06/html-template/history/history.css  |    22 +
 .../insync06/html-template/history/history.js   |   722 +
 .../html-template/history/historyFrame.html     |    45 +
 .../insync06/html-template/index.template.html  |   121 +
 .../insync06/html-template/swfobject.js         |   793 +
 .../WEB-INF/flex-src/insync06/src/Contact.as    |    35 +
 .../flex-src/insync06/src/ContactEvent.as       |    37 +
 .../flex-src/insync06/src/ContactForm.mxml      |   138 +
 .../WEB-INF/flex-src/insync06/src/insync06.mxml |   114 +
 .../flex-src/simplepush/.actionScriptProperties |    38 +
 .../WEB-INF/flex-src/simplepush/.flexProperties |    20 +
 .../WEB-INF/flex-src/simplepush/.project        |    36 +
 .../WEB-INF/flex-src/simplepush/build.xml       |    76 +
 .../html-template/history/history.css           |    22 +
 .../simplepush/html-template/history/history.js |   722 +
 .../html-template/history/historyFrame.html     |    45 +
 .../html-template/index.template.html           |   121 +
 .../simplepush/html-template/swfobject.js       |   793 +
 .../flex-src/simplepush/src/simplepush.mxml     |    53 +
 .../spring-blazeds-101/.actionScriptProperties  |    38 +
 .../flex-src/spring-blazeds-101/.flexProperties |    20 +
 .../flex-src/spring-blazeds-101/.project        |    36 +
 .../flex-src/spring-blazeds-101/build.xml       |    76 +
 .../html-template/history/history.css           |    22 +
 .../html-template/history/history.js            |   722 +
 .../html-template/history/historyFrame.html     |    45 +
 .../html-template/index.template.html           |   121 +
 .../html-template/swfobject.js                  |   793 +
 .../flex-src/spring-blazeds-101/src/Main.mxml   |    39 +
 .../.actionScriptProperties                     |    38 +
 .../spring-blazeds-security-101/.flexProperties |    20 +
 .../spring-blazeds-security-101/.project        |    36 +
 .../spring-blazeds-security-101/build.xml       |    76 +
 .../html-template/history/history.css           |    22 +
 .../html-template/history/history.js            |   722 +
 .../html-template/history/historyFrame.html     |    45 +
 .../html-template/index.template.html           |   121 +
 .../html-template/swfobject.js                  |   793 +
 .../spring-blazeds-security-101/src/Main.mxml   |    87 +
 .../traderdesktop/.actionScriptProperties       |    38 +
 .../flex-src/traderdesktop/.flexProperties      |    20 +
 .../WEB-INF/flex-src/traderdesktop/.project     |    36 +
 .../WEB-INF/flex-src/traderdesktop/build.xml    |    76 +
 .../html-template/history/history.css           |    22 +
 .../html-template/history/history.js            |   722 +
 .../html-template/history/historyFrame.html     |    45 +
 .../html-template/index.template.html           |   121 +
 .../traderdesktop/html-template/swfobject.js    |   793 +
 .../src/BackgroundColorRenderer.as              |    55 +
 .../flex-src/traderdesktop/src/ColorRenderer.as |    40 +
 .../flex/samples/marketfeed/Stock.as            |    35 +
 .../traderdesktop/src/traderdesktop.mxml        |   147 +
 .../WEB-INF/flex/messaging-config.xml           |    32 +
 .../WEB-INF/flex/proxy-config.xml               |    43 +
 .../WEB-INF/flex/remoting-config.xml            |    31 +
 .../WEB-INF/flex/services-config.xml            |   122 +
 .../WEB-INF/spring/app-config.xml               |    58 +
 .../WEB-INF/spring/infrastructure-config.xml    |    41 +
 .../WEB-INF/spring/security-config.xml          |    43 +
 .../WEB-INF/src/spring-samples/.classpath       |    68 +
 .../WEB-INF/src/spring-samples/.project         |    35 +
 .../flex/samples/company/Company.java           |   116 +
 .../flex/samples/company/CompanyDAO.java        |   120 +
 .../flex/samples/company/ICompanyDAO.java       |    28 +
 .../flex/samples/contact/Contact.java           |   124 +
 .../flex/samples/contact/ContactDAO.java        |   112 +
 .../flex/samples/contact/IContactDAO.java       |    28 +
 .../flex/samples/dao/IGenericDAO.java           |    40 +
 .../flex/samples/industry/IIndustryDAO.java     |    28 +
 .../flex/samples/industry/Industry.java         |    54 +
 .../flex/samples/industry/IndustryDAO.java      |    94 +
 .../flex/samples/integration/Counter.java       |    55 +
 .../flex/samples/marketfeed/MarketFeed.java     |   201 +
 .../flex/samples/marketfeed/Stock.java          |   111 +
 .../flex/samples/product/IProductDAO.java       |    28 +
 .../flex/samples/product/Product.java           |   114 +
 .../flex/samples/product/ProductDAO.java        |   165 +
 .../flex/samples/secured/Security3Helper.java   |    29 +
 .../flex/samples/simplefeed/SimpleFeed.java     |    99 +
 .../flex/samples/util/DatabaseInitializer.java  |   304 +
 apps/samples-spring/WEB-INF/web.xml             |    87 +
 apps/samples-spring/build.xml                   |   168 +
 apps/samples-spring/index.html                  |   330 +
 apps/samples-spring/login.jsp                   |    64 +
 apps/samples-spring/main.css                    |   138 +
 apps/samples-spring/stocklist.xml               |   141 +
 apps/samples/README.txt                         |     5 +
 .../WEB-INF/flex-src/dashboard/build.xml        |    85 +
 .../flex-src/dashboard/src/RegionBreakdown.mxml |   176 +
 .../flex-src/dashboard/src/RegionDetail.mxml    |   175 +
 .../flex-src/dashboard/src/RevenueTimeline.mxml |   134 +
 .../WEB-INF/flex-src/dashboard/src/SortUtils.as |    62 +
 .../flex-src/dashboard/src/dashboard.mxml       |   209 +
 .../flex-src/dashboard/src/icon_chart.png       |   Bin 0 -> 28044 bytes
 .../flex-src/dashboard/src/icon_grid.png        |   Bin 0 -> 28182 bytes
 .../WEB-INF/flex-src/dashboard/src/main.css     |    35 +
 .../WEB-INF/flex-src/dashboard/src/results.xml  |   213 +
 .../WEB-INF/flex-src/inventory/build.xml        |    82 +
 .../WEB-INF/flex-src/inventory/src/Product.as   |    44 +
 .../flex-src/inventory/src/ProductForm.mxml     |   106 +
 .../flex-src/inventory/src/SearchPopup.mxml     |    96 +
 .../flex-src/inventory/src/assets/Thumbs.db     |   Bin 0 -> 11264 bytes
 .../flex-src/inventory/src/assets/app_skin.png  |   Bin 0 -> 63724 bytes
 .../flex-src/inventory/src/assets/blank.png     |   Bin 0 -> 46171 bytes
 .../inventory/src/assets/button_over_skin.png   |   Bin 0 -> 57493 bytes
 .../inventory/src/assets/button_skin.png        |   Bin 0 -> 52718 bytes
 .../inventory/src/assets/icon_close.png         |   Bin 0 -> 59628 bytes
 .../flex-src/inventory/src/assets/icon_plus.png |   Bin 0 -> 58539 bytes
 .../inventory/src/assets/icon_search.png        |   Bin 0 -> 49838 bytes
 .../flex-src/inventory/src/assets/search.png    |   Bin 0 -> 53407 bytes
 .../inventory/src/assets/top_separator.png      |   Bin 0 -> 47474 bytes
 .../flex-src/inventory/src/inventory.mxml       |   116 +
 .../WEB-INF/flex-src/inventory/src/styles.css   |    74 +
 .../flex-src/runtimeconfig-messaging/build.xml  |    77 +
 .../runtimeconfig-messaging/src/ChatPanel.mxml  |    87 +
 .../runtimeconfig-messaging/src/main.mxml       |    54 +
 .../flex-src/runtimeconfig-remoting/build.xml   |    77 +
 .../runtimeconfig-remoting/src/main.mxml        |    64 +
 .../WEB-INF/flex-src/testdrive-101/build.xml    |    77 +
 .../flex-src/testdrive-101/src/ProductView.mxml |    35 +
 .../flex-src/testdrive-101/src/Thumb.mxml       |    29 +
 .../flex-src/testdrive-101/src/main.mxml        |    52 +
 .../flex-src/testdrive-101/src/testdrive.css    |    35 +
 .../WEB-INF/flex-src/testdrive-chat/build.xml   |    77 +
 .../flex-src/testdrive-chat/src/main.mxml       |    56 +
 .../flex-src/testdrive-datapush/build.xml       |    81 +
 .../flex-src/testdrive-datapush/src/main.mxml   |    42 +
 .../testdrive-datapush/src/startfeed.jsp        |    26 +
 .../testdrive-datapush/src/stopfeed.jsp         |    26 +
 .../flex-src/testdrive-httpservice/build.xml    |    81 +
 .../testdrive-httpservice/src/catalog.jsp       |    42 +
 .../testdrive-httpservice/src/main.mxml         |    28 +
 .../flex-src/testdrive-remoteobject/build.xml   |    77 +
 .../testdrive-remoteobject/src/main.mxml        |    28 +
 .../WEB-INF/flex-src/testdrive-update/build.xml |    77 +
 .../flex-src/testdrive-update/src/Product.as    |    44 +
 .../testdrive-update/src/ProductForm.mxml       |    60 +
 .../flex-src/testdrive-update/src/main.mxml     |    31 +
 .../flex-src/testdrive-webservice/build.xml     |    81 +
 .../flex-src/testdrive-webservice/src/main.mxml |    33 +
 .../WEB-INF/flex-src/traderdesktop/build.xml    |    81 +
 .../src/BackgroundColorRenderer.as              |    55 +
 .../flex-src/traderdesktop/src/ColorRenderer.as |    40 +
 .../WEB-INF/flex-src/traderdesktop/src/main.css |    30 +
 .../src/samples/portfolio/Stock.as              |    35 +
 .../flex-src/traderdesktop/src/startfeed.jsp    |    26 +
 .../flex-src/traderdesktop/src/stopfeed.jsp     |    26 +
 .../traderdesktop/src/traderdesktop.mxml        |   241 +
 apps/samples/WEB-INF/flex/messaging-config.xml  |    58 +
 apps/samples/WEB-INF/flex/proxy-config.xml      |    60 +
 apps/samples/WEB-INF/flex/remoting-config.xml   |    56 +
 apps/samples/WEB-INF/flex/services-config.xml   |   146 +
 .../src/flex/samples/ConnectionHelper.java      |    59 +
 .../WEB-INF/src/flex/samples/DAOException.java  |    38 +
 .../src/flex/samples/DatabaseCheckService.java  |    65 +
 .../flex/samples/crm/ConcurrencyException.java  |    37 +
 .../src/flex/samples/crm/DAOException.java      |    38 +
 .../src/flex/samples/crm/company/Company.java   |   105 +
 .../flex/samples/crm/company/CompanyDAO.java    |   228 +
 .../src/flex/samples/crm/employee/Employee.java |   106 +
 .../flex/samples/crm/employee/EmployeeDAO.java  |   300 +
 .../src/flex/samples/dcd/product/Product.java   |    89 +
 .../samples/dcd/product/ProductService.java     |   197 +
 .../WEB-INF/src/flex/samples/feed/Feed.java     |    85 +
 .../src/flex/samples/marketdata/Feed.java       |   121 +
 .../src/flex/samples/marketdata/Portfolio.java  |    75 +
 .../src/flex/samples/marketdata/Stock.java      |    84 +
 .../src/flex/samples/marketdata/portfolio.xml   |   141 +
 .../src/flex/samples/product/Product.java       |    89 +
 .../flex/samples/product/ProductService.java    |   191 +
 .../samples/qos/CustomDelayQueueProcessor.java  |   121 +
 .../samples/qos/FlexClientConfigService.java    |    74 +
 .../samples/runtimeconfig/ChatRoomService.java  |    81 +
 .../EmployeeRuntimeRemotingDestination.java     |    54 +
 apps/samples/WEB-INF/web.xml                    |    63 +
 apps/samples/build.xml                          |   168 +
 apps/samples/fb-project-setup.htm               |    67 +
 apps/samples/images/blazeds.png                 |   Bin 0 -> 8104 bytes
 apps/samples/index.htm                          |   101 +
 apps/samples/main.css                           |   138 +
 apps/samples/testdrive.htm                      |   254 +
 apps/team/WEB-INF/activemq.xml                  |    36 +
 apps/team/WEB-INF/flex/global.css               |    17 +
 apps/team/WEB-INF/flex/messaging-config.xml     |   292 +
 apps/team/WEB-INF/flex/proxy-config.xml         |    47 +
 apps/team/WEB-INF/flex/remoting-config.xml      |    96 +
 apps/team/WEB-INF/flex/services-config.xml      |   414 +
 .../add_your_as_and_swc_files_here.txt          |     0
 .../HTTPProxyBootstrapService.java              |   254 +
 .../MessagingBootstrapService.java              |   330 +
 .../RemotingBootstrapService.java               |   220 +
 .../CustomActionscriptAdapter.java              |    96 +
 .../messaging/serverpush/ServerPushService.java |   130 +
 .../features/remoting/AMFConnectionTest.java    |    76 +
 .../src/features/remoting/EchoService.java      |   130 +
 .../externalizable/ExternalizableClass.java     |    43 +
 .../runtimeconfig/RuntimeConfigurator.java      |   110 +
 .../ClassLoggingDeserializationValidator.java   |   127 +
 .../TestDeserializationValidator.java           |    58 +
 apps/team/build.xml                             |   198 +
 apps/team/features/README.txt                   |     2 +
 apps/team/features/ajax/README.txt              |     3 +
 .../features/ajax/messaging/TextMessage.html    |    88 +
 .../features/ajax/messaging/TextMessage.mxml    |    95 +
 .../cluster/messaging_AMF_Poll_Cluster.mxml     |    94 +
 .../cluster/messaging_HTTP_Poll_Cluster.mxml    |    94 +
 .../messaging_SecureAMF_Poll_Cluster.mxml       |    95 +
 .../messaging_SecureHTTP_Poll_Cluster.mxml      |    95 +
 .../customadapter/messaging_CustomAdapter.mxml  |   101 +
 .../features/messaging/discardedMessaging.mxml  |   119 +
 .../jms/messaging_AMF_LongPoll_JMS_Topic.mxml   |    91 +
 .../jms/messaging_AMF_Poll_JMS_Queue.mxml       |    91 +
 .../jms/messaging_AMF_Poll_JMS_Topic.mxml       |    91 +
 .../jms/messaging_HTTP_Poll_JMS_Queue.mxml      |    91 +
 .../jms/messaging_HTTP_Poll_JMS_Topic.mxml      |    91 +
 apps/team/features/messaging/messaging_AMF.mxml |   121 +
 .../messaging/messaging_AMF_LongPoll.mxml       |    91 +
 .../messaging/messaging_AMF_Piggyback.mxml      |   104 +
 .../features/messaging/messaging_AMF_Poll.mxml  |    91 +
 .../messaging/messaging_AMF_Stream.mxml         |    91 +
 .../team/features/messaging/messaging_HTTP.mxml |   117 +
 .../messaging/messaging_HTTP_LongPoll.mxml      |    91 +
 .../messaging/messaging_HTTP_Piggyback.mxml     |   104 +
 .../features/messaging/messaging_HTTP_Poll.mxml |    91 +
 .../messaging/messaging_HTTP_Stream.mxml        |    91 +
 ...aging_AMFLongPoll_and_SecureAMFLongPoll.mxml |   160 +
 ...ssaging_SecureAMFLongPoll_and_AMFStream.mxml |   160 +
 .../messaging_two_AMFLongPoll_Endpoints.mxml    |   160 +
 .../messaging/secure/messaging_SecureAMF.mxml   |   120 +
 .../messaging/secure/messaging_SecureHTTP.mxml  |   120 +
 .../messaging_AMF_Poll_JMS_Queue_Selector.mxml  |   100 +
 .../selector/messaging_AMF_Poll_Selector.mxml   |   100 +
 .../selector/messaging_HTTP_Poll_Selector.mxml  |   102 +
 ...ng_AMF_LongPoll_SendSubscribeConstraint.mxml |   104 +
 ...saging_AMF_Poll_SendSubscribeConstraint.mxml |   104 +
 ...ging_AMF_Stream_SendSubscribeConstraint.mxml |   104 +
 ...aging_HTTP_Poll_SendSubscribeConstraint.mxml |   104 +
 .../subtopic/messaging_AMF_Poll_Subtopic.mxml   |   103 +
 .../messaging_AMF_Stream_MultiSubtopic.mxml     |   131 +
 .../subtopic/messaging_HTTP_Poll_Subtopic.mxml  |   103 +
 .../throttle/messaging_ThrottleInbound.mxml     |   155 +
 .../throttle/messaging_ThrottleOutbound.mxml    |   228 +
 .../externalizable/ExternalizableClass.as       |    56 +
 .../externalizable/remoting_Externalizable.mxml |    80 +
 .../features/remoting/filteredAckRemoting.mxml  |    77 +
 .../remoting/filteredFaultRemoting.mxml         |    77 +
 apps/team/features/remoting/remoting_AMF.mxml   |    77 +
 apps/team/features/remoting/remoting_AMFX.mxml  |    77 +
 .../remoting/remoting_AMF_Dictionary.mxml       |   104 +
 .../features/remoting/remoting_AMF_Legacy.mxml  |    78 +
 .../remoting/remoting_AMF_ReadOnly.mxml         |    69 +
 .../features/remoting/remoting_AMF_Vector.mxml  |   122 +
 .../runtimeconfig_MessageDestination.mxml       |   150 +
 ...runtimeconfig_MessageDestinationWithJMS.mxml |   131 +
 .../features/security-constraints/README.txt    |     6 +
 .../securityConstraint_Basic.mxml               |    71 +
 .../securityConstraint_Custom.mxml              |   140 +
 .../securityConstraint_Legacy.mxml              |   104 +
 .../features/withoutui/messaging_withoutUI.as   |   145 +
 .../features/withoutui/remoting_withoutUI.as    |   116 +
 build.properties                                |    97 +
 build.xml                                       |   813 +
 collateral/blazeds-bin-readme.htm               |   270 +
 collateral/blazeds-src-readme.htm               |   558 +
 collateral/blazeds-turnkey-readme.htm           |   557 +
 development/IDEA/projects/java/BlazeDS.ipr      |   404 +
 development/IDEA/projects/java/blazeds.xml      |    88 +
 development/IDEA/projects/java/common.iml       |   224 +
 development/IDEA/projects/java/core.iml         |   263 +
 development/IDEA/projects/java/opt.iml          |   329 +
 development/IDEA/projects/java/proxy.iml        |   235 +
 development/IDEA/projects/java/remoting.iml     |   216 +
 .../flex/3.0/framework/.actionScriptProperties  |    35 +
 .../flex/3.0/framework/.flexLibProperties       |    30 +
 .../projects/flex/3.0/framework/.project        |    73 +
 .../flex/3.0/rpc/.actionScriptProperties        |    38 +
 .../projects/flex/3.0/rpc/.flexLibProperties    |    28 +
 .../eclipse/projects/flex/3.0/rpc/.project      |    69 +
 .../projects/java/blazeds-common/.classpath     |    25 +
 .../projects/java/blazeds-common/.project       |    52 +
 .../projects/java/blazeds-core/.classpath       |    31 +
 .../eclipse/projects/java/blazeds-core/.project |    52 +
 .../projects/java/blazeds-opt/.classpath        |    41 +
 .../eclipse/projects/java/blazeds-opt/.project  |   129 +
 .../projects/java/blazeds-proxy/.classpath      |    28 +
 .../projects/java/blazeds-proxy/.project        |    47 +
 .../projects/java/blazeds-remoting/.classpath   |    26 +
 .../projects/java/blazeds-remoting/.project     |    47 +
 .../blazeds-team.war/.actionScriptProperties    |    32 +
 .../projects/java/blazeds-team.war/.classpath   |    30 +
 .../java/blazeds-team.war/.flexProperties       |    20 +
 .../projects/java/blazeds-team.war/.project     |    49 +
 development/eclipse/projects/java/formatter.xml |   269 +
 development/eclipse/projects/readme.txt         |   116 +
 downloads.xml                                   |   641 +
 frameworks/local-swcs/FlexSDK3/empty.txt        |     0
 frameworks/local-swcs/FlexSDK4/empty.txt        |     0
 frameworks/local-swcs/readme.txt                |    36 +
 kick-build.txt                                  |     2 +
 modules/common/build.xml                        |    97 +
 modules/common/pom.xml                          |    54 +
 .../common/src/flex/graphics/ImageSnapshot.java |   147 +
 .../common/src/flex/graphics/package-info.java  |    18 +
 .../src/flex/messaging/LocalizedException.java  |   379 +
 .../config/AbstractConfigurationParser.java     |   559 +
 .../flex/messaging/config/AdapterSettings.java  |   130 +
 .../ApacheXPathClientConfigurationParser.java   |    87 +
 .../flex/messaging/config/ChannelSettings.java  |   335 +
 .../messaging/config/ClientConfiguration.java   |   192 +
 .../config/ClientConfigurationParser.java       |   952 +
 .../flex/messaging/config/ClusterSettings.java  |   152 +
 .../src/flex/messaging/config/ConfigMap.java    |   471 +
 .../config/ConfigurationConstants.java          |   467 +
 .../config/ConfigurationException.java          |    38 +
 .../config/ConfigurationFileResolver.java       |    32 +
 .../messaging/config/ConfigurationParser.java   |    31 +
 .../messaging/config/DestinationSettings.java   |   192 +
 .../messaging/config/FlexClientSettings.java    |   133 +
 .../messaging/config/LocalFileResolver.java     |   203 +
 .../flex/messaging/config/LoggingSettings.java  |    47 +
 .../messaging/config/LoginCommandSettings.java  |   102 +
 .../messaging/config/PropertiesSettings.java    |   100 +
 .../messaging/config/SecurityConstraint.java    |   123 +
 .../flex/messaging/config/ServiceSettings.java  |   166 +
 .../messaging/config/ServicesConfiguration.java |    71 +
 .../messaging/config/ServicesDependencies.java  |   747 +
 .../flex/messaging/config/TargetSettings.java   |    79 +
 .../flex/messaging/config/TokenReplacer.java    |   202 +
 .../config/XPathClientConfigurationParser.java  |    90 +
 .../common/src/flex/messaging/errors.properties |   432 +
 .../src/flex/messaging/log/AbstractTarget.java  |   268 +
 .../src/flex/messaging/log/ConsoleTarget.java   |    42 +
 .../flex/messaging/log/LineFormattedTarget.java |   286 +
 modules/common/src/flex/messaging/log/Log.java  |   704 +
 .../src/flex/messaging/log/LogCategories.java   |   112 +
 .../common/src/flex/messaging/log/LogEvent.java |   116 +
 .../common/src/flex/messaging/log/Logger.java   |   402 +
 .../common/src/flex/messaging/log/Target.java   |   112 +
 .../flex/messaging/util/BasicPrettyPrinter.java |   164 +
 .../src/flex/messaging/util/ExceptionUtil.java  |   246 +
 .../src/flex/messaging/util/FileUtils.java      |    96 +
 .../src/flex/messaging/util/LocaleUtils.java    |    58 +
 .../src/flex/messaging/util/ObjectTrace.java    |   173 +
 .../flex/messaging/util/PrettyPrintable.java    |    30 +
 .../src/flex/messaging/util/PrettyPrinter.java  |    30 +
 .../util/PropertyStringResourceLoader.java      |   379 +
 .../src/flex/messaging/util/ResourceLoader.java |   105 +
 .../src/flex/messaging/util/StringUtils.java    |   214 +
 .../src/flex/messaging/util/UUIDUtils.java      |   330 +
 modules/core/AdobeInfo.xml                      |    24 +
 modules/core/build.xml                          |   244 +
 modules/core/pom.xml                            |   101 +
 .../core/src/flex/management/BaseControl.java   |   512 +
 .../src/flex/management/BaseControlMBean.java   |    57 +
 .../flex/management/MBeanLifecycleManager.java  |    65 +
 .../src/flex/management/MBeanServerLocator.java |    35 +
 .../management/MBeanServerLocatorFactory.java   |   125 +
 .../core/src/flex/management/Manageable.java    |    55 +
 .../flex/management/ManageableComponent.java    |   421 +
 .../flex/management/ManagementException.java    |    32 +
 .../management/PlatformMBeanServerLocator.java  |    39 +
 .../core/src/flex/management/jmx/Attribute.java |    63 +
 .../flex/management/jmx/MBeanAttributeInfo.java |    96 +
 .../management/jmx/MBeanConstructorInfo.java    |   106 +
 .../core/src/flex/management/jmx/MBeanInfo.java |   186 +
 .../flex/management/jmx/MBeanOperationInfo.java |   119 +
 .../flex/management/jmx/MBeanParameterInfo.java |    73 +
 .../flex/management/jmx/MBeanServerGateway.java |   909 +
 .../src/flex/management/jmx/ObjectInstance.java |    67 +
 .../src/flex/management/jmx/ObjectName.java     |    99 +
 .../src/flex/management/jmx/package-info.java   |    17 +
 .../core/src/flex/management/package-info.java  |    17 +
 .../runtime/AdminConsoleDisplayRegistrar.java   |   104 +
 .../AdminConsoleDisplayRegistrarMBean.java      |    33 +
 .../management/runtime/AdminConsoleTypes.java   |    35 +
 .../runtime/messaging/DestinationControl.java   |   119 +
 .../messaging/DestinationControlMBean.java      |    57 +
 .../runtime/messaging/MessageBrokerControl.java |   297 +
 .../messaging/MessageBrokerControlMBean.java    |   132 +
 .../messaging/MessageDestinationControl.java    |   312 +
 .../MessageDestinationControlMBean.java         |   155 +
 .../client/FlexClientManagerControl.java        |    99 +
 .../client/FlexClientManagerControlMBean.java   |    70 +
 .../runtime/messaging/client/package-info.java  |    17 +
 .../messaging/endpoints/AMFEndpointControl.java |    50 +
 .../endpoints/AMFEndpointControlMBean.java      |    28 +
 .../messaging/endpoints/EndpointControl.java    |   241 +
 .../endpoints/EndpointControlMBean.java         |   113 +
 .../endpoints/HTTPEndpointControl.java          |    50 +
 .../endpoints/HTTPEndpointControlMBean.java     |    27 +
 .../endpoints/PollingEndpointControl.java       |    72 +
 .../endpoints/PollingEndpointControlMBean.java  |    45 +
 .../endpoints/StreamingAMFEndpointControl.java  |    48 +
 .../StreamingAMFEndpointControlMBean.java       |    26 +
 .../endpoints/StreamingEndpointControl.java     |   133 +
 .../StreamingEndpointControlMBean.java          |    76 +
 .../endpoints/StreamingHTTPEndpointControl.java |    48 +
 .../StreamingHTTPEndpointControlMBean.java      |    26 +
 .../messaging/endpoints/package-info.java       |    17 +
 .../runtime/messaging/log/LogControl.java       |   149 +
 .../runtime/messaging/log/LogControlMBean.java  |    80 +
 .../runtime/messaging/log/LogManager.java       |   266 +
 .../runtime/messaging/log/package-info.java     |    18 +
 .../runtime/messaging/package-info.java         |    17 +
 .../services/MessageServiceControl.java         |    51 +
 .../services/MessageServiceControlMBean.java    |    28 +
 .../services/ServiceAdapterControl.java         |    87 +
 .../services/ServiceAdapterControlMBean.java    |    47 +
 .../messaging/services/ServiceControl.java      |   145 +
 .../messaging/services/ServiceControlMBean.java |    59 +
 .../messaging/SubscriptionManagerControl.java   |   129 +
 .../SubscriptionManagerControlMBean.java        |    61 +
 .../messaging/ThrottleManagerControl.java       |   304 +
 .../messaging/ThrottleManagerControlMBean.java  |   179 +
 .../adapters/ActionScriptAdapterControl.java    |    50 +
 .../ActionScriptAdapterControlMBean.java        |    28 +
 .../messaging/adapters/JMSAdapterControl.java   |   119 +
 .../adapters/JMSAdapterControlMBean.java        |    85 +
 .../messaging/adapters/package-info.java        |    17 +
 .../services/messaging/package-info.java        |    18 +
 .../messaging/services/package-info.java        |    18 +
 .../flex/management/runtime/package-info.java   |    17 +
 .../AbstractConnectionAwareSession.java         |   171 +
 .../messaging/AbstractFlexSessionProvider.java  |   146 +
 .../flex/messaging/ConnectionAwareSession.java  |    63 +
 .../core/src/flex/messaging/Destination.java    |   802 +
 .../flex/messaging/DestructibleFlexFactory.java |    34 +
 .../src/flex/messaging/FactoryDestination.java  |   361 +
 .../src/flex/messaging/FactoryInstance.java     |   179 +
 .../core/src/flex/messaging/FlexComponent.java  |    48 +
 .../src/flex/messaging/FlexConfigurable.java    |    35 +
 .../core/src/flex/messaging/FlexContext.java    |   473 +
 .../core/src/flex/messaging/FlexFactory.java    |    87 +
 .../flex/messaging/FlexRemoteCredentials.java   |    93 +
 .../core/src/flex/messaging/FlexSession.java    |  1062 +
 .../messaging/FlexSessionAttributeListener.java |    47 +
 .../flex/messaging/FlexSessionBindingEvent.java |   114 +
 .../messaging/FlexSessionBindingListener.java   |    40 +
 .../messaging/FlexSessionConnectivityEvent.java |    50 +
 .../FlexSessionConnectivityListener.java        |    38 +
 .../src/flex/messaging/FlexSessionListener.java |    40 +
 .../src/flex/messaging/FlexSessionManager.java  |   299 +
 .../src/flex/messaging/HttpFlexSession.java     |   666 +
 .../flex/messaging/HttpFlexSessionProvider.java |    94 +
 .../core/src/flex/messaging/MessageBroker.java  |  2237 ++
 .../flex/messaging/MessageBrokerServlet.java    |   461 +
 .../core/src/flex/messaging/MessageClient.java  |  1144 +
 .../flex/messaging/MessageClientListener.java   |    40 +
 .../src/flex/messaging/MessageDestination.java  |   491 +
 .../src/flex/messaging/MessageException.java    |   443 +
 .../src/flex/messaging/MessageRoutedEvent.java  |    54 +
 .../flex/messaging/MessageRoutedListener.java   |    35 +
 .../flex/messaging/MessageRoutedNotifier.java   |   120 +
 modules/core/src/flex/messaging/Server.java     |    35 +
 .../messaging/ServiceValidationListener.java    |    30 +
 .../core/src/flex/messaging/VersionInfo.java    |   116 +
 .../flex/messaging/client/AsyncPollHandler.java |    31 +
 .../messaging/client/EndpointPushHandler.java   |    79 +
 .../messaging/client/EndpointPushNotifier.java  |   461 +
 .../src/flex/messaging/client/FlexClient.java   |  2240 ++
 .../client/FlexClientAttributeListener.java     |    47 +
 .../client/FlexClientBindingEvent.java          |   115 +
 .../client/FlexClientBindingListener.java       |    39 +
 .../messaging/client/FlexClientListener.java    |    40 +
 .../messaging/client/FlexClientManager.java     |   519 +
 .../FlexClientNotSubscribedException.java       |    73 +
 .../FlexClientOutboundQueueProcessor.java       |   347 +
 .../src/flex/messaging/client/FlushResult.java  |   117 +
 .../client/OutboundQueueThrottleManager.java    |   269 +
 .../flex/messaging/client/PollFlushResult.java  |    97 +
 .../flex/messaging/client/PollWaitListener.java |    40 +
 .../messaging/client/UserAgentSettings.java     |   258 +
 .../src/flex/messaging/client/package-info.java |    18 +
 .../messaging/cluster/BroadcastHandler.java     |    45 +
 .../src/flex/messaging/cluster/Cluster.java     |   239 +
 .../messaging/cluster/ClusterException.java     |    31 +
 .../flex/messaging/cluster/ClusterManager.java  |   673 +
 .../cluster/ClusterMembershipListener.java      |   137 +
 .../src/flex/messaging/cluster/ClusterNode.java |   172 +
 .../messaging/cluster/RemoveNodeListener.java   |    35 +
 .../flex/messaging/cluster/package-info.java    |    19 +
 .../ApacheXPathServerConfigurationParser.java   |    89 +
 .../messaging/config/ConfigurationManager.java  |    40 +
 .../flex/messaging/config/FactorySettings.java  |    82 +
 .../config/FlexConfigurationManager.java        |   319 +
 .../messaging/config/MessageFilterSettings.java |    99 +
 .../config/MessagingConfiguration.java          |  1003 +
 .../flex/messaging/config/NetworkSettings.java  |   165 +
 .../flex/messaging/config/SecuritySettings.java |   104 +
 .../config/ServerConfigurationParser.java       |  1921 ++
 .../flex/messaging/config/ServerSettings.java   |   231 +
 .../config/ServletResourceResolver.java         |   156 +
 .../messaging/config/SharedServerSettings.java  |    65 +
 .../flex/messaging/config/SystemSettings.java   |   300 +
 .../flex/messaging/config/ThrottleSettings.java |   373 +
 .../messaging/config/ValidatorSettings.java     |    68 +
 .../config/XPathServerConfigurationParser.java  |    94 +
 .../src/flex/messaging/config/package-info.java |    18 +
 .../flex/messaging/endpoints/AMFEndpoint.java   |   152 +
 .../messaging/endpoints/AbstractEndpoint.java   |  1508 ++
 .../messaging/endpoints/BaseHTTPEndpoint.java   |   636 +
 .../endpoints/BasePollingHTTPEndpoint.java      |   603 +
 .../endpoints/BaseStreamingHTTPEndpoint.java    |  1226 +
 .../endpoints/DuplicateSessionException.java    |    81 +
 .../src/flex/messaging/endpoints/Endpoint.java  |   190 +
 .../src/flex/messaging/endpoints/Endpoint2.java |    37 +
 .../flex/messaging/endpoints/HTTPEndpoint.java  |   185 +
 .../messaging/endpoints/SecureAMFEndpoint.java  |    64 +
 .../messaging/endpoints/SecureHTTPEndpoint.java |    64 +
 .../endpoints/SecureStreamingAMFEndpoint.java   |    64 +
 .../endpoints/SecureStreamingHTTPEndpoint.java  |    64 +
 .../endpoints/StreamingAMFEndpoint.java         |   247 +
 .../endpoints/StreamingHTTPEndpoint.java        |   239 +
 .../flex/messaging/endpoints/amf/AMFFilter.java |    53 +
 .../endpoints/amf/BatchProcessFilter.java       |    73 +
 .../messaging/endpoints/amf/LegacyFilter.java   |   339 +
 .../endpoints/amf/MessageBrokerFilter.java      |   180 +
 .../endpoints/amf/SerializationFilter.java      |   480 +
 .../messaging/endpoints/amf/SessionFilter.java  |    81 +
 .../messaging/endpoints/amf/package-info.java   |    18 +
 .../flex/messaging/endpoints/package-info.java  |    17 +
 .../flex/messaging/factories/JavaFactory.java   |   298 +
 .../factories/JavaFactoryInstance.java          |   146 +
 .../flex/messaging/factories/package-info.java  |    18 +
 .../src/flex/messaging/io/AbstractProxy.java    |   294 +
 .../src/flex/messaging/io/ArrayCollection.java  |   165 +
 .../core/src/flex/messaging/io/ArrayList.java   |    44 +
 .../core/src/flex/messaging/io/BeanProxy.java   |   940 +
 .../core/src/flex/messaging/io/ClassAlias.java  |    29 +
 .../flex/messaging/io/ClassAliasRegistry.java   |    98 +
 .../src/flex/messaging/io/DictionaryProxy.java  |   112 +
 .../flex/messaging/io/ManagedObjectProxy.java   |    74 +
 .../core/src/flex/messaging/io/MapProxy.java    |   221 +
 .../flex/messaging/io/MessageDeserializer.java  |    39 +
 .../flex/messaging/io/MessageIOConstants.java   |    54 +
 .../flex/messaging/io/MessageSerializer.java    |    39 +
 .../core/src/flex/messaging/io/ObjectProxy.java |    73 +
 .../src/flex/messaging/io/PageableRowSet.java   |    93 +
 .../flex/messaging/io/PageableRowSetProxy.java  |   157 +
 .../core/src/flex/messaging/io/PagedRowSet.java |   363 +
 .../src/flex/messaging/io/PropertyProxy.java    |   282 +
 .../messaging/io/PropertyProxyRegistry.java     |   336 +
 .../io/RecoverableSerializationException.java   |    36 +
 .../flex/messaging/io/SerializationContext.java |   296 +
 .../messaging/io/SerializationDescriptor.java   |    70 +
 .../messaging/io/SerializationException.java    |    44 +
 .../flex/messaging/io/SerializationProxy.java   |   115 +
 .../src/flex/messaging/io/StatusInfoProxy.java  |   295 +
 .../src/flex/messaging/io/ThrowableProxy.java   |    40 +
 .../src/flex/messaging/io/TypeMarshaller.java   |    43 +
 .../messaging/io/TypeMarshallingContext.java    |   241 +
 .../flex/messaging/io/UnknownTypeException.java |    30 +
 .../src/flex/messaging/io/amf/ASObject.java     |   114 +
 .../flex/messaging/io/amf/AbstractAmfInput.java |   365 +
 .../messaging/io/amf/AbstractAmfOutput.java     |   177 +
 .../flex/messaging/io/amf/ActionContext.java    |   237 +
 .../flex/messaging/io/amf/ActionMessage.java    |   107 +
 .../messaging/io/amf/ActionMessageInput.java    |   105 +
 .../messaging/io/amf/ActionMessageOutput.java   |   118 +
 .../src/flex/messaging/io/amf/Amf0Input.java    |   541 +
 .../src/flex/messaging/io/amf/Amf0Output.java   |   874 +
 .../src/flex/messaging/io/amf/Amf3Input.java    |  1046 +
 .../src/flex/messaging/io/amf/Amf3Output.java   |  1377 ++
 .../src/flex/messaging/io/amf/Amf3Types.java    |    66 +
 .../core/src/flex/messaging/io/amf/AmfIO.java   |   170 +
 .../io/amf/AmfMessageDeserializer.java          |   202 +
 .../messaging/io/amf/AmfMessageSerializer.java  |   159 +
 .../src/flex/messaging/io/amf/AmfTrace.java     |   577 +
 .../src/flex/messaging/io/amf/AmfTypes.java     |    45 +
 .../src/flex/messaging/io/amf/MessageBody.java  |   116 +
 .../flex/messaging/io/amf/MessageHeader.java    |    76 +
 .../flex/messaging/io/amf/SerializedObject.java |    98 +
 .../src/flex/messaging/io/amf/TraitsInfo.java   |   171 +
 .../messaging/io/amf/client/AMFConnection.java  |   926 +
 .../io/amf/client/AMFHeaderProcessor.java       |    35 +
 .../exceptions/ClientStatusException.java       |   127 +
 .../exceptions/ServerStatusException.java       |    94 +
 .../io/amf/client/exceptions/package-info.java  |    18 +
 .../messaging/io/amf/client/package-info.java   |    18 +
 .../src/flex/messaging/io/amf/package-info.java |    18 +
 .../io/amf/translator/ASTranslator.java         |    78 +
 .../io/amf/translator/TranslationException.java |    44 +
 .../translator/decoder/ActionScriptDecoder.java |   131 +
 .../io/amf/translator/decoder/ArrayDecoder.java |   170 +
 .../amf/translator/decoder/BooleanDecoder.java  |    59 +
 .../amf/translator/decoder/CalendarDecoder.java |    69 +
 .../translator/decoder/CharacterDecoder.java    |    65 +
 .../translator/decoder/CollectionDecoder.java   |   163 +
 .../io/amf/translator/decoder/DateDecoder.java  |   122 +
 .../amf/translator/decoder/DecoderFactory.java  |   378 +
 .../io/amf/translator/decoder/EnumDecoder.java  |    71 +
 .../io/amf/translator/decoder/MapDecoder.java   |   101 +
 .../amf/translator/decoder/NativeDecoder.java   |    30 +
 .../io/amf/translator/decoder/NullDecoder.java  |    28 +
 .../amf/translator/decoder/NumberDecoder.java   |   150 +
 .../decoder/ReferenceAwareArrayDecoder.java     |   116 +
 .../decoder/ReferenceAwareCalendarDecoder.java  |    44 +
 .../ReferenceAwareCollectionDecoder.java        |   115 +
 .../decoder/ReferenceAwareDateDecoder.java      |    46 +
 .../decoder/ReferenceAwareMapDecoder.java       |    81 +
 .../ReferenceAwareTypedObjectDecoder.java       |   105 +
 .../amf/translator/decoder/StringDecoder.java   |    55 +
 .../translator/decoder/TypedObjectDecoder.java  |   126 +
 .../io/amf/translator/decoder/package-info.java |    18 +
 .../io/amf/translator/package-info.java         |    18 +
 .../src/flex/messaging/io/amfx/AmfxInput.java   |  1388 ++
 .../io/amfx/AmfxMessageDeserializer.java        |   341 +
 .../io/amfx/AmfxMessageSerializer.java          |   200 +
 .../src/flex/messaging/io/amfx/AmfxOutput.java  |  1087 +
 .../src/flex/messaging/io/amfx/AmfxTypes.java   |   101 +
 .../flex/messaging/io/amfx/package-info.java    |    18 +
 .../src/flex/messaging/io/package-info.java     |    18 +
 .../src/flex/messaging/log/HTTPRequestLog.java  |   281 +
 .../log/LoggingHttpServletRequestWrapper.java   |   187 +
 .../flex/messaging/log/ServletLogTarget.java    |    76 +
 .../src/flex/messaging/log/package-info.java    |    18 +
 .../messaging/messages/AbstractMessage.java     |   721 +
 .../messaging/messages/AcknowledgeMessage.java  |    97 +
 .../messages/AcknowledgeMessageExt.java         |    60 +
 .../flex/messaging/messages/AsyncMessage.java   |   169 +
 .../messaging/messages/AsyncMessageExt.java     |    58 +
 .../messaging/messages/BatchableMessage.java    |    32 +
 .../flex/messaging/messages/CommandMessage.java |   401 +
 .../messaging/messages/CommandMessageExt.java   |    58 +
 .../flex/messaging/messages/ErrorMessage.java   |    90 +
 .../flex/messaging/messages/HTTPMessage.java    |   138 +
 .../src/flex/messaging/messages/Message.java    |   237 +
 .../messages/MessagePerformanceInfo.java        |   193 +
 .../messages/MessagePerformanceUtils.java       |   415 +
 .../src/flex/messaging/messages/RPCMessage.java |    82 +
 .../messaging/messages/RemotingMessage.java     |   133 +
 .../flex/messaging/messages/SOAPMessage.java    |    54 +
 .../flex/messaging/messages/SmallMessage.java   |    37 +
 .../flex/messaging/messages/package-info.java   |    18 +
 .../core/src/flex/messaging/package-info.java   |    18 +
 .../security/AppServerLoginCommand.java         |    98 +
 .../flex/messaging/security/LoginCommand.java   |    78 +
 .../messaging/security/LoginCommandExt.java     |    44 +
 .../flex/messaging/security/LoginManager.java   |   404 +
 .../messaging/security/MessagingSecurity.java   |    51 +
 .../messaging/security/PrincipalConverter.java  |    34 +
 .../messaging/security/SecurityException.java   |   166 +
 .../flex/messaging/security/package-info.java   |    17 +
 .../services/AbstractBootstrapService.java      |   336 +
 .../messaging/services/AbstractService.java     |   755 +
 .../messaging/services/AuthenticationEvent.java |   155 +
 .../services/AuthenticationListener.java        |    37 +
 .../services/AuthenticationService.java         |   268 +
 .../flex/messaging/services/MessageService.java |  1248 +
 .../src/flex/messaging/services/Service.java    |   218 +
 .../flex/messaging/services/ServiceAdapter.java |   314 +
 .../messaging/services/ServiceException.java    |    86 +
 .../services/messaging/MessageFrequency.java    |   109 +
 .../services/messaging/MessagingConstants.java  |    59 +
 .../services/messaging/RemoteMessageClient.java |    68 +
 .../messaging/RemoteSubscriptionManager.java    |   201 +
 .../services/messaging/SubscriptionManager.java |   915 +
 .../messaging/services/messaging/Subtopic.java  |   310 +
 .../services/messaging/ThrottleManager.java     |   556 +
 .../messaging/adapters/ActionScriptAdapter.java |   107 +
 .../adapters/AsyncMessageReceiver.java          |    78 +
 .../services/messaging/adapters/JMSAdapter.java |  1114 +
 .../messaging/adapters/JMSConfigConstants.java  |   116 +
 .../messaging/adapters/JMSConsumer.java         |   464 +
 .../messaging/adapters/JMSExceptionEvent.java   |    53 +
 .../adapters/JMSExceptionListener.java          |    34 +
 .../messaging/adapters/JMSMessageEvent.java     |    54 +
 .../messaging/adapters/JMSMessageListener.java  |    34 +
 .../messaging/adapters/JMSProducer.java         |   336 +
 .../services/messaging/adapters/JMSProxy.java   |   394 +
 .../messaging/adapters/JMSQueueConsumer.java    |    96 +
 .../messaging/adapters/JMSQueueProducer.java    |   132 +
 .../messaging/adapters/JMSSettings.java         |   602 +
 .../messaging/adapters/JMSTopicConsumer.java    |   313 +
 .../messaging/adapters/JMSTopicProducer.java    |   129 +
 .../messaging/adapters/MessageReceiver.java     |    39 +
 .../messaging/adapters/MessagingAdapter.java    |   229 +
 .../MessagingSecurityConstraintManager.java     |   162 +
 .../messaging/adapters/SyncMessageReceiver.java |   201 +
 .../messaging/adapters/package-info.java        |    17 +
 .../services/messaging/package-info.java        |    17 +
 .../messaging/selector/JMSSelector.java         |   120 +
 .../selector/JMSSelectorException.java          |    36 +
 .../messaging/selector/package-info.java        |    17 +
 .../flex/messaging/services/package-info.java   |    17 +
 .../core/src/flex/messaging/util/Assert.java    |    64 +
 .../messaging/util/AssertionFailedError.java    |    35 +
 .../core/src/flex/messaging/util/Base64.java    |   233 +
 .../core/src/flex/messaging/util/ClassUtil.java |   360 +
 modules/core/src/flex/messaging/util/Diag.jsl   |    34 +
 .../src/flex/messaging/util/DoubleUtil.java     |    31 +
 .../core/src/flex/messaging/util/DoubleUtil.jsl |    27 +
 modules/core/src/flex/messaging/util/Hex.java   |   143 +
 .../core/src/flex/messaging/util/MethodKey.java |    80 +
 .../src/flex/messaging/util/MethodMatcher.java  |   515 +
 .../flex/messaging/util/RedeployManager.java    |   296 +
 .../messaging/util/SettingsReplaceUtil.java     |   369 +
 .../messaging/util/TimeoutAbstractObject.java   |   177 +
 .../src/flex/messaging/util/TimeoutCapable.java |    66 +
 .../src/flex/messaging/util/TimeoutManager.java |   232 +
 .../messaging/util/ToStringPrettyPrinter.java   |   234 +
 modules/core/src/flex/messaging/util/Trace.java |   105 +
 .../src/flex/messaging/util/URLDecoder.java     |   127 +
 .../src/flex/messaging/util/URLEncoder.java     |   155 +
 .../src/flex/messaging/util/URLEncoderUtil.java |    42 +
 .../src/flex/messaging/util/URLEncoderUtil.jsl  |    40 +
 .../src/flex/messaging/util/UUIDGenerator.java  |    31 +
 .../flex/messaging/util/UserAgentManager.java   |   207 +
 .../src/flex/messaging/util/WatchedObject.java  |    72 +
 .../core/src/flex/messaging/util/XMLUtil.java   |   140 +
 .../concurrent/DefaultThreadPoolExecutor.java   |   160 +
 .../messaging/util/concurrent/Executor.java     |    59 +
 .../util/concurrent/FailedExecutionHandler.java |    37 +
 .../messaging/util/concurrent/package-info.java |    18 +
 .../src/flex/messaging/util/package-info.java   |    17 +
 .../ClassDeserializationValidator.java          |   337 +
 .../validators/DeserializationValidator.java    |    56 +
 .../flex/messaging/validators/package-info.java |    18 +
 modules/core/test/src/amf_request.xml           |    92 +
 .../test/src/amfclient/ClientCustomType.java    |    45 +
 .../src/flex/messaging/DestinationTest.java     |   335 +
 .../src/flex/messaging/MessageBrokerTest.java   |   351 +
 .../messaging/client/FlexClientManagerTest.java |   125 +
 .../cluster/SerializationProxyTest.java         |    64 +
 .../config/ChannelSettingsParseUriTest.java     |   197 +
 .../config/ConfigurationConfirmation.java       |   544 +
 .../config/ConfigurationParserTest.java         |   200 +
 .../messaging/config/ThrottleSettingsTest.java  |   182 +
 .../src/flex/messaging/config/services/1a.xml   |    37 +
 .../src/flex/messaging/config/services/1b.xml   |    63 +
 .../src/flex/messaging/config/services/1c.xml   |    61 +
 .../src/flex/messaging/config/services/1d.xml   |    93 +
 .../src/flex/messaging/config/services/1e.xml   |    50 +
 .../config/services/1e_adapter_include.xml      |    27 +
 .../config/services/1e_channel_include.xml      |    29 +
 .../config/services/1e_constraint_include.xml   |    32 +
 .../config/services/1e_destination_include.xml  |    26 +
 .../src/flex/messaging/config/services/1f.xml   |    34 +
 .../config/services/1f_service_include.xml      |    40 +
 .../src/flex/messaging/config/services/1g.xml   |    26 +
 .../src/flex/messaging/config/services/1h.xml   |    52 +
 .../src/flex/messaging/config/services/1i.xml   |    55 +
 .../src/flex/messaging/config/services/1j.xml   |    40 +
 .../messaging/config/services/Confirm1a.java    |    54 +
 .../messaging/config/services/Confirm1b.java    |    87 +
 .../messaging/config/services/Confirm1c.java    |    99 +
 .../messaging/config/services/Confirm1d.java    |   112 +
 .../messaging/config/services/Confirm1e.java    |    41 +
 .../messaging/config/services/Confirm1f.java    |    39 +
 .../messaging/config/services/Confirm1g.java    |    46 +
 .../messaging/config/services/Confirm1h.java    |    46 +
 .../messaging/config/services/Confirm1i.java    |    41 +
 .../messaging/config/services/Confirm1j.java    |    39 +
 .../services/adapters/1i_adapter_include.xml    |    25 +
 .../services/channels/1i_channel_include.xml    |    27 +
 .../constraints/1i_constraint_include.xml       |    30 +
 .../destinations/1i_destination_include.xml     |    29 +
 .../services/services/1i_service_include.xml    |    42 +
 .../messaging/io/amf/AmfDeserializerTest.java   |   154 +
 .../flex/messaging/io/amf/MessageGenerator.java |   393 +
 .../io/amf/client/AMFConnectionTest.java        |   758 +
 .../io/amf/client/AMFDataTypeTest.java          |   461 +
 .../amf/translator/HashReferenceTableTest.java  |   280 +
 .../translator/StrictReferenceTableTest.java    |   152 +
 .../AmfDeserializationValidatorTest.java        |   165 +
 .../io/amfx/AmfxSerializationTest.java          |   304 +
 .../io/amfx/DeserializationConfirmation.java    |   522 +
 .../test/src/flex/messaging/io/amfx/amfx.xsd    |   139 +
 .../src/flex/messaging/io/amfx/amfx_tag/1a.xml  |    20 +
 .../src/flex/messaging/io/amfx/amfx_tag/1b.xml  |    27 +
 .../src/flex/messaging/io/amfx/amfx_tag/1c.xml  |    24 +
 .../messaging/io/amfx/amfx_tag/Confirm1a.java   |    42 +
 .../messaging/io/amfx/amfx_tag/Confirm1b.java   |    54 +
 .../messaging/io/amfx/amfx_tag/Confirm1c.java   |    43 +
 .../src/flex/messaging/io/amfx/array_tag/2a.xml |    30 +
 .../src/flex/messaging/io/amfx/array_tag/2b.xml |    39 +
 .../src/flex/messaging/io/amfx/array_tag/2c.xml |    33 +
 .../src/flex/messaging/io/amfx/array_tag/2d.xml |    43 +
 .../src/flex/messaging/io/amfx/array_tag/2e.xml |    26 +
 .../src/flex/messaging/io/amfx/array_tag/2f.xml |    40 +
 .../src/flex/messaging/io/amfx/array_tag/2g.xml |    28 +
 .../src/flex/messaging/io/amfx/array_tag/2h.xml |    29 +
 .../src/flex/messaging/io/amfx/array_tag/2i.xml |    42 +
 .../src/flex/messaging/io/amfx/array_tag/2j.xml |    24 +
 .../src/flex/messaging/io/amfx/array_tag/2k.xml |    28 +
 .../src/flex/messaging/io/amfx/array_tag/2l.xml |    28 +
 .../messaging/io/amfx/array_tag/Confirm2a.java  |    59 +
 .../messaging/io/amfx/array_tag/Confirm2b.java  |    67 +
 .../messaging/io/amfx/array_tag/Confirm2c.java  |    62 +
 .../messaging/io/amfx/array_tag/Confirm2d.java  |    65 +
 .../messaging/io/amfx/array_tag/Confirm2e.java  |    76 +
 .../messaging/io/amfx/array_tag/Confirm2f.java  |    96 +
 .../messaging/io/amfx/array_tag/Confirm2g.java  |    53 +
 .../messaging/io/amfx/array_tag/Confirm2h.java  |    54 +
 .../messaging/io/amfx/array_tag/Confirm2i.java  |    74 +
 .../messaging/io/amfx/array_tag/Confirm2j.java  |    43 +
 .../messaging/io/amfx/array_tag/Confirm2k.java  |    43 +
 .../messaging/io/amfx/array_tag/Confirm2l.java  |    44 +
 .../src/flex/messaging/io/amfx/body_tag/3a.xml  |    22 +
 .../src/flex/messaging/io/amfx/body_tag/3b.xml  |    24 +
 .../src/flex/messaging/io/amfx/body_tag/3c.xml  |    44 +
 .../src/flex/messaging/io/amfx/body_tag/3d.xml  |    25 +
 .../messaging/io/amfx/body_tag/Confirm3a.java   |    45 +
 .../messaging/io/amfx/body_tag/Confirm3b.java   |    46 +
 .../messaging/io/amfx/body_tag/Confirm3c.java   |    66 +
 .../messaging/io/amfx/body_tag/Confirm3d.java   |    43 +
 .../flex/messaging/io/amfx/bytes_tag/16a.xml    |    24 +
 .../messaging/io/amfx/bytes_tag/Confirm16a.java |    53 +
 .../src/flex/messaging/io/amfx/date_tag/4a.xml  |    24 +
 .../src/flex/messaging/io/amfx/date_tag/4b.xml  |    31 +
 .../src/flex/messaging/io/amfx/date_tag/4c.xml  |    28 +
 .../src/flex/messaging/io/amfx/date_tag/4d.xml  |    68 +
 .../src/flex/messaging/io/amfx/date_tag/4e.xml  |    28 +
 .../src/flex/messaging/io/amfx/date_tag/4f.xml  |    24 +
 .../src/flex/messaging/io/amfx/date_tag/4g.xml  |    24 +
 .../messaging/io/amfx/date_tag/Confirm4a.java   |    48 +
 .../messaging/io/amfx/date_tag/Confirm4b.java   |    54 +
 .../messaging/io/amfx/date_tag/Confirm4c.java   |    57 +
 .../messaging/io/amfx/date_tag/Confirm4d.java   |    57 +
 .../messaging/io/amfx/date_tag/Confirm4e.java   |    84 +
 .../messaging/io/amfx/date_tag/Confirm4f.java   |    48 +
 .../messaging/io/amfx/date_tag/Confirm4g.java   |    43 +
 .../flex/messaging/io/amfx/double_tag/5a.xml    |    24 +
 .../flex/messaging/io/amfx/double_tag/5b.xml    |    68 +
 .../flex/messaging/io/amfx/double_tag/5c.xml    |    37 +
 .../flex/messaging/io/amfx/double_tag/5d.xml    |    68 +
 .../flex/messaging/io/amfx/double_tag/5e.xml    |    24 +
 .../flex/messaging/io/amfx/double_tag/5f.xml    |    24 +
 .../flex/messaging/io/amfx/double_tag/5g.xml    |    24 +
 .../flex/messaging/io/amfx/double_tag/5h.xml    |    24 +
 .../messaging/io/amfx/double_tag/Confirm5a.java |    46 +
 .../messaging/io/amfx/double_tag/Confirm5b.java |    62 +
 .../messaging/io/amfx/double_tag/Confirm5c.java |    55 +
 .../messaging/io/amfx/double_tag/Confirm5d.java |    60 +
 .../messaging/io/amfx/double_tag/Confirm5e.java |    43 +
 .../messaging/io/amfx/double_tag/Confirm5f.java |    43 +
 .../messaging/io/amfx/double_tag/Confirm5g.java |    43 +
 .../messaging/io/amfx/double_tag/Confirm5h.java |    43 +
 .../src/flex/messaging/io/amfx/false_tag/6a.xml |    24 +
 .../src/flex/messaging/io/amfx/false_tag/6b.xml |    31 +
 .../src/flex/messaging/io/amfx/false_tag/6c.xml |    28 +
 .../src/flex/messaging/io/amfx/false_tag/6d.xml |    36 +
 .../messaging/io/amfx/false_tag/Confirm6a.java  |    46 +
 .../messaging/io/amfx/false_tag/Confirm6b.java  |    52 +
 .../messaging/io/amfx/false_tag/Confirm6c.java  |    55 +
 .../messaging/io/amfx/false_tag/Confirm6d.java  |    56 +
 .../flex/messaging/io/amfx/header_tag/7a.xml    |    22 +
 .../flex/messaging/io/amfx/header_tag/7b.xml    |    24 +
 .../flex/messaging/io/amfx/header_tag/7c.xml    |    41 +
 .../flex/messaging/io/amfx/header_tag/7d.xml    |    25 +
 .../messaging/io/amfx/header_tag/Confirm7a.java |    46 +
 .../messaging/io/amfx/header_tag/Confirm7b.java |    48 +
 .../messaging/io/amfx/header_tag/Confirm7c.java |    72 +
 .../messaging/io/amfx/header_tag/Confirm7d.java |    43 +
 .../src/flex/messaging/io/amfx/int_tag/8a.xml   |    24 +
 .../src/flex/messaging/io/amfx/int_tag/8b.xml   |    36 +
 .../src/flex/messaging/io/amfx/int_tag/8c.xml   |    37 +
 .../src/flex/messaging/io/amfx/int_tag/8d.xml   |    68 +
 .../src/flex/messaging/io/amfx/int_tag/8e.xml   |    24 +
 .../src/flex/messaging/io/amfx/int_tag/8f.xml   |    24 +
 .../src/flex/messaging/io/amfx/int_tag/8g.xml   |    24 +
 .../messaging/io/amfx/int_tag/Confirm8a.java    |    46 +
 .../messaging/io/amfx/int_tag/Confirm8b.java    |    53 +
 .../messaging/io/amfx/int_tag/Confirm8c.java    |    55 +
 .../messaging/io/amfx/int_tag/Confirm8d.java    |    60 +
 .../messaging/io/amfx/int_tag/Confirm8e.java    |    43 +
 .../messaging/io/amfx/int_tag/Confirm8f.java    |    43 +
 .../messaging/io/amfx/int_tag/Confirm8g.java    |    43 +
 .../src/flex/messaging/io/amfx/null_tag/9a.xml  |    24 +
 .../src/flex/messaging/io/amfx/null_tag/9b.xml  |    31 +
 .../src/flex/messaging/io/amfx/null_tag/9c.xml  |    28 +
 .../src/flex/messaging/io/amfx/null_tag/9d.xml  |    36 +
 .../messaging/io/amfx/null_tag/Confirm9a.java   |    46 +
 .../messaging/io/amfx/null_tag/Confirm9b.java   |    52 +
 .../messaging/io/amfx/null_tag/Confirm9c.java   |    55 +
 .../messaging/io/amfx/null_tag/Confirm9d.java   |    56 +
 .../flex/messaging/io/amfx/object_tag/10a.xml   |    41 +
 .../flex/messaging/io/amfx/object_tag/10b.xml   |    56 +
 .../flex/messaging/io/amfx/object_tag/10c.xml   |    49 +
 .../flex/messaging/io/amfx/object_tag/10d.xml   |    38 +
 .../io/amfx/object_tag/Confirm10a.java          |    57 +
 .../io/amfx/object_tag/Confirm10b.java          |    74 +
 .../io/amfx/object_tag/Confirm10c.java          |   101 +
 .../io/amfx/object_tag/Confirm10d.java          |    93 +
 .../flex/messaging/io/amfx/string_tag/11a.xml   |    24 +
 .../flex/messaging/io/amfx/string_tag/11b.xml   |    31 +
 .../flex/messaging/io/amfx/string_tag/11c.xml   |    28 +
 .../flex/messaging/io/amfx/string_tag/11d.xml   |    68 +
 .../flex/messaging/io/amfx/string_tag/11e.xml   |    28 +
 .../flex/messaging/io/amfx/string_tag/11f.xml   |    30 +
 .../flex/messaging/io/amfx/string_tag/11g.xml   |    28 +
 .../flex/messaging/io/amfx/string_tag/11h.xml   |    31 +
 .../flex/messaging/io/amfx/string_tag/11i.xml   |    24 +
 .../flex/messaging/io/amfx/string_tag/11j.xml   |    24 +
 .../io/amfx/string_tag/Confirm11a.java          |    46 +
 .../io/amfx/string_tag/Confirm11b.java          |    52 +
 .../io/amfx/string_tag/Confirm11c.java          |    55 +
 .../io/amfx/string_tag/Confirm11d.java          |    60 +
 .../io/amfx/string_tag/Confirm11e.java          |    82 +
 .../io/amfx/string_tag/Confirm11f.java          |    94 +
 .../io/amfx/string_tag/Confirm11g.java          |    55 +
 .../io/amfx/string_tag/Confirm11h.java          |    43 +
 .../io/amfx/string_tag/Confirm11i.java          |    46 +
 .../io/amfx/string_tag/Confirm11j.java          |    46 +
 .../io/amfx/testtypes/Bleu_dAuvergne.java       |    51 +
 .../messaging/io/amfx/testtypes/Cheese.java     |    33 +
 .../messaging/io/amfx/testtypes/CowCheese.java  |    34 +
 .../messaging/io/amfx/testtypes/EweCheese.java  |    33 +
 .../messaging/io/amfx/testtypes/Roquefort.java  |    50 +
 .../flex/messaging/io/amfx/traits_tag/12a.xml   |    35 +
 .../flex/messaging/io/amfx/traits_tag/12b.xml   |    47 +
 .../io/amfx/traits_tag/Confirm12a.java          |    55 +
 .../io/amfx/traits_tag/Confirm12b.java          |    71 +
 .../src/flex/messaging/io/amfx/true_tag/13a.xml |    24 +
 .../src/flex/messaging/io/amfx/true_tag/13b.xml |    31 +
 .../src/flex/messaging/io/amfx/true_tag/13c.xml |    28 +
 .../src/flex/messaging/io/amfx/true_tag/13d.xml |    36 +
 .../messaging/io/amfx/true_tag/Confirm13a.java  |    46 +
 .../messaging/io/amfx/true_tag/Confirm13b.java  |    52 +
 .../messaging/io/amfx/true_tag/Confirm13c.java  |    55 +
 .../messaging/io/amfx/true_tag/Confirm13d.java  |    56 +
 .../messaging/io/amfx/undefined_tag/14a.xml     |    24 +
 .../messaging/io/amfx/undefined_tag/14b.xml     |    31 +
 .../messaging/io/amfx/undefined_tag/14c.xml     |    28 +
 .../messaging/io/amfx/undefined_tag/14d.xml     |    36 +
 .../io/amfx/undefined_tag/Confirm14a.java       |    46 +
 .../io/amfx/undefined_tag/Confirm14b.java       |    52 +
 .../io/amfx/undefined_tag/Confirm14c.java       |    55 +
 .../io/amfx/undefined_tag/Confirm14d.java       |    56 +
 .../src/flex/messaging/io/amfx/xml_tag/15a.xml  |    30 +
 .../src/flex/messaging/io/amfx/xml_tag/15b.xml  |    30 +
 .../messaging/io/amfx/xml_tag/Confirm15a.java   |    65 +
 .../messaging/io/amfx/xml_tag/Confirm15b.java   |    64 +
 .../test/src/flex/messaging/log/LogTest.java    |   165 +
 .../test/src/flex/messaging/log/LoggerTest.java |   165 +
 .../src/flex/messaging/log/TestingTarget.java   |    47 +
 .../messaging/services/AbstractServiceTest.java |   368 +
 .../messaging/services/ServiceAdapterTest.java  |   120 +
 .../services/http/SettingsReplaceUtilTest.java  |   229 +
 .../services/messaging/SubtopicTest.java        |   119 +
 .../src/flex/messaging/util/Basae64Test.java    |    80 +
 .../test/src/flex/messaging/util/HexTest.java   |    88 +
 .../src/flex/messaging/util/UUIDUtilTest.java   |   162 +
 .../DefaultThreadPoolExecutorTest.java          |   167 +
 .../macromedia/qa/metrics/AbstractDatabase.java |   545 +
 .../test/src/macromedia/qa/metrics/Build.java   |   120 +
 .../test/src/macromedia/qa/metrics/Metric.java  |   128 +
 .../macromedia/qa/metrics/MetricsDatabase.java  |   237 +
 .../macromedia/qa/metrics/MetricsManager.java   |   166 +
 .../src/macromedia/qa/metrics/Persistable.java  |   178 +
 .../test/src/macromedia/qa/metrics/Project.java |   119 +
 .../test/src/macromedia/qa/metrics/Run.java     |   143 +
 .../test/src/macromedia/qa/metrics/Value.java   |   134 +
 .../test/src/macromedia/util/UnitTrace.java     |    29 +
 .../src/regression/DoNotDeleteUntilFile.txt     |     0
 modules/opt/build.xml                           |   363 +
 modules/opt/pom.xml                             |    97 +
 modules/opt/poms/jrun/pom.xml                   |    49 +
 modules/opt/poms/oracle/pom.xml                 |    64 +
 modules/opt/poms/tomcat4/pom.xml                |    57 +
 modules/opt/poms/tomcat6/pom.xml                |    61 +
 modules/opt/poms/tomcat7/pom.xml                |    62 +
 modules/opt/poms/weblogic/pom.xml               |    62 +
 modules/opt/poms/websphere/pom.xml              |    71 +
 .../messaging/security/OracleLoginCommand.java  |    93 +
 .../flex/messaging/security/OracleUser.java     |   118 +
 .../flex/messaging/vendors.properties           |    53 +
 .../flex/messaging/security/Tomcat7Valve.java   |   313 +
 .../flex/messaging/security/TomcatLogin.java    |    71 +
 .../messaging/security/TomcatLoginCommand.java  |   124 +
 .../messaging/security/TomcatLoginHolder.java   |    63 +
 .../flex/messaging/security/TomcatValve.java    |   275 +
 .../messaging/security/TomcatValve4150.java     |   270 +
 .../messaging/security/tomcat-descriptor.xml    |    67 +
 .../security/WeblogicLoginCommand.java          |   242 +
 .../management/WebSphereMBeanServerLocator.java |    86 +
 .../security/WebSphereLoginCommand.java         |   276 +
 .../AsynchBeansWorkManagerExecutor.java         |   231 +
 modules/pom.xml                                 |   320 +
 modules/proxy/build.xml                         |    98 +
 modules/proxy/pom.xml                           |    71 +
 .../services/HTTPProxyServiceControl.java       |    56 +
 .../services/HTTPProxyServiceControlMBean.java  |    27 +
 .../services/http/HTTPProxyAdapterControl.java  |    57 +
 .../http/HTTPProxyAdapterControlMBean.java      |    31 +
 .../http/HTTPProxyDestinationControl.java       |   205 +
 .../http/HTTPProxyDestinationControlMBean.java  |    97 +
 .../services/http/SOAPProxyAdapterControl.java  |    55 +
 .../http/SOAPProxyAdapterControlMBean.java      |    30 +
 .../messaging/services/http/package-info.java   |    18 +
 .../messaging/services/HTTPProxyService.java    |   368 +
 .../services/http/ExternalProxySettings.java    |   182 +
 .../http/HTTPConnectionManagerSettings.java     |   334 +
 .../services/http/HTTPProxyAdapter.java         |   780 +
 .../services/http/HTTPProxyDestination.java     |   500 +
 .../http/HostConfigurationSettings.java         |   252 +
 .../services/http/ProtocolFactory.java          |    48 +
 .../services/http/SOAPProxyAdapter.java         |   116 +
 .../EasySSLProtocolSocketFactory.java           |   231 +
 .../http/httpclient/EasyX509TrustManager.java   |   182 +
 .../services/http/httpclient/FlexGetMethod.java |    63 +
 .../http/httpclient/FlexPostMethod.java         |    63 +
 .../services/http/httpclient/package-info.java  |    18 +
 .../messaging/services/http/package-info.java   |    18 +
 .../services/http/proxy/AccessFilter.java       |    59 +
 .../services/http/proxy/CookieInfo.java         |    57 +
 .../services/http/proxy/ErrorFilter.java        |    86 +
 .../services/http/proxy/ProxyConstants.java     |    50 +
 .../services/http/proxy/ProxyContext.java       |   313 +
 .../services/http/proxy/ProxyContextFilter.java |   221 +
 .../services/http/proxy/ProxyException.java     |    58 +
 .../services/http/proxy/ProxyFilter.java        |    49 +
 .../services/http/proxy/ProxyUtil.java          |    38 +
 .../services/http/proxy/RequestFilter.java      |   687 +
 .../services/http/proxy/RequestUtil.java        |   137 +
 .../services/http/proxy/ResponseFilter.java     |   428 +
 .../services/http/proxy/ResponseUtil.java       |    72 +
 .../services/http/proxy/SecurityFilter.java     |   273 +
 .../services/http/proxy/SharedProxyContext.java |   140 +
 .../messaging/services/http/proxy/Target.java   |   111 +
 .../services/http/proxy/package-info.java       |    18 +
 modules/remoting/build.xml                      |    96 +
 modules/remoting/pom.xml                        |    55 +
 .../services/RemotingServiceControl.java        |    51 +
 .../services/RemotingServiceControlMBean.java   |    28 +
 .../remoting/RemotingDestinationControl.java    |   145 +
 .../RemotingDestinationControlMBean.java        |    55 +
 .../remoting/adapters/JavaAdapterControl.java   |    51 +
 .../adapters/JavaAdapterControlMBean.java       |    30 +
 .../remoting/adapters/package-info.java         |    18 +
 .../services/remoting/package-info.java         |    18 +
 .../messaging/services/RemotingService.java     |   271 +
 .../services/remoting/PageableRowSetCache.java  |   136 +
 .../services/remoting/RemotingDestination.java  |   177 +
 .../services/remoting/adapters/JavaAdapter.java |   586 +
 .../adapters/NoSuchMethodException.java         |    38 +
 .../adapters/NoSuchServiceException.java        |    38 +
 .../remoting/adapters/RemotingMethod.java       |    95 +
 .../remoting/adapters/package-info.java         |    18 +
 .../services/remoting/package-info.java         |    18 +
 modules/sdk/build.xml                           |   227 +
 qa/apps/qa-manual/FlashvarsTest.mxml            |    37 +
 qa/apps/qa-manual/WEB-INF/activemq.xml          |    36 +
 .../flex/flex-config.mods.deployable.xml        |    22 +
 .../WEB-INF/flex/flex-config.mods.local.xml     |    32 +
 .../qa-manual/WEB-INF/flex/flex-config.mods.xml |    36 +
 qa/apps/qa-manual/WEB-INF/flex/global.css       |    17 +
 .../flex/messaging-config.mods.local.xml        |    34 +
 .../WEB-INF/flex/messaging-config.mods.xml      |   459 +
 .../flex/messaging-throttle-config.mods.xml     |   298 +
 .../WEB-INF/flex/proxy-config.mods.local.xml    |    36 +
 .../WEB-INF/flex/proxy-config.mods.xml          |   268 +
 .../WEB-INF/flex/remoting-config.mods.local.xml |    34 +
 .../WEB-INF/flex/remoting-config.mods.xml       |   182 +
 .../WEB-INF/flex/services-config.mods.local.xml |    53 +
 .../WEB-INF/flex/services-config.mods.xml       |   361 +
 .../WEB-INF/flex/user_classes/_LoginWindow.mxml |    57 +
 .../WEB-INF/flex/user_classes/placeholder       |     1 +
 .../flex/user_classes/qa/data/Address.as        |    90 +
 .../flex/user_classes/qa/data/Company.as        |    97 +
 qa/apps/qa-manual/WEB-INF/server-config.wsdd    |   409 +
 .../WEB-INF/src/bugs/b205439/SampleServlet.java |   126 +
 .../com/adobe/samples/hsbc/MessageSender.java   |    48 +
 .../WEB-INF/src/dev/echoservice/Book.java       |    94 +
 .../src/dev/echoservice/CustomException.java    |    40 +
 .../WEB-INF/src/dev/echoservice/Echo.java       |   458 +
 .../WEB-INF/src/dev/remoting/BindObject.java    |    37 +
 .../WEB-INF/src/dev/remoting/TestServices.java  |   177 +
 .../WEB-INF/src/messaging/ClientManagerRO.java  |   127 +
 .../src/qa/messaging/flook/FLookEmail.java      |    69 +
 .../messaging/throttle/ROPushServerMessage.java |   190 +
 .../WEB-INF/src/qa/utils/MessageGenerator.java  |   205 +
 .../components/RuntimeEndpointsAndFactory.java  |   158 +
 .../components/RuntimeHttpProxyAll.java         |   171 +
 .../components/RuntimeHttpProxyService.java     |    91 +
 .../RuntimeJMSDestinationNoConnFact.java        |   165 +
 .../RuntimeJMSDestinationNoJNDIDestName.java    |   173 +
 .../RuntimeMessageDestinationClustered.java     |   134 +
 .../RuntimeRTPushOverHttpDestinations.java      |   108 +
 .../remoteobjects/RuntimeLogTargets.java        |   132 +
 .../WEB-INF/src/security/PerClientCommand.java  |    50 +
 .../src/security/PerClientPrincipal.java        |    40 +
 qa/apps/qa-manual/WEB-INF/src/test/RpcTest.java |    28 +
 .../ajax/messaging/JMSObjectMessageTest.html    |    94 +
 .../messaging/TextMessageASAdapterTest.html     |    92 +
 .../messaging/TextMessageOverStreamingTest.html |    97 +
 .../ajax/messaging/TextMessageRuntimeDest.html  |    98 +
 qa/apps/qa-manual/ajax/readme.txt               |     1 +
 .../182101/PerClientAuthenticationTest.mxml     |   105 +
 .../qa-manual/bugs/182101/readme_bug182101.txt  |    45 +
 qa/apps/qa-manual/bugs/BLZ-594/BLZ-594.mxml     |    37 +
 qa/apps/qa-manual/bugs/BLZ-594/readme.txt       |    13 +
 qa/apps/qa-manual/build.xml                     |   381 +
 .../ClusteredChannelSetLoginTest.mxml           |   151 +
 .../qa-manual/ipv6/general/URLUtilIPv6Test.mxml |   302 +
 .../messaging/ipv6_messaging_streaming.mxml     |   166 +
 .../ipv6/proxyservice/httpService/basic.xml     |    30 +
 .../proxyservice/httpService/ipv6_hs_dest.mxml  |   106 +
 .../httpService/ipv6_hs_dynamicurl.mxml         |   114 +
 .../httpService/ipv6_hs_externalproxy.mxml      |    96 +
 .../webService/ipv6_ws_dynamicurl.mxml          |   106 +
 qa/apps/qa-manual/ipv6/readme.txt               |     7 +
 .../qa-manual/ipv6/remoteservice/ipv6_ro.mxml   |    85 +
 .../mbean/jmx/MBeanServerGateway_create.mxml    |   157 +
 qa/apps/qa-manual/mbean/jmx/Simple.java         |    29 +
 qa/apps/qa-manual/mbean/jmx/SimpleMBean.java    |    23 +
 qa/apps/qa-manual/messaging/ClientManager.mxml  |    81 +
 qa/apps/qa-manual/messaging/MessagingApp.mxml   |   416 +
 qa/apps/qa-manual/messaging/RPC2MsgLite.mxml    |   138 +
 .../qa-manual/messaging/duplicateSession.mxml   |    91 +
 .../messaging/messaging_Two_Destinations.mxml   |   162 +
 .../throttling/simpleMessagingConsumerTest.mxml |   552 +
 .../simpleMessagingProducerServerPush.mxml      |   377 +
 .../httpservice/ProxyTopLevelConstrainTest.mxml |   122 +
 .../bugs/sdk-11244/leaktest/LeakTest2.html      |    41 +
 .../bugs/sdk-11244/leaktest/LeakTest2.mxml      |   191 +
 .../bugs/sdk-11244/leaktest/leaktest.xml        | 11023 +++++++++
 .../bugs/sdk-11244/leaktest/pbentries.xml       |    20 +
 .../bugs/sdk-11244/pbentries/pbentries.xml      |    20 +
 qa/apps/qa-manual/qa/main.mxml                  |    22 +
 qa/apps/qa-manual/remoting/RemotingApp.mxml     |   368 +
 .../rtPushOverHTTP/secureDestinationTest.mxml   |   159 +
 .../qa-manual/rtPushOverHTTP/test_autosend.mxml |   167 +
 .../runtimeConfiguration/changeLogLevel.mxml    |    66 +
 .../clusteredDynamicMessageDestTest.mxml        |   119 +
 .../clusteredStaticMessageDestTest.mxml         |   104 +
 .../security/login_logout_disconnect.mxml       |   208 +
 qa/apps/qa-regress/META-INF/MANIFEST.MF         |     5 +
 qa/apps/qa-regress/WEB-INF/activemq.xml         |    36 +
 qa/apps/qa-regress/WEB-INF/flex-servlet.xml     |    95 +
 .../WEB-INF/flex/active-mq-messaging-config.xml |  1296 ++
 .../flex/flex-config.mods.deployable.xml        |    36 +
 .../WEB-INF/flex/flex-config.mods.local.xml     |    34 +
 .../WEB-INF/flex/flex-config.mods.xml           |    36 +
 qa/apps/qa-regress/WEB-INF/flex/global.css      |    17 +
 .../flex/messaging-config.mods.local.xml        |    34 +
 .../WEB-INF/flex/messaging-config.mods.xml      |  1832 ++
 .../WEB-INF/flex/proxy-config.mods.local.xml    |    43 +
 .../WEB-INF/flex/proxy-config.mods.xml          |   485 +
 .../WEB-INF/flex/remoting-config.mods.local.xml |    34 +
 .../WEB-INF/flex/remoting-config.mods.xml       |   486 +
 .../WEB-INF/flex/services-config.mods.local.xml |    33 +
 .../flex/services-config.mods.validators.xml    |    74 +
 .../WEB-INF/flex/services-config.mods.xml       |   539 +
 .../user_classes/add_your_as_and_swc_files_here |     0
 .../user_classes/proxy/ApplicationSwfProxy.as   |   137 +
 .../user_classes/proxy/RequestDeserializer.as   |    30 +
 .../user_classes/proxy/ResponseSerializer.as    |    59 +
 .../user_classes/qa/CommunicationManager.as     |    40 +
 .../flex/user_classes/qa/CustomNetConnection.as |    30 +
 qa/apps/qa-regress/WEB-INF/server-config.wsdd   |  2736 +++
 .../qa-regress/WEB-INF/spring/app-config.xml    |    29 +
 .../WEB-INF/spring/infrastructure-config.xml    |    25 +
 .../WEB-INF/spring/security-config.xml          |    48 +
 .../DeserializationValidatorBrokerConfig.java   |   158 +
 .../TestDeserializationValidator.java           |    59 +
 .../src/blazeds/qa/remotingService/Bean.java    |   199 +
 .../blazeds/qa/remotingService/BindObject.java  |    29 +
 .../src/blazeds/qa/remotingService/Book.java    |   100 +
 .../qa/remotingService/CustomException.java     |    40 +
 .../src/blazeds/qa/remotingService/Echo.java    |   573 +
 .../qa/remotingService/ExternalizableDate.java  |    66 +
 .../blazeds/qa/remotingService/FileProxy.java   |    37 +
 .../qa/remotingService/FileReference.java       |    36 +
 .../qa/remotingService/FileReferenceProxy.java  |    38 +
 .../qa/remotingService/ImageSnapshotType.java   |    42 +
 .../qa/remotingService/InstantiationTest.java   |    55 +
 .../qa/remotingService/ObjectMessageClient.java |   161 +
 .../qa/remotingService/TestServices.java        |   242 +
 .../qa/remotingService/TestTypedObject.java     |    50 +
 .../TestTypedObjectWithInheritance.java         |    27 +
 .../qa/remotingService/inherit/ChildClass.java  |    67 +
 .../qa/remotingService/inherit/ParentClass.java |    64 +
 .../WEB-INF/src/commons-logging.properties      |    19 +
 .../src/dev/calendar/CalendarService.java       |    88 +
 .../WEB-INF/src/dev/echoservice/Bean.java       |   199 +
 .../WEB-INF/src/dev/echoservice/Book.java       |    95 +
 .../src/dev/echoservice/CustomException.java    |    41 +
 .../WEB-INF/src/dev/echoservice/Echo.java       |   459 +
 .../dev/echoservice/ObjectMessageClient.java    |   168 +
 .../src/dev/echoservice/TestTypedObject.java    |    55 +
 .../TestTypedObjectWithInheritance.java         |    29 +
 .../src/dev/endpoints/HangingAMFEndpoint.java   |    72 +
 .../src/dev/endpoints/HangingHTTPEndpoint.java  |    53 +
 .../src/dev/httpservice/HttpServiceTest.java    |   140 +
 .../src/dev/httpservice/HttpXmlEchoService.java |    50 +
 .../WEB-INF/src/dev/logging/serverlog.java      |    51 +
 .../WEB-INF/src/dev/remoting/BindObject.java    |    31 +
 .../WEB-INF/src/dev/remoting/TestServices.java  |   171 +
 .../src/dev/remoting/inherit/ChildClass.java    |    67 +
 .../src/dev/remoting/inherit/ParentClass.java   |    64 +
 .../WEB-INF/src/dev/weather/WeatherInfo.java    |    67 +
 .../WEB-INF/src/dev/weather/WeatherService.java |   115 +
 .../src/errorhandling/testException.java        |    37 +
 .../qa-regress/WEB-INF/src/photo/person0.jpg    |   Bin 0 -> 10638 bytes
 .../qa/management/MBeanObjectNameResolver.java  |   241 +
 .../WEB-INF/src/qa/management/Simple.java       |    31 +
 .../WEB-INF/src/qa/management/SimpleMBean.java  |    25 +
 .../qa/messaging/CustomMessagingAdapter.java    |    67 +
 .../src/qa/messaging/CustomTypeMarshaller.java  |    47 +
 .../src/qa/messaging/CustomUUIDGenerator.java   |    29 +
 .../src/qa/messaging/DupeUUIDGenerator.java     |    29 +
 .../qa/messaging/DynamicDestinationAdapter.java |   110 +
 .../qa/messaging/MessageRoutedListenerTest.java |    60 +
 .../src/qa/messaging/ROPushServerMessage.java   |   169 +
 .../src/qa/messaging/SessionManager.java        |    26 +
 .../src/remoting/ConstructorNegativeTest.java   |    34 +
 .../amfclient/AMFConnectionTestService.java     |   121 +
 .../remoting/amfclient/ServerCustomType.java    |    45 +
 .../src/remoting/datatype/EnumApple.java        |    33 +
 .../src/remoting/datatype/EnumProxy.java        |    85 +
 .../WEB-INF/src/remoting/datatype/EnumType.java |    30 +
 .../src/remoting/datatype/EnumTypeTest.java     |    98 +
 .../src/remoting/datatype/MapTypeTest.java      |    44 +
 .../FlexSessionAttributeListenerTest.java       |   100 +
 .../components/RuntimeHttpProxyDestination.java |   158 +
 .../components/RuntimeJMSDestination.java       |   314 +
 .../components/RuntimeMessageDestination.java   |   139 +
 .../RuntimeMessageDestinationClustered.java     |   133 +
 .../components/RuntimeRemotingDestination.java  |    76 +
 .../components/RuntimeSOAPProxyAdapter.java     |   146 +
 .../RuntimeUnmanagedMessageDestination.java     |   137 +
 .../remoteobjects/ROMessageDestination.java     |    82 +
 .../remoteobjects/RuntimeConfigurator.java      |   231 +
 .../remoteobjects/RuntimeLogTargets.java        |   131 +
 .../TestDeserializationValidator.java           |    59 +
 .../WEB-INF/src/security/PerClientCommand.java  |    51 +
 .../src/security/PerClientPrincipal.java        |    41 +
 qa/apps/qa-regress/axis/EchoHeaders.jws         |   136 +
 qa/apps/qa-regress/axis/StockQuoteService.jws   |    99 +
 qa/apps/qa-regress/axis/fingerprint.jsp         |   285 +
 qa/apps/qa-regress/axis/happyaxis.jsp           |   521 +
 qa/apps/qa-regress/axis/index.html              |    59 +
 .../qa-regress/axis/servicesAndPorts/0s0p.wsdl  |   182 +
 .../BadDotNetWebServiceRequest.wsdl             |   866 +
 .../axis/servicesAndPorts/ServicesAndPorts1.jws |    30 +
 .../axis/servicesAndPorts/ServicesAndPorts2.jws |    29 +
 .../axis/servicesAndPorts/ServicesAndPorts3.jws |    30 +
 .../axis/servicesAndPorts/ServicesAndPorts4.jws |    29 +
 .../qa-regress/axis/servicesAndPorts/echo.wsdl  |   622 +
 .../axis/servicesAndPorts/noPound.wsdl          |    68 +
 .../qa-regress/axis/servicesAndPorts/pound.wsdl |    68 +
 .../axis/servicesAndPorts/response.xml          |    85 +
 .../qa-regress/axis/servicesAndPorts/sp.wsdl    |    93 +
 .../qa-regress/axis/servicesAndPorts/spp.wsdl   |    95 +
 .../qa-regress/axis/servicesAndPorts/sppsp.wsdl |   100 +
 .../axis/servicesAndPorts/sppspp.wsdl           |   103 +
 .../qa-regress/axis/servicesAndPorts/spsp.wsdl  |   752 +
 qa/apps/qa-regress/axis/staticEcho.wsdl         |   622 +
 qa/apps/qa-regress/build.xml                    |   467 +
 qa/apps/qa-regress/deserializationData.xml      |    33 +
 qa/apps/qa-regress/metadata/application.xml     |    30 +
 .../qa/RemoteObjectDataTypeMatrix.mxml          |   957 +
 qa/apps/qa-regress/qa/flexContextTest.mxml      |   240 +
 .../qa/flexbuilder_default_application.mxml     |    22 +
 .../qa-regress/qa/resources/languages_pair.txt  |     1 +
 .../qa-regress/qa/resources/languages_utf8.xml  |    33 +
 .../qa/resources/languages_utf8woBOM.xml        |    33 +
 .../qa-regress/qa/resources/macbethShort.xml    |   174 +
 qa/apps/qa-regress/qa/serverlog.jsp             |    40 +
 .../qa-regress/remote/HttpXmlEchoService.jsp    |    28 +
 .../qa-regress/remote/MultipleHeadersTest.jsp   |    31 +
 qa/apps/qa-regress/remote/basic.xml             |    30 +
 qa/apps/qa-regress/remote/echoParams.jsp        |    35 +
 .../qa-regress/remote/echoParamsAsFlashvars.jsp |    39 +
 qa/apps/qa-regress/remote/languages_utf8.xml    |    33 +
 qa/apps/qa-regress/remote/serverlog.jsp         |    40 +
 qa/apps/qa-regress/remote/testMethods.jsp       |    19 +
 qa/apps/qa-regress/testsuites/config/build.xml  |   401 +
 qa/apps/qa-regress/testsuites/config/testng.xml |    26 +
 .../Remoting_NetConnectionTest.mxml             |    91 +
 .../services-config.xml                         |    64 +
 .../Remoting_NetConnectionTest.mxml             |    96 +
 .../services-config.xml                         |    73 +
 .../tests/IncorrectRootElementTest/error.txt    |     1 +
 .../services-config.xml                         |    36 +
 .../tests/NoServicesConfigFileTest/error.txt    |     1 +
 .../tests/channels/DuplicateIdTest/error.txt    |     1 +
 .../DuplicateIdTest/services-config.xml         |    34 +
 .../tests/channels/InvalidIdTest/error.txt      |     1 +
 .../channels/InvalidIdTest/services-config.xml  |    31 +
 .../clientLoadBalancing/NoURLsTest/error.txt    |     1 +
 .../NoURLsTest/services-config.xml              |    59 +
 .../cluster/IncorrectDefaultValueTest/error.txt |     1 +
 .../services-config.xml                         |    39 +
 .../error.txt                                   |     1 +
 .../services-config.xml                         |    39 +
 .../tests/destination/DuplicateIdTest/error.txt |     1 +
 .../DuplicateIdTest/services-config.xml         |    78 +
 .../IncorrectRootElementTest/dest-config.xml    |    22 +
 .../dest-config.xml.sb-6f3bc324-2w7qvX          |     4 +
 .../IncorrectRootElementTest/error.txt          |     1 +
 .../services-config.xml                         |    43 +
 .../destination/InvalidAdapterRefTest/error.txt |     1 +
 .../InvalidAdapterRefTest/services-config.xml   |    48 +
 .../destination/InvalidChannelTest/error.txt    |     1 +
 .../InvalidChannelTest/services-config.xml      |    48 +
 .../tests/destination/InvalidIdTest/error.txt   |     1 +
 .../InvalidIdTest/services-config.xml           |    59 +
 .../tests/destination/NoAdapterTest/error.txt   |     1 +
 .../NoAdapterTest/services-config.xml           |    47 +
 .../NonExistentAdapterTest/error.txt            |     1 +
 .../NonExistentAdapterTest/services-config.xml  |    48 +
 .../NonExistentChannelAttrTest/error.txt        |     1 +
 .../services-config.xml                         |    46 +
 .../NonExistentChannelTest/error.txt            |     1 +
 .../NonExistentChannelTest/services-config.xml  |    48 +
 .../tests/factories/InvalidIdTest/error.txt     |     1 +
 .../factories/InvalidIdTest/services-config.xml |    40 +
 .../factories/NonExistentClassTest/error.txt    |     1 +
 .../NonExistentClassTest/services-config.xml    |    45 +
 .../flexclient/InvalidTimeOutTest/error.txt     |     1 +
 .../InvalidTimeOutTest/services-config.xml      |    25 +
 .../flexclient/NegativeTimeOutTest/error.txt    |     1 +
 .../NegativeTimeOutTest/services-config.xml     |    25 +
 .../AdaptiveFrequencyTest/error.txt             |     1 +
 .../AdaptiveFrequencyTest/messaging-config.xml  |    48 +
 .../AdaptiveFrequencyTest/services-config.xml   |    52 +
 .../FrequencyStepSizeTest/error.txt             |     1 +
 .../FrequencyStepSizeTest/messaging-config.xml  |    48 +
 .../FrequencyStepSizeTest/services-config.xml   |    52 +
 .../MaxQueueSizeTest/error.txt                  |     1 +
 .../MaxQueueSizeTest/messaging-config.xml       |    48 +
 .../MaxQueueSizeTest/services-config.xml        |    81 +
 .../AdaptiveServerToClient/readme.txt           |     1 +
 .../DestinationWithNoChannelTest/error.txt      |     1 +
 .../services-config.xml                         |    56 +
 .../DestinationWithNoIDTest/error.txt           |     1 +
 .../DestinationWithNoIDTest/services-config.xml |    59 +
 .../error.txt                                   |     1 +
 .../services-config.xml                         |    60 +
 .../messagingService/dataTypesTest/Bean.as      |   207 +
 .../dataTypesTest/BigDecimalTypesTest.mxml      |   179 +
 .../dataTypesTest/BigIntegerTypesTest.mxml      |   162 +
 .../messagingService/dataTypesTest/Book.as      |    52 +
 .../dataTypesTest/BooleanTypesTest.mxml         |   731 +
 .../dataTypesTest/ByteTypesTest.mxml            |   536 +
 .../dataTypesTest/CharTypesTest.mxml            |   514 +
 .../dataTypesTest/ComplexCustomTypeTest.mxml    |   141 +
 .../dataTypesTest/CustomTypeTest.mxml           |   380 +
 .../dataTypesTest/DateTypesTest.mxml            |   321 +
 .../dataTypesTest/DoubleTypesTest.mxml          |   675 +
 .../messagingService/dataTypesTest/EnumType.as  |    51 +
 .../dataTypesTest/EnumTypeTest.mxml             |   111 +
 .../dataTypesTest/ExternalizableDate.as         |    69 +
 .../dataTypesTest/ExternalizableTest.mxml       |    58 +
 .../dataTypesTest/FloatTypesTest.mxml           |   359 +
 .../dataTypesTest/IntTypesTest.mxml             |   468 +
 .../dataTypesTest/LongTypesTest.mxml            |   468 +
 .../messagingService/dataTypesTest/MyFileRef.as |    26 +
 .../dataTypesTest/SQLDateTypesTest.mxml         |   256 +
 .../dataTypesTest/ShortTypesTest.mxml           |   423 +
 .../dataTypesTest/StringTypesTest.mxml          |   315 +
 .../messagingService/dataTypesTest/SuperBook.as |    26 +
 .../dataTypesTest/TestTypedObject.as            |    54 +
 .../dataTypesTest/bean_namespace.as             |    22 +
 .../dataTypesTest/messaging-config.xml          |  1656 ++
 .../dataTypesTest/proxy-config.xml              |   433 +
 .../dataTypesTest/remoting-config.xml           |   396 +
 .../dataTypesTest/services-config.xml           |   473 +
 .../jms/InvalidAcknowledgeModeTest/error.txt    |     1 +
 .../services-config.xml                         |    84 +
 .../jms/InvalidDeliveryModeTest/error.txt       |     1 +
 .../InvalidDeliveryModeTest/services-config.xml |    84 +
 .../jms/InvalidDestinationTypeTest/error.txt    |     1 +
 .../services-config.xml                         |    85 +
 .../jms/InvalidMessageTypeTest/error.txt        |     1 +
 .../InvalidMessageTypeTest/services-config.xml  |    85 +
 .../jms/NoConnectionFactoryTest/error.txt       |     1 +
 .../NoConnectionFactoryTest/services-config.xml |    82 +
 .../jms/NoJNDINameTest/error.txt                |     1 +
 .../jms/NoJNDINameTest/services-config.xml      |    82 +
 .../InvalidBufferPolicyTest/error.txt           |     1 +
 .../messaging-config.xml                        |    48 +
 .../InvalidBufferPolicyTest/services-config.xml |    52 +
 .../InvalidConflatePolicyTest/error.txt         |     1 +
 .../messaging-config.xml                        |    48 +
 .../services-config.xml                         |    52 +
 .../UnknownInboundPolicyTest/error.txt          |     1 +
 .../messaging-config.xml                        |    48 +
 .../services-config.xml                         |    52 +
 .../frequencies/McfGreaterthanMfTest/error.txt  |     1 +
 .../McfGreaterthanMfTest/messaging-config.xml   |    48 +
 .../McfGreaterthanMfTest/services-config.xml    |    52 +
 .../InvalidBufferPolicyTest/error.txt           |     1 +
 .../messaging-config.xml                        |    48 +
 .../InvalidBufferPolicyTest/services-config.xml |    52 +
 .../InvalidConflatePolicyTest/error.txt         |     1 +
 .../messaging-config.xml                        |    48 +
 .../services-config.xml                         |    52 +
 .../InvalidErrorPolicyTest/error.txt            |     1 +
 .../InvalidErrorPolicyTest/messaging-config.xml |    48 +
 .../InvalidErrorPolicyTest/services-config.xml  |    52 +
 .../UnknownOutboundPolicyTest/error.txt         |     1 +
 .../messaging-config.xml                        |    48 +
 .../services-config.xml                         |    52 +
 .../frequencies/McfGreaterthanMfTest/error.txt  |     1 +
 .../McfGreaterthanMfTest/messaging-config.xml   |    48 +
 .../McfGreaterthanMfTest/services-config.xml    |    52 +
 .../validation/goodValidatorTest/error.txt      |     1 +
 .../goodValidatorTest/services-config.xml       |   365 +
 .../nonExistingValidatorTest/error.txt          |     1 +
 .../services-config.xml                         |   368 +
 .../patternFilterLoggingValidatorTest/error.txt |     1 +
 .../services-config.xml                         |   350 +
 .../sameExplicitTypeValidatorTest/error.txt     |     1 +
 .../services-config.xml                         |   364 +
 .../validation/sameTypeValidatorTest/error.txt  |     1 +
 .../sameTypeValidatorTest/services-config.xml   |   367 +
 .../validation/wrongTypeValidatorTest/error.txt |     1 +
 .../wrongTypeValidatorTest/services-config.xml  |   382 +
 .../InvalidClusterMessageRoutingTest/error.txt  |     1 +
 .../services-config.xml                         |    61 +
 .../InvocationExceptionTest.mxml                |   108 +
 .../ArgumentsInServerLogTest/error.txt          |     4 +
 .../remoting-config.xml                         |    32 +
 .../services-config.xml                         |    49 +
 .../logincommand/NoClassAttrTest/error.txt      |     1 +
 .../NoClassAttrTest/services-config.xml         |    40 +
 .../logincommand/NoServerAttrTest/error.txt     |     1 +
 .../NoServerAttrTest/services-config.xml        |    40 +
 .../securityconstraint/InvalidIdTest/error.txt  |     1 +
 .../InvalidIdTest/services-config.xml           |    46 +
 .../UndefinedConstraintTest/error.txt           |     1 +
 .../UndefinedConstraintTest/services-config.xml |    59 +
 .../services/BadDefaultChannelTest/error.txt    |     1 +
 .../BadDefaultChannelTest/services-config.xml   |    42 +
 .../tests/services/DuplicateDefTest/error.txt   |     1 +
 .../DuplicateDefTest/services-config.xml        |    35 +
 .../DuplicateDefaultAdapterTest/error.txt       |     1 +
 .../services-config.xml                         |    41 +
 .../ExternalEntityInConfigTest/error.txt        |     1 +
 .../services-config.xml                         |    43 +
 .../services/IncorrectRootElementTest/error.txt |     1 +
 .../messaging-config.xml                        |    27 +
 .../services-config.xml                         |    34 +
 .../services/InvalidAdapterIdTest/error.txt     |     1 +
 .../InvalidAdapterIdTest/services-config.xml    |    40 +
 .../InvalidDefSecConstraintTest/error.txt       |     1 +
 .../services-config.xml                         |    43 +
 .../tests/services/InvalidIdTest/error.txt      |     1 +
 .../services/InvalidIdTest/services-config.xml  |    35 +
 .../tests/services/InvalidIncludeTest/error.txt |     1 +
 .../InvalidIncludeTest/services-config.xml      |    34 +
 .../tests/services/NoClassAttrTest/error.txt    |     1 +
 .../NoClassAttrTest/services-config.xml         |    35 +
 .../StringTypesTest.mxml                        |   316 +
 .../messaging-config.xml                        |    35 +
 .../remoting-config.xml                         |    37 +
 .../services-config.xml                         |   154 +
 .../simpleMessagingTest.mxml                    |   264 +
 .../StringTypesTest.mxml                        |   316 +
 .../messaging-config.xml                        |    35 +
 .../remoting-config.xml                         |    37 +
 .../services-config.xml                         |   154 +
 .../simpleMessagingTest.mxml                    |   264 +
 .../tests/tokens/InvalidTokenTest/error.txt     |     1 +
 .../tokens/InvalidTokenTest/services-config.xml |    36 +
 .../messaging-config.xml                        |    68 +
 .../CustomUUIDGeneratorTest/services-config.xml |    72 +
 .../simpleJMSMessagingTest.mxml                 |   266 +
 .../simpleMessagingTest.mxml                    |   264 +
 .../DuplicateUUIDTest/DuplicateUUIDTest1.mxml   |   266 +
 .../DuplicateUUIDTest/DuplicateUUIDTest2.mxml   |   177 +
 .../DuplicateUUIDTest/messaging-config.xml      |    66 +
 .../DuplicateUUIDTest/services-config.xml       |    72 +
 .../testsuites/flexunit/_seedFileEnd.txt        |     5 +
 .../testsuites/flexunit/_seedFileStart.txt      |    42 +
 .../qa-regress/testsuites/flexunit/basic.xml    |    30 +
 .../qa-regress/testsuites/flexunit/build.xml    |   376 +
 .../flexunit/src/mx/messaging/tests/AMF0Test.as |   116 +
 .../flexunit/src/mx/messaging/tests/AMF3Test.as |   342 +
 .../src/mx/messaging/tests/AMFChannelTest.as    |   235 +
 .../src/mx/messaging/tests/AllMessagingTests.as |    64 +
 .../messaging/tests/Base64EncoderDecoderTest.as |   123 +
 .../src/mx/messaging/tests/ChannelSetTest.as    |   593 +
 .../tests/ConfigurationBasedTestCase.as         |   224 +
 .../src/mx/messaging/tests/ConsumerTest.as      |   172 +
 .../messaging/tests/ConsumerWithServerTest.as   |   265 +
 .../mx/messaging/tests/HexEncoderDecoderTest.as |   122 +
 .../src/mx/messaging/tests/MessageAgentTest.as  |   255 +
 .../src/mx/messaging/tests/ServerConfigTest.as  |   138 +
 .../messaging/tests/helpers/AMFTestResponder.as |    74 +
 .../messaging/tests/helpers/CheckUnsubHelper.as |    56 +
 .../tests/helpers/ConsumerPollingHelper.as      |    68 +
 .../messaging/tests/helpers/EqualityHelper.as   |   494 +
 .../messaging/tests/helpers/MockMessageAgent.as |    58 +
 .../mx/messaging/tests/helpers/PollingTester.as |    87 +
 .../src/mx/messaging/tests/helpers/TestEvent.as |    38 +
 .../messaging/tests/helpers/TestResultEvent.as  |    49 +
 .../messaging/tests/helpers/TestStatusEvent.as  |    49 +
 .../flexunit/src/mx/rpc/tests/AllRemoteTests.as |    77 +
 .../src/mx/rpc/tests/MXMLRemoteObjectTest.as    |   202 +
 .../src/mx/rpc/tests/RemoteObjectAsMXMLTest.as  |    64 +
 .../src/mx/rpc/tests/RemoteObjectTest.as        |   401 +
 .../src/mx/utils/tests/ObjectUtilTest.as        |   249 +
 .../flexunit/src/mx/utils/tests/UIDUtilTest.as  |   181 +
 .../messaging/Base64EncodeLargeByteArrayTest.as |    78 +
 .../mx/messaging/HexEncodeLargeByteArrayTest.as |    78 +
 .../flexunit/stylesheets/junit-frames.xsl       |   769 +
 .../flexunit/stylesheets/junit-noframes.xsl     |   537 +
 qa/apps/qa-regress/testsuites/mxunit/build.xml  |   478 +
 .../mxunit/stylesheets/junit-frames.xsl         |   767 +
 .../mxunit/stylesheets/junit-noframes.xsl       |   537 +
 .../mxunit/tests/MBean/Log/LogMBeans.mxml       |   232 +
 .../mxunit/tests/MBean/Log/MBeanFunctions.as    |   147 +
 .../mxunit/tests/MBean/jmx/MBeanFunctions.as    |   152 +
 .../tests/MBean/jmx/MBeanServerGateway.mxml     |   628 +
 .../MBean/jmx/MBeanServerGateway_register.mxml  |   270 +
 .../testsuites/mxunit/tests/MBean/jmx/Simple.as |    28 +
 .../mxunit/tests/MBean/jmx/appServer.jsp        |    17 +
 .../ServiceAdapterControlMBeanTest.mxml         |   194 +
 .../StreamingAMFEndpointMBean.mxml              |   189 +
 .../StreamingHTTPEndpointMBean.mxml             |   190 +
 .../MBean/proxyservice/HTTPDestinationTest.mxml |   268 +
 .../proxyservice/ProxyServiceMBeanTest.mxml     |   192 +
 .../MBean/proxyservice/SOAPDestinationTest.mxml |   218 +
 .../runtime/AdminConsoleDisplayRegistrar.mxml   |   132 +
 .../runtime/messaging/MessageBrokerControl.mxml |   244 +
 .../client/FlexClientManagerControl.mxml        |   166 +
 .../endpoints/AMF/AMFEndpointControl.mxml       |   226 +
 .../endpoints/AMF/simpleMessagingTest.as        |   156 +
 .../endpoints/HTTP/HTTPEndpointControl.mxml     |   241 +
 .../endpoints/HTTP/simpleMessagingTest.as       |   152 +
 .../StreamingAMFEndpointControl.mxml            |   191 +
 .../StreamingAMF/simpleMessagingTest.as         |   154 +
 .../StreamingHTTPEndpointControl.mxml           |   191 +
 .../StreamingHTTP/simpleMessagingTest.as        |   154 +
 .../tests/errorhandling/roExceptionTest.mxml    |    68 +
 .../serviceAndDestinationMismatchTest.mxml      |   131 +
 .../MPI/MPIJMSMessagingTest.mxml                |   310 +
 .../messagingService/MPI/MPIMessagingTest.mxml  |   303 +
 .../amfChannelWithStreamingEndpoint.mxml        |    93 +
 .../tests/messagingService/TestTypedObject.as   |    29 +
 .../blz-300/subscribeConsumerFromClass.mxml     |    70 +
 .../messagingService/customAdapterTest.mxml     |   285 +
 .../customTypeMarhsaller/TestTypedObject.as     |    28 +
 .../typeMarshallerTestAMFStream.mxml            |   227 +
 .../typeMarshallerTestHTTPStream.mxml           |   228 +
 .../dynamicDestinations/basicsAMF.mxml          |   289 +
 .../dynamicDestinations/headersAMF.mxml         |   222 +
 .../invalidSubtopicsAMF.mxml                    |   252 +
 .../dynamicDestinations/mixedSeparatorsAMF.mxml |   235 +
 .../mixedSeparatorsColonSeparatorAMF.mxml       |   234 +
 .../securityEmployeeUserAMF.mxml                |   354 +
 .../securityGuestUserAMF.mxml                   |   353 +
 .../securityManagerUserAMF.mxml                 |   363 +
 .../securitySupervisorUserAMF.mxml              |   360 +
 .../subtopicsEnabledWildcardsNotAllowed.mxml    |   147 +
 .../subtopicsNotAllowedAMF.mxml                 |   153 +
 ...btopicsNotAllowedAllowSubtopicsFalseAMF.mxml |   152 +
 .../dynamicDestinations/wildcardsAMF.mxml       |   477 +
 .../wildcardsColonSeparatorAMF.mxml             |   478 +
 .../JMSSelectorBooleanTestNegative.mxml         |   177 +
 .../JMSSelectorBooleanTestPositive.mxml         |   156 +
 .../jmsselectors/JMSSelectorInTestNegative.mxml |   178 +
 .../jmsselectors/JMSSelectorInTestPositive.mxml |   157 +
 .../JMSSelectorLikeTestPositive.mxml            |   158 +
 .../JMSSelectorMixedTestNegative.mxml           |   179 +
 .../JMSSelectorMixedTestPositive.mxml           |   158 +
 .../JMSSelectorNullNotNullTestPositive.mxml     |   157 +
 .../JMSSelectorNumberTestBetween.mxml           |   155 +
 .../JMSSelectorNumberTestNegative.mxml          |   177 +
 .../JMSSelectorNumberTestPositive.mxml          |   157 +
 .../JMSSelectorStringTestNegative.mxml          |   177 +
 .../JMSSelectorStringTestPositive.mxml          |   157 +
 .../messagingService/messagingJMSMapTest.mxml   |   273 +
 .../messagingJMSObjectTest.mxml                 |   279 +
 .../messagingJMSQueueMapTest.mxml               |   274 +
 .../messagingJMSQueueObjectTest.mxml            |   279 +
 .../messagingService/messagingObjectTest.mxml   |   279 +
 .../messagingService/messagingTestNoProps.mxml  |   264 +
 ...ltiTopicConsumerRemoveSubscriptionsTest.mxml |    89 +
 .../multiTopicMXMLTagMessagingTest.mxml         |   262 +
 .../multiTopic/multiTopicMessagingTest.mxml     |   267 +
 .../messagingService/multipleMessagesTest.mxml  |   293 +
 .../priority/destinationPriorityTenTest.mxml    |   283 +
 .../priority/destinationPriorityZeroTest.mxml   |   283 +
 .../messagePriorityGrtrThanNineTest.mxml        |   283 +
 .../messagePriorityLessThanZeroTest.mxml        |   283 +
 .../priority/messagePriorityNineTest.mxml       |   283 +
 .../priority/messagePriorityZeroTest.mxml       |   283 +
 .../priority/messagingTest.mxml                 |   312 +
 ...pleMessagesDescendingDegreePriorityTest.mxml |   349 +
 ...agesMessageHeaderDescendingPriorityTest.mxml |   375 +
 ...gesProducerHeaderDescendingPriorityTest.mxml |   374 +
 .../priority/priority01MessagingTest.mxml       |   284 +
 .../priority/priority02MessagingTest.mxml       |   285 +
 .../priority/priority03MessagingTest.mxml       |   284 +
 .../priority/priority04MessagingTest.mxml       |   284 +
 .../priority/priority05MessagingTest.mxml       |   283 +
 .../priority/priority06MessagingTest.mxml       |   283 +
 .../priority/priority07MessagingTest.mxml       |   283 +
 .../priority/priority08MessagingTest.mxml       |   283 +
 .../priority/priority09MessagingTest.mxml       |   283 +
 .../priority/priority10MessagingTest.mxml       |   283 +
 .../priority/priority11MessagingTest.mxml       |   283 +
 .../producerPriorityGrtrThanNineTest.mxml       |   283 +
 ...essThanZeroAndHasDefaultDestSettingTest.mxml |   283 +
 .../producerPriorityLessThanZeroTest.mxml       |   283 +
 .../priority/producerPriorityNineTest.mxml      |   283 +
 .../priority/producerPriorityNullTest.mxml      |   283 +
 .../priority/producerPriorityZeroTest.mxml      |   283 +
 .../messagingService/proBadDestination.mxml     |    77 +
 .../routedMessageListenerTest.mxml              |   106 +
 ...hannelSetAuthenticationJMSMessagingTest.mxml |   262 +
 .../ChannelSetAuthenticationMessagingTest.mxml  |   241 +
 ...etAuthenticationMultipleLoginLogoutTest.mxml |   196 +
 .../security/ChannelSetAuthenticationTest.mxml  |   176 +
 .../polling-amf/JMSAuthConSubscribeTest.mxml    |   213 +
 .../polling-amf/JMSAuthProSendTest.mxml         |   214 +
 .../JMSAuthSendSubscribeConstraintTest.mxml     |   240 +
 .../MessagingAuthConSubscribeTest.mxml          |   213 +
 .../polling-amf/MessagingAuthProSendTest.mxml   |   199 +
 ...essagingAuthSendSubscribeConstraintTest.mxml |   220 +
 .../MessagingAuthenticationTest.mxml            |   266 +
 .../MessagingAuthenticationTest2.mxml           |    81 +
 ...MultiTopicMessagingAuthConSubscribeTest.mxml |   219 +
 .../polling-http/JMSAuthConSubscribeTest.mxml   |   213 +
 .../polling-http/JMSAuthProSendTest.mxml        |   214 +
 .../JMSAuthSendSubscribeConstraintTest.mxml     |   240 +
 .../MessagingAuthConSubscribeTest.mxml          |   213 +
 .../polling-http/MessagingAuthProSendTest.mxml  |   199 +
 ...essagingAuthSendSubscribeConstraintTest.mxml |   220 +
 .../MessagingAuthenticationTest.mxml            |   266 +
 .../MessagingAuthenticationTest2.mxml           |    81 +
 ...MultiTopicMessagingAuthConSubscribeTest.mxml |   219 +
 .../streaming-amf/JMSAuthConSubscribeTest.mxml  |   213 +
 .../streaming-amf/JMSAuthProSendTest.mxml       |   214 +
 .../JMSAuthSendSubscribeConstraintTest.mxml     |   243 +
 .../MessagingAuthConSubscribeTest.mxml          |   213 +
 .../streaming-amf/MessagingAuthProSendTest.mxml |   214 +
 ...essagingAuthSendSubscribeConstraintTest.mxml |   220 +
 .../MessagingAuthenticationTest.mxml            |   266 +
 .../MessagingAuthenticationTest2.mxml           |    81 +
 ...MultiTopicMessagingAuthConSubscribeTest.mxml |   219 +
 .../streaming-http/JMSAuthConSubscribeTest.mxml |   213 +
 .../streaming-http/JMSAuthProSendTest.mxml      |   214 +
 .../JMSAuthSendSubscribeConstraintTest.mxml     |   243 +
 .../MessagingAuthConSubscribeTest.mxml          |   213 +
 .../MessagingAuthProSendTest.mxml               |   213 +
 ...essagingAuthSendSubscribeConstraintTest.mxml |   220 +
 .../MessagingAuthenticationTest.mxml            |   266 +
 .../MessagingAuthenticationTest2.mxml           |    81 +
 ...MultiTopicMessagingAuthConSubscribeTest.mxml |   219 +
 .../selectors/SelectorBooleanTestNegative.mxml  |   177 +
 .../selectors/SelectorBooleanTestPositive.mxml  |   156 +
 .../selectors/SelectorInTestNegative.mxml       |   178 +
 .../selectors/SelectorInTestPositive.mxml       |   157 +
 .../selectors/SelectorLikeTestPositive.mxml     |   158 +
 .../selectors/SelectorMixedTestNegative.mxml    |   179 +
 .../selectors/SelectorMixedTestPositive.mxml    |   158 +
 .../SelectorNullNotNullTestPositive.mxml        |   157 +
 .../selectors/SelectorNumberTestBetween.mxml    |   155 +
 .../selectors/SelectorNumberTestNegative.mxml   |   177 +
 .../selectors/SelectorNumberTestPositive.mxml   |   157 +
 .../selectors/SelectorStringTestNegative.mxml   |   177 +
 .../selectors/SelectorStringTestPositive.mxml   |   157 +
 .../serverPushEnumStreamingAMFTest.mxml         |   236 +
 .../serverPushEnumStreamingHTTPTest.mxml        |   236 +
 .../messagingService/serverPushEnumTest.mxml    |   236 +
 .../serverPushOverlappingChannelSetsTest.mxml   |   198 +
 .../tests/messagingService/serverPushTest.mxml  |   237 +
 .../serverPushWithSubtopicTest.mxml             |   262 +
 .../simpleJMSMessagingAsyncTest.mxml            |   265 +
 ...leJMSMessagingConnectionCredentialsTest.mxml |   265 +
 ...simpleJMSMessagingDeprecatedAttribsTest.mxml |   264 +
 .../simpleJMSMessagingDurableQueueTest.mxml     |   264 +
 .../simpleJMSMessagingDurableTest.mxml          |   304 +
 .../simpleJMSMessagingPreserveHeadersTest.mxml  |   266 +
 .../simpleJMSMessagingSyncTest.mxml             |   264 +
 .../simpleJMSMessagingTest.mxml                 |   266 +
 .../simpleJMSQueueMessagingTest.mxml            |   264 +
 .../messagingService/simpleMessagingTest.mxml   |   264 +
 .../simpleMessagingTest_StreamingHTTP.mxml      |   264 +
 .../disconnectResubscribeJMSTest.mxml           |   233 +
 .../longpolling/disconnectResubscribeTest.mxml  |   233 +
 .../multipleDisconnectsResubscribesTest.mxml    |   228 +
 .../polling/disconnectResubscribeJMSTest.mxml   |   233 +
 .../polling/disconnectResubscribeTest.mxml      |   233 +
 .../multipleDisconnectsResubscribesTest.mxml    |   228 +
 .../streaming/disconnectResubscribeJMSTest.mxml |   233 +
 .../streaming/disconnectResubscribeTest.mxml    |   233 +
 .../multipleDisconnectsResubscribesTest.mxml    |   228 +
 .../DeserializationValidatorConfigTest.mxml     |   141 +
 .../tests/proxyService/184631/WSTest.mxml       |   116 +
 .../184631/bug184631useProxyTrue.mxml           |   116 +
 .../tests/proxyService/184950/bug184950.mxml    |   130 +
 .../proxyService/202863/bug202863DocLit.mxml    |   126 +
 .../proxyService/202863/bug202863RpcEnc.mxml    |   126 +
 .../proxyService/92441/bug92441SoapFault.mxml   |   120 +
 .../mxunit/tests/proxyService/92441/echo.wsdl   |   622 +
 .../tests/proxyService/92441/echoFault.xml      |    31 +
 .../httpservice/MultiHeaderTest.mxml            |   156 +
 .../amfchannel/hsMulti_contenttype_xml.mxml     |   140 +
 .../httpservice/amfchannel/hs_attributes.mxml   |    77 +
 .../httpservice/amfchannel/hs_cancel.mxml       |    61 +
 .../httpservice/amfchannel/hs_channelset.mxml   |    73 +
 .../amfchannel/hs_contenttype_xml.mxml          |   114 +
 .../httpservice/amfchannel/hs_extraparams.mxml  |    84 +
 .../httpservice/amfchannel/hs_resultformat.mxml |   217 +
 .../amfchannel/hs_send_no_request.mxml          |   136 +
 .../amfchannel/hs_send_with_request.mxml        |   153 +
 .../amfchannel/hs_xmldecode_xmlencode.mxml      |    98 +
 .../httpservice/bugs/171569/bug171569.mxml      |    78 +
 .../bugs/171569/bug171569_alternate.mxml        |    91 +
 .../httpservice/bugs/203212/TestCase203212.as   |    55 +
 .../httpservice/bugs/203212/bug203212.mxml      |    96 +
 .../httpservice/bugs/203359/bug203359.mxml      |    82 +
 .../bugs/PutAndDeleteMethodTests.mxml           |    85 +
 .../httpservice/bugs/sdk-11229/sdk11229.mxml    |   126 +
 .../httpservice/httpchannel/hs_attributes.mxml  |    89 +
 .../httpservice/httpchannel/hs_cancel.mxml      |    96 +
 .../httpservice/httpchannel/hs_channelset.mxml  |    97 +
 .../httpchannel/hs_contenttype_xml.mxml         |   171 +
 .../httpservice/httpchannel/hs_extraparams.mxml |   114 +
 .../httpchannel/hs_resultformat.mxml            |   265 +
 .../httpchannel/hs_send_no_request.mxml         |   167 +
 .../httpchannel/hs_send_with_request.mxml       |   188 +
 .../httpchannel/hs_xmldecode_xmlencode.mxml     |   118 +
 .../ConstructorNegativeTest.mxml                |   137 +
 .../tests/remotingService/badEndpointTest.mxml  |    78 +
 .../tests/remotingService/dataTypes/Bean.as     |   207 +
 .../dataTypes/BeanRulesTest.mxml                |   190 +
 .../dataTypes/BigDecimalTypesTest.mxml          |   258 +
 .../dataTypes/BigIntegerTypesTest.mxml          |   213 +
 .../tests/remotingService/dataTypes/Book.as     |    52 +
 .../dataTypes/BooleanTypesTest.mxml             |   865 +
 .../dataTypes/ByteTypesTest.mxml                |   571 +
 .../dataTypes/CharTypesTest.mxml                |   514 +
 .../dataTypes/CircularReferencingTest.mxml      |   143 +
 .../dataTypes/ComplexCustomTypeTest.mxml        |   141 +
 .../dataTypes/CreateASObjectForMissingTest.mxml |   114 +
 .../dataTypes/CustomTypeTest.mxml               |   380 +
 .../dataTypes/DateTypesTest.mxml                |   352 +
 .../dataTypes/DeferInstantiationTest.mxml       |   114 +
 .../remotingService/dataTypes/DocumentTest.mxml |   127 +
 .../dataTypes/DoubleTypesTest.mxml              |   747 +
 .../tests/remotingService/dataTypes/EnumType.as |    51 +
 .../remotingService/dataTypes/EnumTypeTest.mxml |   109 +
 .../dataTypes/ExternalizableDate.as             |    69 +
 .../dataTypes/ExternalizableTest.mxml           |    58 +
 .../dataTypes/FloatTypesTest.mxml               |   426 +
 .../ImageSnapshot/testCaptureBitmapData.mxml    |    87 +
 .../ImageSnapshot/testCaptureImage.mxml         |   112 +
 .../ImageSnapshot/testCaptureImageJPEG.mxml     |    83 +
 .../testCaptureImageScaleLimitedFalse.mxml      |    83 +
 .../testCaptureImageScaleLimitedFalseJPEG.mxml  |    85 +
 .../testCaptureImageScaleLimitedTrue.mxml       |    84 +
 .../testCaptureImageScaleLimitedTrueJPEG.mxml   |    83 +
 .../ImageSnapshot/testEncodeImageAsBase64.mxml  |    81 +
 .../remotingService/dataTypes/IntTypesTest.mxml |   535 +
 .../dataTypes/LongTypesTest.mxml                |   565 +
 .../remotingService/dataTypes/MapTypeTest.mxml  |    67 +
 .../dataTypes/MethodOverLoadingTests.mxml       |    89 +
 .../remotingService/dataTypes/MissingBook.as    |    52 +
 .../dataTypes/MissingTestTypedObject.as         |    54 +
 .../remotingService/dataTypes/MyFileRef.as      |    26 +
 .../dataTypes/NoRemoteAliasBook.as              |    51 +
 .../dataTypes/PropertyProxyTest.mxml            |    84 +
 .../remotingService/dataTypes/ReadOnlyTest.mxml |    85 +
 .../dataTypes/SQLDateTypesTest.mxml             |   256 +
 .../dataTypes/ShortTypesTest.mxml               |   475 +
 .../dataTypes/StringTypesTest.mxml              |   316 +
 .../remotingService/dataTypes/SuperBook.as      |    26 +
 .../dataTypes/TestTypedObject.as                |    54 +
 .../dataTypes/VectorTypesTest.mxml              |   219 +
 .../dataTypes/amf/inheritPropsTest.mxml         |    68 +
 .../remotingService/dataTypes/bean_namespace.as |    22 +
 .../dataTypes/http/inheritPropsTest.mxml        |    68 +
 .../remotingService/domainbaseEndpointTest.mxml |    79 +
 .../remotingService/fault/CustomException.as    |    29 +
 .../fault/CustomExceptionTest.mxml              |    69 +
 .../fault/DestinatedClassNotFoundTest.mxml      |    69 +
 .../fault/InvalidMethodTest.mxml                |    66 +
 .../remotingService/fault/NumberOfArgsTest.mxml |    66 +
 .../remotingService/fault/WrongArgTypeTest.mxml |    66 +
 .../tests/remotingService/forwardToAMF.jsp      |    19 +
 .../mxml/ArgumentsOrderTest.mxml                |    97 +
 .../remotingService/mxml/BasicSyntaxTest.mxml   |    76 +
 .../mxml/ConcurrencyLastTest.mxml               |    74 +
 .../mxml/ConcurrencyMultipleTest.mxml           |    59 +
 .../mxml/ConcurrencyServiceLevelLastTest.mxml   |    76 +
 .../ConcurrencyServiceLevelMultipleTest.mxml    |    59 +
 .../mxml/ConcurrencyServiceLevelSingleTest.mxml |    58 +
 .../mxml/ConcurrencySingleTest.mxml             |    58 +
 .../mxml/HttpChannelInValidateTest.mxml         |    66 +
 .../mxml/MakeObjectBindableTest.mxml            |   145 +
 .../mxml/RequestTimeoutTest.mxml                |   127 +
 .../mxml/ShowBusyCursorTest.mxml                |   111 +
 .../remotingService/relativeEndpointTest.mxml   |    79 +
 .../result/ResultBindableTest.mxml              |    73 +
 .../security/CustomAuthHttpChannelTest.mxml     |   135 +
 .../security/CustomAuthTest.mxml                |   106 +
 .../security/ExcludeMethodsTest.mxml            |   113 +
 .../security/IncludeMethodsTest.mxml            |   259 +
 .../security/IncludeMethodsWinTest.mxml         |   258 +
 .../security/nestedConstrainsTest.mxml          |   246 +
 .../FlexSessionAttributeListenerTest.mxml       |   112 +
 .../stateful/DifferentInstanceTest.mxml         |    64 +
 .../stateful/IsSameInstanceTest.mxml            |    69 +
 .../runtimeConfiguration/roMessageDestTest.mxml |   118 +
 .../runtimeAddRemoveDestTest.mxml               |   124 +
 .../runtimeHTTPProxyDestTest.mxml               |    92 +
 .../runtimeJMSDestTest.mxml                     |   119 +
 .../runtimeMessageDestTest.mxml                 |   107 +
 .../runtimeRemotingDestTest.mxml                |    76 +
 .../runtimeSOAPProxyAdapterTest.mxml            |   117 +
 .../runtimeUnmanagedDestTest.mxml               |   148 +
 .../startupHTTPProxyDestTest.mxml               |    79 +
 .../startupJMSDestTest.mxml                     |   114 +
 .../startupMessageDestTest.mxml                 |   114 +
 .../startupRemotingDestTest.mxml                |    76 +
 .../startupSOAPProxyAdapterTest.mxml            |   125 +
 .../mixedSeparatorsColonSeparatorAMF.mxml       |   248 +
 .../multiTopic/multiTopicMessagingTest.mxml     |   321 +
 .../polling-amf/MessagingAuthProSendTest.mxml   |   201 +
 .../MessagingAuthConSubscribeTest.mxml          |   215 +
 ...essagingAuthSendSubscribeConstraintTest.mxml |   220 +
 .../messagingService/simpleMessagingTest.mxml   |   318 +
 .../remotingService/mxml/BasicSyntaxTest.mxml   |    87 +
 .../simpleMessagingTest_SecureAMF.mxml          |   264 +
 .../simpleMessagingTest_SecureHTTP.mxml         |   264 +
 .../amfchannel/hs_send_no_request.mxml          |   163 +
 .../amfchannel/hs_send_with_request.mxml        |   183 +
 .../httpchannel/hs_send_no_request.mxml         |   167 +
 .../httpchannel/hs_send_with_request.mxml       |   185 +
 qa/build.properties                             |    28 +
 qa/build.xml                                    |   114 +
 qa/features/checkintests-all.properties         |    25 +
 qa/features/checkintests-messaging.properties   |    19 +
 qa/features/checkintests-rpc.properties         |    19 +
 qa/features/checkintests.properties             |    19 +
 qa/features/common.properties                   |    17 +
 qa/features/excludes.properties                 |    52 +
 qa/features/excludes.soft.properties            |    27 +
 qa/features/fds_approval.properties             |    33 +
 qa/features/full.properties                     |    38 +
 qa/features/httpService.properties              |    19 +
 qa/features/messaging.properties                |    23 +
 qa/features/remoteObject.properties             |    18 +
 qa/features/runtimeConfiguration.properties     |    17 +
 qa/features/spring.properties                   |    17 +
 qa/features/ssl.properties                      |    17 +
 qa/features/test.properties                     |    32 +
 qa/kick-build.txt                               |     1 +
 qa/resources/config/messaging-config.xml        |    28 +
 qa/resources/config/proxy-config.xml            |    47 +
 qa/resources/config/remoting-config.xml         |    31 +
 qa/resources/config/services-config.xml         |   113 +
 qa/resources/webtier/build.xml                  |    93 +
 qa/resources/webtier/flex_sdk_3/air-config.xml  |   281 +
 qa/resources/webtier/flex_sdk_3/flex-config.xml |   357 +
 .../webtier/flex_sdk_3/flex-webtier-config.xml  |   147 +
 qa/resources/webtier/flex_sdk_3/web.xml         |   217 +
 qa/resources/webtier/flex_sdk_3/web.xml.spring  |   233 +
 qa/resources/webtier/flex_sdk_4/air-config.xml  |   403 +
 qa/resources/webtier/flex_sdk_4/flex-config.xml |   440 +
 .../webtier/flex_sdk_4/flex-webtier-config.xml  |   147 +
 qa/resources/webtier/flex_sdk_4/web.xml         |   204 +
 qa/resources/webtier/flex_sdk_4/web.xml.spring  |   217 +
 .../qa/src/qa/utils/mxml/MXMLCServlet.java      |   299 +
 qa/resources/webtier/qa/web.xml                 |   181 +
 qa/resources/webtier/qa/web.xml.spring          |   194 +
 qa/src/build.xml                                |    87 +
 readme.txt                                      |    41 +
 resources/clustering/readme.txt                 |    36 +
 .../HTTPProxyBootstrapService.java              |   254 +
 .../MessagingBootstrapService.java              |   330 +
 resources/config/bootstrapservices/README.txt   |    22 +
 .../RemotingBootstrapService.java               |   220 +
 resources/config/messaging-config.xml           |   368 +
 resources/config/proxy-config.xml               |   141 +
 resources/config/readme.txt                     |    25 +
 resources/config/remoting-config.xml            |   220 +
 resources/config/services-config.xml            |   895 +
 .../fds-ajax-bridge/actionscript/FDMSBase.as    |    30 +
 .../fds-ajax-bridge/actionscript/FDMSBridge.as  |   216 +
 .../actionscript/bridge/FABridge.as             |   942 +
 resources/fds-ajax-bridge/build.xml             |    98 +
 .../fds-ajax-bridge/javascript/FABridge.js      |   655 +
 resources/fds-ajax-bridge/javascript/FDMSLib.js |   263 +
 resources/fds-ajax-bridge/readme.txt            |    25 +
 .../ClassLoggingDeserializationValidator.java   |   127 +
 resources/security/jboss/readme.txt             |    23 +
 resources/security/tomcat/context.xml           |    24 +
 resources/security/tomcat/readme.txt            |     9 +
 resources/security/websphere/readme.txt         |    11 +
 sampledb/flexdemodb/flexdemodb.properties       |    32 +
 sampledb/flexdemodb/flexdemodb.script           | 20074 +++++++++++++++++
 sampledb/server.properties                      |    20 +
 sampledb/startdb.bat                            |    17 +
 sampledb/startdb.sh                             |    16 +
 sampledb/stopdb.bat                             |    17 +
 sampledb/stopdb.sh                              |    16 +
 .../bin/catalina.bat                            |   287 +
 .../bin/catalina.sh                             |   456 +
 servers/apache-tomcat-6.0.29-overlay/build.xml  |    55 +
 .../conf/Catalina/localhost/blazeds-spring.xml  |    47 +
 .../localhost/blazeds-spring.xml.install        |    21 +
 .../conf/Catalina/localhost/blazeds.xml         |    47 +
 .../conf/Catalina/localhost/blazeds.xml.install |    21 +
 .../conf/Catalina/localhost/ds-console.xml      |    22 +
 .../Catalina/localhost/ds-console.xml.install   |    21 +
 .../conf/Catalina/localhost/qa-manual.xml       |    54 +
 .../conf/Catalina/localhost/qa-regress.xml      |    50 +
 .../conf/Catalina/localhost/samples-spring.xml  |    47 +
 .../localhost/samples-spring.xml.install        |    21 +
 .../conf/Catalina/localhost/samples.xml         |    22 +
 .../conf/Catalina/localhost/samples.xml.install |    21 +
 .../conf/catalina.properties                    |    81 +
 .../conf/context.xml                            |    33 +
 .../conf/server.xml                             |   145 +
 .../conf/tomcat-users.xml                       |    41 +
 .../apache-tomcat-6.0.29-overlay/conf/web.xml   |  1204 +
 .../webapps/ROOT/WEB_INF/web.xml                |    29 +
 .../webapps/ROOT/index.html                     |    50 +
 2074 files changed, 339812 insertions(+)
----------------------------------------------------------------------



[28/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/main.css
----------------------------------------------------------------------
diff --git a/apps/samples/main.css b/apps/samples/main.css
new file mode 100755
index 0000000..5470820
--- /dev/null
+++ b/apps/samples/main.css
@@ -0,0 +1,138 @@
+/*
+ * 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.
+ */
+body {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	margin-top: 30px;
+	margin-top: 30px;
+	margin-left: 8%;
+	margin-right: 8%;
+	font-size: 0.8em;
+	color: #333333;
+	background-color:#FFFFFF;
+}
+
+h1, h2, h3 {
+	font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif;
+	font-weight: bold;
+}
+
+h1 {
+	font-weight: bold;
+	margin-top: 4px;
+	margin-bottom: 12px;
+	font-size: 2em;
+}
+
+h2 {
+	padding-top: 12px;
+	margin-bottom: 0px;
+	font-size: 1.6em;
+	color: #333333;
+}
+
+h3 {
+	margin-top: 0px;
+	font-size: 1.3em;
+	color: #004477;
+}
+
+h4 {
+	margin-top: 20px;
+	margin-bottom: 8px;
+	font-size: 12px;
+	color: #333333;
+}
+
+.item {
+	border-bottom: 1px solid #CCCCCC;
+	padding-top: 12px;
+	padding-bottom: 0px;
+}
+
+.highlight {
+	border: 1px solid #CCCCCC;
+	padding-top:10px;
+	padding-left:10px;
+	padding-right:10px;
+	padding-bottom:0px;
+	border-color: #2080B3;
+	margin-top:20px;
+	margin-bottom:20px;
+}
+
+.footer {
+	color: #666666;
+	margin-top: 20px;
+	font-size: 0.75em;
+}
+
+ul {
+	margin-top:8px;
+	margin-bottom:8px;
+}
+
+li {
+	padding-bottom:8px;
+}
+
+code {
+	color: #000099;
+	font-family: "Courier New", Courier, monospace;
+	font-size:1.1em;
+}
+
+img {
+	border: 0;
+}
+
+#col1{
+  	float:left;
+	width: 20%;
+	padding-right: 24px;
+}
+
+#col2{
+  float: left;
+  width: 55%;
+}
+
+#col3{
+	float: right;
+	width: 20%;
+	margin: 0px;
+	padding: 0px;
+}
+
+a:link {
+	color: #006699;
+	text-decoration: none;
+}
+
+a:visited {
+	text-decoration: none;
+	color: #006699;
+}
+
+a:hover {
+	text-decoration: underline;
+	color: #006699;
+}
+
+a:active {
+	text-decoration: none;
+	color: #006699;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples/testdrive.htm
----------------------------------------------------------------------
diff --git a/apps/samples/testdrive.htm b/apps/samples/testdrive.htm
new file mode 100755
index 0000000..072c404
--- /dev/null
+++ b/apps/samples/testdrive.htm
@@ -0,0 +1,254 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>BlazeDS Test Drive</title>
+<link href="main.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+
+<h1>BlazeDS Test Drive</h1>
+<p>In this test drive, you  run a series of short sample applications that demonstrate the key features of BlazeDS. We walk you through the source code of each application to highlight the key points of  its implementation. The source code for the Test Drive applications is available in samples\WEB-INF\flex-src\flex-src.zip.
+    <ul>
+    <li>If you want to examine the source code using your favorite code editor, unzip <strong>flex-src.zip</strong> anywhere on your file system. </li>
+    <li>If you want to open the source code in Flex Builder, unzip <strong>flex-src.zip</strong> in the root  folder of your  Flex Builder workspace, and read <a href="fb-project-setup.htm">these instructions</a> to set up your Flex Builder projects. </li>
+  </ul>
+  </p>
+
+<div class="item">
+  <h3>Sample  1: Accessing data using HTTPService</h3>
+
+  <h4>Run the sample:</h4>
+  <ol>
+  <li>Click <a href="testdrive-httpservice/index.html">here</a> to run the application    </li>
+    <li>Click &quot;Get Data&quot;: The DataGrid is populated with XML data returned by catalog.jsp </li>
+    <li>Also notice some of the built-in DataGrid  features:</li>
+    <ul>
+      <li>Sortable columns  (click on a column header) </li>
+      <li>Moveable columns (click on a column header and, with the mouse button pressed, move the column to a new position) </li>
+    </ul>
+  </ol>
+  <h4>Code walkthrough:</h4>
+<p>Open main.mxml in the testdrive-httpservice/src directory  to look at the source code of the application.</p>
+<p>Using HTTPService, you can  send   HTTP requests to a server, and consume the response. Although the  HTTPService can be used to consume different types of responses, it is  typically used to consume XML. You can use the HTTPService with any kind of  server-side technology: JSP, Servlet, ASP, Ruby on Rails, PHP, etc. You specify  the target service in the <strong>url</strong> property of HTTPService.</p>
+<p>Flex provides sophisticated data binding capabilities. You can bind the value of a property to the  value of another property, or to an expression in general. In this example, the  dataProvider property of the DataGrid is bound (using the curly braces notation) to the  lastResult property of the HTTPService. </p>
+<p>HTTPService calls are asynchronous. The <strong>result</strong> event is triggered on the HTTPService  when the data becomes available to the client application. The <strong>fault</strong> event is triggered if an error occurs at the server-side, or if the network becomes unavailable. </p>
+<p>By default, the XML document retrieved from the server is  deserialized into an object graph. This allows you to navigate through the  result using the dot notation. You can also get the result as an XML document by specifying resultFormat=&quot;e4x&quot; on the  HTTPService. In that case, you can parse the document using <a href="http://www.ecma-international.org/publications/standards/Ecma-357.htm">E4X</a> (ECMAScript for XML). </p>
+<p>The BlazeDS server is not required to use the HTTPService: By default, the application tries to connect  directly to the domain specified in the HTTPService url attribute. This  will work if one of the two conditions below is satisfied:</p>
+<ol>
+  <li>The domain specified in the HTTPService url attribute is the domain from where your application was downloaded. </li>
+  <li>A crossdomain.xml file granting access to your application's originating domain is available on the domain specified in the HTTPService url attribute.   More information on crossdomain.xml is available <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14213&sliceId=2">here</a>.</li>
+  </ol>
+<p>If you want your application to access services available on another domain without deploying a crossdomain.xml file on that  domain (for example,  because you may not own the target domain), you can set the <strong>useProxy</strong> attribute of the HTTPService to &quot;<strong>true</strong>&quot; like in this example. In this case, the request is sent to the BlazeDS proxy  which  makes the request to the target domain on the client application's behalf. This configuration also provides more control over the access to the service. For example, you may configure the proxy to require authentication before accessing a  service, log access to the service, etc. </p>
+<p>When using the proxy, you can specify a logical name in the HTTPService <strong>destination</strong> attribute instead of specifying a hardcoded value in the url attribute. You   then map this  logical name to an actual URL in WEB-INF\flex\proxy-config.xml. Open WEB-INF\flex\proxy-config.xml to see how the catalog destination is configured.</p>
+<h4>More info:</h4>
+<ul>
+  <li>Both HTTP and HTTPS are supported</li>
+</ul>
+</div>
+<br />
+<div class="item">
+  <h3>Sample 2: Accessing data using Web Services</h3>
+  <h4>Run the sample:</h4>
+<ol>
+  <li>Click <a href="testdrive-webservice/index.html">here</a> to run the application
+    <p>NOTE: Since this application accesses a live web service, you must have a connection to the internet to run it.</p></li>
+  <li>Click &quot;Get Data&quot;: The DataGrid is populated with  data returned by the MXNA 2.0 web service hosted on feeds.adobe.com. </li>
+  </ol>
+<h4>Code walkthrough:</h4>
+<p>Open main.mxml in the testdrive-webservice/src directory  to look at the source code of the application.</p><p>Access the wsdl file for the web service used in this example: </p>
+<ul>
+  <li><a href="http://feeds.adobe.com/webservices/mxna2.cfc?wsdl">http://feeds.adobe.com/webservices/mxna2.cfc?wsdl</a></li>
+
+</ul>
+<p>Using the WebService tag, you can  invoke SOAP-based web services deployed  in your application server or  on the internet. Objects returned by a web service are automatically deserialized into ActionScript objects. Similarly ActionScript objects passed as arguments to a web service operation are serialized according the  wsdl description.</p>
+<p>Notice that we also added DataGrid column definitions (using DataGridColumn) in this example.</p>
+<p>The BlazeDS server is not required to use the WebService: By default, the application tries to connect  directly to the domain specified in the WebService wsdl attribute. This  will work if one of the two conditions below is satisfied:</p>
+<ol>
+  <li>The domain specified in the WebService wsdl attribute is the domain from where your application was downloaded. </li>
+  <li>A crossdomain.xml file granting access to your application's originating domain is available on the domain specified in the WebService wsdl attribute.   More information on crossdomain.xml is available <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14213&amp;sliceId=2">here</a>.</li>
+</ol>
+<p>If you want your application to access services available on another domain without deploying a crossdomain.xml file on that  domain (for example,  because you may not own the target domain), you can set the <strong>useProxy</strong> attribute of the WebService to &quot;<strong>true</strong>&quot; like in this example. In this case, the request is sent to the BlazeDS proxy  which  makes the request to the target domain on the client application's behalf. This configuration also provides more control over the access to the service. For example, you may configure the proxy to require authentication before accessing a  service, log access to the service, etc. </p>
+<p>When using the proxy, you can specify a logical name in the WebService <strong>destination</strong> attribute instead of specifying a hardcoded value in the wsdl attribute. You   then map this  logical name to an actual URL in WEB-INF\flex\proxy-config.xml. Open WEB-INF\flex\proxy-config.xml to see how the ws-catalog destination is configured.</p>
+<h4>More Info:</h4>
+<ul>
+  <li>Flex supports both RPC-encoded and document-literal web services</li>
+  <li>Like HTTPService, WebService calls are asynchronous: You can code <strong>result</strong> and <strong>fault</strong> event handlers<br />
+  </li>
+  </ul>
+
+</div>
+<br />
+
+<div class="item">
+  <h3>Sample  3: Accessing data using Remoting </h3>
+  <h4>Run the sample:</h4>
+<ol>
+
+  <li>Click <a href="testdrive-remoteobject/index.html">here</a> to run the application</li>
+  <li>Click &quot;Get Data&quot;:  The DataGrid is populated with  data returned by the getProducts() method of the ProductService Java class. </li>
+  </ol>
+<h4>Code walkthrough:</h4>
+<p>Open main.mxml in the testdrive-remoteobject/src directory  to look at the source code of the application.</p>
+<p>Open the following files in a text editor to look at the source code for the server side  of the application: </p>
+<ul>
+  <li>{context-root}\WEB-INF\src\flex\samples\product\ProductService.java</li>
+
+  <li>{context-root}\WEB-INF\flex\remoting-config.xml</li>
+</ul>
+<p>Using RemoteObject, you can directly invoke methods of Java objects  deployed in your application server, and consume the return value. The return value can be a value of a primitive data type, an object, a  collection of objects, an object graph, etc.</p>
+<p>The value of the destination property of RemoteObject is a  logical name that is mapped to a fully qualified java class  in  remoting-config.xml.</p>
+<p>Java objects returned by server-side methods are deserialized into  either dynamic or typed ActionScript objects. In this example, we don't have an explicit ActionScript version of the Product Java class. Product objects are therefore deserialized into dynamic objects. In sample 5, we work with an explicit Product class in ActionScript. </p>
+<h4><strong>More info:</strong></h4>
+<ul>
+  <li>Like HTTPService and WebService, RemoteObject calls are asynchronous. You use the <strong>result</strong> and <strong>fault</strong> events of the RemoteObject to handle results and errors. &nbsp;<br />
+
+  </li>
+  </ul>
+
+</div>
+<br />
+
+<div class="item">
+  <h3>Sample  4: Flex Programming Model 101 </h3>
+  <h4>Run the sample:</h4>
+<ol>
+  <li>Click <a href="testdrive-101/index.html">here</a> to run the application</li>
+
+  <li>Click a phone in the list: the details for the selected phone appear in the right panel  </li>
+  </ol>
+<h4>Code walkthrough:</h4>
+<p>Open the following files in the testdrive-101/src directory to look at the source code of the application:</p>
+<ul>
+  <li>main.mxml</li>
+  <li>Thumb.mxml</li>
+  <li>ProductView.mxml</li>
+</ul>
+<p>Like in any other object-oriented programming language, a Flex application is made of a collection of classes. Using Flex, you can create classes using MXML or ActionScript. You typically create view classes in MXML, and Model and Controller classes in ActionScript. </p>
+<p>When you create an mxml file, you are actually creating a class. The root node of the mxml document indicates the class you extend. For example, creating a file named MasterDetail.mxml with an &lt;Application&gt; root node is equivalent to creating an ActionScript  class with the following signature:</p>
+<div class="code">
+  <p>public class MasterDetail extends Application { </p>
+  <p>} </p>
+</div>
+
+<p>Similarly,   creating a file named ProductView.mxml with a &lt;Panel&gt; root node is similar to creating a class with the following signature:</p>
+<div class="code">
+  <p>public class ProductView extends Panel { </p>
+  <p>} </p>
+</div>
+<p>Once you have defined a class, you can use it programatically or declaratively (as a tag in MXML) without the need for an additional descriptor file. Public properties are automatically available as tag attributes. For example, in MasterDetail.mxml, we define the &lt;ProductView&gt; tag and bind its product attribute to the selected item in the product list. </p>
+
+<p>Also notice the support for CSS style sheets. </p>
+
+</div>
+<br />
+
+<div class="item">
+  <h3>Sample 5: Updating Data</h3>
+  <h4>Run the sample: </h4>
+  <ol>
+  <li>Click <a href="testdrive-update/index.html">here</a> to run the application</li>
+
+  <li>Select a phone </li>
+  <li>Modify some data in the right panel. For example, the price. </li>
+  <li>Click Update: changes are sent to the back-end and persisted in the database by the ProductService class. </li>
+</ol>
+<h4>Code walkthrough:</h4>
+<p>Open the following files in the testdrive-update/src directory to look at the source code of the application:</p>
+<ul>
+  <li>main.mxml</li>
+  <li>ProductForm.mxml</li>
+  <li>Product.as</li>
+</ul>
+<p>Open the following files in a text editor to look at the source code for the server-side  of the application: </p>
+<ul>
+  <li>WEB-INF\src\flex\samples\product\ProductService.java</li>
+  <li>WEB-INF\flex\remoting-config.xml</li>
+</ul>
+<p>In Product.as we use the [RemoteClass(alias=&quot;flex.samples.product.Product&quot;)] annotation to map the ActionScript version of the Product class (Product.as) to the Java version (Product.java). As a result, Product objects returned by the getProducts() method of ProductService are deserialized into instances of the ActionScript Product class. Similarly, the instance of the ActionScript Product class  passed as an argument to the update method of the RemoteObject  is deserialized into an instance of the java version of the Product class at the server-side. </p>
+
+</div>
+<br />
+
+
+<div class="item">
+  <h3>Sample 6: Publish/Subscribe Messaging (Data Push Use Case)</h3>
+  <h4>Run the sample:</h4>
+  <p> In this example, a Java component publishes simulated real time values to a message queue. The Flex client subscribes to that queue and displays the values in real time. </p>
+  <ol>
+
+  <li>To start the feed component at the server-side, access:   <a href="testdrive-datapush/startfeed.jsp">testdrive-datapush/startfeed.jsp</a></li>
+  <li>Click <a href="testdrive-datapush/index.html">here</a> to run the application</li>
+  <li>Click the &quot;Subscribe to 'feed' destination&quot; button: Pushed values appear in the text field</li>
+  <li>To stop the feed when you are done experimenting with the application, access: <a href="testdrive-datapush/stopfeed.jsp">testdrive-datapush/stopfeed.jsp</a></li>
+  </ol>
+  <h4>Code walkthrough:</h4>
+<p>Open FeedClient.mxml in the testdrive-datapush/src directory  to look at the source code of the application.</p>
+  <p>Open the following files in a text editor to look at the source code for the server-side  of the application: </p>
+  <ul>
+    <li>WEB-INF\src\flex\samples\feed\Feed.Java</li>
+    <li>WEB-INF\flex\messaging-config.xml</li>
+  </ul>
+  <p>Flex supports publish/subscribe messaging through the BlazeDS Message Service. The Message Service manages a set of destinations that Flex clients can  publish and subsribe to. Flex provides two components, Producer and Consumer, that you use to respectively publish and subscribe to a destination. To subscribe to a destination, you use the subscribe() method of the Consumer class. When a message is published to a destination you subscribed to, the <strong>message</strong> event is triggered on the Consumer. </p>
+<p>In Feed.java, the BlazeDS Java API (MessageBroker, AsyncMessage) is used to publish messages to the destination. Another option to exchange messages between Flex and Java applications is to map destinations to JMS topics, essentially allowing a Flex client to publish and subscribe to JMS topics. In addition to JMS, the Message Service adapter architecture allows you to integrate with any kind of messaging system. </p>
+<p>Messaging destinations are configured in messaging-config.xml.  A key element of a destination configuration is the channel used to exchange data between the client and the server. Using BlazeDS, a messaging destination typically uses a streaming or a polling channel. </p>
+<ul>
+  <li>Using a streaming channel, the server response is left open until the channel connection is closed, allowing the   server to send down incremental chunks of data to the client. HTTP connections are not duplex. This means that a single streaming AMF or   HTTP channel actually requires two browser HTTP connections in order to send   data in both directions. One for the streamed response from the server to the   client that the channel hangs on to, and a second transient connection, drawn   from the browser pool only when data needs to be sent to the server. This   second transient connection is  immediately released back to the browser&rsquo;s   connection pool.</li>
+  <li>A polling channel can be configured with a simple interval or with a sever wait if data is not immediately   available (long polling). In either case,  each poll response completes the   request. Browser HTTP 1.1   connections are persistent by default, so the browser   will likely recycle existing HTTP connections to send subsequent poll requests   which lowers the overhead for polling.</li>
+</ul>
+<p>The streaming channel is the best option when near real time communication is required.</p>
+
+<p><strong>Difference between IE and FireFox:</strong></p>
+<p>Browsers have a limited number of connections that they can maintain per session. The maximum number of connections allowed, as well as the way sessions are handled are browser specific.</p>
+<p>In IE, the maximum number of connections per session is two, but if you start multiple IE instances from an operating system menu or shortcut, each instance is started in a different process and maintains its own session. However, if you start a new IE window using CTRL+N in an existing IE instance, that new window shares the same session as the IE instance that created it. In other words, you can have an unlimited number of applications using HTTP streaming to get data from the server as long as these applications are started in different IE processes. If you start multiple IE windows using CTRL+N, you are limited to the maximum number of connections per session (2). </p>
+<p>In Firefox, the maximum number of connections per session is eight. If you start multiple Firefox instances from an operating system menu or shortcut, all the instances are started in the same process and share a single session. Since the browser will typically need one connection for traditional HTTP requests, you can theoretically have a maximum of seven HTTP streaming connections with the server across all your browser instances. </p>
+<p>In either case, if the limit of connections per session is reached, the next attempt to connect to the server using a streaming channel will fail. BlazeDS provides an elegant fall back mechanism to handle such situations: The client always tries to connect using the first channel in the list of channles defined for the destination in messaging-config.xml. If that connection fails, the client automatically falls back to the next channel in the list. In this example, we defined the following default channelset for all the messaging destinations:</p>
+<p> &lt;default-channels&gt;<br />
+  &nbsp;&nbsp;&nbsp;&nbsp;&lt;channel ref=&quot;my-streaming-amf&quot;/&gt;<br />
+  &nbsp;&nbsp;&nbsp;&nbsp;&lt;channel ref=&quot;my-polling-amf&quot;/&gt;<br />
+  &lt;/default-channels&gt;<br />
+</p>
+<p>In other words, the client application will try to connect using a streaming channel first and will fall back to a polling channel if the streaming connection fails.</p>
+</div>
+<br />
+
+<div class="item">
+  <h3>Sample 7: Publish/Subscribe Messaging (Collaboration Use Case) </h3>
+  <h4>Run the sample:</h4>
+  <ol>
+
+  <li>Click <a href="testdrive-chat/index.html">here</a> to run the application</li>
+  <li>Open the same URL in another browser session to open a second instance of the chat application </li>
+  <li>Type a message in one of the chat clients and click &quot;Send&quot;: the message appears in the two chat clients </li>
+  </ol>
+<h4>Code walkthrough:</h4>
+<p>Open Chat.mxml in the testdrive-chat/src directory  to look at the source code of the application.</p>
+
+<p>Open the following files in a text editor to look at the source code for the server-side  of the application: </p>
+<ul>
+  <li>WEB-INF\flex\messaging-config.xml</li>
+</ul>
+<p> This sample builds on the concepts and APIs introduced in the previous example. To publish a message from a client, you use the send() method of the Producer class. </p>
+<p>The messaging and real time infrastructure available in BlazeDS enables  collaboration and data push applications to be built in a scalable and  reliable manner while preserving the lightweight web deployment model.</p>
+
+</div>
+<br />
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/activemq.xml
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/activemq.xml b/apps/team/WEB-INF/activemq.xml
new file mode 100755
index 0000000..2da9ae5
--- /dev/null
+++ b/apps/team/WEB-INF/activemq.xml
@@ -0,0 +1,36 @@
+<!--
+    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.
+-->
+<!-- START SNIPPET: xbean -->
+<beans
+  xmlns="http://www.springframework.org/schema/beans"
+  xmlns:amq="http://activemq.apache.org/schema/core"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
+  http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
+
+  
+  <broker xmlns="http://activemq.apache.org/schema/core" useJmx="false" persistent="false">
+  
+    <transportConnectors>
+      <transportConnector uri="tcp://localhost:61516"/>      
+    </transportConnectors>
+        
+  </broker>
+  
+</beans>
+<!-- END SNIPPET: xbean -->

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/flex/global.css
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/flex/global.css b/apps/team/WEB-INF/flex/global.css
new file mode 100755
index 0000000..f13e300
--- /dev/null
+++ b/apps/team/WEB-INF/flex/global.css
@@ -0,0 +1,17 @@
+/*
+ * 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.
+ */
+/* global style sheet */

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/flex/messaging-config.xml
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/flex/messaging-config.xml b/apps/team/WEB-INF/flex/messaging-config.xml
new file mode 100755
index 0000000..86208b7
--- /dev/null
+++ b/apps/team/WEB-INF/flex/messaging-config.xml
@@ -0,0 +1,292 @@
+<?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"/>
+        <adapter-definition id="customASAdapter" class="features.messaging.customadapter.CustomActionscriptAdapter"/>
+    </adapters>
+
+    <!-- Basic destinations -->
+
+    <!-- AMF -->
+    <destination id="messaging_AMF" channels="my-amf"/>
+    <destination id="messaging_AMF_Piggyback" channels="my-amf-piggyback"/>
+    <destination id="messaging_AMF_Poll" channels="my-amf-poll"/>
+    <destination id="messaging_AMF_LongPoll" channels="my-amf-longpoll"/>
+    <destination id="messaging_AMF_LongPoll2" channels="my-amf-longpoll2"/>
+    <destination id="messaging_AMF_SecureLongPoll" channels="my-amf-secure-longpoll"/>
+    <destination id="messaging_AMF_Stream" channels="my-amf-stream"/>
+
+    <destination id="messaging_AMF_fallback" channels="bad-amf-stream,my-amf-poll"/>
+
+    <!-- Secure AMF -->
+    <destination id="messaging_SecureAMF" channels="my-secure-amf"/>
+
+    <!-- HTTP -->
+    <destination id="messaging_HTTP" channels="my-http"/>
+    <destination id="messaging_HTTP_Piggyback" channels="my-http-piggyback"/>
+    <destination id="messaging_HTTP_Poll" channels="my-http-poll"/>
+    <destination id="messaging_HTTP_LongPoll" channels="my-http-longpoll"/>
+    <destination id="messaging_HTTP_Stream" channels="my-http-stream"/>
+
+    <destination id="messaging_HTTP_fallback" channels="bad-http-stream,my-http-poll"/>
+
+    <!-- Secure HTTP -->
+    <destination id="messaging_SecureHTTP" channels="my-secure-http"/>
+
+    <!-- Destinations for specific features -->
+
+    <!-- JMS - AMF -->
+    <destination id="messaging_AMF_Poll_JMS_Topic" 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>
+
+    <destination id="messaging_AMF_LongPoll_JMS_Topic" channels="my-amf-longpoll">
+        <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>
+
+    <destination id="messaging_AMF_Poll_JMS_Queue" channels="my-amf-poll">
+        <adapter ref="jms"/>
+        <properties>
+            <jms>
+                <connection-factory>java:comp/env/jms/flex/QueueConnectionFactory</connection-factory>
+                <destination-type>Queue</destination-type>
+                <destination-jndi-name>java:comp/env/jms/queue/flex/simplequeue</destination-jndi-name>
+                <message-type>javax.jms.TextMessage</message-type>
+            </jms>
+        </properties>
+    </destination>
+
+    <!-- JMS - HTTP -->
+    <destination id="messaging_HTTP_Poll_JMS_Topic" channels="my-http-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>
+
+    <destination id="messaging_HTTP_Poll_JMS_Queue" channels="my-http-poll">
+        <adapter ref="jms"/>
+        <properties>
+            <jms>
+                <connection-factory>java:comp/env/jms/flex/QueueConnectionFactory</connection-factory>
+                <destination-type>Queue</destination-type>
+                <destination-jndi-name>java:comp/env/jms/queue/flex/simplequeue</destination-jndi-name>
+                <message-type>javax.jms.TextMessage</message-type>
+            </jms>
+        </properties>
+    </destination>
+
+    <!-- Send and subscribe constraint examples -->
+    <destination id="messaging_AMF_Poll_SendSubscribeConstraint" channels="my-amf-poll">
+        <properties>
+            <server>
+                <send-security-constraint ref="sample-user-custom"/>
+                <subscribe-security-constraint ref="sample-user-custom"/>
+            </server>
+        </properties>
+    </destination>
+
+    <destination id="messaging_AMF_LongPoll_SendSubscribeConstraint" channels="my-amf-longpoll">
+        <properties>
+            <server>
+                <send-security-constraint ref="sample-user-custom"/>
+                <subscribe-security-constraint ref="sample-user-custom"/>
+            </server>
+        </properties>
+    </destination>
+
+    <destination id="messaging_AMF_Stream_SendSubscribeConstraint" channels="my-amf-stream">
+        <properties>
+            <server>
+                <send-security-constraint ref="sample-user-custom"/>
+                <subscribe-security-constraint ref="sample-user-custom"/>
+            </server>
+        </properties>
+    </destination>
+
+    <destination id="messaging_HTTP_Poll_SendSubscribeConstraint" channels="my-http-poll">
+        <properties>
+            <server>
+                <send-security-constraint ref="sample-user-basic"/>
+                <subscribe-security-constraint ref="sample-user-basic"/>
+            </server>
+        </properties>
+    </destination>
+
+    <!-- Subtopics - AMF -->
+    <destination id="messaging_AMF_Poll_Subtopic" channels="my-amf-poll">
+        <properties>
+            <server>
+                <allow-subtopics>true</allow-subtopics>
+                <subtopic-separator>.</subtopic-separator>
+            </server>
+        </properties>
+    </destination>
+
+    <destination id="messaging_AMF_Stream_Subtopic" channels="my-amf-stream">
+        <properties>
+            <server>
+                <allow-subtopics>true</allow-subtopics>
+                <subtopic-separator>.</subtopic-separator>
+            </server>
+        </properties>
+    </destination>
+
+
+    <!-- Subtopics - HTTP -->
+    <destination id="messaging_HTTP_Poll_Subtopic" channels="my-http-poll">
+        <properties>
+            <server>
+                <allow-subtopics>true</allow-subtopics>
+                <subtopic-separator>.</subtopic-separator>
+            </server>
+        </properties>
+    </destination>
+
+    <!-- Clustering - AMF
+    <destination id="messaging_AMF_Poll_Cluster" channels="my-amf-poll-for-cluster">
+      <properties>
+        <network>
+          <cluster ref="default-cluster"/>
+        </network>
+      </properties>
+    </destination>
+    -->
+
+    <!-- Clustering - SecureAMF
+    <destination id="messaging_SecureAMF_Poll_Cluster" channels="my-secure-amf-poll-for-cluster">
+      <properties>
+        <network>
+          <cluster ref="default-cluster"/>
+        </network>
+      </properties>
+    </destination>
+    -->
+
+    <!-- Clustering - HTTP
+    <destination id="messaging_HTTP_Poll_Cluster" channels="my-http-poll-for-cluster">
+      <properties>
+        <network>
+          <cluster ref="default-cluster"/>
+        </network>
+      </properties>
+    </destination>
+    -->
+
+    <!-- Clustering - SecureHTTP
+    <destination id="messaging_SecureHTTP_Poll_Cluster" channels="my-secure-http-poll-for-cluster">
+      <properties>
+        <network>
+          <cluster ref="default-cluster"/>
+        </network>
+      </properties>
+    </destination>
+    -->
+
+    <!-- BEGIN destinations for testing MessageBrokerFilters -->
+    <destination id="filteredChat" channels="my-amf-longpoll" />
+    <destination id="dev/null" channels="my-amf-longpoll" />
+    <!-- END destinations for testing MessageBrokerFilters -->
+
+    <!-- BEGIN - Throttling samples -->
+
+    <destination id="messaging_ThrottleInbound_PolicyError">
+        <properties>
+            <network>
+                <throttle-inbound policy="ERROR" max-frequency="8" max-client-frequency="4"/>
+            </network>
+        </properties>
+        <channels>
+            <channel ref="my-amf-poll"/>
+            <channel ref="my-amf-longpoll"/>
+            <channel ref="my-amf-stream"/>
+            <channel ref="my-http-poll"/>
+            <channel ref="my-http-longpoll"/>
+            <channel ref="my-http-stream"/>
+        </channels>
+    </destination>
+
+    <destination id="messaging_ThrottleInbound_PolicyIgnore">
+        <properties>
+            <network>
+                <throttle-inbound policy="IGNORE" max-frequency="8" max-client-frequency="4"/>
+            </network>
+        </properties>
+        <channels>
+            <channel ref="my-amf-poll"/>
+            <channel ref="my-amf-longpoll"/>
+            <channel ref="my-amf-stream"/>
+            <channel ref="my-http-poll"/>
+            <channel ref="my-http-longpoll"/>
+            <channel ref="my-http-stream"/>
+        </channels>
+    </destination>
+
+    <destination id="messaging_ThrottleOutbound_PolicyIgnore">
+        <properties>
+            <network>
+                <throttle-outbound policy="IGNORE" max-frequency="8" max-client-frequency="4"/>
+            </network>
+        </properties>
+        <channels>
+            <channel ref="my-amf"/>
+            <channel ref="my-amf-poll"/>
+            <channel ref="my-amf-longpoll"/>
+            <channel ref="my-amf-stream"/>
+            <channel ref="my-http"/>
+            <channel ref="my-http-poll"/>
+            <channel ref="my-http-longpoll"/>
+            <channel ref="my-http-stream"/>
+        </channels>
+    </destination>
+
+    <!-- END - Throttling samples -->
+
+    <!-- A sample that uses a custom adapter. -->
+    <destination id="messaging_CustomAdapter" channels="my-amf-stream">
+        <adapter ref="customASAdapter"/>
+    </destination>
+    
+</service>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/flex/proxy-config.xml
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/flex/proxy-config.xml b/apps/team/WEB-INF/flex/proxy-config.xml
new file mode 100755
index 0000000..60be1f4
--- /dev/null
+++ b/apps/team/WEB-INF/flex/proxy-config.xml
@@ -0,0 +1,47 @@
+<?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>
+
+    <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>
+
+    <default-channels>
+        <channel ref="my-http"/>
+        <channel ref="my-amf"/>
+    </default-channels>
+
+    <destination id="DefaultHTTP">
+    </destination>
+
+    <destination id="DefaultHTTPS">
+    </destination>
+
+</service>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/flex/remoting-config.xml
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/flex/remoting-config.xml b/apps/team/WEB-INF/flex/remoting-config.xml
new file mode 100755
index 0000000..4a28a1e
--- /dev/null
+++ b/apps/team/WEB-INF/flex/remoting-config.xml
@@ -0,0 +1,96 @@
+<?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="remoting_AMF" channels="my-amf">
+        <properties>
+            <source>features.remoting.EchoService</source>
+        </properties>
+    </destination>
+
+    <destination id="remoting_AMFX" channels="my-http">
+        <properties>
+            <source>features.remoting.EchoService</source>
+        </properties>
+    </destination>
+
+    <!-- Destination that can be used to push messages from the server -->
+    <destination id="serverPushRO" channels="my-amf">
+        <properties>
+            <source>features.messaging.serverpush.ServerPushService</source>
+            <scope>application</scope>
+        </properties>
+    </destination>
+
+    <!-- A destination protected by a basic security constraint.
+         Security constraints are defined in services-config.xml
+    -->
+    <destination id="remoting_AMF_SecurityConstraint_Basic" channels="my-amf-loginafterdisconnect">
+        <properties>
+            <source>features.remoting.EchoService</source>
+        </properties>
+        <security>
+            <security-constraint ref="sample-user-basic"/>
+        </security>
+    </destination>
+
+    <!-- A destination protected by a custom security constraint.
+         Security constraints are defined in services-config.xml
+    -->
+    <destination id="remoting_AMF_SecurityConstraint_Custom" channels="my-amf-loginafterdisconnect">
+        <properties>
+            <source>features.remoting.EchoService</source>
+        </properties>
+        <security>
+            <security-constraint ref="sample-user-custom"/>
+        </security>
+    </destination>
+
+    <!-- Used by Flex clients to create destinations at runtime -->
+    <destination id="RuntimeConfigurator" channels="my-amf">
+        <properties>
+            <source>features.runtimeconfig.RuntimeConfigurator</source>
+        </properties>
+    </destination>
+
+    <!-- BEGIN destinations for testing MessageBrokerFilters -->
+    <destination id="filteredAck">
+        <properties>
+            <source>features.remoting.EchoService</source>
+        </properties>
+    </destination>
+
+    <destination id="filteredFault">
+        <properties>
+            <source>features.remoting.EchoService</source>
+        </properties>
+    </destination>
+    <!-- END destinations for testing MessageBrokerFilters -->
+
+</service>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/flex/services-config.xml
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/flex/services-config.xml b/apps/team/WEB-INF/flex/services-config.xml
new file mode 100755
index 0000000..42c2296
--- /dev/null
+++ b/apps/team/WEB-INF/flex/services-config.xml
@@ -0,0 +1,414 @@
+<?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-include file-path="remoting-config.xml" />
+        <service-include file-path="proxy-config.xml" />
+        <service-include file-path="messaging-config.xml" />
+    </services>
+
+    <security>
+        <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 constraints that are used by samples in features/security-constraints/ -->
+        <!-- Basic authentication -->
+        <security-constraint id="sample-user-basic">
+            <auth-method>Basic</auth-method>
+            <!-- Roles are defined by the application server.
+                In Tomcat, they are in conf/tomcat-users.xml
+            -->
+            <roles>
+                <role>sampleusers</role>
+            </roles>
+        </security-constraint>
+        <!-- Custom authentication -->
+        <security-constraint id="sample-user-custom">
+            <auth-method>Custom</auth-method>
+            <roles>
+                <role>sampleusers</role>
+            </roles>
+        </security-constraint>
+    </security>
+
+    <channels>
+
+        <!-- AMF -->
+
+        <!-- A regular AMF channel -->
+        <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>
+                <serialization>
+                    <ignore-property-errors>false</ignore-property-errors>
+                    <include-read-only>true</include-read-only>
+                    <!-- Enable this for remoting_AMF_Vector.mxml test to work -->
+                     <prefer-vectors>false</prefer-vectors>
+                      -->
+                </serialization>
+            </properties>
+        </channel-definition>
+
+        <!-- A secure AMF channel -->
+        <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>
+                <!--HTTPS requests on some browsers do not work when pragma "no-cache" are set-->
+                <add-no-cache-headers>false</add-no-cache-headers>
+            </properties>
+        </channel-definition>
+
+        <!-- A piggybacking AMF channel -->
+        <channel-definition id="my-amf-piggyback" class="mx.messaging.channels.AMFChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/myamfpiggyback"
+            class="flex.messaging.endpoints.AMFEndpoint"/>
+            <properties>
+                <polling-enabled>false</polling-enabled>
+                <piggybacking-enabled>true</piggybacking-enabled>
+            </properties>
+        </channel-definition>
+
+        <!-- A polling AMF channel -->
+        <channel-definition id="my-amf-poll" class="mx.messaging.channels.AMFChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/myamfpoll"
+            class="flex.messaging.endpoints.AMFEndpoint"/>
+            <properties>
+                <polling-enabled>true</polling-enabled>
+                <polling-interval-seconds>3</polling-interval-seconds>
+            </properties>
+        </channel-definition>
+
+        <!-- A long polling AMF channel -->
+        <channel-definition id="my-amf-longpoll" class="mx.messaging.channels.AMFChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/myamflongpoll"
+            class="flex.messaging.endpoints.AMFEndpoint"/>
+            <properties>
+                <user-agent-settings>
+                    <!--
+                    <user-agent match-on="MSIE" max-streaming-connections-per-session=""1 kickstart-bytes="2048"/>
+                    <user-agent match-on="Firefox" max-streaming-connections-per-session="1" kickstart-bytes="0"/>
+                     -->
+                    <!-- MSIE 5, 6, 7 limit is 2. -->
+                    <user-agent match-on="MSIE" max-persistent-connections-per-session="1" kickstart-bytes="2048"/>
+                    <!-- MSIE 8 limit is 6. -->
+                    <user-agent match-on="MSIE 8" max-persistent-connections-per-session="5" kickstart-bytes="2048"/>
+                    <!-- Firefox 1, 2 limit is 2. -->
+                    <user-agent match-on="Firefox" max-persistent-connections-per-session="1"/>
+                    <!-- Firefox 3 limit is 6. -->
+                    <user-agent match-on="Firefox/3" max-persistent-connections-per-session="5"/>
+                    <!-- Safari 3, 4 limit is 4. -->
+                    <user-agent match-on="Safari" max-persistent-connections-per-session="3"/>
+                    <!-- Chrome 0, 1, 2 limit is 6. -->
+                    <user-agent match-on="Chrome" max-persistent-connections-per-session="5"/>
+                    <!-- Opera 7, 9 limit is 4.-->
+                    <user-agent match-on="Opera" max-persistent-connections-per-session="3"/>
+                    <!-- Opera 8 limit is 8. -->
+                    <user-agent match-on="Opera 8" max-persistent-connections-per-session="7"/>
+                    <!-- Opera 10 limit is 8. -->
+                    <user-agent match-on="Opera 9.8" max-persistent-connections-per-session="7"/>
+                </user-agent-settings>
+                <polling-enabled>true</polling-enabled>
+                <polling-interval-seconds>0</polling-interval-seconds>
+                <max-waiting-poll-requests>10</max-waiting-poll-requests>
+                <wait-interval-millis>-1</wait-interval-millis>
+                <client-wait-interval-millis>3000</client-wait-interval-millis>
+            </properties>
+        </channel-definition>
+
+        <!-- A second long polling AMF channel -->
+        <channel-definition id="my-amf-longpoll2" class="mx.messaging.channels.AMFChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/myamflongpoll2"
+            class="flex.messaging.endpoints.AMFEndpoint"/>
+            <properties>
+                <user-agent-settings>
+                    <user-agent match-on="Firefox" max-streaming-connections-per-session="4"/>
+                </user-agent-settings>
+                <polling-enabled>true</polling-enabled>
+                <polling-interval-seconds>0</polling-interval-seconds>
+                <max-waiting-poll-requests>10</max-waiting-poll-requests>
+                <wait-interval-millis>-1</wait-interval-millis>
+                <client-wait-interval-millis>3000</client-wait-interval-millis>
+            </properties>
+        </channel-definition>
+
+        <!-- A secure long polling AMF channel -->
+        <channel-definition id="my-amf-secure-longpoll" class="mx.messaging.channels.SecureAMFChannel">
+            <endpoint url="https://{server.name}:9400/{context.root}/messagebroker/mysecureamflongpoll"
+            class="flex.messaging.endpoints.SecureAMFEndpoint"/>
+            <properties>
+                <user-agent-settings>
+                    <user-agent match-on="Firefox" max-streaming-connections-per-session="4"/>
+                </user-agent-settings>
+                <polling-enabled>true</polling-enabled>
+                <polling-interval-seconds>0</polling-interval-seconds>
+                <max-waiting-poll-requests>10</max-waiting-poll-requests>
+                <wait-interval-millis>-1</wait-interval-millis>
+                <client-wait-interval-millis>3000</client-wait-interval-millis>
+            </properties>
+        </channel-definition>
+
+        <!-- A streaming AMF channel with default options left in -->
+        <channel-definition id="my-amf-stream" class="mx.messaging.channels.StreamingAMFChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/myamfstream"
+            class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
+            <properties>
+                <connection-idle-timeout-minutes>2</connection-idle-timeout-minutes>
+                <max-streaming-clients>10</max-streaming-clients>
+                <server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis>
+                <user-agent-settings>
+                    <user-agent match-on="MSIE" kickstart-bytes="2048" max-streaming-connections-per-session="1"/>
+                    <user-agent match-on="Firefox" kickstart-bytes="0" max-streaming-connections-per-session="4"/>
+                </user-agent-settings>
+            </properties>
+        </channel-definition>
+
+        <channel-definition id="bad-amf-stream" class="mx.messaging.channels.StreamingAMFChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/badamfstream"
+            class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
+            <properties>
+                <idle-timeout-minutes>0</idle-timeout-minutes>
+                <max-streaming-clients>10</max-streaming-clients>
+                <server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis>
+                <user-agent-settings>
+                    <user-agent match-on="MSIE" kickstart-bytes="2048" max-streaming-connections-per-session="0"/>
+                    <user-agent match-on="Firefox" kickstart-bytes="0" max-streaming-connections-per-session="4"/>
+                </user-agent-settings>
+            </properties>
+        </channel-definition>
+
+        <!-- HTTP -->
+
+        <!-- A regular HTTP channel -->
+        <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"/>
+            <properties>
+                <polling-enabled>false</polling-enabled>
+            </properties>
+        </channel-definition>
+
+        <!-- A secure HTTP channel -->
+        <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>
+                <!--HTTPS requests on some browsers do not work when pragma "no-cache" are set-->
+                <add-no-cache-headers>false</add-no-cache-headers>
+            </properties>
+        </channel-definition>
+
+        <!-- A piggybacking HTTP channel -->
+        <channel-definition id="my-http-piggyback" class="mx.messaging.channels.HTTPChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/myhttppiggyback"
+            class="flex.messaging.endpoints.HTTPEndpoint"/>
+            <properties>
+                <polling-enabled>false</polling-enabled>
+                <piggybacking-enabled>true</piggybacking-enabled>
+            </properties>
+        </channel-definition>
+
+        <!-- A polling HTTP channel -->
+        <channel-definition id="my-http-poll" class="mx.messaging.channels.HTTPChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/myhttppoll"
+            class="flex.messaging.endpoints.HTTPEndpoint"/>
+            <properties>
+                <polling-enabled>true</polling-enabled>
+                <polling-interval-seconds>3</polling-interval-seconds>
+            </properties>
+        </channel-definition>
+
+        <!-- A long polling HTTP channel -->
+        <channel-definition id="my-http-longpoll" class="mx.messaging.channels.HTTPChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/myhttplongpoll"
+            class="flex.messaging.endpoints.HTTPEndpoint"/>
+            <properties>
+                <polling-enabled>true</polling-enabled>
+                <polling-interval-seconds>0</polling-interval-seconds>
+                <max-waiting-poll-requests>10</max-waiting-poll-requests>
+                <wait-interval-millis>-1</wait-interval-millis>
+                <client-wait-interval-millis>3000</client-wait-interval-millis>
+            </properties>
+        </channel-definition>
+
+        <!-- A streaming HTTP channel with default options left out -->
+        <channel-definition id="my-http-stream" class="mx.messaging.channels.StreamingHTTPChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/myhttpstream"
+            class="flex.messaging.endpoints.StreamingHTTPEndpoint"/>
+        </channel-definition>
+
+        <channel-definition id="bad-http-stream" class="mx.messaging.channels.StreamingHTTPChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/badhttpstream"
+            class="flex.messaging.endpoints.StreamingHTTPEndpoint"/>
+            <properties>
+                <max-streaming-clients>10</max-streaming-clients>
+                <server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis>
+                <user-agent-settings>
+                    <user-agent match-on="MSIE" kickstart-bytes="2048" max-streaming-connections-per-session="0"/>
+                    <user-agent match-on="Firefox" kickstart-bytes="0" max-streaming-connections-per-session="0"/>
+                </user-agent-settings>
+            </properties>
+        </channel-definition>
+
+        <!-- Clustering -->
+
+        <!-- A polling AMF channel to be used in clustered destinations. This means
+             all tokens (server.name, server.port, etc.) removed from endpoint url
+        -->
+        <channel-definition id="my-amf-poll-for-cluster" class="mx.messaging.channels.AMFChannel">
+            <endpoint url="http://localhost:8400/team/messagebroker/myamfpollforcluster"
+            class="flex.messaging.endpoints.AMFEndpoint"/>
+            <properties>
+                <polling-enabled>true</polling-enabled>
+                <polling-interval-seconds>3</polling-interval-seconds>
+            </properties>
+        </channel-definition>
+
+
+        <!-- A polling HTTP channel to be used in clustered destinations. This means
+             all tokens (server.name, server.port, etc.) removed from endpoint url
+        -->
+        <channel-definition id="my-http-poll-for-cluster" class="mx.messaging.channels.HTTPChannel">
+            <endpoint url="http://localhost:8400/team/messagebroker/myhttppollforcluster"
+            class="flex.messaging.endpoints.HTTPEndpoint"/>
+            <properties>
+                <polling-enabled>true</polling-enabled>
+                <polling-interval-seconds>3</polling-interval-seconds>
+            </properties>
+        </channel-definition>
+
+        <!-- A secure polling AMF channel to be used in clustered destinations. This means
+             all tokens (server.name, server.port, etc.) removed from endpoint url
+        -->
+        <channel-definition id="my-secure-amf-poll-for-cluster" class="mx.messaging.channels.SecureAMFChannel">
+            <endpoint url="https://localhost:9400/team/messagebroker/mysecureamfpollforcluster"
+            class="flex.messaging.endpoints.SecureAMFEndpoint"/>
+            <properties>
+                <!--HTTPS requests on some browsers do not work when pragma "no-cache" are set-->
+                <add-no-cache-headers>false</add-no-cache-headers>
+                <polling-enabled>true</polling-enabled>
+                <polling-interval-seconds>3</polling-interval-seconds>
+            </properties>
+        </channel-definition>
+
+        <!-- A secure polling HTTP channel to be used in clustered destinations. This means
+             all tokens (server.name, server.port, etc.) removed from endpoint url
+        -->
+        <channel-definition id="my-secure-http-poll-for-cluster" class="mx.messaging.channels.SecureHTTPChannel">
+            <endpoint url="https://localhost:9400/team/messagebroker/mysecurehttppollforcluster"
+            class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
+            <properties>
+                <!--HTTPS requests on some browsers do not work when pragma "no-cache" are set-->
+                <add-no-cache-headers>false</add-no-cache-headers>
+                <polling-enabled>true</polling-enabled>
+                <polling-interval-seconds>3</polling-interval-seconds>
+            </properties>
+        </channel-definition>
+
+        <!-- A regular AMF channel with login-after-disconnect enabled. This channel is used
+             by security-constraint samples.
+         -->
+        <channel-definition id="my-amf-loginafterdisconnect" class="mx.messaging.channels.AMFChannel">
+            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfloginafterdisconnect"
+                class="flex.messaging.endpoints.AMFEndpoint"/>
+            <properties>
+                <polling-enabled>false</polling-enabled>
+                <login-after-disconnect>true</login-after-disconnect>
+            </properties>
+        </channel-definition>
+
+    </channels>
+
+    <logging>
+        <target class="flex.messaging.log.ConsoleTarget" level="Debug">
+            <properties>
+                <prefix>[BlazeDS] </prefix>
+                <includeDate>false</includeDate>
+                <includeTime>false</includeTime>
+                <includeLevel>true</includeLevel>
+                <includeCategory>true</includeCategory>
+            </properties>
+            <filters>
+            <!--
+                <pattern>Endpoint.FlexSession</pattern>
+                <pattern>Client.FlexClient</pattern>
+                <pattern>Client.MessageClient</pattern>
+                <pattern>Endpoint.*</pattern>
+                <pattern>Service.*</pattern>
+                <pattern>Configuration</pattern>
+            -->
+            </filters>
+        </target>
+    </logging>
+
+    <system>
+        <!--
+        <enforce-endpoint-validation>false</enforce-endpoint-validation>
+        -->
+        <manageable>true</manageable>
+        <!--
+        <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>
+
+    <clusters>
+        <cluster id="default-cluster" properties="jgroups-tcp.xml" default="false" url-load-balancing="true"/>
+        <cluster id="udp-cluster" properties="jgroups-udp.xml" default="false" url-load-balancing="true"/>
+    </clusters>
+
+    <flex-client>
+    <!--
+        <timeout-minutes>45</timeout-minutes>
+        <heartbeat-interval-millis>5000</heartbeat-interval-millis>
+    -->
+    </flex-client>
+
+    <!-- Deserialization validator, uncomment the one you want to use -->
+    <validators>
+        <!--
+        <validator class="features.validators.deserialization.TestDeserializationValidator"/>
+        -->
+        <!--
+        <validator class="flex.messaging.validators.ClassDeserializationValidator">
+            <properties>
+                <disallow-classes>
+                </disallow-classes>
+                <allow-classes>
+                    <class name="java.*"/>
+                    <class name="\[Ljava.*"/>
+                    <class name="flex.*"/>
+                </allow-classes>
+             </properties>
+        </validator>
+        -->
+    </validators>
+</services-config>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/flex/user_classes/add_your_as_and_swc_files_here.txt
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/flex/user_classes/add_your_as_and_swc_files_here.txt b/apps/team/WEB-INF/flex/user_classes/add_your_as_and_swc_files_here.txt
new file mode 100755
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/WEB-INF/src/features/bootstrapservices/HTTPProxyBootstrapService.java
----------------------------------------------------------------------
diff --git a/apps/team/WEB-INF/src/features/bootstrapservices/HTTPProxyBootstrapService.java b/apps/team/WEB-INF/src/features/bootstrapservices/HTTPProxyBootstrapService.java
new file mode 100755
index 0000000..b0dbc38
--- /dev/null
+++ b/apps/team/WEB-INF/src/features/bootstrapservices/HTTPProxyBootstrapService.java
@@ -0,0 +1,254 @@
+/*
+ * 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.bootstrapservices;
+
+import flex.messaging.config.ConfigMap;
+import flex.messaging.services.AbstractBootstrapService;
+import flex.messaging.services.Service;
+import flex.messaging.services.http.ExternalProxySettings;
+import flex.messaging.services.http.HTTPConnectionManagerSettings;
+import flex.messaging.services.http.HTTPProxyAdapter;
+import flex.messaging.services.http.HTTPProxyDestination;
+import flex.messaging.services.http.SOAPProxyAdapter;
+
+/**
+ * This BootstrapService is used to dynamicaly create a HTTPProxy Service along 
+ * with its HTTPProxy Destinations without the need for any configuration files.
+ */
+public class HTTPProxyBootstrapService extends AbstractBootstrapService
+{
+    
+    /**
+     * Called by the <code>MessageBroker</code> after all of the server 
+     * components are created but right before they are started. This is 
+     * usually the place to create dynamic components.
+     * 
+     * @param id Id of the <code>AbstractBootstrapService</code>.
+     * @param properties Properties for the <code>AbstractBootstrapService</code>. 
+     */
+    public void initialize(String id, ConfigMap properties)
+    {
+        Service httpProxyService = createService();
+        createDestination1(httpProxyService);
+        createDestination2(httpProxyService);
+        createDestination3(httpProxyService);
+    }
+
+    /**
+     * Called by the <code>MessageBroker</code> as server starts. Useful for
+     * custom code that needs to run after all the components are initialized
+     * and the server is starting up. 
+     */    
+    public void start()
+    {
+        // No-op.
+    }
+
+    /**
+     * Called by the <code>MessageBroker</code> as server stops. Useful for 
+     * custom code that needs to run as the server is shutting down.
+     */
+    public void stop()
+    {
+        // No-op.
+    }
+
+    /*
+    <?xml version="1.0" encoding="UTF-8"?>
+    <service id="proxy-service" class="flex.messaging.services.HTTPProxyService">
+
+    <!-- Example proxy-config.xml -->
+
+    <properties>
+        <connection-manager>
+            <max-total-connections>100</max-total-connections>
+            <default-max-connections-per-host>2</default-max-connections-per-host>
+        </connection-manager>
+
+        <!-- Allow self-signed certificates; should not be used in production -->
+        <allow-lax-ssl>true</allow-lax-ssl>
+
+        <external-proxy>
+            <server>10.10.10.10</server>
+            <port>3128</port>
+            <nt-domain>mycompany</nt-domain>
+            <username>flex</username>
+            <password>flex</password>
+        </external-proxy>
+    </properties>
+
+    <!-- Server-side code that directly contacts a destination object or service -->
+    <adapters>
+        <!--
+           id: a unique id specifying the adapter
+           class: the Flex Enterprise class which implements the adapter
+             possible values: flex.messaging.services.http.HTTPProxyAdapter, flex.messaging.services.http.SOAPProxyAdapter
+           default: an optional attribute identifying the adapter to use when none is specified for the service
+        -->
+        <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>
+
+    <default-channels>
+        <!--
+           Set the ref id of the default channels to use as transport for this service.
+           The channel is defined elsewhere using the channel-definition tag.
+        -->
+        <channel ref="my-http"/>
+        <channel ref="my-amf"/>
+    </default-channels>
+     */
+    private Service createService()
+    {
+        String serviceId = "proxy-service";
+        String serviceClass = "flex.messaging.services.HTTPProxyService";        
+        Service httpProxyService = broker.createService(serviceId, serviceClass);
+
+        // Note that <properties> are not set on the service since they are
+        // adapter related properties and will be configured at adapter level
+
+        httpProxyService.registerAdapter("http-proxy", "flex.messaging.services.http.HTTPProxyAdapter");
+        httpProxyService.registerAdapter("soap-proxy", "flex.messaging.services.http.SOAPProxyAdapter");
+        httpProxyService.setDefaultAdapter("http-proxy");
+
+        httpProxyService.addDefaultChannel("my-http");
+        httpProxyService.addDefaultChannel("my-amf");
+
+        return httpProxyService;
+    }
+
+    /*
+    <!-- Example default http destination -->
+    <destination id="DefaultHTTP">
+        <properties>
+            <dynamic-url>http://{server.name}:/{context.root}/</dynamic-url>
+        </properties>
+    </destination>
+
+    <!-- Example http proxy adapter destination -->
+    <destination id="myHTTPService">
+        <properties>
+            <!-- The endpoint available to the http proxy service -->
+            <url>http://www.mycompany.com/services/myservlet</url>
+
+            <!-- Wild card endpoints available to the http proxy services -->
+            <dynamic-url>http://www.mycompany.com/services/*</dynamic-url>
+        </properties>
+    </destination>
+     */
+    public void createDestination1(Service service)
+    {
+        String destinationId = "DefaultHTTP";
+        HTTPProxyDestination destination = (HTTPProxyDestination)service.createDestination(destinationId);
+
+        destination.addDynamicUrl("http://{server.name}:*/{context.root}/*");
+
+        String adapterId = "http-proxy";
+        HTTPProxyAdapter adapter = (HTTPProxyAdapter)destination.createAdapter(adapterId);
+        addProperties(adapter);
+    }
+
+    /*
+    <!-- Example http proxy adapter destination -->
+    <destination id="myHTTPService">
+        <properties>
+            <!-- The endpoint available to the http proxy service -->
+            <url>http://www.mycompany.com/services/myservlet</url>
+
+            <!-- Wild card endpoints available to the http proxy services -->
+            <dynamic-url>http://www.mycompany.com/services/*</dynamic-url>
+        </properties>
+    </destination>
+     */
+    private void createDestination2(Service service)
+    {
+        String destinationId = "myHTTPService";
+        HTTPProxyDestination destination = (HTTPProxyDestination)service.createDestination(destinationId);
+        
+        destination.setDefaultUrl("http://www.mycompany.com/services/myservlet");
+        destination.addDynamicUrl("http://www.mycompany.com/services/*");
+
+        String adapterId = "http-proxy";
+        HTTPProxyAdapter adapter = (HTTPProxyAdapter)destination.createAdapter(adapterId);
+        addProperties(adapter);
+    }
+
+    /*
+    <!-- Example soap proxy adapter destination -->
+    <destination id="echoSoapService">
+        <properties>
+            <!-- The location of the wsdl defined for soap proxy services -->
+            <wsdl>http://{server.name}:{server.port}/myapp/echo?wsdl</wsdl>
+
+            <!-- The soap endpoints available for access defined for soap proxy services -->
+            <soap>http://{server.name}:/myapp/echo</soap>
+        </properties>
+
+        <!-- A specific adapter ref for the destination may be defined -->
+        <adapter ref="soap-proxy"/>
+    </destination>     
+     */
+    private void createDestination3(Service service)
+    {
+        String destinationId = "echoSoapService";
+        HTTPProxyDestination destination = (HTTPProxyDestination)service.createDestination(destinationId);
+
+        destination.setDefaultUrl("http://{server.name}:{server.port}/myapp/echo?wsdl");
+        destination.addDynamicUrl("http://{server.name}:/myapp/echo");
+
+        String adapterId = "soap-proxy";
+        SOAPProxyAdapter adapter = (SOAPProxyAdapter)destination.createAdapter(adapterId);
+        addProperties(adapter);
+    }
+
+    /*
+    <properties>
+        <connection-manager>
+            <max-total-connections>100</max-total-connections>
+            <default-max-connections-per-host>2</default-max-connections-per-host>
+        </connection-manager>
+
+        <!-- Allow self-signed certificates; should not be used in production -->
+        <allow-lax-ssl>true</allow-lax-ssl>
+
+        <external-proxy>
+            <server>10.10.10.10</server>
+            <port>3128</port>
+            <nt-domain>mycompany</nt-domain>
+            <username>flex</username>
+            <password>flex</password>
+        </external-proxy>
+    </properties>     
+     */
+    private void addProperties(HTTPProxyAdapter adapter)
+    {
+        HTTPConnectionManagerSettings cms = new HTTPConnectionManagerSettings();
+        cms.setMaxTotalConnections(100);
+        cms.setDefaultMaxConnectionsPerHost(2);
+        adapter.setConnectionManagerSettings(cms);
+
+        adapter.setAllowLaxSSL(true);
+
+        ExternalProxySettings eps = new ExternalProxySettings();
+        eps.setProxyServer("10.10.10.10");
+        eps.setProxyPort(3128);
+        eps.setNTDomain("mycompany");
+        eps.setUsername("flex");
+        eps.setPassword("flex");
+        adapter.setExternalProxySettings(eps);
+    }
+}


[35/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/history/history.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/history/history.js b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/history/history.js
new file mode 100755
index 0000000..0f82450
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/history/history.js
@@ -0,0 +1,722 @@
+/*
+ * 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.
+ */
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        ie8: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+        if (browser.version == 8)
+        {
+            browser.ie = false;
+            browser.ie8 = true;
+        }
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    function hashChangeHandler()
+    {
+        currentHref = document.location.href;
+        var flexAppUrl = getHash();
+        //ADR: to fix multiple
+        if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+            var pl = getPlayers();
+            for (var i = 0; i < pl.length; i++) {
+                pl[i].browserURLChange(flexAppUrl);
+            }
+        } else {
+            getPlayer().browserURLChange(flexAppUrl);
+        }
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+        var i;
+
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+                for (i = 0; i < o.length; i++) {
+                    if (typeof o[i].browserURLChange != "undefined")
+                        return o[i];
+                }
+                for (i = 0; i < e.length; i++) {
+                    if (typeof e[i].browserURLChange != "undefined")
+                        return e[i];
+                }
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+            for (i = 0; i < e.length; i++) {
+                if (typeof e[i].browserURLChange != "undefined")
+                {
+                    return e[i];
+                }
+            }
+            for (i = 0; i < o.length; i++) {
+                if (typeof o[i].browserURLChange != "undefined")
+                {
+                    return o[i];
+                }
+            }
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var i;
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+                        currentHref = document.location.href;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                var flexAppUrl = getHash();
+                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
+                {    
+                    // If it did change and we're running Safari 3.x or earlier, 
+                    // then we have to look the old state up in our hand-maintained 
+                    // array since document.location.hash won't have changed, 
+                    // then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                    flexAppUrl = historyHash[currentHistoryLength];
+                }
+
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            iframe.src = 'javascript:false;'; 
+
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox || browser.ie8)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+
+        if (browser.ie8)        
+            document.body.onhashchange = hashChangeHandler;
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        },
+        getUserAgent: function() {
+            return navigator.userAgent;
+        },
+        getPlatform: function() {
+            return navigator.platform;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/history/historyFrame.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/history/historyFrame.html b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/history/historyFrame.html
new file mode 100755
index 0000000..63bdd3e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/history/historyFrame.html
@@ -0,0 +1,45 @@
+<!--
+  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>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/index.template.html b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/index.template.html
new file mode 100755
index 0000000..e3e9c81
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/swfobject.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/swfobject.js b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/swfobject.js
new file mode 100755
index 0000000..07730fa
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/html-template/swfobject.js
@@ -0,0 +1,793 @@
+/*
+ * 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.
+ */
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+	
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+		ON_READY_STATE_CHANGE = "onreadystatechange",
+		
+		win = window,
+		doc = document,
+		nav = navigator,
+		
+		plugin = false,
+		domLoadFnArr = [main],
+		regObjArr = [],
+		objIdArr = [],
+		listenersArr = [],
+		storedAltContent,
+		storedAltContentId,
+		storedCallbackFn,
+		storedCallbackObj,
+		isDomLoaded = false,
+		isExpressInstallActive = false,
+		dynamicStylesheet,
+		dynamicStylesheetMedia,
+		autoHideShow = true,
+	
+	/* Centralized function for browser feature detection
+		- User agent string detection is only used when no good alternative is possible
+		- Is executed directly for optimal performance
+	*/	
+	ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+			u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+				plugin = true;
+				ie = false; // cascaded feature detection for Internet Explorer
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			try {
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+				if (a) { // a will return null when ActiveX is disabled
+					d = a.GetVariable("$version");
+					if (d) {
+						ie = true; // cascaded feature detection for Internet Explorer
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+			}
+			catch(e) {}
+		}
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+	}(),
+	
+	/* Cross-browser onDomLoad
+		- Will fire an event as soon as the DOM of a web page is loaded
+		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+		- Regular onload serves as fallback
+	*/ 
+	onDomLoad = function() {
+		if (!ua.w3) { return; }
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+			callDomLoadFunctions();
+		}
+		if (!isDomLoaded) {
+			if (typeof doc.addEventListener != UNDEF) {
+				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+			}		
+			if (ua.ie && ua.win) {
+				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+					if (doc.readyState == "complete") {
+						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+						callDomLoadFunctions();
+					}
+				});
+				if (win == top) { // if not inside an iframe
+					(function(){
+						if (isDomLoaded) { return; }
+						try {
+							doc.documentElement.doScroll("left");
+						}
+						catch(e) {
+							setTimeout(arguments.callee, 0);
+							return;
+						}
+						callDomLoadFunctions();
+					})();
+				}
+			}
+			if (ua.wk) {
+				(function(){
+					if (isDomLoaded) { return; }
+					if (!/loaded|complete/.test(doc.readyState)) {
+						setTimeout(arguments.callee, 0);
+						return;
+					}
+					callDomLoadFunctions();
+				})();
+			}
+			addLoadEvent(callDomLoadFunctions);
+		}
+	}();
+	
+	function callDomLoadFunctions() {
+		if (isDomLoaded) { return; }
+		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+			t.parentNode.removeChild(t);
+		}
+		catch (e) { return; }
+		isDomLoaded = true;
+		var dl = domLoadFnArr.length;
+		for (var i = 0; i < dl; i++) {
+			domLoadFnArr[i]();
+		}
+	}
+	
+	function addDomLoadEvent(fn) {
+		if (isDomLoaded) {
+			fn();
+		}
+		else { 
+			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+		}
+	}
+	
+	/* Cross-browser onload
+		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+		- Will fire an event as soon as a web page including all of its assets are loaded 
+	 */
+	function addLoadEvent(fn) {
+		if (typeof win.addEventListener != UNDEF) {
+			win.addEventListener("load", fn, false);
+		}
+		else if (typeof doc.addEventListener != UNDEF) {
+			doc.addEventListener("load", fn, false);
+		}
+		else if (typeof win.attachEvent != UNDEF) {
+			addListener(win, "onload", fn);
+		}
+		else if (typeof win.onload == "function") {
+			var fnOld = win.onload;
+			win.onload = function() {
+				fnOld();
+				fn();
+			};
+		}
+		else {
+			win.onload = fn;
+		}
+	}
+	
+	/* Main function
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
+	*/
+	function main() { 
+		if (plugin) {
+			testPlayerVersion();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Detect the Flash Player version for non-Internet Explorer browsers
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+		  a. Both release and build numbers can be detected
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+	*/
+	function testPlayerVersion() {
+		var b = doc.getElementsByTagName("body")[0];
+		var o = createElement(OBJECT);
+		o.setAttribute("type", FLASH_MIME_TYPE);
+		var t = b.appendChild(o);
+		if (t) {
+			var counter = 0;
+			(function(){
+				if (typeof t.GetVariable != UNDEF) {
+					var d = t.GetVariable("$version");
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				else if (counter < 10) {
+					counter++;
+					setTimeout(arguments.callee, 10);
+					return;
+				}
+				b.removeChild(o);
+				t = null;
+				matchVersions();
+			})();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Perform Flash Player and SWF version matching; static publishing only
+	*/
+	function matchVersions() {
+		var rl = regObjArr.length;
+		if (rl > 0) {
+			for (var i = 0; i < rl; i++) { // for each registered object element
+				var id = regObjArr[i].id;
+				var cb = regObjArr[i].callbackFn;
+				var cbObj = {success:false, id:id};
+				if (ua.pv[0] > 0) {
+					var obj = getElementById(id);
+					if (obj) {
+						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+							setVisibility(id, true);
+							if (cb) {
+								cbObj.success = true;
+								cbObj.ref = getObjectById(id);
+								cb(cbObj);
+							}
+						}
+						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+							var att = {};
+							att.data = regObjArr[i].expressInstall;
+							att.width = obj.getAttribute("width") || "0";
+							att.height = obj.getAttribute("height") || "0";
+							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+							// parse HTML object param element's name-value pairs
+							var par = {};
+							var p = obj.getElementsByTagName("param");
+							var pl = p.length;
+							for (var j = 0; j < pl; j++) {
+								if (p[j].getAttribute("name").toLowerCase() != "movie") {
+									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+								}
+							}
+							showExpressInstall(att, par, id, cb);
+						}
+						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+							displayAltContent(obj);
+							if (cb) { cb(cbObj); }
+						}
+					}
+				}
+				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+					setVisibility(id, true);
+					if (cb) {
+						var o = getObjectById(id); // test whether there is an HTML object element or not
+						if (o && typeof o.SetVariable != UNDEF) { 
+							cbObj.success = true;
+							cbObj.ref = o;
+						}
+						cb(cbObj);
+					}
+				}
+			}
+		}
+	}
+	
+	function getObjectById(objectIdStr) {
+		var r = null;
+		var o = getElementById(objectIdStr);
+		if (o && o.nodeName == "OBJECT") {
+			if (typeof o.SetVariable != UNDEF) {
+				r = o;
+			}
+			else {
+				var n = o.getElementsByTagName(OBJECT)[0];
+				if (n) {
+					r = n;
+				}
+			}
+		}
+		return r;
+	}
+	
+	/* Requirements for Adobe Express Install
+		- only one instance can be active at a time
+		- fp 6.0.65 or higher
+		- Win/Mac OS only
+		- no Webkit engines older than version 312
+	*/
+	function canExpressInstall() {
+		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+	}
+	
+	/* Show the Adobe Express Install dialog
+		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+	*/
+	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+		isExpressInstallActive = true;
+		storedCallbackFn = callbackFn || null;
+		storedCallbackObj = {success:false, id:replaceElemIdStr};
+		var obj = getElementById(replaceElemIdStr);
+		if (obj) {
+			if (obj.nodeName == "OBJECT") { // static publishing
+				storedAltContent = abstractAltContent(obj);
+				storedAltContentId = null;
+			}
+			else { // dynamic publishing
+				storedAltContent = obj;
+				storedAltContentId = replaceElemIdStr;
+			}
+			att.id = EXPRESS_INSTALL_ID;
+			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+				fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+			if (typeof par.flashvars != UNDEF) {
+				par.flashvars += "&" + fv;
+			}
+			else {
+				par.flashvars = fv;
+			}
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			if (ua.ie && ua.win && obj.readyState != 4) {
+				var newObj = createElement("div");
+				replaceElemIdStr += "SWFObjectNew";
+				newObj.setAttribute("id", replaceElemIdStr);
+				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						obj.parentNode.removeChild(obj);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			createSWF(att, par, replaceElemIdStr);
+		}
+	}
+	
+	/* Functions to abstract and display alternative content
+	*/
+	function displayAltContent(obj) {
+		if (ua.ie && ua.win && obj.readyState != 4) {
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			var el = createElement("div");
+			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+			el.parentNode.replaceChild(abstractAltContent(obj), el);
+			obj.style.display = "none";
+			(function(){
+				if (obj.readyState == 4) {
+					obj.parentNode.removeChild(obj);
+				}
+				else {
+					setTimeout(arguments.callee, 10);
+				}
+			})();
+		}
+		else {
+			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+		}
+	} 
+
+	function abstractAltContent(obj) {
+		var ac = createElement("div");
+		if (ua.win && ua.ie) {
+			ac.innerHTML = obj.innerHTML;
+		}
+		else {
+			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+			if (nestedObj) {
+				var c = nestedObj.childNodes;
+				if (c) {
+					var cl = c.length;
+					for (var i = 0; i < cl; i++) {
+						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+							ac.appendChild(c[i].cloneNode(true));
+						}
+					}
+				}
+			}
+		}
+		return ac;
+	}
+	
+	/* Cross-browser dynamic SWF creation
+	*/
+	function createSWF(attObj, parObj, id) {
+		var r, el = getElementById(id);
+		if (ua.wk && ua.wk < 312) { return r; }
+		if (el) {
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+				attObj.id = id;
+			}
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+				var att = "";
+				for (var i in attObj) {
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+						if (i.toLowerCase() == "data") {
+							parObj.movie = attObj[i];
+						}
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							att += ' class="' + attObj[i] + '"';
+						}
+						else if (i.toLowerCase() != "classid") {
+							att += ' ' + i + '="' + attObj[i] + '"';
+						}
+					}
+				}
+				var par = "";
+				for (var j in parObj) {
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+					}
+				}
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+				r = getElementById(attObj.id);	
+			}
+			else { // well-behaving browsers
+				var o = createElement(OBJECT);
+				o.setAttribute("type", FLASH_MIME_TYPE);
+				for (var m in attObj) {
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							o.setAttribute("class", attObj[m]);
+						}
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+							o.setAttribute(m, attObj[m]);
+						}
+					}
+				}
+				for (var n in parObj) {
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+						createObjParam(o, n, parObj[n]);
+					}
+				}
+				el.parentNode.replaceChild(o, el);
+				r = o;
+			}
+		}
+		return r;
+	}
+	
+	function createObjParam(el, pName, pValue) {
+		var p = createElement("param");
+		p.setAttribute("name", pName);	
+		p.setAttribute("value", pValue);
+		el.appendChild(p);
+	}
+	
+	/* Cross-browser SWF removal
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
+	*/
+	function removeSWF(id) {
+		var obj = getElementById(id);
+		if (obj && obj.nodeName == "OBJECT") {
+			if (ua.ie && ua.win) {
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						removeObjectInIE(id);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			else {
+				obj.parentNode.removeChild(obj);
+			}
+		}
+	}
+	
+	function removeObjectInIE(id) {
+		var obj = getElementById(id);
+		if (obj) {
+			for (var i in obj) {
+				if (typeof obj[i] == "function") {
+					obj[i] = null;
+				}
+			}
+			obj.parentNode.removeChild(obj);
+		}
+	}
+	
+	/* Functions to optimize JavaScript compression
+	*/
+	function getElementById(id) {
+		var el = null;
+		try {
+			el = doc.getElementById(id);
+		}
+		catch (e) {}
+		return el;
+	}
+	
+	function createElement(el) {
+		return doc.createElement(el);
+	}
+	
+	/* Updated attachEvent function for Internet Explorer
+		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+	*/	
+	function addListener(target, eventType, fn) {
+		target.attachEvent(eventType, fn);
+		listenersArr[listenersArr.length] = [target, eventType, fn];
+	}
+	
+	/* Flash Player and SWF content version matching
+	*/
+	function hasPlayerVersion(rv) {
+		var pv = ua.pv, v = rv.split(".");
+		v[0] = parseInt(v[0], 10);
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+		v[2] = parseInt(v[2], 10) || 0;
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+	}
+	
+	/* Cross-browser dynamic CSS creation
+		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+	*/	
+	function createCSS(sel, decl, media, newStyle) {
+		if (ua.ie && ua.mac) { return; }
+		var h = doc.getElementsByTagName("head")[0];
+		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+		var m = (media && typeof media == "string") ? media : "screen";
+		if (newStyle) {
+			dynamicStylesheet = null;
+			dynamicStylesheetMedia = null;
+		}
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+			// create dynamic stylesheet + get a global reference to it
+			var s = createElement("style");
+			s.setAttribute("type", "text/css");
+			s.setAttribute("media", m);
+			dynamicStylesheet = h.appendChild(s);
+			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+			}
+			dynamicStylesheetMedia = m;
+		}
+		// add style rule
+		if (ua.ie && ua.win) {
+			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+				dynamicStylesheet.addRule(sel, decl);
+			}
+		}
+		else {
+			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+			}
+		}
+	}
+	
+	function setVisibility(id, isVisible) {
+		if (!autoHideShow) { return; }
+		var v = isVisible ? "visible" : "hidden";
+		if (isDomLoaded && getElementById(id)) {
+			getElementById(id).style.visibility = v;
+		}
+		else {
+			createCSS("#" + id, "visibility:" + v);
+		}
+	}
+
+	/* Filter to avoid XSS attacks
+	*/
+	function urlEncodeIfNecessary(s) {
+		var regex = /[\\\"<>\.;]/;
+		var hasBadChars = regex.exec(s) != null;
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+	}
+	
+	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+	*/
+	var cleanup = function() {
+		if (ua.ie && ua.win) {
+			window.attachEvent("onunload", function() {
+				// remove listeners to avoid memory leaks
+				var ll = listenersArr.length;
+				for (var i = 0; i < ll; i++) {
+					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+				}
+				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+				var il = objIdArr.length;
+				for (var j = 0; j < il; j++) {
+					removeSWF(objIdArr[j]);
+				}
+				// cleanup library's main closures to avoid memory leaks
+				for (var k in ua) {
+					ua[k] = null;
+				}
+				ua = null;
+				for (var l in swfobject) {
+					swfobject[l] = null;
+				}
+				swfobject = null;
+			});
+		}
+	}();
+	
+	return {
+		/* Public API
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
+		*/ 
+		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+			if (ua.w3 && objectIdStr && swfVersionStr) {
+				var regObj = {};
+				regObj.id = objectIdStr;
+				regObj.swfVersion = swfVersionStr;
+				regObj.expressInstall = xiSwfUrlStr;
+				regObj.callbackFn = callbackFn;
+				regObjArr[regObjArr.length] = regObj;
+				setVisibility(objectIdStr, false);
+			}
+			else if (callbackFn) {
+				callbackFn({success:false, id:objectIdStr});
+			}
+		},
+		
+		getObjectById: function(objectIdStr) {
+			if (ua.w3) {
+				return getObjectById(objectIdStr);
+			}
+		},
+		
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+			var callbackObj = {success:false, id:replaceElemIdStr};
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+				setVisibility(replaceElemIdStr, false);
+				addDomLoadEvent(function() {
+					widthStr += ""; // auto-convert to string
+					heightStr += "";
+					var att = {};
+					if (attObj && typeof attObj === OBJECT) {
+						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+							att[i] = attObj[i];
+						}
+					}
+					att.data = swfUrlStr;
+					att.width = widthStr;
+					att.height = heightStr;
+					var par = {}; 
+					if (parObj && typeof parObj === OBJECT) {
+						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+							par[j] = parObj[j];
+						}
+					}
+					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+							if (typeof par.flashvars != UNDEF) {
+								par.flashvars += "&" + k + "=" + flashvarsObj[k];
+							}
+							else {
+								par.flashvars = k + "=" + flashvarsObj[k];
+							}
+						}
+					}
+					if (hasPlayerVersion(swfVersionStr)) { // create SWF
+						var obj = createSWF(att, par, replaceElemIdStr);
+						if (att.id == replaceElemIdStr) {
+							setVisibility(replaceElemIdStr, true);
+						}
+						callbackObj.success = true;
+						callbackObj.ref = obj;
+					}
+					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+						att.data = xiSwfUrlStr;
+						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+						return;
+					}
+					else { // show alternative content
+						setVisibility(replaceElemIdStr, true);
+					}
+					if (callbackFn) { callbackFn(callbackObj); }
+				});
+			}
+			else if (callbackFn) { callbackFn(callbackObj);	}
+		},
+		
+		switchOffAutoHideShow: function() {
+			autoHideShow = false;
+		},
+		
+		ua: ua,
+		
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		},
+		
+		hasFlashPlayerVersion: hasPlayerVersion,
+		
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
+			if (ua.w3) {
+				return createSWF(attObj, parObj, replaceElemIdStr);
+			}
+			else {
+				return undefined;
+			}
+		},
+		
+		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+			if (ua.w3 && canExpressInstall()) {
+				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+			}
+		},
+		
+		removeSWF: function(objElemIdStr) {
+			if (ua.w3) {
+				removeSWF(objElemIdStr);
+			}
+		},
+		
+		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+			if (ua.w3) {
+				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+			}
+		},
+		
+		addDomLoadEvent: addDomLoadEvent,
+		
+		addLoadEvent: addLoadEvent,
+		
+		getQueryParamValue: function(param) {
+			var q = doc.location.search || doc.location.hash;
+			if (q) {
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+				if (param == null) {
+					return urlEncodeIfNecessary(q);
+				}
+				var pairs = q.split("&");
+				for (var i = 0; i < pairs.length; i++) {
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+					}
+				}
+			}
+			return "";
+		},
+		
+		// For internal usage only
+		expressInstallCallback: function() {
+			if (isExpressInstallActive) {
+				var obj = getElementById(EXPRESS_INSTALL_ID);
+				if (obj && storedAltContent) {
+					obj.parentNode.replaceChild(storedAltContent, obj);
+					if (storedAltContentId) {
+						setVisibility(storedAltContentId, true);
+						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+					}
+					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+				}
+				isExpressInstallActive = false;
+			} 
+		}
+	};
+}();

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/src/Main.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/src/Main.mxml b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/src/Main.mxml
new file mode 100755
index 0000000..00abc2d
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/spring-blazeds-security-101/src/Main.mxml
@@ -0,0 +1,87 @@
+<?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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx"
+			   applicationComplete="applicationCompleteHandler()">
+	
+	<fx:Script>
+		<![CDATA[
+		
+		import mx.messaging.ChannelSet;
+		import mx.messaging.channels.AMFChannel;
+		import mx.controls.Alert;
+		import mx.rpc.events.FaultEvent;
+		
+		private function applicationCompleteHandler():void
+		{
+			var channel:AMFChannel = new AMFChannel("my-amf", "/samples-spring/messagebroker/amf");
+			var channelSet:ChannelSet = new ChannelSet();
+			channelSet.addChannel(channel);
+			ro.channelSet = channelSet;
+		}
+		
+		private function faultHandler(event:FaultEvent):void
+		{
+			Alert.show(event.fault.faultString, "Error accessing RemoteObject");
+		}
+		
+		private function login():void
+		{
+			ro.channelSet.login(userId.text, password.text);
+		}
+		
+		private function logout():void
+		{
+			ro.channelSet.logout();	
+		}
+		
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<!-- "productService" is defined in Spring's configuration file WEB-INF/config/web-application-config.xml
+		and provides remote access to the org.springframework.flex.samples.product.ProductDAO class --> 
+		<s:RemoteObject id="ro" destination="securedProductService" fault="faultHandler(event)"/>
+	</fx:Declarations>
+	
+	<s:layout>
+		<s:VerticalLayout paddingTop="12" paddingBottom="12" paddingLeft="12" paddingRight="12"/>
+	</s:layout>
+	
+	<mx:Form>
+		<mx:FormItem label="User Id">
+			<s:TextInput id="userId"/>
+		</mx:FormItem>
+		<mx:FormItem label="Password">
+			<s:TextInput id="password" displayAsPassword="true"/>
+		</mx:FormItem>
+		<mx:FormItem direction="horizontal">
+			<s:Button label="Login" click="login()"/>
+			<s:Button label="Logout" click="logout()"/>
+		</mx:FormItem>
+	</mx:Form>
+	
+	<mx:DataGrid dataProvider="{ro.findAll.lastResult}" width="100%" height="100%"/>
+	
+	<!-- the findAll() method is defined in org.springframework.flex.samples.product.ProductDAO -->
+	<s:Button label="Get Data" click="ro.findAll()"/>
+	
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/traderdesktop/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/traderdesktop/.actionScriptProperties b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/.actionScriptProperties
new file mode 100755
index 0000000..de3f3a0
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="traderdesktop.mxml" projectUUID="834611ae-9033-40d8-b18b-0ab770a9b52b" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="traderdesktop.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/traderdesktop/.flexProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/traderdesktop/.flexProperties b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/.flexProperties
new file mode 100755
index 0000000..1d99468
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/.flexProperties
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/traderdesktop/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/traderdesktop/.project b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/.project
new file mode 100755
index 0000000..4c49527
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/.project
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>traderdesktop</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/traderdesktop/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/traderdesktop/build.xml b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/build.xml
new file mode 100755
index 0000000..069a5d0
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/build.xml
@@ -0,0 +1,76 @@
+<?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-spring.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="context.root" value="samples-spring" />
+    <property name="application.name" value="traderdesktop" />
+    <property name="application.file" value="traderdesktop" />
+    <property name="application.bin.dir" value="${samples-spring.war}/traderdesktop" />
+    <property name="application.src.dir" value="${samples-spring.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-spring.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"
+            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-spring/WEB-INF/flex-src/traderdesktop/html-template/history/history.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/history/history.css b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/history/history.css
new file mode 100755
index 0000000..4a7f791
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/history/history.css
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }


[48/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/LogManager.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/LogManager.as b/apps/ds-console/console/containers/LogManager.as
new file mode 100755
index 0000000..a44dc06
--- /dev/null
+++ b/apps/ds-console/console/containers/LogManager.as
@@ -0,0 +1,189 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 console.containers
+{
+    import console.ConsoleManager;
+    import flash.events.Event;
+    import mx.controls.ComboBox;
+    import console.events.ManagementOperationInvokeEvent;
+    import mx.events.ListEvent;
+    import flash.events.MouseEvent;
+    import mx.collections.ArrayCollection;
+    
+    public class LogManager extends UpdateListener
+    {
+        private var _manager:ConsoleManager;
+        private var _logMBean:String;
+        private var _logTree:Array;
+        private var display:LogManagerDisplay;
+        
+        public static var targetLevels:Array = new Array(
+                {label:"NONE", value:"2000"},
+                {label:"FATAL", value:"1000"},
+                {label:"ERROR", value:"8"},
+                {label:"WARN", value:"6"},
+                {label:"INFO", value:"4"},
+                {label:"DEBUG", value:"2"},
+                {label:"ALL", value:"0"}
+            );
+        
+        public function LogManager():void
+        {
+            super();
+            
+            display = new LogManagerDisplay;
+            this.addChild(display);
+            
+            this.label = "Log Manager";
+            
+            _manager = ConsoleManager.getInstance();
+            _manager.registerListener(this, []);
+            
+            // On selecting a log target, invoke 'getTargetFilters' to populate the table of filters
+            display.logTargetSelect.addEventListener(ListEvent.CHANGE, selectLogTarget);
+            display.logTargetLevel.dataProvider = targetLevels;
+            
+            // Handler for removing a target
+            display.deleteCategory.addEventListener(MouseEvent.CLICK,
+                function(e:Event):void {
+                    
+                    _manager.invokeOperation(
+                    
+                    new ManagementOperationInvokeEvent(_logMBean, 
+                        "removeFilterForTarget", 
+                        [display.logTargetSelect.selectedItem, display.currentCategories.selectedItem], 
+                        ["java.lang.String", "java.lang.String"]),
+                        
+                        function (e:Event):void { display.logTargetSelect.dispatchEvent(
+                            new Event(ListEvent.CHANGE)); } );
+                }
+            );
+            
+            // Handler for adding a target
+            display.addFilterButton.addEventListener(MouseEvent.CLICK,
+                function(e:Event):void {
+                    
+                    _manager.invokeOperation(
+                    
+                    new ManagementOperationInvokeEvent(_logMBean, 
+                        "addFilterForTarget", 
+                        [display.logTargetSelect.selectedItem, display.addFilterTextInput.text], 
+                        ["java.lang.String", "java.lang.String"]),
+                        // Simple callback function to refresh the Log View
+                        function (e:Event):void { 
+                            display.logTargetSelect.dispatchEvent(new Event(ListEvent.CHANGE));
+                            display.addFilterTextInput.text = "";
+                        } 
+                    );
+                }
+            );
+            
+            // Handler for adding a target
+            display.addCommonFilterButton.addEventListener(MouseEvent.CLICK,
+                function(e:Event):void {
+                    
+                    _manager.invokeOperation(
+                    
+                    new ManagementOperationInvokeEvent(_logMBean, 
+                        "addFilterForTarget", 
+                        [display.logTargetSelect.selectedItem, display.commonCategories.selectedItem], 
+                        ["java.lang.String", "java.lang.String"]),
+                        // Simple callback function to refresh the Log View
+                        function (e:Event):void { 
+                            display.logTargetSelect.dispatchEvent(new Event(ListEvent.CHANGE));
+                            display.addFilterTextInput.text = "";
+                        } 
+                    );
+                }
+            );
+            
+            // Handler for changing the target's level
+            display.logTargetLevel.addEventListener(ListEvent.CHANGE, function(e:Event):void
+                {
+                    _manager.invokeOperation(
+                    
+                    new ManagementOperationInvokeEvent(_logMBean, 
+                        "changeTargetLevel", 
+                        [display.logTargetSelect.selectedItem, display.logTargetLevel.selectedItem.value], 
+                        ["java.lang.String", "java.lang.String"]),
+                        new Function
+                    );
+                }
+            );
+            
+        }
+        
+        public override function mbeanModelUpdate(model:Object):void
+        {
+            _logTree = _manager.getChildTree("Log");
+            if (_logTree != null && _logTree.length != 0)
+            {
+                _logMBean = _logTree[0]["objectName"]["canonicalName"];
+                // Get the targets for the current application
+                _manager.getAttributes(_logMBean, ["Targets"], this, updateTargets);
+                _manager.getAttributes(_logMBean, ["Categories"], this, updateCommonCats);
+            }
+        }
+        
+        public override function appChanged(s:String):void
+        {
+            mbeanModelUpdate(null);
+        }
+        
+        public function updateCommonCats(e:Event):void
+        {
+            display.commonCategories.dataProvider = (e["result"] as Array)[0].value;
+            display.commonCategories.selectedIndex = 0;
+            display.commonCategories.dispatchEvent(new Event(ListEvent.CHANGE));
+        }
+        
+        public function updateTargets(e:Event):void
+        {
+            var logTargets:Array = (e["result"] as Array)[0].value;
+            display.logTargetSelect.dataProvider = logTargets;
+            display.logTargetSelect.selectedIndex = 0;
+            display.logTargetSelect.dispatchEvent(new Event(ListEvent.CHANGE));
+        }
+        
+        public function updateFilters(e:Event):void
+        {
+            display.currentCategories.dataProvider = e["result"] as Array;
+        }
+        
+        public function selectLogTarget(e:Event):void
+        {
+            _manager.invokeOperation(new ManagementOperationInvokeEvent(_logMBean, 
+                "getTargetFilters", [display.logTargetSelect.selectedItem], ["java.lang.String"]),
+                updateFilters);
+            _manager.invokeOperation(new ManagementOperationInvokeEvent(_logMBean, 
+                "getTargetLevel", [display.logTargetSelect.selectedItem], ["java.lang.String"]),
+                handleGetTargetLevel);
+        }
+        
+        public function handleGetTargetLevel(e:Event):void
+        {
+            var currentLevelInt:String = e["message"]["body"];
+            for (var i:int = 0; i < targetLevels.length; i++)
+            {
+                if (targetLevels[i].value == currentLevelInt)
+                    display.logTargetLevel.selectedIndex = i;
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/LogManagerDisplay.mxml
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/LogManagerDisplay.mxml b/apps/ds-console/console/containers/LogManagerDisplay.mxml
new file mode 100755
index 0000000..969c9d4
--- /dev/null
+++ b/apps/ds-console/console/containers/LogManagerDisplay.mxml
@@ -0,0 +1,54 @@
+<?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:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%">
+    <mx:HBox width="100%" height="100%">
+        <mx:Form>
+            <mx:FormItem label="Log Target:">
+                <mx:ComboBox id="logTargetSelect" />
+            </mx:FormItem>
+            <mx:FormItem label="Target Level:">
+                <mx:ComboBox id="logTargetLevel"></mx:ComboBox>
+            </mx:FormItem>
+            <mx:HRule width="100%"/>
+            <mx:FormItem label="Add a Custom Category">
+                <mx:TextInput id="addFilterTextInput" />
+            </mx:FormItem>
+            <mx:FormItem>
+                <mx:Button label="Add Category" id="addFilterButton" />
+            </mx:FormItem>
+        </mx:Form>
+        <mx:VBox width="100%">
+        <mx:DataGrid id="currentCategories" width="100%">
+            <mx:columns>
+                <mx:DataGridColumn headerText="Current Categories" dataField="filters" />
+            </mx:columns>
+        </mx:DataGrid>
+        <mx:Button label="Remove Category" id="deleteCategory" />
+        </mx:VBox>
+        <mx:VBox width="100%">
+            <mx:DataGrid id="commonCategories" width="100%">
+                <mx:columns>
+                    <mx:DataGridColumn headerText="Common Categories" dataField="common"/>
+                </mx:columns>
+            </mx:DataGrid>
+            <mx:Button label="Add Category" id="addCommonFilterButton" />
+        </mx:VBox>
+    </mx:HBox>
+</mx:VBox>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/Operation.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/Operation.as b/apps/ds-console/console/containers/Operation.as
new file mode 100755
index 0000000..2b9788e
--- /dev/null
+++ b/apps/ds-console/console/containers/Operation.as
@@ -0,0 +1,169 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 console.containers
+{
+
+import flash.events.MouseEvent;
+import mx.containers.HBox;
+import mx.controls.Button;
+import mx.controls.Label;
+import mx.controls.TextInput;
+import mx.messaging.management.MBeanOperationInfo;
+import mx.messaging.management.MBeanParameterInfo;
+
+/**
+ * The Operation container is an HBox that renders UI to invoke an operation on
+ * an MBean. When the operationInfo property of an Operation is set, the current
+ * UI for the Operation is torn down, and new UI is rendered based on the new 
+ * MBeanOperationInfo metadata provided.
+ * <p>
+ * This container/control should not be instantiated directly. A parent OperationSet
+ * container will create nested Operations based on its MBean metadata.
+ */
+public class Operation extends HBox
+{
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 * @private
+	 * Constructor.
+	 */
+	public function Operation(wrapper:OperationSet)
+	{
+		super();
+		
+		_wrapper = wrapper;
+		_values = [];
+		_signature = [];
+	}
+	
+	/**
+	 * @private
+	 * The parent container.
+	 */
+	private var _wrapper:OperationSet;
+	
+	/**
+	 * @private
+	 * Array to store references to controls for each argument.
+	 */
+	private var _values:Array; 
+	
+	/**
+	 * @private
+	 * Array to store the type signature for this operation.
+	 */
+	private var _signature:Array;
+	
+	//----------------------------------
+	//  MBeanOperationInfo
+	//----------------------------------
+
+	/**
+	 * @private
+	 * Storage for the operation info.
+	 */	
+	private var _operationInfo:MBeanOperationInfo;
+
+	/**
+	 * MBean operation metadata that drives the UI for this component.
+	 */
+	public function get operationInfo():MBeanOperationInfo
+	{
+		return _operationInfo;
+	}
+
+	public function set operationInfo(value:MBeanOperationInfo):void
+	{
+                var i:int;
+
+		_operationInfo = value;
+		// Remove any existing children and refs to argument values.
+		_values.splice(0);
+		_signature.splice(0);
+		for (i = numChildren - 1; i >= 0; --i)
+		{
+			removeChildAt(i);	
+		}		
+		
+		// Build UI for this operation.
+		var opName:Button = new Button();
+		opName.label = value.name;
+		opName.addEventListener("click", invokeOperation);		
+		addChild(opName);	
+		
+		var openParen:Label = new Label();
+		openParen.text = " (";
+		addChild(openParen);
+		
+		var comma:Label = new Label();
+		comma.text = ", ";
+		var paramName:String;
+		var n:int = value.signature.length;
+		for (i = 0; i < n; ++i)
+		{
+			var pName:Label = new Label();
+			paramName = value.signature[i].name;
+			if (paramName.length > 0)
+			{
+				pName.text = paramName;	
+			}
+			else
+			{
+				pName.text = "p" + (i + 1);				
+			}
+			addChild(pName);
+			var pValue:TextInput = new TextInput();
+			addChild(pValue);
+			_values[i] = pValue;
+			_signature[i] = value.signature[i].type;
+			if (i != (n - 1))
+			{
+				addChild(comma);
+			}
+		}
+		
+		var closeParen:Label = new Label();
+		closeParen.text = " ) ";
+		addChild(closeParen);
+	}
+	
+	/**
+	 * @private
+	 * Calls back into the parent OperationSet to dispatch an
+	 * event for this operation invocation request.
+	 */
+	private function invokeOperation(e:MouseEvent):void
+	{
+		var argsToPass:Array = [];
+		var n:int = _values.length;	
+		for (var i:int = 0; i < n; ++i)
+		{
+			argsToPass.push(_values[i].text);	
+		}	
+		_wrapper.dispatchInvokeEvent(_operationInfo.name, argsToPass, _signature);
+	}
+}	
+	
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/OperationSet.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/OperationSet.as b/apps/ds-console/console/containers/OperationSet.as
new file mode 100755
index 0000000..98ca6de
--- /dev/null
+++ b/apps/ds-console/console/containers/OperationSet.as
@@ -0,0 +1,149 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 console.containers
+{
+
+import console.events.ManagementOperationInvokeEvent;
+
+import mx.containers.*;
+import mx.messaging.management.MBeanInfo;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ * Broadcast when a request has been made to invoke an Operation within this OperationSet.
+ */
+[Event(name="invoke", type="console.events.ManagementOperationInvokeEvent")]
+
+/**
+ * The OperationSet is a VBox containing an Operation for each operation exposed by a
+ * MBean. When the mbeanInfo property is set, the current UI of the OperationSet is torn
+ * down and new UI is built based upon the MBeanInfo metadata provided.
+ *
+ * <p><b>MXML Syntax</b></p>
+ *
+ * <p>The <code>&lt;mx:OperationSet&gt;</code> tag inherits all the properties
+ * of its parent classes and adds the following properties:</p>
+ *
+ * <p>
+ * <pre>
+ * &lt;mx:Button
+ *   mbeanInfo="<i>No default</i>."
+ * /&gt;
+ * </pre>
+ * </p>
+ */
+public class OperationSet extends VBox
+{
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  Constructor.
+	 */
+	public function OperationSet()
+	{
+		super();
+	}
+
+
+
+
+	//----------------------------------
+	//  MBeanOperationInfo
+	//----------------------------------
+	
+	private var _mbeanName:String;
+	public function set mbeanName(name:String):void
+	{
+	    _mbeanName = name;
+	}
+
+	/**
+	 *  @private
+	 *  Storage for the Mbean info.
+	 */
+	private var _mbeanInfo:MBeanInfo;
+
+	/**
+	 *  MBean metadata to drive the UI for this component.
+	 */
+	public function get mbeanInfo():MBeanInfo
+	{
+		return _mbeanInfo;
+	}
+	
+		
+	private var _tabnav:TabNavigator;
+	public function set tabnav(p:TabNavigator):void
+	{
+	    _tabnav = p;
+	}
+
+	public function set mbeanInfo(value:MBeanInfo):void
+	{
+                var i:int;
+
+		_mbeanInfo = value;
+		// Remove any existing children.
+		for (i = numChildren - 1; i >= 0; --i)
+		{
+			removeChildAt(i);
+		}
+		if (value != null)
+		{
+			var n:int = value.operations.length;
+
+            // If there are no operations for this MBean, disable the Operations tab.
+            if (n == 0)
+                _tabnav.getTabAt(1).enabled = false;
+
+            // Otherwise, build UI for the set of operations exposed by this MBean.
+            else
+            {
+                _tabnav.getTabAt(1).enabled = true;
+                for (i = 0; i < n; ++i)
+                {
+                    var op:Operation = new Operation(this);
+                    addChild(op);
+                    op.operationInfo = value.operations[i];
+                }
+            }
+		}
+	}
+
+	/**
+	 *  Raises an operation invoke event for a nested Operation.
+	 */
+	public function dispatchInvokeEvent(name:String, values:Array, signature:Array):void
+	{
+		var event:ManagementOperationInvokeEvent = new ManagementOperationInvokeEvent(_mbeanName, name, values, signature);
+		dispatchEvent(event);
+	}
+
+}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/PollableAttributeChart.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/PollableAttributeChart.as b/apps/ds-console/console/containers/PollableAttributeChart.as
new file mode 100755
index 0000000..a8470c5
--- /dev/null
+++ b/apps/ds-console/console/containers/PollableAttributeChart.as
@@ -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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package console.containers
+{
+    import mx.charts.LineChart;
+    import mx.charts.series.LineSeries;
+
+    public class PollableAttributeChart extends LineChart
+    {
+        function PollableAttributeChart(provider:Object):void
+        {
+            super();
+            
+            dataProvider = provider;
+            this.percentHeight = 100;
+            this.percentWidth = 100;
+            
+            var series:LineSeries = new LineSeries;
+            series.dataProvider = provider;
+            series.yField = "value";
+            this.addChild(series);
+            
+            initialize();
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/ServerManager.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/ServerManager.as b/apps/ds-console/console/containers/ServerManager.as
new file mode 100755
index 0000000..719556c
--- /dev/null
+++ b/apps/ds-console/console/containers/ServerManager.as
@@ -0,0 +1,138 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 console.containers
+{
+    import console.ConsoleManager;
+    import mx.collections.ArrayCollection;
+    import mx.events.ListEvent;
+    import flash.events.Event;
+    import mx.charts.LineChart;
+    import mx.charts.series.LineSeries;
+    import mx.utils.ObjectProxy;
+    import flash.utils.setInterval;
+    import mx.collections.ICollectionView;
+    import console.data.Bindable3DHashMap;
+    import flash.events.TextEvent;
+    import console.events.ManagementOperationInvokeEvent;
+    import mx.controls.DataGrid;
+    import mx.events.DataGridEvent;
+    import mx.events.FlexEvent;
+    
+    public class ServerManager extends UpdateListener
+    {
+        private var _manager:ConsoleManager;
+        private var display:ServerManagerDisplay;
+        private var dataCache:Bindable3DHashMap;
+        private var pollableAttributes:Object;
+        private var visibleTypes:Array;
+        
+        public function ServerManager():void
+        {
+            super();
+            display = new ServerManagerDisplay;
+            this.addChild(display);
+            
+            this.label = "Server Management";
+            display.scalarProperties.addEventListener(ListEvent.CHANGE, selectedScalar);
+            display.pollableProperties.addEventListener(ListEvent.CHANGE, selectedPollable);
+            _manager = ConsoleManager.getInstance();
+            _manager.registerListener(this, [{type: ConsoleManager.GENERAL_OPERATION, poll: false},
+                                             {type: ConsoleManager.GENERAL_SERVER, poll: false},
+                                             {type: ConsoleManager.GENERAL_POLLABLE, poll: true}]);
+            setupDataCache();
+        }
+        
+        public override function dataUpdate(type:int, data:Object):void
+        {
+            var dataArray:ArrayCollection = new ArrayCollection;
+            
+            for (var name:String in data)
+            {
+
+                var propertyArrayForMBean:Array = data[name];
+                
+                for (var i:int = 0; i < propertyArrayForMBean.length; i++)
+                {
+                    dataCache.update(String(type), propertyArrayForMBean[i].name, propertyArrayForMBean[i].value);
+                }
+            }
+            
+            if (type == ConsoleManager.GENERAL_POLLABLE)
+                pollableAttributes = data;
+        }
+              
+        private function setupDataCache():void
+        {
+            dataCache = new Bindable3DHashMap();
+            dataCache.update(String(ConsoleManager.GENERAL_OPERATION),null,null);
+            dataCache.update(String(ConsoleManager.GENERAL_POLLABLE),null,null);
+            dataCache.update(String(ConsoleManager.GENERAL_SERVER),null,null);
+            
+            display.scalarProperties.dataProvider = dataCache.getBindableKeyArray(String(ConsoleManager.GENERAL_SERVER));
+            display.pollableProperties.dataProvider = dataCache.getBindableKeyArray(String(ConsoleManager.GENERAL_POLLABLE));
+        }
+        
+        private function invokeOp(mbean:String, operation:String, value:String):void
+        {
+            _manager.invokeOperation(
+                new ManagementOperationInvokeEvent(mbean, operation, [value], ["java.lang.String"]),
+                function (e:Event):void {
+                    
+                }
+            );
+        }
+        
+        private function selectedScalar(e:Event):void
+        {
+            // It's possible that the data has changed since it was clicked because of polling
+            // if the selected item is null, then return.
+            // TODO: Handle this more gracefully.
+            if (display.scalarProperties.selectedItem == -1) return;
+            
+            var attr:String = display.scalarProperties.selectedItem.propertyName;
+            var mbean:String = display.scalarProperties.selectedItem.mbeanName;
+            display.selectedProperty.text = attr;
+            display.pollableProperties.selectedIndex = -1;
+        }
+        
+        private function selectedPollable(e:Event):void
+        {
+            // It's possible that the data has changed since it was clicked because of polling
+            // if the selected item is null, then return.
+            // TODO: Handle this more gracefully.
+            if (display.pollableProperties.selectedItem == null) return;
+            
+            var attr:String = display.pollableProperties.selectedItem.Property
+            display.selectedProperty.text = attr;
+            
+            display.attrgraph.dataProvider = dataCache.getBindableDataArray(String(ConsoleManager.GENERAL_POLLABLE), attr);
+            display.attrgraphSeries.dataProvider = dataCache.getBindableDataArray(String(ConsoleManager.GENERAL_POLLABLE), attr);
+            display.scalarProperties.selectedIndex = -1;
+        }
+        
+        public override function appChanged(s:String):void
+        {
+            display.attrgraph.dataProvider = null;
+            display.attrgraphSeries.dataProvider = null;
+            display.selectedProperty.text = "None";
+            setupDataCache();
+            _manager.updateData(this);
+        }                
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/ServerManagerDisplay.mxml
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/ServerManagerDisplay.mxml b/apps/ds-console/console/containers/ServerManagerDisplay.mxml
new file mode 100755
index 0000000..2bf1152
--- /dev/null
+++ b/apps/ds-console/console/containers/ServerManagerDisplay.mxml
@@ -0,0 +1,54 @@
+<?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" width="100%" height="100%">
+    <mx:HDividedBox width="100%" height="100%">
+        <mx:VBox height="100%" width="400">
+            <mx:DataGrid id="scalarProperties" width="100%">
+                <mx:columns>
+                    <mx:DataGridColumn dataField="mbeanName" visible="false" />
+                    <mx:DataGridColumn headerText="Scalar Property" dataField="Property" />
+                    <mx:DataGridColumn headerText="Value" dataField="Value" />
+                </mx:columns>
+            </mx:DataGrid>
+            <mx:DataGrid id="pollableProperties"  width="100%">
+                <mx:columns>
+                    <mx:DataGridColumn dataField="mbeanName" visible="false" />
+                    <mx:DataGridColumn headerText="Graphable Property" dataField="Property" />
+                    <mx:DataGridColumn headerText="Value" dataField="Value" />
+                </mx:columns>
+            </mx:DataGrid>
+        </mx:VBox>
+        <mx:VDividedBox height="100%">
+            <mx:HBox>
+                <mx:Label text="Selected Attribute" />
+                <mx:Text id="selectedProperty" />
+            </mx:HBox>
+            <mx:LineChart id="attrgraph" width="100%" height="100%">
+                <mx:verticalAxis>
+                    <mx:LinearAxis id="attrgraphAxis" baseAtZero="false" />
+                </mx:verticalAxis>
+                <mx:series>
+                    <mx:LineSeries id="attrgraphSeries" yField="Value" />
+                </mx:series>
+            </mx:LineChart>
+        </mx:VDividedBox>
+    </mx:HDividedBox>
+    
+</mx:Panel>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/UpdateListener.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/UpdateListener.as b/apps/ds-console/console/containers/UpdateListener.as
new file mode 100755
index 0000000..bd3a464
--- /dev/null
+++ b/apps/ds-console/console/containers/UpdateListener.as
@@ -0,0 +1,109 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 console.containers
+{
+    import mx.containers.Canvas;
+    import console.data.Bindable3DHashMap;
+    import mx.collections.ArrayCollection;
+    import mx.messaging.management.ObjectName;
+    
+    public class UpdateListener extends Canvas
+    {
+        protected var _name:String;
+        protected var _model:Object;
+
+        /**
+        * Invoked when the names of the mbeans are retrieved from the server.
+        */
+        public function mbeanModelUpdate(mbeanModel:Object):void
+        {
+            
+        }
+        
+        /**
+        * Invoked when the data for a given type is updated if the implementing class
+        * is registered with the ConsoleManager for the type, and if the implementing class
+        * is set to active in the ConsoleManager.
+        */
+        public function dataUpdate(type:int, data:Object):void
+        {
+            
+        }
+        
+        /**
+        * Invoked when the selected application has changed.  An implementing class might
+        * want to clear any data it is holding onto since the data will be belonging to
+        * objects in an application's MBeans that are no longer being queried.
+        */
+        public function appChanged(s:String):void
+        {
+            
+        }
+
+        /**
+        * If the container only wishes to query a select number of MBeans upon dataUpdate, they should be
+        * visible in a map keyed on the display type containing arrays of the MBean names.
+        * 
+        * If a null value, or any object that the ConsoleManager can't parse, then all
+        * MBeans for all active types are returned upon dataUpdate.
+        */
+        public function get specificMBeansMap():Object
+        {
+            return null;
+        }
+        
+        protected function traverseTreeForObject(node:Object, searchType:String = null, searchObject:String = null):Object
+        {
+            if (node == null)
+            {
+                return null;
+            }
+            else if (node.hasOwnProperty("type"))
+            {
+                // Node is a container of objects of 'type'
+                if (searchType != null)
+                {
+                    if (node.type == searchObject)
+                        return node;
+                }
+            }
+            else if (node.hasOwnProperty("objectName"))
+            {
+                // Node is a specific object, an instance of parent 'type'
+                if (searchObject != null)
+                {
+                    if ((node.objectName as ObjectName).getKeyProperty("id") == searchObject)
+                        return node;
+                }
+            }
+            
+            // recur
+            if (node.hasOwnProperty("children") && (node.children is Array))
+            {
+                for each (var child:Object in (node.children as Array))
+                {
+                    traverseTreeForObject(child, searchType, searchObject);
+                }
+            }
+            
+            // not found
+            return null;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/UpdateManager.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/UpdateManager.as b/apps/ds-console/console/containers/UpdateManager.as
new file mode 100755
index 0000000..1f6d7ec
--- /dev/null
+++ b/apps/ds-console/console/containers/UpdateManager.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 console.containers
+{
+    public interface UpdateManager
+    {
+        function registerListener(listner:UpdateListener, types:Array):void;
+        function unregisterListener(listner:UpdateListener):void;
+        function activateListener(listener:UpdateListener):void;
+        function deactivateListener(listener:UpdateListener):void;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/data/Bindable3DHashMap.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/data/Bindable3DHashMap.as b/apps/ds-console/console/data/Bindable3DHashMap.as
new file mode 100755
index 0000000..5e4088f
--- /dev/null
+++ b/apps/ds-console/console/data/Bindable3DHashMap.as
@@ -0,0 +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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package console.data
+{
+    import mx.collections.ArrayCollection;
+    import mx.utils.ObjectProxy;
+    import flash.events.Event;
+    import mx.events.PropertyChangeEvent;
+    import mx.events.CollectionEvent;
+    import mx.controls.listClasses.ListBase;
+    
+    public class Bindable3DHashMap
+    {
+        public var objects:ObjectProxy;
+        public var objectsForKeyArray:ObjectProxy;
+        
+        public function Bindable3DHashMap()
+        {
+            objects = new ObjectProxy;
+            objectsForKeyArray = new ObjectProxy;
+        }
+        
+        public function updateNoPollable(object:String, key:String, value:*):void
+        {
+		    if (!objectsForKeyArray.hasOwnProperty(object))            
+		        objectsForKeyArray[object] = new ArrayCollection;
+		        
+		    if (!key)
+		        return;
+		        
+		    var keysForKeyArray:ArrayCollection = objectsForKeyArray[object] as ArrayCollection;
+            
+			var foundKey:Boolean = false;
+			for (var i:int = 0; i < keysForKeyArray.length; i++)
+			{
+			    if ((keysForKeyArray[i].hasOwnProperty("Property")) && (keysForKeyArray[i]["Property"] == key))
+			    {
+			        keysForKeyArray[i]["Value"] = value;
+			        foundKey = true;
+			        break;
+			    }
+			}
+			
+			if (!foundKey)
+			    keysForKeyArray.addItem({Property: key, Value:value});
+			    
+			keysForKeyArray.dispatchEvent(new CollectionEvent(CollectionEvent.COLLECTION_CHANGE));
+        }
+        
+		public function update(object:String, key:String, value:*):void
+		{
+		    if (!objects.hasOwnProperty(object))
+		    {
+		        objects[object] = new ObjectProxy;
+		    }
+		    
+		    if (!key)
+		        return;
+		        
+		    var keys:ObjectProxy = objects[object] as ObjectProxy;
+		    
+			if (!keys.hasOwnProperty(key))
+			    keys[key] = new ArrayCollection;
+
+			(keys[key] as ArrayCollection).addItem({Name: key, Value: value});
+			(keys[key] as ArrayCollection).dispatchEvent(new CollectionEvent(CollectionEvent.COLLECTION_CHANGE));
+			
+			updateNoPollable(object, key, value);
+		}
+		
+		public function getBindableKeyArray(object:String):ArrayCollection
+		{
+		    if (!objectsForKeyArray.hasOwnProperty(object))            
+		        objectsForKeyArray[object] = new ArrayCollection;
+		        
+		    return (objectsForKeyArray[object] as ArrayCollection);
+		}
+		
+		public function getBindableDataArray(object:String, key:String):ArrayCollection
+		{
+		    if (!objects.hasOwnProperty(object))
+		        objects[object] = new ObjectProxy;
+		        
+		    var keys:ObjectProxy = objects[object] as ObjectProxy;
+		    return keys[key] as ArrayCollection;
+		}
+		
+		public function clearData():void
+		{
+		    objects = new ObjectProxy;
+		    objectsForKeyArray = new ObjectProxy;
+		}
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/events/ManagementOperationInvokeEvent.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/events/ManagementOperationInvokeEvent.as b/apps/ds-console/console/events/ManagementOperationInvokeEvent.as
new file mode 100755
index 0000000..1390c4d
--- /dev/null
+++ b/apps/ds-console/console/events/ManagementOperationInvokeEvent.as
@@ -0,0 +1,99 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 console.events
+{
+
+import flash.events.Event;
+
+/**
+ * Used to request that an MBean operation be invoked.
+ */
+public class ManagementOperationInvokeEvent extends Event
+{
+    /**
+     * Constructs an instance of this event with the specified type, target,
+     * and message.
+     */
+    public function ManagementOperationInvokeEvent(mbean:String, name:String, values:Array, signature:Array)
+    {
+        super(INVOKE, false, false);
+        _mbean = mbean;
+        _name = name;
+        _values = values;
+        _signature = signature;
+    }
+    
+    /**
+     * The mbean of the operation to invoke.
+     */
+    public function get mbean():String
+    {
+        return _mbean;
+    }
+    
+    /**
+     * The name of the operation to invoke.
+     */
+    public function get name():String
+    {
+        return _name;
+    }
+    
+    /**
+     * The argument values for the operation.
+     */
+    public function get values():Array
+    {
+    	return _values;	
+    }
+    
+    /**
+     * The type signature for operation arguments.
+     */
+    public function get signature():Array
+    {
+    	return _signature;
+    }
+
+	/**
+     * Because this event can be re-dispatched we have to implement clone to
+     * return the appropriate type, otherwise we will get just the standard
+     * event type.
+	 *
+     * @return Clone of this <code>ManagementOperationInvokeEvent</code>
+	 */
+	override public function clone():Event
+	{
+	    return new ManagementOperationInvokeEvent(_mbean, _name, _values, _signature);
+	}
+
+    /**
+     * The event type.
+     */
+    public static const INVOKE:String = "invoke";
+	
+    // private members    
+    private var _name:String;
+    private var _values:Array;
+    private var _signature:Array;
+    private var _mbean:String;
+}
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/README.txt
----------------------------------------------------------------------
diff --git a/apps/samples-spring/README.txt b/apps/samples-spring/README.txt
new file mode 100755
index 0000000..16c2166
--- /dev/null
+++ b/apps/samples-spring/README.txt
@@ -0,0 +1,5 @@
+All of the files contained in this directory and any subdirectories are 
+considered "Sample Code" under the terms of the end user license agreement 
+that accompanies this product. Please consult such end user license agreement 
+for details about your rights with respect to such files.
+

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/classes/commons-logging.properties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/classes/commons-logging.properties b/apps/samples-spring/WEB-INF/classes/commons-logging.properties
new file mode 100755
index 0000000..46c3be4
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/classes/commons-logging.properties
@@ -0,0 +1,19 @@
+# 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.
+
+# suppress logging for 3rd-party libraries using commons-logging
+# Flex logging is not configured here. It is configured through in the logging section of flex-config.xml
+org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
+org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-servlet.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-servlet.xml b/apps/samples-spring/WEB-INF/flex-servlet.xml
new file mode 100755
index 0000000..158453b
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-servlet.xml
@@ -0,0 +1,70 @@
+<?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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:flex="http://www.springframework.org/schema/flex"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+        http://www.springframework.org/schema/flex 
+        http://www.springframework.org/schema/flex/spring-flex-1.5.xsd">
+ 
+    <flex:message-broker>
+        <flex:message-service
+            default-channels="my-streaming-amf,my-longpolling-amf,my-polling-amf" />
+        <flex:secured />
+    </flex:message-broker>
+
+    <!-- Expose the productService bean for BlazeDS remoting -->
+    <flex:remoting-destination ref="productService" />
+
+    <!-- Expose the contactService bean for BlazeDS remoting -->
+    <flex:remoting-destination ref="contactService" />
+
+    <!-- Expose the securedProductService bean for BlazeDS remoting -->
+    <flex:remoting-destination ref="securedProductService" />
+    
+    <!-- Helper for getting the currently authenticated user -->
+    <bean id="securityHelper" class="org.springframework.flex.samples.secured.Security3Helper">
+        <flex:remoting-destination/>
+    </bean>
+
+    <!-- Messaging destinations -->
+    <flex:message-destination id="chat" />
+    <flex:message-destination id="simple-feed" />
+    <flex:message-destination id="market-feed" allow-subtopics="true" subtopic-separator="." />
+
+    <!-- MessageTemplate makes it easy to publish messages -->
+    <bean id="defaultMessageTemplate" class="org.springframework.flex.messaging.MessageTemplate" />
+
+    <!-- Pojo used to start and stop the data feed that pushes data in the 'simple-feed' destination -->
+    <bean id="simpleFeedStarter" class="org.springframework.flex.samples.simplefeed.SimpleFeed">
+        <constructor-arg ref="defaultMessageTemplate" />
+        <flex:remoting-destination />
+    </bean>
+
+    <!-- Pojo used to start and stop the data feed that pushes data in the 'market-feed' destination -->
+    <bean id="marketFeedStarter" class="org.springframework.flex.samples.marketfeed.MarketFeed">
+        <constructor-arg ref="defaultMessageTemplate" />
+        <constructor-arg value="stocklist.xml" />
+        <flex:remoting-destination />
+    </bean>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/chat/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/chat/.actionScriptProperties b/apps/samples-spring/WEB-INF/flex-src/chat/.actionScriptProperties
new file mode 100755
index 0000000..b5390a8
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/chat/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="chat.mxml" projectUUID="46e6c4ea-bda5-466a-9d9a-a020928ae0f8" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="chat.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/chat/.flexProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/chat/.flexProperties b/apps/samples-spring/WEB-INF/flex-src/chat/.flexProperties
new file mode 100755
index 0000000..1d99468
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/chat/.flexProperties
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/chat/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/chat/.project b/apps/samples-spring/WEB-INF/flex-src/chat/.project
new file mode 100755
index 0000000..0cb0ea0
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/chat/.project
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>chat</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/chat/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/chat/build.xml b/apps/samples-spring/WEB-INF/flex-src/chat/build.xml
new file mode 100755
index 0000000..e5ee6d4
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/chat/build.xml
@@ -0,0 +1,76 @@
+<?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-spring.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="context.root" value="samples-spring" />
+    <property name="application.name" value="chat" />
+    <property name="application.file" value="chat" />
+    <property name="application.bin.dir" value="${samples-spring.war}/chat" />
+    <property name="application.src.dir" value="${samples-spring.war}/WEB-INF/flex-src/chat/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-spring.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"
+            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-spring/WEB-INF/flex-src/chat/html-template/history/history.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/chat/html-template/history/history.css b/apps/samples-spring/WEB-INF/flex-src/chat/html-template/history/history.css
new file mode 100755
index 0000000..4a7f791
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/chat/html-template/history/history.css
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }


[17/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/DestinationSettings.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/DestinationSettings.java b/modules/common/src/flex/messaging/config/DestinationSettings.java
new file mode 100755
index 0000000..e063147
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/DestinationSettings.java
@@ -0,0 +1,192 @@
+/*
+ * 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.messaging.config;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Destinations are configured for a particular <code>Service</code>. A
+ * destination's configuration includes an <code>id</code> attribute to provide
+ * a public name for clients to use when sending messages.
+ * <p>
+ * The configuration also specifies which channels are valid to contact the
+ * destination, as well as which adapter a service must use to process
+ * client messages for this destination and any security constraints that need
+ * to be enforced.
+ * </p>
+ *
+ * @see flex.messaging.Destination
+ * @author Peter Farland
+ * @exclude
+ */
+public class DestinationSettings extends PropertiesSettings
+{
+    /**
+     * @exclude
+     */
+    public static final String SERVER_ELEMENT = "server";
+
+    private final String id;
+    private String sourceFile;
+    private List channelSettings;
+    private AdapterSettings adapterSettings;
+    private SecurityConstraint constraint;
+
+    /**
+     * Used to construct a new set of properties to describe a destination.
+     * Note that an identity is required in order for clients to refer to a
+     * destination.
+     *
+     * @param id A string representing the unique identity of this destination.
+     */
+    public DestinationSettings(String id)
+    {
+        this.id = id;
+        channelSettings = new ArrayList();
+    }
+
+    /**
+     * Gets the unique identity used by clients to target a destination.
+     *
+     * @return String the destination's id.
+     */
+    public String getId()
+    {
+        return id;
+    }
+
+    /**
+     * Internal use only.
+     * @exclude
+     */
+    String getSourceFile()
+    {
+        return sourceFile;
+    }
+
+    /**
+     * Internal use only.
+     * @exclude
+     */
+    void setSourceFile(String sourceFile)
+    {
+        this.sourceFile = sourceFile;
+    }
+
+    /*
+     *  CHANNEL SETTINGS
+     */
+
+    /**
+     * Adds a channel to the set of channels that should be used to contact
+     * this destination. The order in which channels are added is significant
+     * (clients use this order to locate an available channel and failover to
+     * the next in the list on failure).
+     *
+     * @param c the <code>ChannelSettings</code> to add to the set of
+     * channel definitions for this destination.
+     */
+    public void addChannelSettings(ChannelSettings c)
+    {
+        if (c != null)
+        {
+            channelSettings.add(c);
+        }
+    }
+
+    /**
+     * Overrides the set of channels that can be used to contact this
+     * destination.
+     *
+     * @param settings A List of <code>ChannelSettings</code>.
+     */
+    public void setChannelSettings(List settings)
+    {
+        channelSettings = settings;
+    }
+
+    /**
+     * Gets the set of channels that can be used to contact this destination.
+     *
+     * @return a <code>java.util.List</code> of <code>ChannelSetting</code>s
+     * describing the channels that can be used to contact this destination.
+     */
+    public List getChannelSettings()
+    {
+        return channelSettings;
+    }
+
+
+    /*
+     *  SECURITY
+     */
+
+    /**
+     * Gets the <code>SecurityConstraint</code> that will be applied to this
+     * destination, or <code>null</code> if no constraint has been registered.
+     *
+     * @return the <code>SecurityConstraint</code> for this destination.
+     */
+    public SecurityConstraint getConstraint()
+    {
+        return constraint;
+    }
+
+    /**
+     * Sets the security constraint to be applied to this destination. Security
+     * constraints restrict which clients can contact this destination. Use
+     * <code>null</code> to remove an existing constraint.
+     *
+     * @param sc the <code>SecurityConstraint</code> to apply to this
+     * destination.
+     */
+    public void setConstraint(SecurityConstraint sc)
+    {
+        constraint = sc;
+    }
+
+    /*
+     *  SERVICE ADAPTER
+     */
+
+    /**
+     * Sets the service adapter to be used when the managing service is
+     * processing messages bound for this destination.
+     *
+     * @param a The <code>AdapterSettings</code> that describe the adapter
+     * to use for this destination.
+     */
+    public void setAdapterSettings(AdapterSettings a)
+    {
+        adapterSettings = a;
+    }
+
+    /**
+     * Gets the adapter to be used for this destination.
+     *
+     * @return <code>AdapterSettings</code> for this destinations adapter.
+     * A <code>null</code> value implies the the default service adapter should
+     * be used.
+     */
+    public AdapterSettings getAdapterSettings()
+    {
+        return adapterSettings;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/FlexClientSettings.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/FlexClientSettings.java b/modules/common/src/flex/messaging/config/FlexClientSettings.java
new file mode 100755
index 0000000..9b24b40
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/FlexClientSettings.java
@@ -0,0 +1,133 @@
+/*
+ * 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.messaging.config;
+
+/**
+ * @exclude
+ */
+public class FlexClientSettings extends PropertiesSettings
+{
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Constructs a FlexClientSettings instance.
+     */
+    public FlexClientSettings()
+    {
+        // Empty for now.
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    private long timeoutMinutes = -1;
+
+    /**
+     * Returns the number of minutes before an idle FlexClient is timed out.
+     *
+     * @return The number of minutes before an idle FlexClient is timed out.
+     */
+    public long getTimeoutMinutes()
+    {
+        return timeoutMinutes;
+    }
+
+    /**
+     * Sets the number of minutes before an idle FlexClient is timed out.
+     *
+     * @param value The number of minutes before an idle FlexClient is timed out.
+     */
+    public void setTimeoutMinutes(long value)
+    {
+        timeoutMinutes = value;
+    }
+
+    private String flexClientOutboundQueueProcessorClassName;
+
+    /**
+     * Returns the name of the default <code>FlexClientOutboundQueueProcessorClass</code>.
+     *
+     * @return The the name of the  default <code>FlexClientOutboundQueueProcessorClass</code>.
+     */
+    public String getFlexClientOutboundQueueProcessorClassName()
+    {
+        return flexClientOutboundQueueProcessorClassName;
+    }
+
+    /**
+     * Sets the name of the default <code>FlexClientOutboundQueueProcessor</code>.
+     *
+     * @param flexClientOutboundQueueProcessorClassName The name of the default <code>FlexClientOutboundQueueProcessor</code>.
+     */
+    public void setFlexClientOutboundQueueProcessorClassName(String flexClientOutboundQueueProcessorClassName)
+    {
+        this.flexClientOutboundQueueProcessorClassName = flexClientOutboundQueueProcessorClassName;
+    }
+
+    private ConfigMap flexClientOutboundQueueProcessorProperties;
+
+    /**
+     * Returns the properties for the default <code>FlexClientOutboundQueueProcessor</code>.
+     *
+     * @return The properties for the default <code>FlexClientOutboundQueueProcessor</code>.
+     */
+    public ConfigMap getFlexClientOutboundQueueProcessorProperties()
+    {
+        return flexClientOutboundQueueProcessorProperties;
+    }
+
+    /**
+     * Sets the properties for the default <code>FlexClientOutboundQueueProcessor</code>.
+     *
+     * @param flexClientOutboundQueueProcessorProperties
+     */
+    public void setFlexClientOutboundQueueProcessorProperties(ConfigMap flexClientOutboundQueueProcessorProperties)
+    {
+        this.flexClientOutboundQueueProcessorProperties = flexClientOutboundQueueProcessorProperties;
+    }
+    
+    private int reliableReconnectDurationMillis;
+    
+    public int getReliableReconnectDurationMillis()
+    {
+        return reliableReconnectDurationMillis;    
+    }
+    
+    public void setReliableReconnectDurationMillis(int value)
+    {
+        reliableReconnectDurationMillis = value;
+    }
+    
+    private int heartbeatIntervalMillis;
+    
+    public int getHeartbeatIntervalMillis()
+    {
+        return heartbeatIntervalMillis;
+    }
+    
+    public void setHeartbeatIntervalMillis(int value)
+    {
+        heartbeatIntervalMillis = value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/LocalFileResolver.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/LocalFileResolver.java b/modules/common/src/flex/messaging/config/LocalFileResolver.java
new file mode 100755
index 0000000..c6c99cd
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/LocalFileResolver.java
@@ -0,0 +1,203 @@
+/*
+ * 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.messaging.config;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FilenameFilter;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Stack;
+
+/**
+ * @exclude
+ */
+public class LocalFileResolver implements ConfigurationFileResolver
+{
+    public static final int CLIENT = 0;
+    public static final int SERVER = 1;
+    public static final int LIVECYCLE = 2;
+
+    private static final int ERR_MSG_INVALID_PATH_CLIENT = 11106;
+    private static final int ERR_MSG_INVALID_PATH_SERVER = 11108;
+    private static final int ERR_MSG_INVALID_PATH_LIVECYCLE = 11122;
+
+    private Stack configurationPathStack = new Stack();
+    int version = CLIENT;
+
+    public LocalFileResolver()
+    {
+    }
+
+    public LocalFileResolver(int version)
+    {
+        this.version = version;
+    }
+
+    public void setErrorMessage(ConfigurationException e, String path)
+    {
+        if (version == LIVECYCLE)
+        {
+            // Invalid location: ''{0}''. Please specify a valid LiveCycle Data Services Configuration file via the LiveCycle Admin UI.
+            e.setMessage(ERR_MSG_INVALID_PATH_LIVECYCLE, new Object[] {path});
+        }
+        else if (version == SERVER)
+        {
+            // Please specify a valid ''services.configuration.file'' in web.xml. You specified ''{0}''. This is not a valid file system path reachable via the app server and is also not a path to a resource in your J2EE application archive.
+            e.setMessage(ERR_MSG_INVALID_PATH_SERVER, new Object[]{path});
+        }
+        else
+        {
+            // Please specify a valid <services/> file path in flex-config.xml.
+            e.setMessage(ERR_MSG_INVALID_PATH_CLIENT);
+        }
+    }
+
+    public InputStream getConfigurationFile(String path)
+    {
+        File f = new File(path);
+        try
+        {
+            if (f != null && f.exists() && f.isAbsolute())
+            {
+                FileInputStream fin = new FileInputStream(f);
+                pushConfigurationFile(f.getParent());
+                return fin;
+            }
+            else
+            {
+                ConfigurationException e = new ConfigurationException();
+                setErrorMessage(e, path);
+                throw e;
+            }
+        }
+        catch (FileNotFoundException ex)
+        {
+            ConfigurationException e = new ConfigurationException();
+            setErrorMessage(e, path);
+            e.setRootCause(ex);
+            throw e;
+        }
+        catch (SecurityException se)
+        {
+            ConfigurationException e = new ConfigurationException();
+            setErrorMessage(e, path);
+            e.setRootCause(se);
+            throw e;
+        }
+    }
+
+    public InputStream getIncludedFile(String src)
+    {
+        String path = configurationPathStack.peek() + File.separator + src;
+        File f = new File(path);
+        try
+        {
+            if (f != null && f.exists() && f.isAbsolute())
+            {
+                FileInputStream fin = new FileInputStream(f);
+                pushConfigurationFile(f.getParent());
+                return fin;
+            }
+            else
+            {
+                // Please specify a valid include file. ''{0}'' is invalid.
+                ConfigurationException e = new ConfigurationException();
+                e.setMessage(11107, new Object[] {path});
+                throw e;
+            }
+        }
+        catch (FileNotFoundException ex)
+        {
+            // Please specify a valid include file. ''{0}'' is invalid.
+            ConfigurationException e = new ConfigurationException();
+            e.setMessage(11107, new Object[] {path});
+            e.setRootCause(ex);
+            throw e;
+        }
+        catch (SecurityException se)
+        {
+            // Please specify a valid include file. ''{0}'' is invalid.
+            ConfigurationException e = new ConfigurationException();
+            e.setMessage(11107, new Object[] {path});
+            e.setRootCause(se);
+            throw e;
+        }
+    }
+
+    public void popIncludedFile()
+    {
+        configurationPathStack.pop();
+    }
+
+    /**
+     * Returns the list of XML files (denoted by .xml extension) in the directory
+     * relative to the current configuration file.
+     *
+     * @param dir a directory relative to the current configuration file
+     * @return a (possibly empty) list of file names
+     */
+    public List getFiles(String dir)
+    {
+        List result = new ArrayList();
+        File f = new File(configurationPathStack.peek().toString(), dir);
+        if (f.exists() && f.isDirectory())
+        {
+            String[] xmlFiles = f.list(new FilenameFilter()
+            {
+                public boolean accept(File dir, String name)
+                {
+                    return name.endsWith(".xml");
+                }
+            });
+
+            // prepend the directory to each filename
+            for (int i = 0; i < xmlFiles.length; i++)
+            {
+                String file = xmlFiles[i];
+                result.add(dir +  File.separator + file);
+            }
+            return result;
+        }
+        else
+        {
+            // Please specify a valid include directory. ''{0}'' is invalid.
+            ConfigurationException e = new ConfigurationException();
+            e.setMessage(11113, new Object[]{dir});
+            throw e;
+        }
+    }
+
+    private void pushConfigurationFile(String topLevelPath)
+    {
+        configurationPathStack.push(topLevelPath);
+    }
+
+    public String getIncludedPath(String src)
+    {
+        return configurationPathStack.peek() + File.separator + src;
+    }
+
+    public long getIncludedLastModified(String src)
+    {
+        String path = configurationPathStack.peek() + File.separator + src;
+        File f = new File(path);
+        return f.lastModified();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/LoggingSettings.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/LoggingSettings.java b/modules/common/src/flex/messaging/config/LoggingSettings.java
new file mode 100755
index 0000000..b9b95fe
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/LoggingSettings.java
@@ -0,0 +1,47 @@
+/*
+ * 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.messaging.config;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * A log maintains a series of Loggers for each logging category and
+ * Targets are established that listen for LogEvents on those Loggers.
+ *
+ * @author Peter Farland
+ * @exclude
+ */
+public class LoggingSettings extends PropertiesSettings
+{
+    private final List targets;
+
+    public LoggingSettings()
+    {
+        targets = new ArrayList();
+    }
+
+    public void addTarget(TargetSettings t)
+    {
+        targets.add(t);
+    }
+
+    public List getTargets()
+    {
+        return targets;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/LoginCommandSettings.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/LoginCommandSettings.java b/modules/common/src/flex/messaging/config/LoginCommandSettings.java
new file mode 100755
index 0000000..c91a4d7
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/LoginCommandSettings.java
@@ -0,0 +1,102 @@
+/*
+ * 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.messaging.config;
+
+/**
+ * Settings for <code>LoginCommand</code> class.
+ *
+ * @author esolovey
+ * @exclude
+ */
+public class LoginCommandSettings
+{
+    public static final String SERVER_MATCH_OVERRIDE = "all";
+
+    private String className;
+    private String server;
+    private boolean perClientAuthentication;
+
+    /**
+     * Create a new <code>LoginCommandSettings</code> instance with default settings.
+     */
+    public LoginCommandSettings()
+    {
+        perClientAuthentication = false;
+    }
+
+    /**
+     * Returns the class name associated with the settings.
+     *
+     * @return The class name.
+     */
+    public String getClassName()
+    {
+        return className;
+    }
+
+    /**
+     * Sets the class name associated with the settings.
+     *
+     * @param className The class name.
+     */
+    public void setClassName(String className)
+    {
+        this.className = className;
+    }
+
+    /**
+     * Returns the server name associated with the settings.
+     *
+     * @return The server name.
+     */
+    public String getServer()
+    {
+        return server;
+    }
+
+    /**
+     * Sets the server name associated with the settings.
+     *
+     * @param server The server name.
+     */
+    public void setServer(String server)
+    {
+        this.server = server;
+    }
+
+    /**
+     * Returns whether per client authentication is enabled or not.
+     *
+     * @return <code>true</code> if per client authentication is enabled;
+     * otherwise <code>false</code>.
+     */
+    public boolean isPerClientAuthentication()
+    {
+        return perClientAuthentication;
+    }
+
+    /**
+     * Sets whether per client authentication is enabled or not.
+     *
+     * @param perClientAuthentication <code>true</code> if per client authentication
+     * is enabled; otherwise <code>false</code>.
+     */
+    public void setPerClientAuthentication(boolean perClientAuthentication)
+    {
+        this.perClientAuthentication = perClientAuthentication;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/PropertiesSettings.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/PropertiesSettings.java b/modules/common/src/flex/messaging/config/PropertiesSettings.java
new file mode 100755
index 0000000..8245606
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/PropertiesSettings.java
@@ -0,0 +1,100 @@
+/*
+ * 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.messaging.config;
+
+import java.util.List;
+
+/**
+ * Holds any child element of the properties section of the services configuration.
+ * <p>
+ * If a property is a simple element with a text value then it is stored as a String
+ * using the element name as the property name. If the same element appears again then
+ * the element is converted to a List of values and further occurences are simply added
+ * to the List.
+ * </p>
+ * <p>
+ * If a property element has child elements the children are recursively processed
+ * and added as a Map.
+ * </p>
+ *
+ * @author Peter Farland
+ * @exclude
+ */
+public abstract class PropertiesSettings
+{
+    protected final ConfigMap properties;
+
+    public PropertiesSettings()
+    {
+        properties = new ConfigMap();
+    }
+
+    public final void addProperties(ConfigMap p)
+    {
+        properties.addProperties(p);
+    }
+
+    public ConfigMap getProperties()
+    {
+        return properties;
+    }
+
+    public final String getProperty(String name)
+    {
+        return getPropertyAsString(name, null);
+    }
+
+    public final void addProperty(String name, String value)
+    {
+        properties.addProperty(name, value);
+    }
+
+    public final void addProperty(String name, ConfigMap value)
+    {
+        properties.addProperty(name, value);
+    }
+
+    public final ConfigMap getPropertyAsMap(String name, ConfigMap defaultValue)
+    {
+        return properties.getPropertyAsMap(name, defaultValue);
+    }
+
+    public final String getPropertyAsString(String name, String defaultValue)
+    {
+        return properties.getPropertyAsString(name, defaultValue);
+    }
+
+    public final List getPropertyAsList(String name, List defaultValue)
+    {
+        return properties.getPropertyAsList(name, defaultValue);
+    }
+
+    public final int getPropertyAsInt(String name, int defaultValue)
+    {
+        return properties.getPropertyAsInt(name, defaultValue);
+    }
+
+    public final boolean getPropertyAsBoolean(String name, boolean defaultValue)
+    {
+        return properties.getPropertyAsBoolean(name, defaultValue);
+    }
+
+    public final long getPropertyAsLong(String name, long defaultValue)
+    {
+        return properties.getPropertyAsLong(name, defaultValue);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/SecurityConstraint.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/SecurityConstraint.java b/modules/common/src/flex/messaging/config/SecurityConstraint.java
new file mode 100755
index 0000000..fd18646
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/SecurityConstraint.java
@@ -0,0 +1,123 @@
+/*
+ * 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.messaging.config;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Security constraints are used by the login manager to secure access to
+ * destinations and endpoints.
+ */
+public class SecurityConstraint
+{
+    /**
+     * String constant for basic authentication.
+     */
+    public static final String BASIC_AUTH_METHOD = "Basic";
+
+    /**
+     * String constant for custom authentication.
+     */
+    public static final String CUSTOM_AUTH_METHOD = "Custom";
+
+    private final String id;
+    private String method;
+    private List roles;
+
+    /**
+     * Creates an anonymous <code>SecurityConstraint</code> instance.
+     */
+    public SecurityConstraint()
+    {
+        this(null);
+    }
+
+    /**
+     * Creates a <code>SecurityConstraint</code> instance with an id.
+     *
+     * @param id The id of the <code>SecurityConstraint</code> instance.
+     */
+    public SecurityConstraint(String id)
+    {
+        this.id = id;
+        method = CUSTOM_AUTH_METHOD;
+    }
+
+    /**
+     * Returns a list of roles of the <code>SecurityConstraint</code>.
+     *
+     * @return List of roles.
+     */
+    public List getRoles()
+    {
+        return roles;
+    }
+
+    /**
+     * Adds a role to the list of roles of the <code>SecurityConstraint</code>.
+     *
+     * @param role New role to add to the list of roles.
+     */
+    public void addRole(String role)
+    {
+        if (role == null)
+            return;
+
+        if (roles == null)
+            roles = new ArrayList();
+
+            roles.add(role);
+    }
+
+    /**
+     * Returns the id of the <code>SecurityConstraint</code>.
+     *
+     * @return The id of the <code>SecurityConstraint</code>.
+     */
+    public String getId()
+    {
+        return id;
+    }
+
+    /**
+     * Returns the authorization method of the <code>SecurityConstraint</code>.
+     *
+     * @return Authorization method.
+     */
+    public String getMethod()
+    {
+        return method;
+    }
+
+    /**
+     * Sets the authorization method of the <code>SecurityConstraint</code>.
+     * Valid values are Basic and Custom.
+     *
+     * @param method The authentication method to set which can be custom or basic.
+     */
+    public void setMethod(String method)
+    {
+        if (method == null)
+            return;
+
+        if (CUSTOM_AUTH_METHOD.equalsIgnoreCase(method))
+            this.method = CUSTOM_AUTH_METHOD;
+        else if (BASIC_AUTH_METHOD.equalsIgnoreCase(method))
+            this.method = BASIC_AUTH_METHOD;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/ServiceSettings.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/ServiceSettings.java b/modules/common/src/flex/messaging/config/ServiceSettings.java
new file mode 100755
index 0000000..3c93759
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/ServiceSettings.java
@@ -0,0 +1,166 @@
+/*
+ * 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.messaging.config;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A service represents a high-level grouping of
+ * functionality to which the message broker can
+ * delegate messages. Services specify which
+ * message types they're interested in and use
+ * adapters to carry out a message's for a
+ * destination.
+ * <p>
+ * A service maintains a list of destinations which
+ * effectively represents a &quot;whitelist&quot;
+ * of actions allowed by that service.
+ * </p>
+ *
+ * @author Peter Farland
+ * @exclude
+ */
+public class ServiceSettings extends PropertiesSettings
+{
+    private final String id;
+    private String sourceFile;
+    private String className;
+
+    private AdapterSettings defaultAdapterSettings;
+    private final Map adapterSettings;
+    private final List defaultChannels;
+    private final Map destinationSettings;
+    private SecurityConstraint securityConstraint;
+
+    public ServiceSettings(String id)
+    {
+        this.id = id;
+        destinationSettings = new HashMap();
+        adapterSettings = new HashMap(2);
+        defaultChannels = new ArrayList(4);
+    }
+
+    public String getId()
+    {
+        return id;
+    }
+
+    String getSourceFile()
+    {
+        return sourceFile;
+    }
+
+    void setSourceFile(String sourceFile)
+    {
+        this.sourceFile = sourceFile;
+    }
+
+    public String getClassName()
+    {
+        return className;
+    }
+
+    public void setClassName(String name)
+    {
+        className = name;
+    }
+
+    /*
+     *  SERVER ADAPTERS
+     */
+    public AdapterSettings getDefaultAdapter()
+    {
+        return defaultAdapterSettings;
+    }
+
+    public AdapterSettings getAdapterSettings(String id)
+    {
+        return (AdapterSettings)adapterSettings.get(id);
+    }
+
+    public Map getAllAdapterSettings()
+    {
+        return adapterSettings;
+    }
+
+    public void addAdapterSettings(AdapterSettings a)
+    {
+        adapterSettings.put(a.getId(), a);
+        if (a.isDefault())
+        {
+            defaultAdapterSettings = a;
+        }
+    }
+
+    /*
+     *  DEFAULT CHANNELS
+     */
+    public void addDefaultChannel(ChannelSettings c)
+    {
+        defaultChannels.add(c);
+    }
+
+    public List getDefaultChannels()
+    {
+        return defaultChannels;
+    }
+
+    /*
+     *  DEFAULT SECURITY
+     */
+
+    /**
+     * Gets the <code>SecurityConstraint</code> that will be applied to all
+     * destinations of the service, or <code>null</code> if no constraint has
+     * been registered.
+     *
+     * @return the <code>SecurityConstraint</code> for this service.
+     */
+    public SecurityConstraint getConstraint()
+    {
+        return securityConstraint;
+    }
+
+    /**
+     * Sets the security constraint to be applied to all destinations of the service.
+     * Security constraints restrict which clients can contact this destination. Use
+     * <code>null</code> to remove an existing constraint.
+     *
+     * @param sc the <code>SecurityConstraint</code> to apply to this
+     * service.
+     */
+    public void setConstraint(SecurityConstraint sc)
+    {
+        securityConstraint = sc;
+    }
+
+    /*
+     *  DESTINATIONS
+     */
+    public Map getDestinationSettings()
+    {
+        return destinationSettings;
+    }
+
+    public void addDestinationSettings(DestinationSettings dest)
+    {
+        destinationSettings.put(dest.getId(), dest);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/ServicesConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/ServicesConfiguration.java b/modules/common/src/flex/messaging/config/ServicesConfiguration.java
new file mode 100755
index 0000000..8bc25fc
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/ServicesConfiguration.java
@@ -0,0 +1,71 @@
+/*
+ * 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.messaging.config;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Base interface for Flex Data Services configuration.
+ *
+ * Implementations may have different levels of detail
+ * based on how much of the configuration is supported.
+ *
+ * @author pfarland
+ * @exclude
+ */
+public interface ServicesConfiguration
+{
+    /*
+     * CHANNEL CONFIGURATION
+     */
+
+    void addChannelSettings(String id, ChannelSettings settings);
+
+    ChannelSettings getChannelSettings(String ref);
+
+    Map getAllChannelSettings();
+
+    /*
+     * DEFAULT CHANNELS CONFIGURATION
+     */
+    void addDefaultChannel(String id);
+
+    List getDefaultChannels();
+
+    /*
+     * SERVICE CONFIGURATION
+     */
+
+    void addServiceSettings(ServiceSettings settings);
+
+    ServiceSettings getServiceSettings(String id);
+
+    List getAllServiceSettings();
+
+    /*
+     * LOGGING CONFIGURATION
+     */
+    void setLoggingSettings(LoggingSettings settings);
+
+    LoggingSettings getLoggingSettings();
+
+    /* CLUSTER CONFIGURATION */
+    ClusterSettings getClusterSettings(String clusterId);
+
+    ClusterSettings getDefaultCluster();
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/ServicesDependencies.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/ServicesDependencies.java b/modules/common/src/flex/messaging/config/ServicesDependencies.java
new file mode 100755
index 0000000..cfdaa16
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/ServicesDependencies.java
@@ -0,0 +1,747 @@
+/*
+ * 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.messaging.config;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import flex.messaging.LocalizedException;
+
+/**
+ * Flex MXMLC compiler uses the result of the client configuration parser
+ * to generate mixin initialization source code to be added to the SWF by
+ * PreLink. It also requires a list of channel classes to be added as
+ * dependencies.
+ *
+ * @exclude
+ */
+public class ServicesDependencies
+{
+    private static final String ADVANCED_CHANNELSET_CLASS = "mx.messaging.AdvancedChannelSet";
+    private static final String ADVANCED_MESSAGING_SUPPORT_CLASS = "flex.messaging.services.AdvancedMessagingSupport";
+    private static final String REDIRECT_URL = "redirect-url";
+    
+    private boolean containsClientLoadBalancing;
+    private String xmlInit = "";
+    private StringBuffer imports = new StringBuffer();
+    private StringBuffer references = new StringBuffer();
+    private List channelClasses;
+    private Map configPaths;
+    private Map lazyAssociations;
+    
+    private static final List channel_excludes = new ArrayList();
+    static
+    {
+        channel_excludes.add(REDIRECT_URL);
+    }
+
+    public static final boolean traceConfig = (System.getProperty("trace.config") != null);
+
+    public ServicesDependencies(String path, String parserClass, String contextRoot)
+    {
+        ClientConfiguration config = getClientConfiguration(path, parserClass);
+
+        if (config != null)
+        {
+            Map importMap = new HashMap();
+            lazyAssociations = new HashMap();
+            configPaths = config.getConfigPaths();
+            xmlInit = codegenXmlInit(config, contextRoot, importMap);
+            codegenServiceImportsAndReferences(importMap, imports, references);
+            channelClasses = listChannelClasses(config);
+        }
+    }
+
+    public Set getLazyAssociations(String destination)
+    {
+        if (lazyAssociations == null)
+        {
+            lazyAssociations = new HashMap();
+        }
+
+        return (Set)lazyAssociations.get(destination);
+    }
+
+    public void addLazyAssociation(String destination, String associationProp)
+    {
+        Set la = getLazyAssociations(destination);
+        if (la == null)
+        {
+            la = new HashSet();
+            lazyAssociations.put(destination, la);
+        }
+        la.add(associationProp);
+    }
+
+    public String getServerConfigXmlInit()
+    {
+        return xmlInit;
+    }
+
+    public String getImports()
+    {
+        return imports.toString();
+    }
+
+    public String getReferences()
+    {
+        return references.toString();
+    }
+
+    public List getChannelClasses()
+    {
+        return channelClasses;
+    }
+
+    public void addChannelClass(String className)
+    {
+        channelClasses.add(className);
+    }
+
+    public void addConfigPath(String path, long modified)
+    {
+        configPaths.put(path, new Long(modified));
+    }
+
+    public Map getConfigPaths()
+    {
+        return configPaths;
+    }
+    
+    /**
+     * Gets ActionScript source file for a class. The class will be compiled as 
+     * a mixin and initialize Flex at runtime.
+     * 
+     * @param packageName - the package compiled into the generated source.
+     * @param className - the class name of the generated source.
+     * @return A String that represents an ActionScript Source file.
+     */
+        public String getServicesInitSource(String packageName, String className)
+    {
+        StringBuilder sb = new StringBuilder(2048);
+
+        sb.append("package ").append(packageName).append("\n");
+        sb.append("{\n\n");
+        sb.append("import mx.core.IFlexModuleFactory;\n");
+        sb.append("import flash.net.registerClassAlias;\n");
+        sb.append("import flash.net.getClassByAlias;\n");
+
+        // generated imports
+        sb.append(getImports());
+
+        sb.append("\n[Mixin]\n");
+        sb.append("public class ").append(className).append("\n");
+        sb.append("{\n");
+        sb.append("    public function ").append(className).append("()\n");
+        sb.append("    {\n");
+        sb.append("        super();\n");
+        sb.append("    }\n\n");
+        sb.append("    public static function init(fbs:IFlexModuleFactory):void\n");
+        sb.append("    {\n");
+
+        // code for init
+        sb.append(getServerConfigXmlInit());
+        sb.append("    }\n\n");
+
+        // generated variables to create references
+        sb.append(getReferences());
+        sb.append("}\n");
+        sb.append("}\n");
+
+        return sb.toString();
+    }
+
+    public static ClientConfiguration getClientConfiguration(String path, String parserClass)
+    {
+        ClientConfiguration config = new ClientConfiguration();
+
+        ConfigurationParser parser = getConfigurationParser(parserClass);
+
+        if (parser == null)
+        {
+            // "Unable to create a parser to load messaging configuration."
+            LocalizedException lme = new LocalizedException();
+            lme.setMessage(10138);
+            throw lme;
+        }
+
+        LocalFileResolver local = new LocalFileResolver();
+        parser.parse(path, local, config);
+
+        config.addConfigPath(path, new File(path).lastModified());
+
+        return config;
+    }
+
+    static ConfigurationParser getConfigurationParser(String className)
+    {
+        ConfigurationParser parser = null;
+        Class parserClass = null;
+
+        // Check for Custom Parser Specification
+        if (className != null)
+        {
+            try
+            {
+                parserClass = Class.forName(className);
+                parser = (ConfigurationParser)parserClass.newInstance();
+            }
+            catch (Throwable t)
+            {
+                if (traceConfig)
+                {
+                    System.out.println("Could not load services configuration parser as: " + className);
+                }
+            }
+        }
+
+        // Try Sun JRE 1.4 / Apache Xalan Based Implementation
+        if (parser == null)
+        {
+            try
+            {
+                Class.forName("org.apache.xpath.CachedXPathAPI");
+                className = "flex.messaging.config.ApacheXPathClientConfigurationParser";
+                parserClass = Class.forName(className);
+                parser = (ConfigurationParser)parserClass.newInstance();
+            }
+            catch (Throwable t)
+            {
+                if (traceConfig)
+                {
+                    System.out.println("Could not load configuration parser as: " + className);
+                }
+            }
+        }
+
+        // Try Sun JRE 1.5 Based Implementation
+        if (parser == null)
+        {
+            try
+            {
+                className = "flex.messaging.config.XPathClientConfigurationParser";
+                parserClass = Class.forName(className);
+                // double-check, on some systems the above loads but the import classes don't
+                Class.forName("javax.xml.xpath.XPathExpressionException");
+
+                parser = (ConfigurationParser)parserClass.newInstance();
+            }
+            catch (Throwable t)
+            {
+                if (traceConfig)
+                {
+                    System.out.println("Could not load configuration parser as: " + className);
+                }
+            }
+        }
+
+        if (traceConfig && parser != null)
+        {
+            System.out.println("Services Configuration Parser: " + parser.getClass().getName());
+        }
+
+        return parser;
+    }
+
+    private static List listChannelClasses(ServicesConfiguration config)
+    {
+        List channelList = new ArrayList();
+        Iterator it = config.getAllChannelSettings().values().iterator();
+        while (it.hasNext())
+        {
+            ChannelSettings settings = (ChannelSettings)it.next();
+            if (!settings.serverOnly)
+            {
+                String clientType = settings.getClientType();
+                channelList.add(clientType);
+            }
+        }
+
+        return channelList;
+    }
+
+    /**
+     * Emits source code declaration of public var xml:XML (unnamed package), containing ServicesConfiguration as e4x.
+     */
+    private String codegenXmlInit(ServicesConfiguration config, String contextRoot, Map serviceImportMap)
+    {
+        StringBuffer e4x = new StringBuffer();
+        String channelSetImplToImport = null;
+
+        e4x.append("<services>\n");
+
+        // Add default channels of the application
+        if (config.getDefaultChannels().size() > 0)
+        {
+            e4x.append("\t<default-channels>\n");
+            for (Iterator chanIter = config.getDefaultChannels().iterator(); chanIter.hasNext();)
+            {
+                String id = (String)chanIter.next();
+                e4x.append("\t\t<channel ref=\"" + id + "\"/>\n");
+            }
+            e4x.append("\t</default-channels>\n");
+        }
+
+        ClusterSettings defaultCluster = config.getDefaultCluster();
+        // Do not add the cluster tag if the default cluster does not have
+        // client side load balancing.
+        if (defaultCluster != null && !defaultCluster.getURLLoadBalancing())
+            defaultCluster = null;
+
+        for (Iterator servIter = config.getAllServiceSettings().iterator(); servIter.hasNext();)
+        {
+            ServiceSettings entry = (ServiceSettings)servIter.next();
+
+            // FIXME: Need to find another way to skip BootstrapServices
+            // Skip services with no message types
+            /*
+            String messageTypes = entry.getMessageTypesString();
+            if (messageTypes == null)
+                continue;
+            */
+
+            String serviceType = entry.getId();
+            e4x.append("\t<service id=\"");
+            e4x.append(serviceType);
+            e4x.append("\"");
+            e4x.append(">\n");
+
+            String serviceClass = entry.getClassName();
+            if (ADVANCED_MESSAGING_SUPPORT_CLASS.equals(serviceClass))
+                channelSetImplToImport = ADVANCED_CHANNELSET_CLASS;
+
+            String useTransactionsStr = entry.getProperties().getPropertyAsString("use-transactions", null);
+            if (useTransactionsStr != null)
+            {
+                e4x.append("\t\t<properties>\n\t\t\t<use-transactions>" + useTransactionsStr + "</use-transactions>\n");
+                e4x.append("\t\t</properties>\n");
+            }
+
+            for (Iterator destIter = entry.getDestinationSettings().values().iterator(); destIter.hasNext();)
+            {
+                DestinationSettings dest = (DestinationSettings) destIter.next();
+                String destination = dest.getId();
+                e4x.append("\t\t<destination id=\"" + destination + "\">\n");
+
+                // add in the identity properties
+                ConfigMap metadata = dest.getProperties().getPropertyAsMap("metadata", null);
+                boolean closePropTag = false;
+                if (metadata != null)
+                {
+                    e4x.append("\t\t\t<properties>\n\t\t\t\t<metadata\n");
+                    String extendsStr = metadata.getPropertyAsString("extends", null);
+                    if (extendsStr != null)
+                    {
+                        e4x.append(" extends=\"");
+                        e4x.append(extendsStr);
+                        e4x.append("\"");
+                    }
+                    e4x.append(">");
+                    closePropTag = true;
+                    List identities = metadata.getPropertyAsList("identity", null);
+                    if (identities != null)
+                    {
+                        Iterator it = identities.iterator();
+                        while (it.hasNext())
+                        {
+                            Object o = it.next();
+                            String identityName = null;
+                            String undefinedValue = null;
+                            if (o instanceof String)
+                            {
+                                identityName = (String) o;
+                            }
+                            else if (o instanceof ConfigMap)
+                            {
+                                identityName = ((ConfigMap) o).getPropertyAsString("property", null);
+                                undefinedValue = ((ConfigMap) o).getPropertyAsString("undefined-value", null);
+                            }
+
+                            if (identityName != null)
+                            {
+                                e4x.append("\t\t\t\t\t<identity property=\"");
+                                e4x.append(identityName);
+                                e4x.append("\"");
+                                if (undefinedValue != null)
+                                {
+                                    e4x.append(" undefined-value=\"");
+                                    e4x.append(undefinedValue);
+                                    e4x.append("\"");
+                                }
+                                e4x.append("/>\n");
+                            }
+                        }
+                    }
+                    // add associations which reference other data service destinations
+                    codegenServiceAssociations(metadata, e4x, destination, "one-to-many");
+                    codegenServiceAssociations(metadata, e4x, destination, "many-to-many");
+                    codegenServiceAssociations(metadata, e4x, destination, "one-to-one");
+                    codegenServiceAssociations(metadata, e4x, destination, "many-to-one");
+
+                    e4x.append("\t\t\t\t</metadata>\n");
+                }
+
+                String itemClass = dest.getProperties().getPropertyAsString("item-class", null);
+                if (itemClass != null)
+                {
+                    if (!closePropTag)
+                    {
+                        e4x.append("\t\t\t<properties>\n");
+                        closePropTag = true;
+                    }
+
+                    e4x.append("\t\t\t\t<item-class>");
+                    e4x.append(itemClass);
+                    e4x.append("</item-class>\n");
+                }
+
+                // add in sub-set of network-related destination properties
+                ConfigMap network = dest.getProperties().getPropertyAsMap("network", null);
+                ConfigMap clusterInfo = null;
+                ConfigMap pagingInfo = null;
+                ConfigMap reconnectInfo = null;
+                if (network != null || defaultCluster != null)
+                {
+                    if (!closePropTag)
+                    {
+                        e4x.append("\t\t\t<properties>\n");
+                        closePropTag = true;
+                    }
+                    e4x.append("\t\t\t\t<network>\n");
+
+                    if (network != null)
+                        pagingInfo = network.getPropertyAsMap("paging", null);
+                    if (pagingInfo != null)
+                    {
+                        String enabled = pagingInfo.getPropertyAsString("enabled", "false");
+                        e4x.append("\t\t\t\t\t<paging enabled=\"");
+                        e4x.append(enabled);
+                        e4x.append("\"");
+                        // Always put page size even if it is disabled as we can
+                        // end up using this for nested properties with lazy="true".
+                        // supporting pageSize for backwards compatibility but config options are not camelCase in general.
+                        String size = pagingInfo.getPropertyAsString("page-size", pagingInfo.getPropertyAsString("pageSize", null));
+                        if (size != null)
+                        {
+                            e4x.append(" page-size=\"");
+                            e4x.append(size);
+                            e4x.append("\"");
+
+                            // Included so that newer compilers can work with older clients
+                            e4x.append(" pageSize=\"");
+                            e4x.append(size);
+                            e4x.append("\"");
+                        }
+                        e4x.append("/>\n");
+                    }
+
+                    if (network != null)
+                        reconnectInfo = network.getPropertyAsMap("reconnect", null);
+                    if (reconnectInfo != null)
+                    {
+                        String fetchOption = reconnectInfo.getPropertyAsString("fetch", "IDENTITY");
+                        e4x.append("\t\t\t\t\t<reconnect fetch=\"");
+                        e4x.append(fetchOption.toUpperCase());
+                        e4x.append("\" />\n");
+                    }
+
+                    if (network != null)
+                    {
+                        String reliable = network.getPropertyAsString("reliable", "false");
+                        if (Boolean.valueOf(reliable).booleanValue()) // No need the default value for the setting.
+                        {
+                            e4x.append("\t\t\t\t\t<reliable>");
+                            e4x.append(reliable);
+                            e4x.append("</reliable>\n");
+                        }
+                    }
+
+                    if (network != null)
+                        clusterInfo = network.getPropertyAsMap("cluster", null);
+                    if (clusterInfo != null)
+                    {
+                        String clusterId = clusterInfo.getPropertyAsString("ref", null);
+
+                        ClusterSettings clusterSettings = config.getClusterSettings(clusterId);
+                        if (clusterSettings != null &&
+                            clusterSettings.getURLLoadBalancing())
+                        {
+                            e4x.append("\t\t\t\t\t<cluster ref=\"");
+                            e4x.append(clusterId);
+                            e4x.append("\"/>\n");
+                        }
+                    }
+                    else if (defaultCluster != null)
+                    {
+                        e4x.append("\t\t\t\t\t<cluster");
+                        if (defaultCluster.getClusterName() != null)
+                        {
+                            e4x.append(" ref=\"");
+                            e4x.append(defaultCluster.getClusterName());
+                            e4x.append("\"");
+                        }
+                        e4x.append("/>\n");
+                    }
+                    e4x.append("\t\t\t\t</network>\n");
+                }
+
+                String useTransactions = dest.getProperties().getPropertyAsString("use-transactions", null);
+
+                if (useTransactions !=null)
+                {
+                    if (!closePropTag)
+                    {
+                        e4x.append("\t\t\t<properties>\n");
+                        closePropTag = true;
+                    }
+                    e4x.append("\t\t\t\t<use-transactions>" + useTransactions + "</use-transactions>\n");
+                }
+
+                String autoSyncEnabled = dest.getProperties().getPropertyAsString("auto-sync-enabled", "true");
+
+                if (autoSyncEnabled.equalsIgnoreCase("false"))
+                {
+                    if (!closePropTag)
+                    {
+                        e4x.append("\t\t\t<properties>\n");
+                        closePropTag = true;
+                    }
+                    e4x.append("\t\t\t\t<auto-sync-enabled>false</auto-sync-enabled>\n");
+                }
+
+                if (closePropTag)
+                {
+                    e4x.append("\t\t\t</properties>\n");
+                }
+
+                e4x.append("\t\t\t<channels>\n");
+                for (Iterator chanIter = dest.getChannelSettings().iterator(); chanIter.hasNext();)
+                {
+                    e4x.append("\t\t\t\t<channel ref=\"" + ((ChannelSettings) chanIter.next()).getId() + "\"/>\n");
+                }
+                e4x.append("\t\t\t</channels>\n");
+                e4x.append("\t\t</destination>\n");
+            }
+            e4x.append("\t</service>\n");
+        }
+        // channels
+        e4x.append("\t<channels>\n");
+        String channelType;
+        for (Iterator chanIter = config.getAllChannelSettings().values().iterator(); chanIter.hasNext();)
+        {
+            ChannelSettings chan = (ChannelSettings) chanIter.next();
+            if (chan.getServerOnly()) // Skip server-only channels.
+                continue;
+            channelType = chan.getClientType();
+            serviceImportMap.put(channelType, channelType);
+            e4x.append("\t\t<channel id=\"" + chan.getId() + "\" type=\"" + channelType + "\">\n");
+            StringBuffer channelProps = new StringBuffer();
+            containsClientLoadBalancing = false;
+            channelProperties(chan.getProperties(), channelProps, "\t\t\t\t");
+            if (!containsClientLoadBalancing) // Add the uri, only when there is no client-load-balancing defined.
+                e4x.append("\t\t\t<endpoint uri=\"" + chan.getClientParsedUri(contextRoot) + "\"/>\n");
+            containsClientLoadBalancing = false;
+            e4x.append("\t\t\t<properties>\n");
+            e4x.append(channelProps);
+            e4x.append("\t\t\t</properties>\n");
+            e4x.append("\t\t</channel>\n");
+        }
+        e4x.append("\t</channels>\n");
+        FlexClientSettings flexClientSettings = (config instanceof ClientConfiguration) ? ((ClientConfiguration)config).getFlexClientSettings() : null;
+        if (flexClientSettings != null && flexClientSettings.getHeartbeatIntervalMillis() > 0)
+        {
+            e4x.append("\t<flex-client>\n");
+            e4x.append("\t\t<heartbeat-interval-millis>");
+            e4x.append(flexClientSettings.getHeartbeatIntervalMillis());
+            e4x.append("</heartbeat-interval-millis>");
+            e4x.append("\t</flex-client>\n");
+        }
+        e4x.append("</services>");
+
+        StringBuffer advancedMessagingSupport = new StringBuffer();
+        if (channelSetImplToImport != null)
+        {
+            serviceImportMap.put("ChannelSetImpl", channelSetImplToImport);
+
+            // Codegen same class alias registration as is done by flex2.tools.Prelink#codegenRemoteClassAliases(Map<String,String>).
+            // This codegen isn't processed by PreLink.
+            String alias = "flex.messaging.messages.ReliabilityMessage";
+            String className = "mx.messaging.messages.ReliabilityMessage";
+            advancedMessagingSupport.append("     ServerConfig.channelSetFactory = AdvancedChannelSet;\n");
+            advancedMessagingSupport.append("     try {\n");
+            advancedMessagingSupport.append("     if (flash.net.getClassByAlias(\"" + alias + "\") == null){\n");
+            advancedMessagingSupport.append("         flash.net.registerClassAlias(\"" + alias + "\", " + className + ");}\n");
+            advancedMessagingSupport.append("     } catch (e:Error) {\n");
+            advancedMessagingSupport.append("         flash.net.registerClassAlias(\"" + alias + "\", " + className + "); }\n");
+            if (flexClientSettings != null && flexClientSettings.getReliableReconnectDurationMillis() > 0)
+            {
+                advancedMessagingSupport.append("     AdvancedChannelSet.reliableReconnectDuration =");
+                advancedMessagingSupport.append(flexClientSettings.getReliableReconnectDurationMillis());
+                advancedMessagingSupport.append(";\n");
+            }
+        }
+        String generatedChunk = "\n     ServerConfig.xml =\n" + e4x.toString() + ";\n" + advancedMessagingSupport.toString();
+
+        return generatedChunk;
+    }
+
+    /**
+     * Process channel properties recursively.
+     */
+    private void channelProperties(ConfigMap properties, StringBuffer buf, String indent)
+    {
+        for (Iterator nameIter = properties.propertyNames().iterator(); nameIter.hasNext();)
+        {
+            String name = (String)nameIter.next();
+            Object value = properties.get(name);
+            if (value instanceof String)
+            {
+                addStringProperty(buf, indent, name, (String)value);
+            }
+            else if (value instanceof List)
+            {
+                List children = (List)value;
+                for (Iterator childrenIter = children.iterator(); childrenIter.hasNext();)
+                    addStringProperty(buf, indent, name, (String)childrenIter.next());;
+            }
+            else if (value instanceof ConfigMap)
+            {
+                ConfigMap childProperties = (ConfigMap)value;
+                buf.append(indent);
+                buf.append("<" + name + ">\n");
+                if (ConfigurationConstants.CLIENT_LOAD_BALANCING_ELEMENT.equals(name))
+                    containsClientLoadBalancing = true;
+                channelProperties(childProperties, buf, indent + "\t");
+                buf.append(indent);
+                buf.append("</" + name + ">\n");
+            }
+        }
+    }
+
+    private void addStringProperty(StringBuffer buf, String indent, String name, String value)
+    {
+        if (!channel_excludes.contains(name))
+        {
+            buf.append(indent);
+            buf.append("<" + name + ">" + value + "</" + name + ">\n");
+        }
+    }
+
+    /**
+     * Analyze code gen service associations.
+     * @param metadata the ConfigMap object
+     * @param e4x the buffer object
+     * @param destination the current destination
+     * @param relation the relationship 
+     */
+    public void codegenServiceAssociations(ConfigMap metadata, StringBuffer e4x, String destination, String relation)
+    {
+        List references = metadata.getPropertyAsList(relation, null);
+        if (references != null)
+        {
+            Iterator it = references.iterator();
+            while (it.hasNext())
+            {
+                Object ref = it.next();
+                if (ref instanceof ConfigMap)
+                {
+                    ConfigMap refMap = (ConfigMap) ref;
+                    String name = refMap.getPropertyAsString("property", null);
+                    String associatedDestination = refMap.getPropertyAsString("destination", null);
+                    String lazy = refMap.getPropertyAsString("lazy", null);
+                    String loadOnDemand = refMap.getPropertyAsString("load-on-demand", null);
+                    String hierarchicalEvents = refMap.getPropertyAsString("hierarchical-events", null);
+                    String pageSize = refMap.getPropertyAsString("page-size", refMap.getPropertyAsString("pageSize", null));
+                    String pagedUpdates = refMap.getPropertyAsString("paged-updates", null);
+                    String cascade = refMap.getPropertyAsString("cascade", null);
+                    String ordered = refMap.getPropertyAsString("ordered", null);
+                    e4x.append("\t\t\t\t\t<");
+                    e4x.append(relation);
+                    if (lazy != null)
+                    {
+                        e4x.append(" lazy=\"");
+                        e4x.append(lazy);
+                        e4x.append("\"");
+
+                        if (Boolean.valueOf(lazy.toLowerCase().trim()).booleanValue())
+                        {
+                            addLazyAssociation(destination, name);
+                        }
+                    }
+                    e4x.append(" property=\"");
+                    e4x.append(name);
+                    e4x.append("\" destination=\"");
+                    e4x.append(associatedDestination);
+                    e4x.append("\"");
+                    String readOnly = refMap.getPropertyAsString("read-only", null);
+                    if (readOnly != null && readOnly.equalsIgnoreCase("true"))
+                    {
+                        e4x.append(" read-only=\"true\"");
+                    }
+                    if (loadOnDemand != null && loadOnDemand.equalsIgnoreCase("true"))
+                        e4x.append(" load-on-demand=\"true\"");
+                    if (hierarchicalEvents != null && hierarchicalEvents.equalsIgnoreCase("true"))
+                        e4x.append(" hierarchical-events=\"true\"");
+                    if (pagedUpdates != null)
+                        e4x.append(" paged-updates=\"" + pagedUpdates + "\"");
+                    if (pageSize != null)
+                        e4x.append(" page-size=\"" + pageSize + "\"");
+                    if (cascade != null)
+                        e4x.append(" cascade=\"" + cascade + "\"");
+                    if (ordered != null)
+                        e4x.append(" ordered=\"" + ordered + "\"");
+                    e4x.append("/>\n");
+                }
+            }
+        }
+    }
+
+    /**
+     * This method will return an import and variable reference for channels specified in the map.
+     * @param map HashMap containing the client side channel type to be used, typically of the form
+     * "mx.messaging.channels.XXXXChannel", where the key and value are equal.
+     * @param imports StringBuffer of the imports needed for the given channel definitions
+     * @param references StringBuffer of the required references so that these classes will be linked in.
+     */
+    public static void codegenServiceImportsAndReferences(Map map, StringBuffer imports, StringBuffer references)
+    {
+        String channelSetImplType = (String)map.remove("ChannelSetImpl");
+        String type;
+        imports.append("import mx.messaging.config.ServerConfig;\n");
+        references.append("   // static references for configured channels\n");
+        for (Iterator chanIter = map.values().iterator(); chanIter.hasNext();)
+        {
+            type = (String)chanIter.next();
+            imports.append("import ");
+            imports.append(type);
+            imports.append(";\n");
+            references.append("   private static var ");
+            references.append(type.replace('.', '_'));
+            references.append("_ref:");
+            references.append(type.substring(type.lastIndexOf(".") +1) +";\n");
+        }
+        if (channelSetImplType != null)
+            imports.append("import mx.messaging.AdvancedChannelSet;\nimport mx.messaging.messages.ReliabilityMessage;\n");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/TargetSettings.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/TargetSettings.java b/modules/common/src/flex/messaging/config/TargetSettings.java
new file mode 100755
index 0000000..9fb11d5
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/TargetSettings.java
@@ -0,0 +1,79 @@
+/*
+ * 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.messaging.config;
+
+import java.util.List;
+import java.util.ArrayList;
+
+import flex.messaging.log.LogCategories;
+
+/**
+ * A logging target must specify the class name
+ * of the implementation, the level of logging events
+ * it will accept, a list of filters for logging
+ * categories it is interested in, and a collection of
+ * properties required to initialize the target.
+ *
+ * @author Peter Farland
+ * @exclude
+ */
+public class TargetSettings extends PropertiesSettings
+{
+    private String className;
+    private String level;
+    private List filters;
+
+    public TargetSettings(String className)
+    {
+        this.className = className;
+    }
+
+    public String getClassName()
+    {
+        return className;
+    }
+
+    public String getLevel()
+    {
+        return level;
+    }
+
+    public void setLevel(String level)
+    {
+        this.level = level;
+    }
+
+    public List getFilters()
+    {
+        return filters;
+    }
+
+    public void addFilter(String filter)
+    {
+        if (filters == null)
+            filters = new ArrayList();
+
+        // Replace DataService with Service.Data for backwards compatibility,
+        // excluding DataService.coldfusion.
+        if (filter.startsWith("DataService") && !filter.equals("DataService.coldfusion"))
+            filter = filter.replaceFirst("DataService", LogCategories.SERVICE_DATA);
+
+        filters.add(filter);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/TokenReplacer.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/TokenReplacer.java b/modules/common/src/flex/messaging/config/TokenReplacer.java
new file mode 100755
index 0000000..c628051
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/TokenReplacer.java
@@ -0,0 +1,202 @@
+/*
+ * 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.messaging.config;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+
+import flex.messaging.log.Log;
+import flex.messaging.log.LogCategories;
+import flex.messaging.util.StringUtils;
+
+/**
+ * This class is used by configuration parser to replace tokens of the format
+ * {...} with actual values. The value can either come from a JVM property 
+ * (eg. -Dmy.channel.id=my-amf) or from a token properties file specified via 
+ * token.file JVM property (eg. -Dtoken.file=/usr/local/tokens.properties) where
+ * the token key and value are specified in the property file.
+ * 
+ * If a token value is both specified as a JVM property and inside the token.file,
+ * JVM property takes precedence.
+ *
+ * @exclude
+ */
+public class TokenReplacer
+{
+    private static final String TOKEN_FILE = "token.file";
+    private static final Pattern pattern = Pattern.compile("\\{(.*?)\\}");
+
+    private final Map replacedTokens;
+    private Properties tokenProperties;
+    private String tokenPropertiesFilename;
+
+    /**
+     * Default constructor.
+     */
+    public TokenReplacer()
+    {
+        replacedTokens = new LinkedHashMap();
+        loadTokenProperties();
+    }
+
+    /**
+     * Replace any tokens in the value of the node or the text child of the node.
+     *
+     * @param node The node whose value will be searched for tokens.
+     * @param sourceFileName The source file where the node came from.
+     */
+    public void replaceToken(Node node, String sourceFileName)
+    {
+        // Exit if we are attempting to replace one of the forbidden nodes - nodes
+        // that may have curly brackets as part of their syntax
+        if (ConfigurationConstants.IP_ADDRESS_PATTERN.equals(node.getNodeName()))
+            return;
+
+        // ReplacementNode is either the original node if it has a value or the text
+        // child of the node if it does not have a value
+        Node replacementNode;
+        if (node.getNodeValue() == null)
+        {
+            if (node.getChildNodes().getLength() == 1 && node.getFirstChild() instanceof Text)
+                replacementNode = node.getFirstChild();
+            else
+                return;
+        }
+        else
+        {
+            replacementNode = node;
+        }
+
+        String nodeValue = replacementNode.getNodeValue();
+        Matcher matcher = pattern.matcher(nodeValue);
+        while (matcher.find()) // Means the node value has token(s)
+        {
+            String tokenWithCurlyBraces = matcher.group();
+            String tokenWithoutCurlyBraces = matcher.group(1);
+            String propertyValue = getPropertyValue(tokenWithoutCurlyBraces);
+            if (propertyValue != null)
+            {
+                nodeValue = StringUtils.substitute(nodeValue, tokenWithCurlyBraces, propertyValue);
+                replacedTokens.put(tokenWithCurlyBraces, propertyValue);
+            }
+            // context-path, server-name and server-port tokens can be replaced
+            // later, therefore, no warning is necessary if they cannot be replaced
+            // at this point.
+            else if (!ConfigurationConstants.CONTEXT_PATH_TOKEN.equals(tokenWithCurlyBraces)
+                    && !ConfigurationConstants.CONTEXT_PATH_ALT_TOKEN.equals(tokenWithCurlyBraces)
+                    && !ConfigurationConstants.SERVER_NAME_TOKEN.equals(tokenWithCurlyBraces)
+                    && !ConfigurationConstants.SERVER_PORT_TOKEN.equals(tokenWithCurlyBraces))
+            {
+                // Token ''{0}'' in ''{1}'' was not replaced. Either supply a value to this token with a JVM option, or remove it from the configuration.
+                ConfigurationException ex = new ConfigurationException();
+                Object[] args = {tokenWithCurlyBraces, sourceFileName};
+                ex.setMessage(ConfigurationConstants.IRREPLACABLE_TOKEN, args);
+                throw ex;
+            }
+        }
+        replacementNode.setNodeValue(nodeValue);
+    }
+
+    /**
+     * See if the token have a value either provided as a JVM property or as 
+     * part of the token property file. JVM property takes precedence on the token
+     * property file.
+     */
+    private String getPropertyValue(String tokenWithoutCurlyBraces)
+    {
+        String propertyValue = System.getProperty(tokenWithoutCurlyBraces);
+        if (propertyValue != null)
+            return propertyValue;
+
+        if (tokenProperties != null)
+            propertyValue = tokenProperties.getProperty(tokenWithoutCurlyBraces);
+
+        return propertyValue;
+    }
+
+    /**
+     * Used by the parser to report the replaced tokens once logging is setup.
+     */
+    public void reportTokens()
+    {
+        if (Log.isWarn())
+        {
+            if (tokenProperties != null && Log.isDebug())
+                Log.getLogger(LogCategories.CONFIGURATION).debug("Token replacer is using the token file '" + tokenPropertiesFilename + "'");
+
+            for (Iterator iter = replacedTokens.entrySet().iterator(); iter.hasNext();)
+            {
+                Map.Entry entry = (Map.Entry)iter.next();
+                String tokenWithParanthesis = (String)entry.getKey();
+                String propertyValue = (String)entry.getValue();
+                // Issue a special warning for context.root replacements,
+                if (ConfigurationConstants.CONTEXT_PATH_TOKEN.equals(tokenWithParanthesis)
+                        || ConfigurationConstants.CONTEXT_PATH_ALT_TOKEN.equals(tokenWithParanthesis))
+                {
+                    Log.getLogger(LogCategories.CONFIGURATION).warn("Token '{0}' was replaced with '{1}'. Note that this will apply to all applications on the JVM",
+                            new Object[]{tokenWithParanthesis, propertyValue});
+                }
+                else if (Log.isDebug())
+                {
+                    Log.getLogger(LogCategories.CONFIGURATION).debug("Token '{0}' was replaced with '{1}'", new Object[]{tokenWithParanthesis, propertyValue});
+                }
+            }
+        }
+    }
+
+    /**
+     * Given a String, determines whether the string contains tokens. 
+     * 
+     * @param value The String to check.
+     * @return True if the String contains tokens.
+     */
+    public static boolean containsTokens(String value)
+    {
+        return (value != null && value.length() > 0)? pattern.matcher(value).find() : false;
+    }
+
+    private void loadTokenProperties()
+    {
+        tokenPropertiesFilename = System.getProperty(TOKEN_FILE);
+        if (tokenPropertiesFilename == null)
+            return;
+
+        tokenProperties = new Properties();
+        try
+        {
+            tokenProperties.load(new FileInputStream(tokenPropertiesFilename));
+        }
+        catch (FileNotFoundException e)
+        {
+            tokenProperties = null;
+        }
+        catch (IOException e)
+        {
+            tokenProperties = null;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/XPathClientConfigurationParser.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/XPathClientConfigurationParser.java b/modules/common/src/flex/messaging/config/XPathClientConfigurationParser.java
new file mode 100755
index 0000000..4917135
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/XPathClientConfigurationParser.java
@@ -0,0 +1,90 @@
+/*
+ * 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.messaging.config;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+/**
+ * Uses Sun's JDK 1.5 XPath implementation on a DOM
+ * representation of a messaging configuration file.
+ * <p>
+ * NOTE: Since reference ids are used between elements, certain
+ * sections of the document need to be parsed first.
+ * </p>
+ *
+ * @author Peter Farland
+ * @exclude
+ */
+public class XPathClientConfigurationParser extends ClientConfigurationParser
+{
+    private XPath xpath;
+
+    protected void initializeExpressionQuery()
+    {
+        this.xpath = XPathFactory.newInstance().newXPath();
+    }
+
+    protected Node selectSingleNode(Node source, String expression)
+    {
+        try
+        {
+            return (Node) xpath.evaluate(expression, source, XPathConstants.NODE);
+        }
+        catch (XPathExpressionException expressionException)
+        {
+            throw wrapException(expressionException);
+        }
+    }
+
+    protected NodeList selectNodeList(Node source, String expression)
+    {
+        try
+        {
+            return (NodeList) xpath.evaluate(expression, source, XPathConstants.NODESET);
+        }
+        catch (XPathExpressionException expressionException)
+        {
+            throw wrapException(expressionException);
+        }
+    }
+
+    protected Object evaluateExpression(Node source, String expression)
+    {
+        try
+        {
+            return xpath.evaluate(expression, source, XPathConstants.STRING);
+        }
+        catch (XPathExpressionException expressionException)
+        {
+            throw wrapException(expressionException);
+        }
+    }
+
+    private ConfigurationException wrapException(XPathExpressionException exception)
+    {
+       ConfigurationException result = new ConfigurationException();
+       result.setDetails(PARSER_INTERNAL_ERROR);
+       result.setRootCause(exception);
+       return result;
+    }
+}


[13/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/jmx/MBeanOperationInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/jmx/MBeanOperationInfo.java b/modules/core/src/flex/management/jmx/MBeanOperationInfo.java
new file mode 100755
index 0000000..a514ba5
--- /dev/null
+++ b/modules/core/src/flex/management/jmx/MBeanOperationInfo.java
@@ -0,0 +1,119 @@
+/*
+ * 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.management.jmx;
+
+/**
+ * Remotable MBeanOperationInfo class that complies with Flash serialization requirements.
+ *
+ * @author shodgson
+ */
+public class MBeanOperationInfo
+{
+    /**
+     * The operation name.
+     */
+    public String name;
+    
+    /**
+     * The operation description.
+     */
+    public String description;
+    
+    /**
+     * The operation's argument signature.
+     */
+    public MBeanParameterInfo[] signature;
+    
+    /**
+     * The operation's return type.
+     */
+    public String returnType;
+    
+    /**
+     * The impact of the operation; one of <code>INFO, ACTION, ACTION_INFO, UNKNOWN</code>.
+     */
+    public int impact;
+    
+    /**
+     * Constructs an empty <code>MBeanOperationInfo</code> instance.    
+     */
+    public MBeanOperationInfo()
+    {}
+    
+    /**
+     * Constructs a <code>MBeanOperationInfo</code> instance based upon a
+     * <code>javax.management.MBeanOperationInfo</code> instance.
+     * 
+     * @param mbeanOperationInfo The JMX <code>MBeanOperationInfo</code> instance to base this instance on.
+     */
+    public MBeanOperationInfo(javax.management.MBeanOperationInfo mbeanOperationInfo)
+    {
+        name = mbeanOperationInfo.getName();
+        description = mbeanOperationInfo.getDescription();
+        signature = convertSignature(mbeanOperationInfo.getSignature());
+        returnType = mbeanOperationInfo.getReturnType();
+        impact = mbeanOperationInfo.getImpact();
+    }
+    
+    /**
+     * Utility method to convert this <code>MBeanOperationInfo</code> to a
+     * <code>javax.management.MBeanOperationInfo</code> instance.
+     * 
+     * @return A JMX <code>MBeanOperationInfo</code> based upon this instance.
+     */
+    public javax.management.MBeanOperationInfo toMBeanOperationInfo()
+    {
+        return new javax.management.MBeanOperationInfo(name,
+                                                       description,
+                                                       convertSignature(signature),
+                                                       returnType,
+                                                       impact);
+    }
+    
+    /**
+     * Utility method to convert JMX parameter info instances to Flash friendly parameter info instances.
+     * 
+     * @param source JMX parameter info instances.
+     * @return Flash friendly parameter info instances.
+     */
+    private MBeanParameterInfo[] convertSignature(javax.management.MBeanParameterInfo[] source)
+    {
+        MBeanParameterInfo[] signature = new MBeanParameterInfo[source.length];
+        for (int i = 0; i < source.length; i++)
+        {
+            signature[i] = new MBeanParameterInfo(source[i]);
+        }
+        return signature;
+    }
+    
+    /**
+     * Utility method to convert Flash friendly parameter info instances to JMX parameter info instances.
+     * 
+     * @param source Flash friendly parameter info instances.
+     * @return JMX parameter info instances.
+     */
+    private javax.management.MBeanParameterInfo[] convertSignature(MBeanParameterInfo[] source)
+    {
+        javax.management.MBeanParameterInfo[] signature = new javax.management.MBeanParameterInfo[source.length];
+        for (int i = 0; i < source.length; i++)
+        {
+            signature[i] = source[i].toMBeanParameterInfo();
+        }
+        return signature;
+    }
+        
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/jmx/MBeanParameterInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/jmx/MBeanParameterInfo.java b/modules/core/src/flex/management/jmx/MBeanParameterInfo.java
new file mode 100755
index 0000000..d56b941
--- /dev/null
+++ b/modules/core/src/flex/management/jmx/MBeanParameterInfo.java
@@ -0,0 +1,73 @@
+/*
+ * 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.management.jmx;
+
+/**
+ * Remotable MBeanParameterInfo class that complies with Flash serialization requirements.
+ *
+ * @author shodgson
+ */
+public class MBeanParameterInfo
+{
+    /**
+     * The name of the parameter.
+     */
+    public String name;
+    
+    /**
+     * The Java type for the parameter.
+     */
+    public String type;
+    
+    /**
+     * The description for the parameter.
+     */
+    public String description;
+    
+    /**
+     * Constructs an empty <code>MBeanParameterInfo</code> instance.
+     */
+    public MBeanParameterInfo()
+    {}
+    
+    /**
+     * Constructs a <code>MBeanParameterInfo</code> instance based upon a
+     * <code>javax.management.MBeanParameterInfo</code> instance.
+     * 
+     * @param mbeanParameterInfo The JMX <code>MBeanParameterInfo</code> instance to base this instance on.
+     */
+    public MBeanParameterInfo(javax.management.MBeanParameterInfo mbeanParameterInfo)
+    {
+        name = mbeanParameterInfo.getName();
+        type = mbeanParameterInfo.getType();
+        description = mbeanParameterInfo.getDescription();
+    }
+    
+    /**
+     * Utility method to convert this <code>MBeanParameterInfo</code> to a
+     * <code>javax.management.MBeanParameterInfo</code> instance.
+     * 
+     * @return A JMX <code>MBeanParameterInfo</code> based upon this instance.
+     */
+    public javax.management.MBeanParameterInfo toMBeanParameterInfo()
+    {
+        return new javax.management.MBeanParameterInfo(name,
+                                                       type,
+                                                       description);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/jmx/MBeanServerGateway.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/jmx/MBeanServerGateway.java b/modules/core/src/flex/management/jmx/MBeanServerGateway.java
new file mode 100755
index 0000000..f522dec
--- /dev/null
+++ b/modules/core/src/flex/management/jmx/MBeanServerGateway.java
@@ -0,0 +1,909 @@
+/*
+ * 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.management.jmx;
+
+import flex.management.BaseControl;
+import flex.management.MBeanServerLocatorFactory;
+import flex.management.ManagementException;
+
+import java.util.Iterator;
+import java.util.Set;
+import java.util.TreeSet;
+
+import javax.management.AttributeList;
+import javax.management.AttributeNotFoundException;
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.IntrospectionException;
+import javax.management.InvalidAttributeValueException;
+import javax.management.MalformedObjectNameException;
+import javax.management.MBeanException;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServer;
+import javax.management.NotCompliantMBeanException;
+import javax.management.ReflectionException;
+import javax.management.RuntimeOperationsException;
+
+/**
+ * Remoting gateway to the MBean server that hosts Flex MBeans.
+ * <p>
+ * Some base javax.management.MBeanServer methods are unimplemented due to the
+ * fact that we're interacting with the MBean server from remote Flash clients.
+ * Some methods have been modified to better suite remote Flash clients. Other
+ * methods are additive, serving as a convenience for Flex applications.
+ * </p><p>
+ * Unimplemented methods from the base MBeanServer API:
+ * <ul>
+ *   <li>getDomains() - JMX 1.2</li>
+ *   <li>addNotificationListener()/removeNotificationListener() - Flash objects
+ *       cannot listen directly for MBean notifications.</li>
+ *   <li>instantiate() - returns a reference to a Java object that is not useful
+ *       to a remote Flash client.</li>
+ *   <li>deserialize() - deprecated.</li>
+ *   <li>getClassLoaderFor() - meaningless to a Flash client.</li>
+ *   <li>getClassLoader() - meaningless to a Flash client.</li>
+ *   <li>getClassLoaderRepository() - meaningless to a Flash client.</li>
+ * </ul>
+ * </p><p>
+ * Modifications to the base MBeanServer API:
+ * <ul>
+ *   <li>* All ObjectName arguments are typed as String because serialization in either
+ *       direction doesn't support ObjectNames that are patterns. This does not effect
+ *       ObjectNames that are not patterns that are returned to the client.</li>
+ *   <li>queryMBeans() - returns an Array of ObjectInstances rather than a java.util.Set
+ *       and does not currently support the QueryExp argument.</li>
+ *   <li>queryNames() returns an Array of ObjectNames rather than a java.util.Set
+ *       and does not currently support the QueryExp argument.</li>
+ *   <li>getAttributes() returns an Array of Attributes rather than an AttributeList.</li>
+ *   <li>setAttributes() accepts and returns Arrays of Attributes rather than AttributeLists.</li>
+ * </ul>
+ * </p><p>
+ * Additonal Flex-specific methods:
+ * <ul>
+ *   <li>getFlexMBeanCount()</li>
+ *   <li>getFlexDomains()</li>
+ *   <li>getFlexMBeanObjectNames()</li>
+ * </ul>
+ * </p>
+ *
+ * @author shodgson
+ */
+public class MBeanServerGateway
+{
+    // Error string constants.
+    private static final int MALFORMED_OBJECTNAME = 10400;
+    private static final int GETINFO_INTROSPECTION_ERR = 10406;
+    private static final int MBEAN_NOTFOUND = 10407;
+    private static final int GETINFO_REFLECT_ERR = 10408;
+    private static final int ATTRIB_NOTFOUND = 10409;
+    private static final int GETATTRIB_EXCEPTION = 10410;
+    private static final int GETATTRIB_REFLECT_ERR = 10411;
+    private static final int GETATTRIB_NULL_ARGUMENT = 10412;
+    private static final int GETATTRIBS_REFLECT_ERR = 10413;
+    private static final int GETATTRIBS_NULL_ARGUMENT = 10414;
+    private static final int INVOKE_REFLECT_ERR = 10415;
+    private static final int INVOKE_ERR = 10416;
+    private static final int CREATE_ERR = 10417;
+    private static final int INSTANCE_EXISTS = 10418;
+    private static final int NOT_COMPLIANT = 10419;
+    private static final int MBEAN_PREREG_ERR = 10420;
+    private static final int MBEAN_PREDEREG_ERR = 10421;
+    private static final int SETATTRIB_REFLECT_ERR = 10422;
+    private static final int SETATTRIB_EXCEPTION = 10423;
+    private static final int INVALID_ATTRIB_VALUE = 10424;
+    private static final int SETATTRIBS_REFLECT_ERR = 10425;
+    
+    private MBeanServer server;
+
+    /**
+     * Constructs a new MBeanServerGateway. The gateway exposes the MBean server
+     * that Flex MBean are registered with in a remoting-friendly fashion.
+     */
+    public MBeanServerGateway()
+    {
+        server = MBeanServerLocatorFactory.getMBeanServerLocator().getMBeanServer();
+    }
+
+    /////////////////////////////////////
+    //
+    // Core MBeanServer API
+    //
+    /////////////////////////////////////
+
+    /**
+     * Instantiates and registers an MBean with the MBean server.
+     *
+     * @param className The class name for the MBean to instantiate.
+     * @param objectName The object name of the MBean.
+     * @return An ObjectInstance containing the ObjectName and Java class name of the new MBean.
+     */
+    public ObjectInstance createMBean(String className, String objectName)
+    {
+        javax.management.ObjectName name = null;
+        if (objectName != null)
+            name = validateObjectName(objectName);
+        try
+        {
+            return new ObjectInstance(server.createMBean(className, name));
+        }
+        catch (ReflectionException re)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(CREATE_ERR, new Object[] {name});
+            me.setRootCause(re);
+            throw me;
+        }
+        catch (InstanceAlreadyExistsException iaee)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(INSTANCE_EXISTS, new Object[] {name});
+            me.setRootCause(iaee);
+            throw me;
+        }
+        catch (MBeanException mbe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(CREATE_ERR, new Object[] {name});
+            me.setRootCause(mbe);
+            throw me;
+        }
+        catch (NotCompliantMBeanException ncmbe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(NOT_COMPLIANT, new Object[] {className});
+            me.setRootCause(ncmbe);
+            throw me;
+        }
+    }
+
+    /**
+     * Instantiates and registers an MBean with the MBean server. The class loader
+     * to use to load the MBean class is identified by its ObjectName.
+     *
+     * @param className The class name for the MBean to instantiate.
+     * @param objectName The object name of the MBean.
+     * @param loaderName The object name of the desired class loader.
+     * @return An ObjectInstance containing the ObjectName and Java class name of the new MBean.
+     */
+    public ObjectInstance createMBean(String className, String objectName, String loaderName)
+    {
+        javax.management.ObjectName name = null;
+        javax.management.ObjectName loader = null;
+        if (objectName != null)
+            name = validateObjectName(objectName);
+        if (loaderName != null)
+            loader = validateObjectName(loaderName);
+        try
+        {
+            return new ObjectInstance(server.createMBean(className, name, loader));
+        }
+        catch (ReflectionException re)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(CREATE_ERR, new Object[] {name});
+            me.setRootCause(re);
+            throw me;
+        }
+        catch (InstanceAlreadyExistsException iaee)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(INSTANCE_EXISTS, new Object[] {name});
+            me.setRootCause(iaee);
+            throw me;
+        }
+        catch (MBeanException mbe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(CREATE_ERR, new Object[] {name});
+            me.setRootCause(mbe);
+            throw me;
+        }
+        catch (NotCompliantMBeanException ncmbe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(NOT_COMPLIANT, new Object[] {className});
+            me.setRootCause(ncmbe);
+            throw me;
+        }
+        catch (InstanceNotFoundException infe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(MBEAN_NOTFOUND, new Object[] {name});
+            me.setRootCause(infe);
+            throw me;
+        }
+    }
+
+    /**
+     * Instantiates and registers an MBean with the MBean server.
+     *
+     * @param className The class name for the MBean to instantiate.
+     * @param objectName The object name of the MBean.
+     * @param params An array of parameters to pass to the MBean constructor.
+     * @param signature An array containing the type signature for the constructor to invoke.
+     * @return An ObjectInstance containing the ObjectName and Java class name of the new MBean.
+     */
+    public ObjectInstance createMBean(String className, String objectName, Object[] params, String[] signature)
+    {
+        javax.management.ObjectName name = null;
+        if (objectName != null)
+            name = validateObjectName(objectName);
+        try
+        {
+            return new ObjectInstance(server.createMBean(className, name, params, signature));
+        }
+        catch (ReflectionException re)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(CREATE_ERR, new Object[] {name});
+            me.setRootCause(re);
+            throw me;
+        }
+        catch (InstanceAlreadyExistsException iaee)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(INSTANCE_EXISTS, new Object[] {name});
+            me.setRootCause(iaee);
+            throw me;
+        }
+        catch (MBeanException mbe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(CREATE_ERR, new Object[] {name});
+            me.setRootCause(mbe);
+            throw me;
+        }
+        catch (NotCompliantMBeanException ncmbe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(NOT_COMPLIANT, new Object[] {className});
+            me.setRootCause(ncmbe);
+            throw me;
+        }
+    }
+
+    /**
+     * Instantiates and registers an MBean with the MBean server. The class loader
+     * to use to load the MBean class is identified by its ObjectName.
+     *
+     * @param className The class name for the MBean to instantiate.
+     * @param objectName The object name of the MBean.
+     * @param loaderName The object name of the desired class loader.
+     * @param params An array of parameters to pass to the MBean constructor.
+     * @param signature An array containing the type signature for the constructor to invoke.
+     * @return An ObjectInstance containing the ObjectName and Java class name of the new MBean.
+     */
+    public ObjectInstance createMBean(String className, String objectName, String loaderName, Object[] params, String[] signature)
+    {
+        javax.management.ObjectName name = null;
+        javax.management.ObjectName loader = null;
+        if (objectName != null)
+            name = validateObjectName(objectName);
+        if (loaderName != null)
+            loader = validateObjectName(loaderName);
+        try
+        {
+            return new ObjectInstance(server.createMBean(className, name, loader, params, signature));
+        }
+        catch (ReflectionException re)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(CREATE_ERR, new Object[] {name});
+            me.setRootCause(re);
+            throw me;
+        }
+        catch (InstanceAlreadyExistsException iaee)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(INSTANCE_EXISTS, new Object[] {name});
+            me.setRootCause(iaee);
+            throw me;
+        }
+        catch (MBeanException mbe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(CREATE_ERR, new Object[] {name});
+            me.setRootCause(mbe);
+            throw me;
+        }
+        catch (NotCompliantMBeanException ncmbe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(NOT_COMPLIANT, new Object[] {className});
+            me.setRootCause(ncmbe);
+            throw me;
+        }
+        catch (InstanceNotFoundException infe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(MBEAN_NOTFOUND, new Object[] {name});
+            me.setRootCause(infe);
+            throw me;
+        }
+    }
+
+    /**
+     * Registers a pre-existing object as an MBean with the MBean server.
+     *
+     * @param object The object to register as an MBean.
+     * @param objectName The object name for the MBean.
+     * @return An ObjectInstance containing the ObjectName and Java class name of the new MBean.
+     */
+    public ObjectInstance registerMBean(Object object, String objectName)
+    {
+        javax.management.ObjectName name = null;
+        if (objectName != null)
+            name = validateObjectName(objectName);
+        try
+        {
+            return new ObjectInstance(server.registerMBean(object, name));
+        }
+        catch (InstanceAlreadyExistsException iaee)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(INSTANCE_EXISTS, new Object[] {name});
+            me.setRootCause(iaee);
+            throw me;
+        }
+        catch (NotCompliantMBeanException ncmbe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(NOT_COMPLIANT, new Object[] {object.getClass().getName()});
+            me.setRootCause(ncmbe);
+            throw me;
+        }
+        catch (MBeanRegistrationException mbre)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(MBEAN_PREREG_ERR, new Object[] {name});
+            me.setRootCause(mbre);
+            throw me;
+        }
+    }
+
+    /**
+     * Unregisters an MBean from the MBean server.
+     *
+     * @param objectName The object name of the MBean to unregister.
+     */
+    public void unregisterMBean(String objectName)
+    {
+        javax.management.ObjectName name = validateObjectName(objectName);
+        try
+        {
+            server.unregisterMBean(name);
+        }
+        catch (InstanceNotFoundException infe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(MBEAN_NOTFOUND, new Object[] {name});
+            me.setRootCause(infe);
+            throw me;
+        }
+        catch (MBeanRegistrationException mbre)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(MBEAN_PREDEREG_ERR, new Object[] {name});
+            me.setRootCause(mbre);
+            throw me;
+        }
+    }
+
+    /**
+     * Gets the ObjectInstance for the specified MBean registered with the
+     * MBean server.
+     *
+     * @param objectName The object name of the MBean.
+     * @return An ObjectInstance containing the ObjectName and Java class name of the MBean.
+     */
+    public ObjectInstance getObjectInstance(String objectName)
+    {
+        javax.management.ObjectName name = validateObjectName(objectName);
+        try
+        {
+            return new ObjectInstance(server.getObjectInstance(name));
+        }
+        catch (InstanceNotFoundException infe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(MBEAN_NOTFOUND, new Object[] {name});
+            me.setRootCause(infe);
+            throw me;
+        }
+    }
+
+    /**
+     * Gets MBeans controlled by the MBean server. This method allows the following to be obtained:
+     * All MBeans, or a set of MBeans specified by pattern matching on the ObjectName, or a specific
+     * MBean.
+     * <p>
+     * This method does not support a QueryExp argument for additional filtering of the queried set.
+     * </p>
+     *
+     * @param objectName The object name pattern identifying the MBeans to retrieve.
+     * @return A set of ObjectInstances for the selected MBeans.
+     */
+    public ObjectInstance[] queryMBeans(String objectName)
+    {
+        javax.management.ObjectName name = validateObjectName(objectName);
+        Set result = server.queryMBeans(name, null);
+        int n = result.size();
+        if (n > 0)
+        {
+            ObjectInstance[] toReturn = new ObjectInstance[n];
+            int i = 0;
+            for (Iterator iter = result.iterator(); iter.hasNext();) 
+            {
+                toReturn[i++] = new ObjectInstance((javax.management.ObjectInstance)iter.next());
+            }
+            return toReturn;
+        }
+        else
+        {
+            return new ObjectInstance[0];
+        }
+    }
+
+    /**
+     * Gets the names of MBeans controlled by the MBean server. This method allows the following to be
+     * obtained: The names of all MBeans, the names of the set of MBeans matching the ObjectName pattern,
+     * a specific MBean name.
+     * <p>
+     * This method does not support a QueryExp argument for additional filtering of the queried set.
+     * </p>
+     *
+     * @param objectName The object name pattern identifying the MBean names to retrieve.
+     * @return A set of ObjectNames for the selected MBeans.
+     */
+    public ObjectName[] queryNames(String objectName)
+    {
+        javax.management.ObjectName name = validateObjectName(objectName);
+        Set result = server.queryNames(name, null);
+        int n = result.size();
+        if (n > 0)
+        {
+            ObjectName[] toReturn = new ObjectName[n];
+            int i = 0;
+            for (Iterator iter = result.iterator(); iter.hasNext();)
+            {
+                toReturn[i++] = new ObjectName((javax.management.ObjectName)iter.next());
+            }
+            return toReturn;
+        }
+        else
+        {
+            return new ObjectName[0];
+        }
+    }
+
+    /**
+     * Checks whether an MBean, identified by its object name, is already registered with the MBean server.
+     *
+     * @param objectName The object name of the MBean to be checked.
+     * @return True if the MBean is already registered in the MBean server, false otherwise.
+     */
+    public boolean isRegistered(String objectName)
+    {
+        javax.management.ObjectName name = validateObjectName(objectName);
+        return server.isRegistered(name);
+    }
+
+    /**
+     * Returns the total number of beans registered in the MBean server.
+     *
+     * @return The number of registered MBeans.
+     */
+    public Integer getMBeanCount()
+    {
+        return server.getMBeanCount();
+    }
+
+    /**
+     * Gets the value of a specific attribute of a named MBean. The MBean is identified by its object name.
+     *
+     * @param objectName The object name of the MBean from which the attribute is to be retrieved.
+     * @param attribute The name of the attribute to be retrieved.
+     * @return The value of the retrieved attribute.
+     */
+    public Object getAttribute(String objectName, String attribute)
+    {
+        javax.management.ObjectName name = validateObjectName(objectName);
+        try
+        {
+            return server.getAttribute(name, attribute);
+        }
+        catch (AttributeNotFoundException anfe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(ATTRIB_NOTFOUND, new Object[] {attribute, name});
+            me.setRootCause(anfe);
+            throw me;
+        }
+        catch (MBeanException mbe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(GETATTRIB_EXCEPTION, new Object[] {attribute, name});
+            me.setRootCause(mbe);
+            throw me;
+        }
+        catch (ReflectionException re)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(GETATTRIB_REFLECT_ERR, new Object[] {attribute, name});
+            me.setRootCause(re);
+            throw me;
+        }
+        catch (InstanceNotFoundException infe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(MBEAN_NOTFOUND, new Object[] {name});
+            me.setRootCause(infe);
+            throw me;
+        }
+        catch (RuntimeOperationsException roe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(GETATTRIB_NULL_ARGUMENT);
+            me.setRootCause(roe);
+            throw me;
+        }
+    }
+
+    /**
+     * Gets the values of several attributes of a named MBean.
+     *
+     * @param objectName The object name of the MBean to get attribute values from.
+     * @param attributes The names of the attributes to get values for.
+     * @return The attributes, each containing their name and value.
+     */
+    public Attribute[] getAttributes(String objectName, String[] attributes)
+    {
+        javax.management.ObjectName name = validateObjectName(objectName);
+        try
+        {
+            AttributeList result = server.getAttributes(name, attributes);
+            Attribute[] values = new Attribute[result.size()];
+            for (int i = 0; i < result.size(); i++)
+            {
+                values[i] = new Attribute((javax.management.Attribute)result.get(i));
+            }
+            return values;
+        }
+        catch (ReflectionException re)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(GETATTRIBS_REFLECT_ERR, new Object[] {name});
+            me.setRootCause(re);
+            throw me;
+        }
+        catch (InstanceNotFoundException infe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(MBEAN_NOTFOUND, new Object[] {name});
+            me.setRootCause(infe);
+            throw me;
+        }
+        catch (RuntimeOperationsException roe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(GETATTRIBS_NULL_ARGUMENT);
+            me.setRootCause(roe);
+            throw me;
+        }
+    }
+
+    /**
+     * Sets the value of the attribute for the specified MBean.
+     *
+     * @param objectName The name of the MBean.
+     * @param attribute The attribute to set.
+     */
+    public void setAttribute(String objectName, Attribute attribute)
+    {
+        javax.management.ObjectName name = validateObjectName(objectName);
+        javax.management.Attribute attrib = validateAttribute(attribute);
+        try
+        {
+            server.setAttribute(name, attrib);
+        }
+        catch (ReflectionException re)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(SETATTRIB_REFLECT_ERR, new Object[] {attrib.getName(), name});
+            me.setRootCause(re);
+            throw me;
+        }
+        catch (InstanceNotFoundException infe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(MBEAN_NOTFOUND, new Object[] {name});
+            me.setRootCause(infe);
+            throw me;
+        }
+        catch (AttributeNotFoundException anfe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(ATTRIB_NOTFOUND, new Object[] {attrib.getName(), name});
+            me.setRootCause(anfe);
+            throw me;
+        }
+        catch (MBeanException mbe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(SETATTRIB_EXCEPTION, new Object[] {attrib.getName(), name});
+            me.setRootCause(mbe);
+            throw me;
+        }
+        catch (InvalidAttributeValueException iave)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(INVALID_ATTRIB_VALUE, new Object[] {attrib.getValue(), attrib.getName(), name});
+            me.setRootCause(iave);
+            throw me;
+        }
+    }
+
+    /**
+     * Sets the values for several attributes of the specified MBean.
+     *
+     * @param objectName The object name for the MBean.
+     * @param attributes The attributes to set.
+     * @return The attributes that were set with their new values.
+     */
+    public Attribute[] setAttributes(String objectName, Attribute[] attributes)
+    {
+        javax.management.ObjectName name = validateObjectName(objectName);
+        AttributeList attribList = new AttributeList();
+        for (int i = 0; i < attributes.length; i++)
+        {
+            attribList.add(attributes[i].toAttribute());
+        }
+        try
+        {
+            AttributeList result = server.setAttributes(name, attribList);
+            Attribute[] values = new Attribute[result.size()];
+            for (int i = 0; i < result.size(); i++)
+            {
+                values[i] = new Attribute((javax.management.Attribute)result.get(i));
+            }
+            return values;
+        }
+        catch (InstanceNotFoundException infe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(MBEAN_NOTFOUND, new Object[] {name});
+            me.setRootCause(infe);
+            throw me;
+        }
+        catch (ReflectionException re)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(SETATTRIBS_REFLECT_ERR, new Object[] {name});
+            me.setRootCause(re);
+            throw me;
+        }
+    }
+
+    /**
+     * Invokes an operation on an MBean.
+     *
+     * @param objectName The object name of the MBean to invoke the operation on.
+     * @param operationName The operation to invoke.
+     * @param params The parameters for the operation invocation.
+     * @param signature The parameter signature for the operation.
+     * @return The object returned by the operation invocation.
+     */
+    public Object invoke(String objectName, String operationName, Object[] params, String[] signature)
+    {
+        javax.management.ObjectName name = validateObjectName(objectName);
+        try
+        {
+            return server.invoke(name, operationName, params, signature);
+        }
+        catch (ReflectionException re)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(INVOKE_REFLECT_ERR, new Object[]  {operationName, objectName});
+            me.setRootCause(re);
+            throw me;
+        }
+        catch (InstanceNotFoundException infe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(MBEAN_NOTFOUND, new Object[] {objectName});
+            me.setRootCause(infe);
+            throw me;
+        }
+        catch (MBeanException mbe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(INVOKE_ERR, new Object[]  {operationName, objectName});
+            me.setRootCause(mbe);
+            throw me;
+        }
+    }
+
+    /**
+     * Returns the default domain used for naming MBeans.
+     *
+     * @return The default domain.
+     */
+    public String getDefaultDomain()
+    {
+        return server.getDefaultDomain();
+    }
+
+    /**
+     * This method discovers the attributes and operations that an MBean exposes for management
+     * by a Flash client.
+     *
+     * @param objectName The name of the MBean to get metadata for.
+     * @return An MBeanInfo instance that describes the MBean.
+     */
+    public flex.management.jmx.MBeanInfo getMBeanInfo(String objectName)
+    {
+        javax.management.ObjectName name = validateObjectName(objectName);
+        try
+        {
+            return new MBeanInfo(server.getMBeanInfo(name));
+        }
+        catch (IntrospectionException ie)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(GETINFO_INTROSPECTION_ERR, new Object[] {objectName});
+            me.setRootCause(ie);
+            throw me;
+        }
+        catch (InstanceNotFoundException infe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(MBEAN_NOTFOUND, new Object[] {objectName});
+            me.setRootCause(infe);
+            throw me;
+        }
+        catch (ReflectionException re)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(GETINFO_REFLECT_ERR, new Object[] {objectName});
+            me.setRootCause(re);
+            throw me;
+        }
+    }
+
+
+    /**
+     * Returns true if the specified MBean is an instance of the specified class; otherwise false.
+     *
+     * @param objectName The object name of the MBean.
+     * @param className The name of the class.
+     * @return true if the specified MBean is an instance of the specified class; otherwise false.
+     */
+    public boolean isInstanceOf(String objectName, String className)
+    {
+        javax.management.ObjectName name = validateObjectName(objectName);
+        try
+        {
+            return server.isInstanceOf(name, className);
+        }
+        catch (InstanceNotFoundException infe)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(MBEAN_NOTFOUND, new Object[] {objectName});
+            me.setRootCause(infe);
+            throw me;
+        }
+    }
+
+    ////////////////////////////////
+    //
+    // Additive Flex-specific API
+    //
+    ////////////////////////////////
+
+    /**
+     * Returns all the object names for Flex related MBeans.
+     *
+     * @return The object names for all Flex related MBeans.
+     */
+    public ObjectName[] getFlexMBeanObjectNames()
+    {
+        javax.management.ObjectName pattern = validateObjectName(BaseControl.DOMAIN_PREFIX + "*:*");
+        Set result = server.queryNames(pattern, null);
+        ObjectName[] names = new ObjectName[result.size()];
+        int i = 0;
+        for (Iterator iter = result.iterator(); iter.hasNext(); )
+        {
+            names[i++] = new ObjectName((javax.management.ObjectName)iter.next());
+        }
+        return names;
+    }
+
+    /**
+     * Returns the number of narrowed Flex MBeans registered in the MBean server.
+     *
+     * @return The number of narrowed Flex MBeans registered in the MBean server.
+     */
+    public Integer getFlexMBeanCount()
+    {
+        return new Integer(getFlexMBeanObjectNames().length);
+    }
+
+    /**
+     * Returns the narrowed list of Flex domains in which any MBean is currently registered.
+     * The domains are returned in naturally sorted order.
+     *
+     * @return The narrowed list of Flex domains in which any MBean is currently registered.
+     */
+    public String[] getFlexDomains()
+    {
+        ObjectName[] names = getFlexMBeanObjectNames();
+        Set domains = new TreeSet();
+        String name;
+        String domain;
+        if (names.length > 0)
+        {
+            for (int i = 0; i < names.length; ++i)
+            {
+                name = names[i].canonicalName;
+                domain = name.substring(0, name.indexOf(':'));
+                if (!domains.contains(domain))
+                {
+                    domains.add(domain);
+                }
+            }
+        }
+        return (String[])domains.toArray(new String[domains.size()]);
+    }
+
+    ///////////////////////////////
+    //
+    // Internal helper methods
+    //
+    ///////////////////////////////
+
+    /**
+     * Helper method to validate that we have a well-formed ObjectName string.
+     *
+     * @param objectName The object name to validate.
+     * @return The valid ObjectName.
+     */
+    private javax.management.ObjectName validateObjectName(String objectName)
+    {
+        try
+        {
+            return new javax.management.ObjectName(objectName);
+        }
+        catch (MalformedObjectNameException mone)
+        {
+            ManagementException me = new ManagementException();
+            me.setMessage(MALFORMED_OBJECTNAME, new Object[] {objectName});
+            throw me;
+        }
+    }
+
+    /**
+     * Helper method to validate that we have a well-formed Attribute.
+     *
+     * @param attribute The attribute to validate.
+     * @return The valid Attribute.
+     */
+    private javax.management.Attribute validateAttribute(Attribute attribute)
+    {
+        return attribute.toAttribute();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/jmx/ObjectInstance.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/jmx/ObjectInstance.java b/modules/core/src/flex/management/jmx/ObjectInstance.java
new file mode 100755
index 0000000..03e81a0
--- /dev/null
+++ b/modules/core/src/flex/management/jmx/ObjectInstance.java
@@ -0,0 +1,67 @@
+/*
+ * 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.management.jmx;
+
+import javax.management.MalformedObjectNameException;
+
+/**
+ * Remotable ObjectInstance representation that complies with Flash serialization requirements.
+ * 
+ * @author shodgson
+ */
+public class ObjectInstance
+{
+    /**
+     * The object name part of the <code>ObjectInstance</code>.
+     */
+    public ObjectName objectName;
+    
+    /**
+     * The class name part of the <code>ObjectInstance</code>.
+     */
+    public String className;
+    
+    /**
+     * Constructs an empty <code>ObjectInstance</code> instance.
+     *
+     */
+    public ObjectInstance()
+    {}
+    
+    /**
+     * Constructs a <code>ObjectInstance</code> instance based upon a
+     * <code>javax.management.ObjectInstance</code> instance.
+     * 
+     * @param objectInstance The JMX <code>ObjectInstance</code> instance to base this instance on.
+     */
+    public ObjectInstance(javax.management.ObjectInstance objectInstance)
+    {
+        objectName = new ObjectName(objectInstance.getObjectName());
+        className = objectInstance.getClassName();
+    }
+    
+    /**
+     * Utility method to convert this <code>ObjectInstance</code> to a
+     * <code>javax.management.ObjectInstance</code> instance.
+     * 
+     * @return A JMX <code>ObjectInstance</code> based upon this instance.
+     */
+    public javax.management.ObjectInstance toObjectInstance() throws MalformedObjectNameException
+    {
+        return new javax.management.ObjectInstance(objectName.toObjectName(), className);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/jmx/ObjectName.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/jmx/ObjectName.java b/modules/core/src/flex/management/jmx/ObjectName.java
new file mode 100755
index 0000000..2c3356e
--- /dev/null
+++ b/modules/core/src/flex/management/jmx/ObjectName.java
@@ -0,0 +1,99 @@
+/*
+ * 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.management.jmx;
+
+import java.util.Hashtable;
+import javax.management.MalformedObjectNameException;
+
+/**
+ * Remotable ObjectName representation that complies with Flash serialization requirements. 
+ * This class is JMX 1.1 compliant.
+ * 
+ * @author shodgson
+ */
+public class ObjectName
+{
+    /**
+     * String representation of the list of key properties sorted in lexical order.
+     */
+    public String canonicalKeyPropertyListString;
+    
+    /**
+     * Canonical form of the name with properties sorted in lexical order.
+     */
+    public String canonicalName;
+    
+    /**
+     * The domain part of the object name.
+     */
+    public String domain;
+    
+    /**
+     * A Hashtable containing key-property pairs.
+     */
+    public Hashtable keyPropertyList;
+    
+    /**
+     * String representation of the key properties. 
+     */
+    public String keyPropertyListString;    
+    
+    /**
+     * Indicates whether the object name is a pattern.
+     */
+    public boolean pattern;
+    
+    /**
+     * Indicates whether the object name is a pattern on key properties.
+     */
+    public boolean propertyPattern;
+    
+    /**
+     * Constructs an empty <code>ObjectName</code> instance.
+     */
+    public ObjectName()
+    {}
+    
+    /**
+     * Constructs a <code>ObjectName</code> instance based upon a
+     * <code>javax.management.ObjectName</code> instance.
+     * 
+     * @param objectName The JMX <code>ObjectName</code> instance to base this instance on.
+     */
+    public ObjectName(javax.management.ObjectName objectName)
+    {
+        canonicalKeyPropertyListString = objectName.getCanonicalKeyPropertyListString();
+        canonicalName = objectName.getCanonicalName();
+        domain = objectName.getDomain();
+        keyPropertyList = objectName.getKeyPropertyList();
+        keyPropertyListString = objectName.getKeyPropertyListString();
+        pattern = objectName.isPattern();        
+        propertyPattern = objectName.isPropertyPattern();
+    }
+    
+    /**
+     * Utility method to convert this <code>ObjectName</code> to a
+     * <code>javax.management.ObjectName</code> instance.
+     * 
+     * @return A JMX <code>ObjectName</code> based upon this instance.
+     */
+    public javax.management.ObjectName toObjectName() throws MalformedObjectNameException
+    {
+        return new javax.management.ObjectName(domain, keyPropertyList);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/jmx/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/jmx/package-info.java b/modules/core/src/flex/management/jmx/package-info.java
new file mode 100755
index 0000000..638bdf6
--- /dev/null
+++ b/modules/core/src/flex/management/jmx/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * 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.management.jmx;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/package-info.java b/modules/core/src/flex/management/package-info.java
new file mode 100755
index 0000000..814e6ef
--- /dev/null
+++ b/modules/core/src/flex/management/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * 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.management;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/AdminConsoleDisplayRegistrar.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/AdminConsoleDisplayRegistrar.java b/modules/core/src/flex/management/runtime/AdminConsoleDisplayRegistrar.java
new file mode 100755
index 0000000..222aafa
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/AdminConsoleDisplayRegistrar.java
@@ -0,0 +1,104 @@
+/*
+ * 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.management.runtime;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import flex.management.BaseControl;
+
+/**
+ * @exclude
+ */
+public class AdminConsoleDisplayRegistrar extends BaseControl implements AdminConsoleDisplayRegistrarMBean
+{
+    public static final String ID = "AdminConsoleDisplay";
+    
+    private HashMap registeredExposedObjects;
+    
+    public AdminConsoleDisplayRegistrar(BaseControl parent)
+    {
+        super(parent);
+        registeredExposedObjects = new HashMap();
+        register();
+    }
+
+    public void registerObject(int type, String beanName, String propertyName)
+    {
+        Object objects = registeredExposedObjects.get(new Integer(type));
+        if (objects != null)
+        {
+            ((ArrayList)objects).add(beanName + ":" + propertyName);
+        }
+        else
+        {
+            if (type < 1)
+                return;
+            
+            objects = new ArrayList();
+            ((ArrayList)objects).add(beanName + ":" + propertyName);
+            registeredExposedObjects.put(new Integer(type), objects);
+        }
+    }
+    
+    public void registerObjects(int type, String beanName, String[] propertyNames)
+    {
+        for (int i = 0; i < propertyNames.length; i++)
+        {
+            registerObject(type, beanName, propertyNames[i]);
+        }
+    }
+    
+    public void registerObjects(int[] types, String beanName, String[] propertyNames)
+    {
+        for (int j = 0; j < types.length; j++)
+        {
+            registerObjects(types[j], beanName, propertyNames);
+        }
+    }
+    
+    public Integer[] getSupportedTypes() throws IOException
+    {
+        Object[] array = registeredExposedObjects.keySet().toArray();
+        Integer[] types = new Integer[array.length];
+        for (int i = 0; i < array.length; i++)
+        {
+            types[i] = (Integer)array[i];
+        }
+        return types;
+    }
+
+    public String[] listForType(int type) throws IOException
+    {
+        Object list = registeredExposedObjects.get(new Integer(type));
+        
+        return (list != null) ? (String[]) ((ArrayList)list).toArray(new String[0]) : new String[0];
+    }
+
+    public String getId()
+    {
+        return ID;
+    }
+
+    public String getType()
+    {
+        return ID;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/AdminConsoleDisplayRegistrarMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/AdminConsoleDisplayRegistrarMBean.java b/modules/core/src/flex/management/runtime/AdminConsoleDisplayRegistrarMBean.java
new file mode 100755
index 0000000..cc12ffb
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/AdminConsoleDisplayRegistrarMBean.java
@@ -0,0 +1,33 @@
+/*
+ * 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.management.runtime;
+
+import java.io.IOException;
+
+import flex.management.BaseControlMBean;
+
+/**
+ * @exclude
+ */
+public interface AdminConsoleDisplayRegistrarMBean extends BaseControlMBean
+{
+    
+    Integer[] getSupportedTypes() throws IOException;
+    
+    String[] listForType(int type) throws IOException;
+ 
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/AdminConsoleTypes.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/AdminConsoleTypes.java b/modules/core/src/flex/management/runtime/AdminConsoleTypes.java
new file mode 100755
index 0000000..a6a113a
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/AdminConsoleTypes.java
@@ -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 flex.management.runtime;
+
+/**
+ * The interface defines a number of constants for admin console types.
+ */
+public interface AdminConsoleTypes
+{
+    static final int GENERAL_SERVER = 1;
+    static final int GENERAL_POLLABLE = 2;
+    static final int GENERAL_OPERATION = 3;
+    
+    static final int GRAPH_BY_POLL_INTERVAL = 50;
+    
+    static final int ENDPOINT_SCALAR = 100;
+    static final int ENDPOINT_POLLABLE = 101;
+    
+    static final int DESTINATION_GENERAL = 150;
+    static final int DESTINATION_POLLABLE = 151;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/DestinationControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/DestinationControl.java b/modules/core/src/flex/management/runtime/messaging/DestinationControl.java
new file mode 100755
index 0000000..a83a6f7
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/DestinationControl.java
@@ -0,0 +1,119 @@
+/*
+ * 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.management.runtime.messaging;
+
+import java.util.Date;
+
+import flex.management.BaseControl;
+import flex.management.runtime.messaging.services.ServiceControl;
+import flex.messaging.Destination;
+import flex.messaging.services.ServiceAdapter;
+
+import javax.management.ObjectName;
+
+/**
+ * The <code>DestinationControl</code> class is the MBean implementation for
+ * monitoring and managing a <code>Destination</code> at runtime.
+ * 
+ * @author shodgson
+ */
+public abstract class DestinationControl extends BaseControl implements
+        DestinationControlMBean
+{
+    protected Destination destination;
+    private ObjectName adapter;
+        
+    /**
+     * Constructs a new <code>DestinationControl</code> instance.
+     * 
+     * @param destination The <code>Destination</code> managed by this MBean.
+     * @param parent The parent MBean in the management hierarchy.
+     */
+    public DestinationControl(Destination destination, BaseControl parent)
+    {
+        super(parent);
+        this.destination = destination;
+    }
+        
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.BaseControlMBean#getId()
+     */
+    public String getId()
+    {
+        return destination.getId();
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.DestinationControlMBean#getAdapter()
+     */
+    public ObjectName getAdapter()
+    {
+        return adapter;
+    }
+    
+    /**
+     * Sets the <code>ObjectName</code> for the adapter associated with the managed destination.
+     * 
+     * @param value The <code>ObjectName</code> for the adapter.
+     */
+    public void setAdapter(ObjectName value)
+    {
+        adapter = value;
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.DestinationControlMBean#isRunning()
+     */
+    public Boolean isRunning()
+    {
+        return Boolean.valueOf(destination.isStarted());
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.DestinationControlMBean#getStartTimestamp()
+     */
+    public Date getStartTimestamp()
+    {
+        return startTimestamp;
+    }
+        
+    /*
+     *  (non-Javadoc)
+     * @see javax.management.MBeanRegistration#preDeregister()
+     */
+    public void preDeregister() throws Exception
+    {
+        ServiceControl parent = (ServiceControl)getParentControl();
+        parent.removeDestination(getObjectName());
+        
+        // Unregister adapter of the destination
+        ServiceAdapter child = destination.getAdapter();
+        if (child.getControl() != null)
+        {
+            child.getControl().unregister();
+            child.setControl(null);
+            child.setManaged(false);
+        }
+        
+        super.preDeregister();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/DestinationControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/DestinationControlMBean.java b/modules/core/src/flex/management/runtime/messaging/DestinationControlMBean.java
new file mode 100755
index 0000000..acc1399
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/DestinationControlMBean.java
@@ -0,0 +1,57 @@
+/*
+ * 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.management.runtime.messaging;
+
+import flex.management.BaseControlMBean;
+
+import java.io.IOException;
+import java.util.Date;
+
+import javax.management.ObjectName;
+
+/**
+ * Defines the runtime monitoring and management interface for managed destinations.
+ *
+ * @author shodgson
+ */
+public interface DestinationControlMBean extends BaseControlMBean
+{
+    /**
+     * Returns the <code>ObjectName</code> for the adapter associated with this
+     * managed destination.
+     *
+     * @return The <code>ObjectName</code> for the adapter.
+     * @throws IOException Throws IOException.
+     */
+    ObjectName getAdapter() throws IOException;;
+
+    /**
+     * Returns <code>true</code> if the <code>Destination</code> is running.
+     *
+     * @return <code>true</code> if the <code>Destination</code> is running.
+     * @throws IOException Throws IOException.
+     */
+    Boolean isRunning() throws IOException;
+
+    /**
+     * Returns the start timestamp for the <code>Destination</code>.
+     *
+     * @return The start timestamp for the <code>Destination</code>.
+     * @throws IOException Throws IOException.
+     */
+    Date getStartTimestamp() throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/MessageBrokerControl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/MessageBrokerControl.java b/modules/core/src/flex/management/runtime/messaging/MessageBrokerControl.java
new file mode 100755
index 0000000..6b8c5a5
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/MessageBrokerControl.java
@@ -0,0 +1,297 @@
+/*
+ * 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.management.runtime.messaging;
+
+import flex.management.BaseControl;
+import flex.management.runtime.AdminConsoleDisplayRegistrar;
+import flex.management.runtime.AdminConsoleTypes;
+import flex.messaging.MessageBroker;
+import flex.messaging.endpoints.AMFEndpoint;
+import flex.messaging.endpoints.AbstractEndpoint;
+import flex.messaging.endpoints.Endpoint;
+import flex.messaging.endpoints.HTTPEndpoint;
+import flex.messaging.endpoints.StreamingAMFEndpoint;
+import flex.messaging.endpoints.StreamingHTTPEndpoint;
+
+import java.io.IOException;
+import java.util.Date;
+import java.util.List;
+import java.util.ArrayList;
+
+import javax.management.ObjectName;
+
+/**
+ * The <code>MessageBrokerControl</code> class is the MBean implemenation for monitoring
+ * and managing a <code>MessageBroker</code> at runtime.
+ *
+ * @author shodgson
+ * @author majacobs
+ */
+public class MessageBrokerControl extends BaseControl implements MessageBrokerControlMBean
+{
+    private static final Object classMutex = new Object();
+    private static final String TYPE = "MessageBroker";
+    private static int instanceCount = 0;
+    private String id;
+    private MessageBroker broker;
+    private List endpointNames;
+    private List amfEndpoints;
+    private List httpEndpoints;
+    private List enterpriseEndpoints;
+    private List streamingAmfEndpoints;
+    private List streamingHttpEndpoints;
+    private List services;
+
+    /**
+     * Constructs a new <code>MessageBrokerControl</code> instance, assigning its
+     * backing <code>MessageBroker</code>.
+     *
+     * @param broker The <code>MessageBroker</code> managed by this MBean.
+     */
+    public MessageBrokerControl(MessageBroker broker)
+    {
+        super(null);
+        this.broker = broker;
+        endpointNames = new ArrayList();
+        amfEndpoints = new ArrayList();
+        httpEndpoints = new ArrayList();
+        enterpriseEndpoints = new ArrayList();
+        streamingAmfEndpoints = new ArrayList();
+        streamingHttpEndpoints = new ArrayList();
+        services = new ArrayList();
+        synchronized (classMutex)
+        {
+            id = TYPE + ++instanceCount;
+        }
+
+        setRegistrar(new AdminConsoleDisplayRegistrar(this));
+    }
+
+    protected void onRegistrationComplete()
+    {
+        String name = this.getObjectName().getCanonicalName();
+        getRegistrar().registerObject(AdminConsoleTypes.GENERAL_POLLABLE, name, "FlexSessionCount");
+        getRegistrar().registerObjects(new int[] {AdminConsoleTypes.GENERAL_POLLABLE, AdminConsoleTypes.GRAPH_BY_POLL_INTERVAL },
+                name, new String[] {"AMFThroughput", "HTTPThroughput", "EnterpriseThroughput"});
+
+        getRegistrar().registerObject(AdminConsoleTypes.GENERAL_SERVER, name, "MaxFlexSessionsInCurrentHour");
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.BaseControlMBean#getId()
+     */
+    public String getId()
+    {
+        return id;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.BaseControlMBean#getType()
+     */
+    public String getType()
+    {
+        return TYPE;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.MessageBrokerControlMBean#isRunning()
+     */
+    public Boolean isRunning()
+    {
+        return Boolean.valueOf(broker.isStarted());
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.MessageBrokerControlMBean#getStartTimestamp()
+     */
+    public Date getStartTimestamp()
+    {
+        return startTimestamp;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.MessageBrokerControlMBean#getEndpoints()
+     */
+    public ObjectName[] getEndpoints() throws IOException
+    {
+        int size = endpointNames.size();
+        ObjectName[] endpointNameObjects = new ObjectName[size];
+        for (int i = 0; i < size; ++i)
+        {
+            endpointNameObjects[i] = (ObjectName)endpointNames.get(i);
+        }
+        return endpointNameObjects;
+    }
+
+    /**
+     * Adds an <code>Endpoint</code> for an endpoint registered with the backing <code>MessageBroker</code>.
+     *
+     * @param value The endpoint <code>Endpoint</code>.
+     */
+    public void addEndpoint(Endpoint value)
+    {
+        if (value instanceof AMFEndpoint)
+            amfEndpoints.add(value);
+        else if (value instanceof HTTPEndpoint)
+            httpEndpoints.add(value);
+        else if (value instanceof StreamingAMFEndpoint)
+            streamingAmfEndpoints.add(value);
+        else if (value instanceof StreamingHTTPEndpoint)
+            streamingHttpEndpoints.add(value);
+        else
+            enterpriseEndpoints.add(value);
+
+        endpointNames.add(value.getControl().getObjectName());
+    }
+
+    /**
+     * Removes an <code>ObjectName</code> for an endpoint registered with the backing <code>MessageBroker</code>.
+     *
+     * @param value The endpoint <code>ObjectName</code>.
+     */
+    public void removeEndpoint(ObjectName value)
+    {
+        endpointNames.remove(value);
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.MessageBrokerControlMBean#getServices()
+     */
+    public ObjectName[] getServices() throws IOException
+    {
+        int size = services.size();
+        ObjectName[] serviceNames = new ObjectName[size];
+        for (int i = 0; i < size; ++i)
+        {
+            serviceNames[i] = (ObjectName)services.get(i);
+        }
+        return serviceNames;
+    }
+
+    /**
+     * Adds an <code>ObjectName</code> for a service registered with the backing <code>MessageBroker</code>.
+     *
+     * @param value The service <code>ObjectName</code>.
+     */
+    public void addService(ObjectName value)
+    {
+        services.add(value);
+    }
+
+    /**
+     * Removes an <code>ObjectName</code> for a service registered with the backing <code>MessageBroker</code>.
+     *
+     * @param value The service <code>ObjectName</code>.
+     */
+    public void removeService(ObjectName value)
+    {
+        services.remove(value);
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.MessageBrokerControlMBean#getFlexSessionCount()
+     */
+    public Integer getFlexSessionCount()
+    {
+        return broker.getFlexSessionManager().getFlexSessionCount();
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see flex.management.runtime.MessageBrokerControlMBean#getMaxFlexSessionsInCurrentHour()
+     */
+    public Integer getMaxFlexSessionsInCurrentHour()
+    {
+        return broker.getFlexSessionManager().getMaxFlexSessionsInCurrentHour();
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageBrokerControlMBean#getRTMPConnectionCount()
+     */
+    public Integer getEnterpriseConnectionCount() throws IOException
+    {
+        int connections = 0;
+    /*
+        for (int i = 0; i < rtmpEndpoints.size(); i++)
+        {
+            connections += (((RTMPEndpoint)rtmpEndpoints.get(i)).getConnectionCount());
+        }
+    */
+        return new Integer(connections);
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageBrokerControlMBean#getAMFThroughput()
+     */
+    public Long getAMFThroughput() throws IOException
+    {
+        return new Long(calculateEndpointThroughput(amfEndpoints));
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageBrokerControlMBean#getHTTPThroughput()
+     */
+    public Long getHTTPThroughput() throws IOException
+    {
+        return new Long(calculateEndpointThroughput(httpEndpoints));
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageBrokerControlMBean#getRTMPThroughput()
+     */
+    public Long getEnterpriseThroughput() throws IOException
+    {
+        return new Long(calculateEndpointThroughput(enterpriseEndpoints));
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageBrokerControlMBean#getStreamingAMFThroughput()
+     */
+    public Long getStreamingAMFThroughput() throws IOException
+    {
+        return new Long(calculateEndpointThroughput(streamingAmfEndpoints));
+    }
+
+    /* (non-Javadoc)
+     * @see flex.management.runtime.messaging.MessageBrokerControlMBean#getStreamingHTTPThroughput()
+     */
+    public Long getStreamingHTTPThroughput() throws IOException
+    {
+        return new Long(calculateEndpointThroughput(streamingHttpEndpoints));
+    }
+
+    private long calculateEndpointThroughput(List endpoints)
+    {
+        long throughput = 0;
+
+        for (int i = 0; i < endpoints.size(); i++)
+        {
+            // This method shouldn't be used with Lists containing objects that are not AbstractEndpoints
+            if (endpoints.get(i) instanceof AbstractEndpoint)
+                throughput += ((AbstractEndpoint)endpoints.get(i)).getThroughput();
+        }
+
+        return throughput;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/management/runtime/messaging/MessageBrokerControlMBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/management/runtime/messaging/MessageBrokerControlMBean.java b/modules/core/src/flex/management/runtime/messaging/MessageBrokerControlMBean.java
new file mode 100755
index 0000000..a209c4b
--- /dev/null
+++ b/modules/core/src/flex/management/runtime/messaging/MessageBrokerControlMBean.java
@@ -0,0 +1,132 @@
+/*
+ * 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.management.runtime.messaging;
+
+import flex.management.BaseControlMBean;
+
+import java.io.IOException;
+import java.util.Date;
+import javax.management.ObjectName;
+
+/**
+ * Defines the runtime monitoring and management interface for managed <code>MessageBroker</code>s.
+ *
+ * @author shodgson
+ */
+public interface MessageBrokerControlMBean extends BaseControlMBean
+{
+    /**
+     * Returns <code>true</code> if the <code>MessageBroker</code> is running.
+     *
+     * @return <code>true</code> if the <code>MessageBroker</code> is running.
+     * @throws IOException Throws IOException.
+     */
+    Boolean isRunning() throws IOException;
+
+    /**
+     * Returns the start timestamp for the <code>MessageBroker</code>.
+     *
+     * @return The start timestamp for the <code>MessageBroker</code>.
+     * @throws IOException Throws IOException.
+     */
+    Date getStartTimestamp() throws IOException;
+
+    /**
+     * Returns the <code>ObjectName</code>s for endpoints that are registered with the
+     * managed <code>MessageBroker</code>.
+     *
+     * @return The <code>ObjectName</code>s for endpoints registered with the managed <code>MessageBroker</code>.
+     * @throws IOException Throws IOException.
+     */
+    ObjectName[] getEndpoints() throws IOException;
+
+    /**
+     * Returns the <code>ObjectName</code>s for services that are registered with the
+     * managed <code>MessageBroker</code>.
+     *
+     * @return The <code>ObjectName</code>s for services registered with the managed <code>MessageBroker</code>.
+     * @throws IOException Throws IOException.
+     */
+    ObjectName[] getServices() throws IOException;
+
+    /**
+     * Returns Flex session count for the <code>MessageBroker</code>.
+     *
+     * @return Flex session count for the <code>MessageBroker</code>.
+     * @throws IOException Throws IOException.
+     */
+    Integer getFlexSessionCount() throws IOException;
+
+    /**
+     * Returns the maximum concurrent Flex session count for the
+     * <code>MessageBroker</code> in the current hour.
+     *
+     * @return The maximum concurrent Flex session count for the
+     * <code>MessageBroker</code> over the course of the last hour.
+     * @throws IOException Throws IOException.
+     */
+    Integer getMaxFlexSessionsInCurrentHour() throws IOException;
+
+    /**
+     * Returns the number of Enterprise Connections across all
+     * Enterprise Endpoints.
+     *
+     * @return The number of Enterprise Connections
+     * @throws IOException Throws IOException.
+     */
+    Integer getEnterpriseConnectionCount() throws IOException;
+
+    /**
+     * Returns the total number of bytes passing through all AMF endpoints.
+     *
+     * @return The total number of bytes passing through all AMF endpoints.
+     * @throws IOException Throws IOException.
+     */
+    Long getAMFThroughput() throws IOException;
+
+    /**
+     * Returns the total number of bytes passing through all HTTP endpoints.
+     *
+     * @return The total number of bytes passing through all HTTP endpoints.
+     * @throws IOException Throws IOException.
+     */
+    Long getHTTPThroughput() throws IOException;
+
+    /**
+     * Returns the total number of bytes passing through all Enterprise endpoints.
+     *
+     * @return The total number of bytes passing through all Enterprise endpoints.
+     * @throws IOException Throws IOException.
+     */
+    Long getEnterpriseThroughput() throws IOException;
+
+    /**
+     * Returns the total number of bytes passing through all streaming AMF endpoints.
+     *
+     * @return The total number of bytes passing through all streaming AMF endpoints.
+     * @throws IOException Throws IOException.
+     */
+    Long getStreamingAMFThroughput() throws IOException;
+
+    /**
+     * Returns the total number of bytes passing through all streaming HTTP endpoints.
+     *
+     * @return The total number of bytes passing through all streaming HTTP endpoints.
+     * @throws IOException Throws IOException.
+     */
+    Long getStreamingHTTPThroughput() throws IOException;
+}


[25/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/messaging/multipleendpoints/messaging_AMFLongPoll_and_SecureAMFLongPoll.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/multipleendpoints/messaging_AMFLongPoll_and_SecureAMFLongPoll.mxml b/apps/team/features/messaging/multipleendpoints/messaging_AMFLongPoll_and_SecureAMFLongPoll.mxml
new file mode 100755
index 0000000..87c24e6
--- /dev/null
+++ b/apps/team/features/messaging/multipleendpoints/messaging_AMFLongPoll_and_SecureAMFLongPoll.mxml
@@ -0,0 +1,160 @@
+<?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();">
+    
+    <mx:Panel id="mainPanel1" 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:Panel id="mainPanel2" height="100%" width="100%">
+        <mx:HBox>    
+        	<mx:Label text="Producer2"/>        
+        	<mx:Button label="Send Foo{counter2}" click="sendMessage2()"/>
+			<mx:Button label="Disconnect" click="producer2.disconnect();" enabled="{producer2.connected}"/> 
+            <mx:CheckBox label="Connected?" selected="{producer2.connected}"/>	     	
+        </mx:HBox>        	
+        <mx:HBox>
+        	<mx:Label text="Consumer2"/>
+			<mx:Button label="Subcribe" click="consumer2.subscribe();" enabled="{!consumer2.subscribed}"/>    
+			<mx:Button label="Unsubscribe" click="consumer2.unsubscribe();" enabled="{consumer2.subscribed}"/>
+			<mx:Button label="Disconnect" click="consumer2.disconnect();" enabled="{consumer2.connected}"/>
+			<mx:Button label="Poll" click="(consumer2.channelSet.currentChannel as PollingChannel).poll();" enabled="{consumer2.connected}"/>
+            <mx:CheckBox label="Connected?" selected="{consumer2.connected}"/>			
+			<mx:CheckBox label="Subscribed?" selected="{consumer2.subscribed}"/>
+        </mx:HBox>                      
+        <mx:Button label="Clear" click='ta2.text = ""'/>        
+        <mx:TextArea id="ta2" width="100%" height="100%"/>           
+    </mx:Panel>
+    
+    
+    <mx:Producer id="producer" 
+        destination="messaging_AMF_LongPoll"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_AMF_LongPoll"
+        fault="faultHandler(event)" 
+        message="messageHandler(event)"/>
+	
+	<mx:Producer id="producer2" 
+        destination="messaging_AMF_SecureLongPoll"
+        fault="faultHandler2(event)"/>
+               
+    <mx:Consumer id="consumer2" 
+        destination="messaging_AMF_SecureLongPoll"
+        fault="faultHandler2(event)" 
+        message="messageHandler2(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.messaging.channels.PollingChannel;     
+			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";
+            }    
+
+			[Bindable]				                	
+			public var counter2:int = 0;
+			
+    		
+            private function sendMessage2():void
+            {
+                var msg:AsyncMessage = new AsyncMessage();
+                msg.body = "Foo" + counter2++;         
+                producer2.send(msg);
+            }
+                                                            
+            private function messageHandler2(event:MessageEvent):void
+            {
+                ta2.text += "Consumer received message: "+ event.message.body + "\n";  
+            }
+                       
+            private function faultHandler2(event:MessageFaultEvent):void
+            {
+                ta2.text += "Received fault: " + event.faultString + "\n";
+            }                      
+        ]]>
+    </mx:Script>
+
+
+    
+                    
+    <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;
+	                        
+			                        
+        ]]>
+    </mx:Script>
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/messaging/multipleendpoints/messaging_SecureAMFLongPoll_and_AMFStream.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/multipleendpoints/messaging_SecureAMFLongPoll_and_AMFStream.mxml b/apps/team/features/messaging/multipleendpoints/messaging_SecureAMFLongPoll_and_AMFStream.mxml
new file mode 100755
index 0000000..c5619cd
--- /dev/null
+++ b/apps/team/features/messaging/multipleendpoints/messaging_SecureAMFLongPoll_and_AMFStream.mxml
@@ -0,0 +1,160 @@
+<?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();">
+    
+    <mx:Panel id="mainPanel1" 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:Panel id="mainPanel2" height="100%" width="100%">
+        <mx:HBox>    
+        	<mx:Label text="Producer2"/>        
+        	<mx:Button label="Send Foo{counter2}" click="sendMessage2()"/>
+			<mx:Button label="Disconnect" click="producer2.disconnect();" enabled="{producer2.connected}"/> 
+            <mx:CheckBox label="Connected?" selected="{producer2.connected}"/>	     	
+        </mx:HBox>        	
+        <mx:HBox>
+        	<mx:Label text="Consumer2"/>
+			<mx:Button label="Subcribe" click="consumer2.subscribe();" enabled="{!consumer2.subscribed}"/>    
+			<mx:Button label="Unsubscribe" click="consumer2.unsubscribe();" enabled="{consumer2.subscribed}"/>
+			<mx:Button label="Disconnect" click="consumer2.disconnect();" enabled="{consumer2.connected}"/>
+			<mx:Button label="Poll" click="(consumer2.channelSet.currentChannel as PollingChannel).poll();" enabled="{consumer2.connected}"/>
+            <mx:CheckBox label="Connected?" selected="{consumer2.connected}"/>			
+			<mx:CheckBox label="Subscribed?" selected="{consumer2.subscribed}"/>
+        </mx:HBox>                      
+        <mx:Button label="Clear" click='ta2.text = ""'/>        
+        <mx:TextArea id="ta2" width="100%" height="100%"/>           
+    </mx:Panel>
+    
+    
+    <mx:Producer id="producer" 
+        destination="messaging_AMF_SecureLongPoll"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_AMF_SecureLongPoll"
+        fault="faultHandler(event)" 
+        message="messageHandler(event)"/>
+	
+	<mx:Producer id="producer2" 
+        destination="messaging_AMF_Stream"
+        fault="faultHandler2(event)"/>
+               
+    <mx:Consumer id="consumer2" 
+        destination="messaging_AMF_Stream"
+        fault="faultHandler2(event)" 
+        message="messageHandler2(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.messaging.channels.PollingChannel;     
+			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";
+            }    
+
+			[Bindable]				                	
+			public var counter2:int = 0;
+			
+    		
+            private function sendMessage2():void
+            {
+                var msg:AsyncMessage = new AsyncMessage();
+                msg.body = "Foo" + counter2++;         
+                producer2.send(msg);
+            }
+                                                            
+            private function messageHandler2(event:MessageEvent):void
+            {
+                ta2.text += "Consumer received message: "+ event.message.body + "\n";  
+            }
+                       
+            private function faultHandler2(event:MessageFaultEvent):void
+            {
+                ta2.text += "Received fault: " + event.faultString + "\n";
+            }                      
+        ]]>
+    </mx:Script>
+
+
+    
+                    
+    <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;
+	                        
+			                        
+        ]]>
+    </mx:Script>
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/messaging/multipleendpoints/messaging_two_AMFLongPoll_Endpoints.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/multipleendpoints/messaging_two_AMFLongPoll_Endpoints.mxml b/apps/team/features/messaging/multipleendpoints/messaging_two_AMFLongPoll_Endpoints.mxml
new file mode 100755
index 0000000..78d289b
--- /dev/null
+++ b/apps/team/features/messaging/multipleendpoints/messaging_two_AMFLongPoll_Endpoints.mxml
@@ -0,0 +1,160 @@
+<?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();">
+    
+    <mx:Panel id="mainPanel1" 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:Panel id="mainPanel2" height="100%" width="100%">
+        <mx:HBox>    
+        	<mx:Label text="Producer2"/>        
+        	<mx:Button label="Send Foo{counter2}" click="sendMessage2()"/>
+			<mx:Button label="Disconnect" click="producer2.disconnect();" enabled="{producer2.connected}"/> 
+            <mx:CheckBox label="Connected?" selected="{producer2.connected}"/>	     	
+        </mx:HBox>        	
+        <mx:HBox>
+        	<mx:Label text="Consumer2"/>
+			<mx:Button label="Subcribe" click="consumer2.subscribe();" enabled="{!consumer2.subscribed}"/>    
+			<mx:Button label="Unsubscribe" click="consumer2.unsubscribe();" enabled="{consumer2.subscribed}"/>
+			<mx:Button label="Disconnect" click="consumer2.disconnect();" enabled="{consumer2.connected}"/>
+			<mx:Button label="Poll" click="(consumer2.channelSet.currentChannel as PollingChannel).poll();" enabled="{consumer2.connected}"/>
+            <mx:CheckBox label="Connected?" selected="{consumer2.connected}"/>			
+			<mx:CheckBox label="Subscribed?" selected="{consumer2.subscribed}"/>
+        </mx:HBox>                      
+        <mx:Button label="Clear" click='ta2.text = ""'/>        
+        <mx:TextArea id="ta2" width="100%" height="100%"/>           
+    </mx:Panel>
+    
+    
+    <mx:Producer id="producer" 
+        destination="messaging_AMF_LongPoll"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_AMF_LongPoll"
+        fault="faultHandler(event)" 
+        message="messageHandler(event)"/>
+	
+	<mx:Producer id="producer2" 
+        destination="messaging_AMF_LongPoll2"
+        fault="faultHandler2(event)"/>
+               
+    <mx:Consumer id="consumer2" 
+        destination="messaging_AMF_LongPoll2"
+        fault="faultHandler2(event)" 
+        message="messageHandler2(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.messaging.channels.PollingChannel;     
+			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";
+            }    
+
+			[Bindable]				                	
+			public var counter2:int = 0;
+			
+    		
+            private function sendMessage2():void
+            {
+                var msg:AsyncMessage = new AsyncMessage();
+                msg.body = "Foo" + counter2++;         
+                producer2.send(msg);
+            }
+                                                            
+            private function messageHandler2(event:MessageEvent):void
+            {
+                ta2.text += "Consumer received message: "+ event.message.body + "\n";  
+            }
+                       
+            private function faultHandler2(event:MessageFaultEvent):void
+            {
+                ta2.text += "Received fault: " + event.faultString + "\n";
+            }                      
+        ]]>
+    </mx:Script>
+
+
+    
+                    
+    <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;
+	                        
+			                        
+        ]]>
+    </mx:Script>
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/messaging/secure/messaging_SecureAMF.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/secure/messaging_SecureAMF.mxml b/apps/team/features/messaging/secure/messaging_SecureAMF.mxml
new file mode 100755
index 0000000..ae5d1a1
--- /dev/null
+++ b/apps/team/features/messaging/secure/messaging_SecureAMF.mxml
@@ -0,0 +1,120 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
+    creationComplete="creationCompleteHandler();">
+    
+    <!-- An example where the client manually initiates a poll request without 
+         relying on polling-interval with secure HTTP.
+    -->
+    <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"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_SecureAMF"
+        fault="faultHandler(event)" 
+        message="messageHandler(event)"/>
+                    
+    <mx:Script>
+        <![CDATA[
+        
+    	    import mx.messaging.events.MessageFaultEvent;	    
+            import mx.messaging.events.MessageEvent;
+        
+			import mx.messaging.ChannelSet;            
+            import mx.messaging.Producer;
+            import mx.messaging.Consumer;
+			import mx.messaging.channels.PollingChannel;                
+			import mx.messaging.messages.AsyncMessage;  	
+
+			import mx.logging.Log;
+	        import mx.logging.targets.TraceTarget;			
+	        
+			public var pc:PollingChannel;                
+			
+			[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:Object):void
+            {
+                ta.text += "Received fault: " + event.faultString + "\n";
+            }      
+            
+			private function poll():void
+			{
+            	ta.text += "Polling" + "\n";
+	            if (!consumer.subscribed)
+	            {
+	            	subscribeConsumer();
+	            }            
+            	pc.poll();
+        	}
+        	
+        	private function subscribeConsumer():void
+        	{
+            	ta.text += "Subscribing Consumer \n";
+	            consumer.subscribe();  
+        		
+            	var pcs:ChannelSet = consumer.channelSet;
+            	pc = PollingChannel(pcs.currentChannel);	        		
+        	}
+        ]]>
+    </mx:Script>
+
+</mx:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/messaging/secure/messaging_SecureHTTP.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/secure/messaging_SecureHTTP.mxml b/apps/team/features/messaging/secure/messaging_SecureHTTP.mxml
new file mode 100755
index 0000000..ecbb6e4
--- /dev/null
+++ b/apps/team/features/messaging/secure/messaging_SecureHTTP.mxml
@@ -0,0 +1,120 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"
+    creationComplete="creationCompleteHandler();">
+    
+    <!-- An example where the client manually initiates a poll request without 
+         relying on polling-interval with secure HTTP.
+    -->
+    <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_SecureHTTP"
+        fault="faultHandler(event)"/>
+               
+    <mx:Consumer id="consumer" 
+        destination="messaging_SecureHTTP"
+        fault="faultHandler(event)" 
+        message="messageHandler(event)"/>
+                    
+    <mx:Script>
+        <![CDATA[
+        
+    	    import mx.messaging.events.MessageFaultEvent;	    
+            import mx.messaging.events.MessageEvent;
+        
+			import mx.messaging.ChannelSet;            
+            import mx.messaging.Producer;
+            import mx.messaging.Consumer;
+			import mx.messaging.channels.PollingChannel;                
+			import mx.messaging.messages.AsyncMessage;  	
+
+			import mx.logging.Log;
+	        import mx.logging.targets.TraceTarget;			
+	        
+			public var pc:PollingChannel;                
+			
+			[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:Object):void
+            {
+                ta.text += "Received fault: " + event.faultString + "\n";
+            }      
+            
+			private function poll():void
+			{
+            	ta.text += "Polling" + "\n";
+	            if (!consumer.subscribed)
+	            {
+	            	subscribeConsumer();
+	            }            
+            	pc.poll();
+        	}
+        	
+        	private function subscribeConsumer():void
+        	{
+            	ta.text += "Subscribing Consumer \n";
+	            consumer.subscribe();  
+        		
+            	var pcs:ChannelSet = consumer.channelSet;
+            	pc = PollingChannel(pcs.currentChannel);	        		
+        	}
+        ]]>
+    </mx:Script>
+
+</mx:Application>
\ No newline at end of file

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

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

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

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

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/team/features/messaging/subtopic/messaging_AMF_Poll_Subtopic.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/subtopic/messaging_AMF_Poll_Subtopic.mxml b/apps/team/features/messaging/subtopic/messaging_AMF_Poll_Subtopic.mxml
new file mode 100755
index 0000000..a97b75b
--- /dev/null
+++ b/apps/team/features/messaging/subtopic/messaging_AMF_Poll_Subtopic.mxml
@@ -0,0 +1,103 @@
+<?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();">
+
+    <!-- This example shows how to use subtopics. Before using subtopics, need
+         to make sure that the following are set on the messaging destination:
+         <properties>
+             <server>
+                <allow-subtopics>true</allow-subtopics>
+                <subtopic-separator>.</subtopic-separator>
+             </server>
+         </properties>
+     -->
+
+    <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();"/>
+            <mx:CheckBox label="Connected?" selected="{producer.connected}"/>
+        </mx:HBox>
+        <mx:HBox>
+            <mx:Label text="Consumer"/>
+            <mx:Button label="Subcribe" click="consumer.subscribe();"/>
+            <mx:Button label="Unsubscribe" click="consumer.unsubscribe();"/>
+            <mx:Button label="Disconnect" click="consumer.disconnect();"/>
+            <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_Subtopic"
+        fault="faultHandler(event)"
+        subtopic="chat.newton"/>
+
+    <mx:Consumer id="consumer"
+        destination="messaging_AMF_Poll_Subtopic"
+        fault="faultHandler(event)"
+        message="messageHandler(event)"
+        subtopic="chat.newton"/>
+
+    <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/7a58369c/apps/team/features/messaging/subtopic/messaging_AMF_Stream_MultiSubtopic.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/subtopic/messaging_AMF_Stream_MultiSubtopic.mxml b/apps/team/features/messaging/subtopic/messaging_AMF_Stream_MultiSubtopic.mxml
new file mode 100755
index 0000000..9e49f2b
--- /dev/null
+++ b/apps/team/features/messaging/subtopic/messaging_AMF_Stream_MultiSubtopic.mxml
@@ -0,0 +1,131 @@
+<?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();">
+
+    <!-- This example shows how to use a MultiTopicConsumer to listen for multiple
+         subtopics. Before using subtopics, need
+         to make sure that the following are set on the messaging destination:
+         <properties>
+             <server>
+                <allow-subtopics>true</allow-subtopics>
+                <subtopic-separator>.</subtopic-separator>
+             </server>
+         </properties>
+     -->
+
+    <mx:Panel id="mainPanel" height="100%" width="100%">
+        <mx:HBox>
+            <mx:Label text="Producer"/>
+            <mx:Button label="Send Foo{counter1} to subtopic1" click="sendMessage()"/>
+            <mx:Button label="Send Foo{counter2} to subtopic2" click="sendMessage(false)"/>
+            <mx:Button label="Disconnect1" click="producer1.disconnect();"/>
+            <mx:Button label="Disconnect2" click="producer2.disconnect();"/>
+            <mx:CheckBox label="Connected1?" selected="{producer1.connected}"/>
+            <mx:CheckBox label="Connected2?" selected="{producer2.connected}"/>
+        </mx:HBox>
+        <mx:HBox>
+            <mx:Label text="Consumer"/>
+            <mx:Button label="Add sub to subtopic1" click="consumer.addSubscription('chat.newton1');"/>
+            <mx:Button label="Add sub to subtopic2" click="consumer.addSubscription('chat.newton2');"/>
+            <mx:Button label="Remove sub to subtopic1" click="consumer.removeSubscription('chat.newton1');"/>
+            <mx:Button label="Remove sub to subtopic2" click="consumer.removeSubscription('chat.newton2');"/>
+        </mx:HBox>
+        <mx:HBox>
+            <mx:Label text="Consumer"/>
+            <mx:Button label="Subcribe" click="consumer.subscribe();"/>
+            <mx:Button label="Unsubscribe" click="consumer.unsubscribe();"/>
+            <mx:Button label="Disconnect" click="consumer.disconnect();"/>
+            <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="producer1"
+        destination="messaging_AMF_Stream_Subtopic"
+        fault="faultHandler(event)"
+        subtopic="chat.newton1"/>
+
+    <mx:Producer id="producer2"
+        destination="messaging_AMF_Stream_Subtopic"
+        fault="faultHandler(event)"
+        subtopic="chat.newton2"/>
+
+    <mx:Script>
+        <![CDATA[
+            import mx.messaging.MultiTopicConsumer;
+            import mx.messaging.Producer;
+            import mx.messaging.events.MessageFaultEvent;
+            import mx.messaging.events.MessageEvent;
+            import mx.messaging.messages.AsyncMessage;
+
+            import mx.logging.Log;
+            import mx.logging.targets.TraceTarget;
+
+            [Bindable]
+            public var counter1:int = 0;
+
+            [Bindable]
+            public var counter2:int = 0;
+
+            [Bindable]
+            public var consumer:MultiTopicConsumer = new MultiTopicConsumer();
+
+            private function creationCompleteHandler():void
+            {
+                var target:TraceTarget = new TraceTarget();
+                target.includeLevel = true;
+                target.filters = ["mx.messaging.*", "mx.rpc.*"];
+                Log.addTarget(target);
+
+                consumer.destination = "messaging_AMF_Stream_Subtopic";
+                consumer.addEventListener(MessageEvent.MESSAGE, messageHandler);
+                consumer.addEventListener(MessageFaultEvent.FAULT, faultHandler);
+            }
+
+            private function sendMessage(firstProducer:Boolean = true):void
+            {
+                var msg:AsyncMessage = new AsyncMessage();
+                if (firstProducer)
+                {
+                    msg.body = "Foo" + counter1++;
+                    producer1.send(msg);
+                }
+                else
+                {
+                    msg.body = "Foo" + counter2++;
+                    producer2.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/7a58369c/apps/team/features/messaging/subtopic/messaging_HTTP_Poll_Subtopic.mxml
----------------------------------------------------------------------
diff --git a/apps/team/features/messaging/subtopic/messaging_HTTP_Poll_Subtopic.mxml b/apps/team/features/messaging/subtopic/messaging_HTTP_Poll_Subtopic.mxml
new file mode 100755
index 0000000..53f897f
--- /dev/null
+++ b/apps/team/features/messaging/subtopic/messaging_HTTP_Poll_Subtopic.mxml
@@ -0,0 +1,103 @@
+<?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();">
+
+    <!-- This example shows how to use subtopics. Before using subtopics, need
+         to make sure that the following are set on the messaging destination:
+         <properties>
+             <server>
+                <allow-subtopics>true</allow-subtopics>
+                <subtopic-separator>.</subtopic-separator>
+             </server>
+         </properties>
+    -->
+
+    <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();"/>
+            <mx:CheckBox label="Connected?" selected="{producer.connected}"/>
+        </mx:HBox>
+        <mx:HBox>
+            <mx:Label text="Consumer"/>
+            <mx:Button label="Subcribe" click="consumer.subscribe();"/>
+            <mx:Button label="Unsubscribe" click="consumer.unsubscribe();"/>
+            <mx:Button label="Disconnect" click="consumer.disconnect();"/>
+            <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_Subtopic"
+        fault="faultHandler(event)"
+        subtopic="chat.newton"/>
+
+    <mx:Consumer id="consumer"
+        destination="messaging_HTTP_Poll_Subtopic"
+        fault="faultHandler(event)"
+        message="messageHandler(event)"
+        subtopic="chat.newton"/>
+
+    <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


[02/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/cluster/Cluster.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/cluster/Cluster.java b/modules/core/src/flex/messaging/cluster/Cluster.java
new file mode 100755
index 0000000..789c8a0
--- /dev/null
+++ b/modules/core/src/flex/messaging/cluster/Cluster.java
@@ -0,0 +1,239 @@
+/*
+ * 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.messaging.cluster;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.w3c.dom.Element;
+
+import flex.messaging.config.ConfigMap;
+import flex.messaging.log.LogCategories;
+
+/**
+ * @exclude
+ * Base interface for cluster implementations.
+ */
+public abstract class Cluster
+{
+    /**
+     * Default log category for clustering.
+     */
+    public static final String LOG_CATEGORY = LogCategories.SERVICE_CLUSTER;
+
+    /**
+     * Listeners to be notified when a node is removed from the cluster.
+     */
+    List removeNodeListeners = Collections.synchronizedList(new ArrayList());
+
+    /**
+     * Cluster properties file.
+     */
+    Element clusterPropertiesFile;
+
+    /**
+     * Specifies whether or not this is the default cluster.
+     */
+    boolean def;
+
+    /**
+     * Specifies if this cluster is enabled for URL load balancing.
+     */
+    boolean urlLoadBalancing;
+
+    /**
+     * Because destinations are the constructs which become clustered, clusters
+     * are identified by a unique name composed in the format
+     * "serviceType:destinationId".
+     *
+     * @return The unique name for the clustered destination.
+     * @param serviceType The name of the service for this destination.
+     * @param destinationName The original name of the destination.
+     */
+    static String getClusterDestinationKey(String serviceType, String destinationName)
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append(serviceType);
+        sb.append(':');
+        sb.append(destinationName);
+        return sb.toString();
+    }
+
+    /**
+     * Add a listener for remove cluster node notification.
+     *
+     * @param listener the RemoveNodeListener to add
+     */
+    public void addRemoveNodeListener(RemoveNodeListener listener)
+    {
+        removeNodeListeners.add(listener);
+    }
+
+    /**
+     * Send notification to remove node listeners that a node has
+     * been removed from the cluster.
+     *
+     * @param address The node that was removed from the cluster.
+     */
+    protected void sendRemoveNodeListener(Object address)
+    {
+        synchronized (removeNodeListeners)
+        {
+            for (int i = 0; i < removeNodeListeners.size(); i++)
+                ((RemoveNodeListener)removeNodeListeners.get(i)).removeClusterNode(address);
+        }
+    }
+
+    /**
+     * Initializes the Cluster with id and the map of properties. The default
+     * implementation is no-op.
+     * 
+     * @param id The cluster id.
+     * @param properties The map of properties.
+     */
+    public void initialize(String id, ConfigMap properties)
+    {
+        // No-op.
+    }
+
+    /**
+     * Returns the cluster properties file.
+     * 
+     * @return The cluster properties file.
+     */
+    public Element clusterPropertiesFile()
+    {
+        return clusterPropertiesFile;
+    }
+
+    /**
+     * Sets the cluster properties file.
+     * 
+     * @param value The cluster properties file.
+     */
+    public void setClusterPropertiesFile(Element value)
+    {
+        this.clusterPropertiesFile = value;
+    }
+
+    /**
+     * Returns true if this is the default cluster for any destination that does not
+     * specify a clustered destination.
+     *
+     * @return Returns true if this is the default cluster.
+     */
+    public boolean isDefault()
+    {
+        return def;
+    }
+
+    /**
+     * When true, this is the default cluster for any destination that does not
+     * specify a clustered destination.
+     *
+     * @param d true if this is the default cluster
+     */
+    public void setDefault(boolean d)
+    {
+        this.def = d;
+    }
+
+    /**
+     * When true, this cluster is enabled for URL load balancing.
+     *
+     * @return true if this cluster enabled for load balancing.
+     */
+    public boolean getURLLoadBalancing()
+    {
+        return urlLoadBalancing;
+    }
+
+    /**
+     * When true, the cluster is enabled for URL load balancing.
+     *
+     * @param u the flag to enable the URL load balancing
+     */
+    public void setURLLoadBalancing(boolean u)
+    {
+        urlLoadBalancing = u;
+    }
+
+    /**
+     * Shutdown the cluster.
+     */
+    public abstract void destroy();
+
+    /**
+     * Retrieve a List of Maps, where each Map contains channel id keys
+     * mapped to endpoint URLs for the given service type and destination name.
+     * There is exactly one endpoint URL for each
+     * channel id. This List represents all of the known endpoint URLs
+     * for all of the channels in the Cluster.
+     * @param serviceType the service type 
+     * @param destName the destination name
+     * @return List of maps of channel ids to endpoint URLs for each node in
+     *         the cluster.
+     */
+    public abstract List getAllEndpoints(String serviceType, String destName);
+
+    /**
+     * Returns a list of all of the nodes of this cluster.
+     * @return List a list of member IP addresses in the cluster
+     */
+    public abstract List getMemberAddresses();
+
+    /**
+     * Returns the local cluster node.
+     * @return Object the Local Address object
+     */
+    public abstract Object getLocalAddress();
+
+    /**
+     * Broadcast a service-related operation, which usually includes a Message as a method parameter. This method
+     * allows a local service to process a Message and then send the Message to the services on all peer nodes
+     * so that they may perform the same processing.
+     *
+     * @param serviceOperation The operation to broadcast.
+     * @param params Parameters for the operation.
+     */
+    public abstract void broadcastServiceOperation(String serviceOperation, Object[] params);
+
+    /**
+     * Send a service-related operation in point-to-point fashion to one and only one member of the cluster.
+     * This is similar to the broadcastServiceOperation except that this invocation is sent to the first
+     * node among the cluster members that does not have the local node's address.
+     *
+     * @param serviceOperation The operation to send.
+     * @param params Parameters for the operation.
+     * @param targetAddress the target address of a remote node in the cluster
+     */
+    public abstract void sendPointToPointServiceOperation(String serviceOperation, Object[] params, Object targetAddress);
+
+    /**
+     * Add a local endpoint URL for a local channel. After doing so, broadcast the information to
+     * peers so that they will be aware of the URL.
+     * <p/>
+     * @param serviceType the service type of the endpoint
+     * @param destName the destination name
+     * @param channelId the Channel ID
+     * @param endpointUrl the endpoint URL
+     * @param endpointPort the endpoint port
+     */
+    public abstract void addLocalEndpointForChannel(String serviceType, String destName,
+                                             String channelId, String endpointUrl, int endpointPort);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/cluster/ClusterException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/cluster/ClusterException.java b/modules/core/src/flex/messaging/cluster/ClusterException.java
new file mode 100755
index 0000000..824f7c6
--- /dev/null
+++ b/modules/core/src/flex/messaging/cluster/ClusterException.java
@@ -0,0 +1,31 @@
+/*
+ * 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.messaging.cluster;
+
+import flex.messaging.MessageException;
+
+/**
+ * @exclude
+ * Exception type for cluster errors.
+ */
+public class ClusterException extends MessageException
+{
+    /**
+     * Serializable version uid.
+     */
+    static final long serialVersionUID = 1948590697997522770L;
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/cluster/ClusterManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/cluster/ClusterManager.java b/modules/core/src/flex/messaging/cluster/ClusterManager.java
new file mode 100755
index 0000000..d3a4196
--- /dev/null
+++ b/modules/core/src/flex/messaging/cluster/ClusterManager.java
@@ -0,0 +1,673 @@
+/*
+ * 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.messaging.cluster;
+
+import java.io.InputStream;
+import java.lang.reflect.Constructor;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Collections;
+import java.util.TreeSet;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import flex.messaging.Destination;
+import flex.messaging.MessageBroker;
+import flex.messaging.config.ClusterSettings;
+import flex.messaging.config.ConfigMap;
+import flex.messaging.endpoints.Endpoint;
+import flex.messaging.util.ClassUtil;
+
+/**
+ * @exclude
+ * The manager of all clusters defined in services-config.xml, and the broker
+ * for the clusters created for clustered destinations.
+ */
+public class ClusterManager
+{
+    /**
+     * Supported operations.
+     */
+    public static final String OPERATION_ADD_ENDPOINT_FOR_CHANNEL = "addEndpointForChannel";
+    public static final String OPERATION_SEND_ENDPOINT_URL = "sendEndpointUrl";
+    public static final String OPERATION_RECEIVE_ENDPOINT_URL = "receiveEndpointUrl";
+
+    public static final String OPERATION_PUSH_MESSAGE_FROM_PEER = "pushMessageFromPeer";
+    public static final String OPERATION_PEER_SYNC_AND_PUSH = "peerSyncAndPush";
+    public static final String OPERATION_REQUEST_ADAPTER_STATE = "requestAdapterState";
+    public static final String OPERATION_RECEIVE_ADAPTER_STATE = "receiveAdapterState";
+    public static final String OPERATION_SEND_SUBSCRIPTIONS = "sendSubscriptions";
+    public static final String OPERATION_RECEIVE_SUBSCRIPTIONS = "receiveSubscriptions";
+    public static final String OPERATION_SUBSCRIBE_FROM_PEER = "subscribeFromPeer";
+    public static final String OPERATION_PUSH_MESSAGE_FROM_PEER_TO_PEER = "pushMessageFromPeerToPeer";
+    public static final String OPERATION_PEER_SYNC_AND_PUSH_ONE_TO_PEER = "peerSyncAndPushOneToPeer";
+
+    /**
+     * A link to the MessageBroker.
+     */
+    private MessageBroker broker;
+
+    /**
+     * A mapping between the cluster ids and the Cluster instances.
+     * name=clusterId value=clusterInstance
+     */
+    private LinkedHashMap<String,Cluster> clusters;
+
+    /**
+     * A mapping between destinations and the Cluster instances.
+     */
+    private Map<String, Cluster> clustersForDestination;
+
+    /**
+     * A mapping between cluster ids and their configuration files.
+     * name=clusterId value=propsFile
+     */
+    private Map<String, Element> clusterConfig;
+
+    /**
+     * A mapping between cluster ids and ClusterSettings instances.
+     * name=clusterId value=ClusterSettings
+     */
+    private Map<String, ClusterSettings> clusterSettings;    
+
+    /**
+     * A mapped between destinations and a boolean representing
+     * whether or not the backend for the destination is shared.
+     */
+    private Map<String, Boolean> backendSharedForDestination;
+
+    /**
+     * The default cluster when the cluster id for the destination
+     * is unspecified.
+     */
+    private Cluster defaultCluster;
+
+    /**
+     * The id of the default cluster.
+     */
+    private String defaultClusterId;
+
+    /**
+     * The manager of all clusters defined in services-config.xml, and the broker
+     * for the clusters created for clustered destinations.  This class provides
+     * an entry point and abstraction to the logical cluster implementation as
+     * well as the specific cluster implementation.
+     * @param broker the message broker which uses the cluster manager
+     */
+    public ClusterManager(MessageBroker broker)
+    {
+        this.broker = broker;
+        clusters = new LinkedHashMap<String,Cluster>();
+        clusterConfig = new HashMap<String, Element>();
+        clusterSettings = new HashMap<String, ClusterSettings>();
+        clustersForDestination = new HashMap<String,Cluster>();
+        backendSharedForDestination = new HashMap<String, Boolean>();
+    }
+
+    /**
+     * The MessageBroker for this cluster.
+     *
+     * @return The defined MessageBroker.
+     */
+    public MessageBroker getMessageBroker()
+    {
+        return broker;
+    }
+
+    /**
+     * The default cluster when the cluster id for the destination
+     * is unspecified.
+     * @return Cluster the default Cluster to use
+     */
+    public Cluster getDefaultCluster()
+    {
+        return defaultCluster;
+    }
+
+    /**
+     * The id of the default cluster.
+     * @return String the default cluster ID
+     */
+    public String getDefaultClusterId()
+    {
+        return defaultClusterId;
+    }
+
+    /**
+     * Invoke an endpoint operation across the cluster.
+     * <p>
+     * NOTE: Endpoints don't reference a specific cluster so the default cluster is used for the broadcast.
+     * If no default cluster is defined the operation is broadcast over all defined clusters.
+     * </p>
+     *
+     * @param endpointId The id of the remote endpoint across the cluster to invoke an operation on.
+     * @param operationName The name of the operation to invoke.
+     * @param params The arguments to use for operation invocation.
+     */
+    public void invokeEndpointOperation(String endpointId, String operationName, Object[] params)
+    {
+        Object[] arguments = new Object[2 + params.length];
+        arguments[0] = endpointId;
+        arguments[1] = operationName;
+        int n = params.length;
+        for (int i = 2, j = 0; j < n; ++i, ++j)
+            arguments[i] = params[j];
+
+        if (defaultCluster != null)
+        {
+            defaultCluster.broadcastServiceOperation(operationName, arguments);
+        }
+        else
+        {
+            for (Cluster cluster : clusters.values())
+                cluster.broadcastServiceOperation(operationName, arguments);
+        }
+    }
+
+    /**
+     * Invoke an endpoint operation on a specific peer within the cluster.
+     * <p>
+     * NOTE: Endpoints don't reference a specific cluster so the default cluster is used for the broadcast.
+     * If no default cluster is defined the operation is broadcast over all defined clusters.
+     * </p>
+     *
+     * @param endpointId The id of the remote endpoint across the cluster to invoke an operation on.
+     * @param operationName The name of the operation to invoke.
+     * @param params The arguments to use for operation invocation.
+     * @param targetAddress The peer node that the operation should be invoked on.
+     */
+    public void invokePeerToPeerEndpointOperation(String endpointId, String operationName, Object[] params, Object targetAddress)
+    {
+        Object[] arguments = new Object[2 + params.length];
+        arguments[0] = endpointId;
+        arguments[1] = operationName;
+        int n = params.length;
+        for (int i = 2, j = 0; j < n; ++i, ++j)
+            arguments[i] = params[j];
+
+        if (defaultCluster != null)
+        {
+            defaultCluster.sendPointToPointServiceOperation(operationName, arguments, targetAddress);
+        }
+        else
+        {
+            for (Cluster cluster : clusters.values())
+            {
+                cluster.sendPointToPointServiceOperation(operationName, arguments, targetAddress);
+            }
+        }
+    }
+
+    /**
+     * Invoke a service-related operation, which usually includes a Message as a method parameter. This method
+     * allows a local service to process a Message and then send the Message to the services on all peer nodes
+     * so that they may perform the same processing. Invoke the service operation for the cluster, identified by
+     * serviceType and destinationName.
+     *
+     * @param serviceType The name for the service for this destination.
+     * @param destinationName The name of the destination.
+     * @param operationName The name of the service operation to invoke.
+     * @param params Parameters needed for the service operation.
+     */
+    public void invokeServiceOperation(String serviceType, String destinationName,
+                                       String operationName, Object[] params)
+    {
+        Cluster c = getCluster(serviceType,destinationName);
+        ArrayList newParams = new ArrayList(Arrays.asList(params));
+        newParams.add(0, serviceType);
+        newParams.add(1, destinationName);
+        c.broadcastServiceOperation(operationName, newParams.toArray());
+    }
+
+    /**
+     * Send a service-related operation in point-to-point fashion to one and only one member of the cluster.
+     * This is similar to the invokeServiceOperation except that this invocation is sent to the node,
+     * identified by targetAddress.
+     *
+     * @param serviceType The name for the service for this destination.
+     * @param destinationName The name of the destination.
+     * @param operationName The name of the service operation to invoke.
+     * @param params Parameters needed for the service operation.
+     * @param targetAddress The node that the operation should be passed to.
+     */
+    public void invokePeerToPeerOperation(String serviceType, String destinationName,
+                                          String operationName, Object[] params, Object targetAddress)
+    {
+        Cluster c = getCluster(serviceType,destinationName);
+        ArrayList newParams = new ArrayList(Arrays.asList(params));
+        newParams.add(0, serviceType);
+        newParams.add(1, destinationName);
+        c.sendPointToPointServiceOperation(operationName, newParams.toArray(), targetAddress);
+    }
+
+    /**
+     * Determines whether the given destination is clustered.
+     *
+     * @param serviceType The name for the service for this destination.
+     * @param destinationName The name of the destination.
+     * @return Whether the destination is a clustered destination.
+     */
+    public boolean isDestinationClustered(String serviceType, String destinationName)
+    {
+        return getCluster(serviceType, destinationName) != null;
+    }
+
+    /**
+     * Checks whether the give destination is configured for a shared backend.
+     *
+     * @param serviceType The name of the service for this destination.
+     * @param destinationName The name of the destination.
+     * @return Whether the destination is configured for shared backend.
+     */
+    public boolean isBackendShared(String serviceType, String destinationName)
+    {
+        String destKey = Cluster.getClusterDestinationKey(serviceType, destinationName);
+        Boolean shared = backendSharedForDestination.get(destKey);
+        return shared != null? shared.booleanValue() : false;
+    }
+
+    /**
+     * Retrieves a list of cluster nodes for the given cluster.
+     *
+     * @param serviceType The name of the service for the clustered destination.
+     * @param destinationName The name of the destination.
+     * @return List of cluster nodes for the given cluster.
+     */
+    public List getClusterMemberAddresses(String serviceType, String destinationName)
+    {
+        Cluster c= getCluster(serviceType, destinationName);
+        return c != null? c.getMemberAddresses() :  Collections.EMPTY_LIST;
+    }
+
+    /**
+     * Used for targeted endpoint operation invocations across the cluster.
+     * If a default cluster is defined, its list of member addresses is returned.
+     * Otherwise, a de-duped list of all member addresses from all registered clusters is returned.
+     *
+     * @return The list of cluster nodes that endpoint operation invocations can be issued against.
+     */
+    public List getClusterMemberAddresses()
+    {
+        if (defaultCluster != null)
+            return defaultCluster.getMemberAddresses();
+
+        TreeSet uniqueAddresses = new TreeSet();
+        for (Cluster cluster : clusters.values())
+            uniqueAddresses.addAll(cluster.getMemberAddresses());
+
+        return new ArrayList(uniqueAddresses);
+    }
+
+    /**
+     * Find the properties file in the given cluster settings.  Read the XML based
+     * cluster configuration file and save the settings and configuration for the
+     * given cluster for retrieval later.
+     *
+     * @param settings The cluster settings for a specific cluster.
+     */
+    public void prepareCluster(ClusterSettings settings)
+    {
+        String propsFileName = settings.getPropsFileName();
+
+        checkForNullPropertiesFile(settings.getClusterName(), propsFileName);
+
+        InputStream propsFile = resolveInternalPath(propsFileName);
+
+        if( propsFile == null )
+            propsFile = resolveExternalPath(propsFileName);
+
+        if (propsFile == null)
+            throwClusterException(10208, new Object[] {propsFileName}, null);
+
+        try
+        {
+            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+            factory.setNamespaceAware(false);
+            factory.setValidating(false);
+            DocumentBuilder builder = factory.newDocumentBuilder();
+            Document doc = builder.parse(propsFile);
+            if (settings.isDefault())
+                defaultClusterId = settings.getClusterName();
+            clusterConfig.put(settings.getClusterName(), doc.getDocumentElement());
+            clusterSettings.put(settings.getClusterName(), settings);
+        }
+        catch (Exception ex)
+        {
+            throwClusterException(10213, new Object[] {propsFileName}, ex);
+        }
+    }
+
+    /**
+     * Retrieve the local address for the specified clustered destination.
+     *
+     * @param serviceType The service type of the clustered destination.
+     * @param destinationName The name of the clustered destination.
+     * @return The local address of the clustered destination.
+     */
+    public Object getLocalAddress(String serviceType, String destinationName)
+    {
+        Cluster c = getCluster(serviceType, destinationName);
+        return c != null? c.getLocalAddress() : null;
+    }
+
+    /**
+     * Retrieve the local address for the default cluster or if no default cluster is defined
+     * return the local address derived from the first cluster of any defined.
+     *
+     * @return The local address for this cluster node, or <code>null</code> if this node
+     *         is not a member of any cluster.
+     */
+    public Object getLocalAddress()
+    {
+        if (defaultCluster != null)
+            return defaultCluster.getLocalAddress();
+
+        // Else, use first defined cluster.
+        for (Entry<String,Cluster> entry : clusters.entrySet())
+            return entry.getValue().getLocalAddress();
+
+        return null; // No cluster defined.
+    }
+
+    /**
+     * Find the cluster for the specified cluster id.
+     *
+     * @param clusterId the cluster ID
+     * @return The cluster identified by the given id.
+     */
+    public Cluster getClusterById(String clusterId)
+    {
+        return clusters.get(clusterId);
+    }
+
+    /**
+     * Find the cluster identified by the service type and destination name.
+     *
+     * @param serviceType The service type of the clustered destination.
+     * @param destinationName The name of the clustered destination.
+     * @return The cluster identified by the serviec type and destination naem.
+     */
+    public Cluster getCluster(String serviceType, String destinationName)
+    {
+        Cluster cluster = null;
+        try
+        {
+            String destKey = Cluster.getClusterDestinationKey(serviceType, destinationName);
+
+            cluster = clustersForDestination.get(destKey);
+
+            if (cluster == null)
+                cluster = defaultCluster;
+        }
+        catch (NoClassDefFoundError nex)
+        {
+            ClusterException cx = new ClusterException();
+            cx.setMessage(10202, new Object[] { destinationName });
+            cx.setRootCause(nex);
+            throw cx;
+        }
+        return cluster;
+    }
+
+    /**
+     * Call destroy on each of the managed clusters.
+     */
+    public void destroyClusters()
+    {
+        for (Iterator<Cluster> iter=clusters.values().iterator(); iter.hasNext(); )
+        {
+            Cluster cluster = iter.next();
+            cluster.destroy();
+            iter.remove();
+        }
+    }
+
+    /**
+     * Add the specified destination to the cluster, identitied by clusterId if available.  If the cluster
+     * is not currently defined, create the cluster.  Also, setup the load balancing urls and shared
+     * backend information for this clustered destination and endpoint.
+     *
+     * @param clusterId The cluster id that this destination wants to be associated with.
+     * @param serviceType The service type for the clustered destination.
+     * @param destinationName The name of the clustered destination.
+     * @param channelId The channel id that should be added to the cluster load balancing.
+     * @param endpointUrl The endpoint url that should be added to the cluster load balancing.
+     * @param endpointPort The endpoint port that should be added to the cluster load balancing.
+     * @param sharedBackend Whether the destination has shared backend set to true or not.
+     */
+    public void clusterDestinationChannel(String clusterId, String serviceType, String destinationName,
+                                          String channelId, String endpointUrl, int endpointPort, boolean sharedBackend)
+    {
+        Cluster cluster = getClusterById(clusterId);
+        String destKey = Cluster.getClusterDestinationKey(serviceType, destinationName);
+        if (cluster == null)
+        {
+            if (!clusterConfig.containsKey(clusterId))
+            {
+                ClusterException cx = new ClusterException();
+                cx.setMessage(10207, new Object[] { destinationName, clusterId });
+                throw cx;
+            }
+            cluster = createCluster(clusterId, serviceType, destinationName);
+        }
+        else
+        {
+            clustersForDestination.put(destKey, cluster);
+        }
+        backendSharedForDestination.put(destKey, sharedBackend ? Boolean.TRUE : Boolean.FALSE);
+
+        if (cluster.getURLLoadBalancing())
+            cluster.addLocalEndpointForChannel(serviceType, destinationName,
+                                               channelId, endpointUrl, endpointPort);
+    }
+
+    /**
+     * Adds the destination to the cluster.  The settings for the clustered destination are
+     * available from the <code>Destination</code> object.
+     *
+     * @param destination The destination to be clustered.
+     */
+    public void clusterDestination(Destination destination)
+    {
+        String clusterId = destination.getNetworkSettings().getClusterId();
+        if (clusterId == null)
+            clusterId = getDefaultClusterId();
+
+        ClusterSettings cls = clusterSettings.get(clusterId);
+        if (cls == null)
+        {
+            ClusterException ce = new ClusterException();
+            ce.setMessage(10217, new Object[] {destination.getId(), clusterId});
+            throw ce;
+        }
+
+        for (String channelId : destination.getChannels())
+        {
+            Endpoint endpoint = broker.getEndpoint(channelId);
+            String endpointUrl = endpoint.getUrl();
+            int endpointPort = endpoint.getPort();
+
+            // This is only an error if we are using client side url-based load balancing.  If
+            // there is a HW load balancer, then we can assume the server.name served up by the
+            // SWF can be used to access the cluster members.  With client side load balancing,
+            // the clients need the direct URLs of all of the servers.
+            if (cls.getURLLoadBalancing())
+            {
+                // Ensure that the endpoint URI does not contain any replacement tokens.
+                int tokenStart = endpointUrl.indexOf('{');
+                if (tokenStart != -1)
+                {
+                    int tokenEnd = endpointUrl.indexOf('}', tokenStart);
+                    if (tokenEnd == -1)
+                        tokenEnd = endpointUrl.length();
+                    else
+                        tokenEnd++;
+
+                    ClusterException ce = new ClusterException();
+                    ce.setMessage(10209, new Object[] {destination.getId(), channelId, endpointUrl.substring(tokenStart, tokenEnd)});
+                    throw ce;
+                }
+            }
+
+            clusterDestinationChannel(clusterId, destination.getServiceType(), 
+                    destination.getId(), channelId, endpointUrl, endpointPort, destination.getNetworkSettings().isSharedBackend());
+      }
+    }
+
+    /**
+     * Get a list of endpoints for the destination.
+     * @param serviceType the service type
+     * @param destinationName destination name
+     * @return List the list endpoints that the destination can use
+     */
+    public List getEndpointsForDestination(String serviceType, String destinationName)
+    {
+        Cluster c = getCluster(serviceType, destinationName);
+        return c != null? c.getAllEndpoints(serviceType, destinationName) : null;
+    }
+
+
+    private void checkForNullPropertiesFile(String clusterName, String propsFileName)
+    {
+        if (propsFileName == null)
+            throwClusterException(10201, new Object[] {clusterName, propsFileName}, null);
+    }
+
+    /**
+     * Create the cluster based on the cluster settings already available. The cluster
+     * is added to the cluster managers list of clusters indexed by the cluster id.
+     * The cluster is also associated with the specified service type and destination
+     * name.  The cluster id is unique across all clusters managed by this cluster
+     * manager.  The cluster may be associated with more than one cluster destination.
+     *
+     * @param clusterId The cluster id.
+     * @param serviceType The service type of the clustered destination.
+     * @param destinationName The destination name for the clustered destination.
+     * @return The new cluster.
+     */
+    private Cluster createCluster(String clusterId, String serviceType, String destinationName)
+    {
+        String destKey = Cluster.getClusterDestinationKey(serviceType, destinationName);
+        Element propsFile = clusterConfig.get(clusterId);
+        ClusterSettings cls = clusterSettings.get(clusterId);
+        Cluster cluster = null;
+        Class clusterClass = ClassUtil.createClass(cls.getImplementationClass());
+        Constructor clusterConstructor = null;
+        try
+        {
+            clusterConstructor = clusterClass.getConstructor(new Class[] {ClusterManager.class});
+        }
+        catch (Exception e)
+        {
+            ClusterException cx = new ClusterException();
+            cx.setMessage(10210);
+            cx.setRootCause(e);
+            throw cx;
+        }
+        try
+        {
+            cluster = (Cluster)clusterConstructor.newInstance(new Object[] {this});
+            cluster.setClusterPropertiesFile(propsFile);
+            cluster.setURLLoadBalancing(cls.getURLLoadBalancing());
+            cluster.initialize(clusterId, cls.getProperties());
+        }
+        catch (Exception e)
+        {
+            ClusterException cx = new ClusterException();
+            cx.setMessage(10211);
+            cx.setRootCause(e);
+            throw cx;
+        }
+        clustersForDestination.put(destKey, cluster);
+        clusters.put(clusterId, cluster);
+
+        if (defaultClusterId != null && defaultClusterId.equals(clusterId))
+            defaultCluster = cluster;
+
+        return cluster;
+    }
+
+    private InputStream resolveExternalPath(String propsFileName)
+    {
+        try
+        {
+            return broker.resolveExternalPath(propsFileName);
+        }
+        catch (Throwable t)
+        {
+            throwClusterException(10208, new Object[] {propsFileName}, t);
+        }
+        return null;
+    }
+
+    private InputStream resolveInternalPath(String propsFileName)
+    {
+        try
+        {
+           return broker.resolveInternalPath(propsFileName);
+        }
+        catch (Throwable t)
+        {
+            throwClusterException(10208, new Object[] {propsFileName}, t);
+        }
+        return null;
+    }
+
+    private void throwClusterException(int number, Object[] args, Throwable t)
+    {
+        ClusterException cx = new ClusterException();
+        cx.setMessage(number, args);
+        if (t != null)
+            cx.setRootCause(t);
+        throw cx;
+    }
+    
+    /**
+     * Return a {@link ConfigMap} describing the clusters that have been added to the cluster manager
+     * 
+     * @return a ConfigMap of the clusters
+     */
+    public ConfigMap describeClusters()
+    {
+        ConfigMap result = new ConfigMap();
+        for (Entry<String, Cluster> entry: clusters.entrySet())
+        {
+            Cluster cluster = entry.getValue();
+            ConfigMap clusterMap = new ConfigMap();
+            clusterMap.put("id", entry.getKey());
+            ClusterSettings settings = clusterSettings.get(entry.getKey());
+            clusterMap.put("properties", settings.getPropsFileName());
+            if (settings.isDefault())
+            {
+                clusterMap.put("default", "true");
+            }
+            clusterMap.put("class", cluster.getClass().getCanonicalName());
+            
+            result.addProperty("cluster", clusterMap);
+        }
+        return result;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/cluster/ClusterMembershipListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/cluster/ClusterMembershipListener.java b/modules/core/src/flex/messaging/cluster/ClusterMembershipListener.java
new file mode 100755
index 0000000..36a1de5
--- /dev/null
+++ b/modules/core/src/flex/messaging/cluster/ClusterMembershipListener.java
@@ -0,0 +1,137 @@
+/*
+ * 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.messaging.cluster;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Vector;
+
+import org.jgroups.Address;
+import org.jgroups.MembershipListener;
+import org.jgroups.View;
+
+/**
+ * @exclude
+ * Clusters employ this Listener in order to respond to nodes which
+ * join and abandon it. This class bridges the low-level protocol layer
+ * to the more abstract logical cluster.
+ */
+class ClusterMembershipListener implements MembershipListener
+{
+    /**
+     * The cluster implementation that owns this listener.
+     */
+    private JGroupsCluster cluster;
+
+    /**
+     * The list of current cluster members as we know it.
+     */
+    private List<Address> members;
+
+    /**
+     * The list of cluster members that are not currently active.
+     */
+    private List<Address> zombies;
+
+    /**
+     * Our implementation of cluster membership listener.
+     *
+     * @param cluster The logical cluster implementation.
+     */
+    public ClusterMembershipListener(Cluster cluster)
+    {
+        this.cluster = (JGroupsCluster)cluster;
+        this.members = new ArrayList<Address>();
+        this.zombies = new ArrayList<Address>();
+    }
+
+    /**
+     * This method is invoked by the cluster infrastructure whenever
+     * a member joins or abandons the cluster group.
+     *
+     * @param membershipView Snapshot of members of the cluster.
+     */
+    public void viewAccepted(View membershipView)
+    {
+        synchronized(this)
+        {
+            Vector<Address> currentMemberList = membershipView.getMembers();
+            handleArrivingMembers(currentMemberList);
+            handleDepartedMembers(membershipView, currentMemberList);
+        }
+    }
+
+    /**
+     * This method is invoked by the cluster infrastructure whenever
+     * a member appears to have left the cluster, but before it has
+     * been removed from the active member list. The Cluster treats
+     * these addresses as zombies and will not use their channel and
+     * endpoint information.
+     *
+     * @param zombieAddress The address of the suspect node.
+     */
+    public void suspect(Address zombieAddress)
+    {
+        synchronized(this)
+        {
+            zombies.add(zombieAddress);
+        }
+    }
+
+    /**
+     * This method from the core MembershipListener is a no-op for
+     * the Flex destination Cluster.
+     */
+    public void block()
+    {
+        // No-op.
+    }
+
+    /**
+     * Allow the Cluster to determine whether a given physical address
+     * is a zombie.
+     *
+     * @param address The node to check.
+     * @return True, if the given address is a zombie.
+     */
+    public boolean isZombie(Address address)
+    {
+        return zombies.contains(address);
+    }
+
+    private void handleDepartedMembers(View membershipView, Vector<Address> currentMemberList)
+    {
+        for (Address member : members)
+        {
+            if (!membershipView.containsMember(member))
+            {
+                cluster.removeClusterNode(member);
+                zombies.remove(member);
+            }
+        }
+        members = currentMemberList;
+    }
+
+    private void handleArrivingMembers(Vector<Address> currentMemberList)
+    {
+        for (Address member : currentMemberList) 
+        {
+            if (!cluster.getLocalAddress().equals(member) && !members.contains(member))
+                cluster.addClusterNode(member);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/cluster/ClusterNode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/cluster/ClusterNode.java b/modules/core/src/flex/messaging/cluster/ClusterNode.java
new file mode 100755
index 0000000..945867a
--- /dev/null
+++ b/modules/core/src/flex/messaging/cluster/ClusterNode.java
@@ -0,0 +1,172 @@
+/*
+ * 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.messaging.cluster;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @exclude
+ * ClusterNode is an encapsulation for pairing a physical host and a logical
+ * software group, which is in effect a mapping between a physical address used
+ * by the cluster infrastructure and a service destination used by the message
+ * infrastructure.
+ *
+ * This class is specific to the <code>JGroupsCluster</code> implementation.
+ */
+public class ClusterNode
+{
+    /**
+     * The name of the host for this cluster node.
+     */
+    private final String host;
+
+    /**
+     * Mapping between clustered destinations and the
+     * clustered endpoint.
+     * key = destination key (String)
+     * value = Map of channel-id to endpoint-url mappings.
+     */
+    private final Map<String,Map<String,String>> destKeyToChannelMap;
+
+    /**
+     * Constructor.
+     */
+    ClusterNode(String host)
+    {
+        this.host = host;
+        destKeyToChannelMap = new HashMap<String,Map<String,String>>();
+    }
+
+    /**
+     * Returns the name of the host for this cluster node.
+     *
+     * @return The name of the host.
+     */
+    String getHost()
+    {
+        return host;
+    }
+
+    /**
+     * Returns a map of clustered destination to clustered
+     * endpoint mappings.
+     *
+     * @return Map of clustered destination to clustered
+    *  endpoint mappings.
+     */
+    Map<String,Map<String,String>> getDestKeyToChannelMap()
+    {
+        return destKeyToChannelMap;
+    }
+
+    /**
+     * Returns a map of clustered endpoints for the specified
+     * clustered destination. If there is not currently a
+     * map for the destination, an empty mapping is created
+     * and returned.
+     *
+     * The endpoint map is indexed by channel id.
+     * The endpoint map contains endpoint urls.
+     *
+     * @param serviceType The service type of the clustered destination.
+     * @param destName The destination name of the clustered destination.
+     * @return Map of clustered endpoints.
+     */
+    Map<String,String> getEndpoints(String serviceType, String destName)
+    {
+        String destKey = serviceType + ":" + destName;
+        synchronized (destKeyToChannelMap)
+        {
+            Map<String,String> channelEndpoints = destKeyToChannelMap.get(destKey);
+            if (channelEndpoints == null)
+            {
+                channelEndpoints = new HashMap<String,String>();
+                destKeyToChannelMap.put(destKey, channelEndpoints);
+            }
+            return channelEndpoints;
+        }
+    }
+
+    /**
+     * This method adds an endpoint to the list of endpoints for the clustered
+     * destination, identified by service type and destination name.
+     *
+     * @param serviceType The service type of the clustered destination.
+     * @param destName The destination name of the clustered destination.
+     * @param channelId The channel id to be added to the channel endpoint mapping.
+     * @param endpointUrl The endpoint url to be added to the endpoint url mapping.
+     */
+    void addEndpoint(String serviceType, String destName, String channelId, String endpointUrl)
+    {
+        synchronized (destKeyToChannelMap)
+        {
+            Map<String,String> channelEndpoints = getEndpoints(serviceType, destName);
+            channelEndpoints.put(channelId, endpointUrl);
+        }
+    }
+
+    /**
+     * Returns whether the endpoint, specified by channel id and endpoint url,
+     * is included in the list of endpoints in the clustered destination.
+     *
+     * @param serviceType The service type of the clustered destination.
+     * @param destName The destination name of the clustered destination.
+     * @param channelId The channel id to find in the list of endpoints.
+     * @param endpointUrl The endpoint url to find in the list of endpoints.
+     * @return Whether the endpoint is included in the list for the clustered destination.
+     */
+    boolean containsEndpoint(String serviceType, String destName, String channelId, String endpointUrl)
+    {
+        Map<String,String> channelEndpoints = getEndpoints(serviceType, destName);
+        return channelEndpoints.containsKey(channelId) && channelEndpoints.get(channelId).equals(endpointUrl);
+    }
+
+    /**
+     * Returns a description of the clustered node including details
+     * on the mapping between the clustered destinations on this node
+     * and their endpoint mappings.
+     *
+     * @return Description of the clustered node.
+     */
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer("ClusterNode[");
+        synchronized (destKeyToChannelMap)
+        {
+            for (Map.Entry<String,Map<String,String>> entry : destKeyToChannelMap.entrySet())
+            {
+                sb.append(" channels for ");
+                sb.append(entry.getKey());
+                sb.append('(');
+                for (Iterator<Map.Entry<String,String>> iter = entry.getValue().entrySet().iterator(); iter.hasNext();)
+                {
+                    Map.Entry<String,String> channelMapEntry = iter.next();
+                    sb.append(channelMapEntry.getKey());
+                    sb.append('=');
+                    sb.append(channelMapEntry.getValue());
+                    if (iter.hasNext())
+                        sb.append(", ");
+                }
+                sb.append(')');
+            }
+        }
+        sb.append(" ]");
+        return sb.toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/cluster/RemoveNodeListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/cluster/RemoveNodeListener.java b/modules/core/src/flex/messaging/cluster/RemoveNodeListener.java
new file mode 100755
index 0000000..5d23721
--- /dev/null
+++ b/modules/core/src/flex/messaging/cluster/RemoveNodeListener.java
@@ -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 flex.messaging.cluster;
+
+
+/**
+ * @exclude
+ * Called when a node leaves the cluster.  Note that for JGroups at least, this
+ * callback should not execute any "long running" operations.  This is indirectly
+ * called from the MembershipListener interface in JGroups.
+ */
+public interface RemoveNodeListener
+{
+    /**
+     * Callback that the clustering subsystem uses to notify that a
+     * node has been removed from the cluster.
+     *
+     * @address The node that was removed from the cluster.
+     */
+    void removeClusterNode(Object address);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/cluster/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/cluster/package-info.java b/modules/core/src/flex/messaging/cluster/package-info.java
new file mode 100755
index 0000000..5ff0444
--- /dev/null
+++ b/modules/core/src/flex/messaging/cluster/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * 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.messaging.cluster;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/config/ApacheXPathServerConfigurationParser.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/config/ApacheXPathServerConfigurationParser.java b/modules/core/src/flex/messaging/config/ApacheXPathServerConfigurationParser.java
new file mode 100755
index 0000000..2eeac88
--- /dev/null
+++ b/modules/core/src/flex/messaging/config/ApacheXPathServerConfigurationParser.java
@@ -0,0 +1,89 @@
+/*
+ * 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.messaging.config;
+
+import org.apache.xpath.CachedXPathAPI;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import javax.xml.transform.TransformerException;
+
+/**
+ * Uses Apache XPath on a DOM representation of a messaging configuration
+ * file.
+ * <p>
+ * Note: Since reference ids are used between elements, certain
+ * sections of the document need to be parsed first.
+ * </p>
+ *
+ * @author Peter Farland
+ * @exclude
+ */
+public class ApacheXPathServerConfigurationParser extends ServerConfigurationParser
+{
+    private CachedXPathAPI xpath;
+
+    protected void initializeExpressionQuery()
+    {
+        this.xpath = new CachedXPathAPI();
+    }
+
+    protected Node selectSingleNode(Node source, String expression)
+    {
+        try
+        {
+            return xpath.selectSingleNode(source, expression);
+        }
+        catch (TransformerException transformerException)
+        {
+            throw wrapException(transformerException);
+        }
+    }
+
+    protected NodeList selectNodeList(Node source, String expression)
+    {
+        try
+        {
+            return xpath.selectNodeList(source, expression);
+        }
+        catch (TransformerException transformerException)
+        {
+            throw wrapException(transformerException);
+        }
+    }
+
+    protected Object evaluateExpression(Node source, String expression)
+    {
+        try
+        {
+            return xpath.eval(source, expression);
+        }
+        catch (TransformerException transformerException)
+        {
+            throw wrapException(transformerException);
+        }
+    }
+
+    private ConfigurationException wrapException(TransformerException exception)
+    {
+       ConfigurationException result = new ConfigurationException();
+       result.setDetails(PARSER_INTERNAL_ERROR);
+       result.setRootCause(exception);
+       return result;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/config/ConfigurationManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/config/ConfigurationManager.java b/modules/core/src/flex/messaging/config/ConfigurationManager.java
new file mode 100755
index 0000000..70b8cc6
--- /dev/null
+++ b/modules/core/src/flex/messaging/config/ConfigurationManager.java
@@ -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 flex.messaging.config;
+
+import javax.servlet.ServletConfig;
+
+import flex.messaging.log.LogCategories;
+
+/**
+ * ConfigurationManager interface
+ *
+ * The default implementation of the configuration manager is
+ * FlexConfigurationManager.  However, this value be specified in
+ * a servlet init-param &quot;services.configuration.manager&quot;
+ * to the MessageBrokerServlet.
+ *
+ * @exclude
+ */
+public interface ConfigurationManager
+{
+    String LOG_CATEGORY = LogCategories.CONFIGURATION;
+
+    MessagingConfiguration getMessagingConfiguration(ServletConfig servletConfig);
+
+    void reportTokens();
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/config/FactorySettings.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/config/FactorySettings.java b/modules/core/src/flex/messaging/config/FactorySettings.java
new file mode 100755
index 0000000..384feba
--- /dev/null
+++ b/modules/core/src/flex/messaging/config/FactorySettings.java
@@ -0,0 +1,82 @@
+/*
+ * 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.messaging.config;
+
+import flex.messaging.FlexFactory;
+import flex.messaging.util.ClassUtil;
+
+/**
+ * The factory configuration defines a single factory in the flex
+ * configuration file.
+ *
+ * @author Jeff Vroom
+ * @exclude
+ */
+public class FactorySettings extends PropertiesSettings
+{
+    protected String id;
+    protected String className;
+
+    public FactorySettings(String id, String className)
+    {
+        this.id = id;
+        this.className = className;
+    }
+
+    public String getId()
+    {
+        return id;
+    }
+
+    public String getClassName()
+    {
+        return className;
+    }
+
+    public FlexFactory createFactory()
+    {
+        return createFactory(null);
+    }
+
+    public FlexFactory createFactory(ClassLoader cl)
+    {
+        try
+        {
+            Class c = ClassUtil.createClass(className, cl);
+            Object f = ClassUtil.createDefaultInstance(c, FlexFactory.class);
+            if (f instanceof FlexFactory)
+            {
+                FlexFactory ff = (FlexFactory) f;
+                ff.initialize(getId(), getProperties());
+                return ff;
+            }
+            else
+            {
+                ConfigurationException cx = new ConfigurationException();
+                cx.setMessage(11101, new Object[] { className });
+                throw cx;
+            }
+        }
+        catch (Throwable th)
+        {
+            ConfigurationException cx = new ConfigurationException();
+            cx.setMessage(11102, new Object[] { className, th.toString() });
+            cx.setRootCause(th);
+            throw cx;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/config/FlexConfigurationManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/config/FlexConfigurationManager.java b/modules/core/src/flex/messaging/config/FlexConfigurationManager.java
new file mode 100755
index 0000000..8d1ae34
--- /dev/null
+++ b/modules/core/src/flex/messaging/config/FlexConfigurationManager.java
@@ -0,0 +1,319 @@
+/*
+ * 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.messaging.config;
+
+import flex.messaging.LocalizedException;
+import flex.messaging.util.Trace;
+import flex.messaging.util.ClassUtil;
+
+import javax.servlet.ServletConfig;
+import java.io.File;
+
+/**
+ * Manages which ConfigurationParser implementation will be
+ * used to read in the services configuration file and determines
+ * where the configuration file is located.
+ * <p>
+ * The default location of the configuration file is
+ * /WEB-INF/flex/services-config.xml, however this value can
+ * be specified in a servlet init-param &quot;services.configuration.file&quot;
+ * to the MessageBrokerServlet.
+ * </p>
+ * <p>
+ * The ConfigurationParser implementation can also be specified in
+ * a servlet init-param &quot;services.configuration.parser&quot; to
+ * the MessageBrokerServlet.
+ * </p>
+ *
+ * @author Peter Farland
+ * @see ConfigurationParser
+ * @exclude
+ */
+public class FlexConfigurationManager implements ConfigurationManager
+{
+    static final String DEFAULT_CONFIG_PATH = "/WEB-INF/flex/services-config.xml";
+
+    protected String configurationPath = null;
+    protected ConfigurationFileResolver configurationResolver = null;
+    protected ConfigurationParser parser = null;
+
+    public MessagingConfiguration getMessagingConfiguration(ServletConfig servletConfig)
+    {
+        MessagingConfiguration config = new MessagingConfiguration();
+
+        if (servletConfig != null)
+        {
+            String serverInfo = servletConfig.getServletContext().getServerInfo();
+            config.getSecuritySettings().setServerInfo(serverInfo);
+        }
+
+        verifyMinimumJavaVersion();
+
+        parser = getConfigurationParser(servletConfig);
+
+        if (parser == null)
+        {
+            // "Unable to create a parser to load messaging configuration."
+            LocalizedException lme = new LocalizedException();
+            lme.setMessage(10138);
+            throw lme;
+        }
+
+        setupConfigurationPathAndResolver(servletConfig);
+        parser.parse(configurationPath, configurationResolver, config);
+
+        if (servletConfig != null)
+        {
+            config.getSystemSettings().setPaths(servletConfig.getServletContext());
+        }
+
+        return config;
+    }
+
+    public void reportTokens()
+    {
+        parser.reportTokens();
+    }
+
+    protected ConfigurationParser getConfigurationParser(ServletConfig servletConfig)
+    {
+        ConfigurationParser parser = null;
+        Class parserClass = null;
+        String className = null;
+
+        // Check for Custom Parser Specification
+        if (servletConfig != null)
+        {
+            String p = servletConfig.getInitParameter("services.configuration.parser");
+            if (p != null)
+            {
+                className = p.trim();
+                try
+                {
+                    parserClass = ClassUtil.createClass(className);
+                    parser = (ConfigurationParser)parserClass.newInstance();
+                }
+                catch (Throwable t)
+                {
+                    if (Trace.config)
+                    {
+                        Trace.trace("Could not load configuration parser as: " + className);
+                    }
+                }
+            }
+        }
+
+        // Always try Sun JRE 1.4 / Apache Xalan Based Implementation first to
+        // avoid performance problems with Sun JRE 1.5 Based Implementation
+        if (parser == null)
+        {
+            try
+            {
+                ClassUtil.createClass("org.apache.xpath.CachedXPathAPI");
+                className = "flex.messaging.config.ApacheXPathServerConfigurationParser";
+                parserClass = ClassUtil.createClass(className);
+                parser = (ConfigurationParser)parserClass.newInstance();
+            }
+            catch (Throwable t)
+            {
+                if (Trace.config)
+                {
+                    Trace.trace("Could not load configuration parser as: " + className);
+                }
+            }
+        }
+
+        // Try Sun JRE 1.5 Based Implementation
+        if (parser == null)
+        {
+            try
+            {
+                className = "flex.messaging.config.XPathServerConfigurationParser";
+                parserClass = ClassUtil.createClass(className);
+                // double-check, on some systems the above loads but the import classes don't
+                ClassUtil.createClass("javax.xml.xpath.XPathExpressionException");
+
+                parser = (ConfigurationParser)parserClass.newInstance();
+            }
+            catch (Throwable t)
+            {
+                if (Trace.config)
+                {
+                    Trace.trace("Could not load configuration parser as: " + className);
+                }
+            }
+        }
+
+        if (Trace.config && parser != null)
+        {
+            Trace.trace("Services Configuration Parser: " + parser.getClass().getName());
+        }
+
+        return parser;
+    }
+
+    /**
+     * Sets up the configuration path and resolver objects.
+     * If no entry is specified in web.xml, assumed services-config.xml in the web application.
+     * If an entry is specified for windows starting with '/', it's assumed to be in the web application.
+     * If an entry is specified for windows not starting with '\', it's assumed to be on the local file system.
+     * If an entry is specified for non-windows starting with '/', we will first look in the web application
+     *  then the the local file system.
+     *
+     * @param servletConfig configuration
+     */
+    protected void setupConfigurationPathAndResolver(ServletConfig servletConfig)
+    {
+        if (servletConfig != null)
+        {
+            String p = servletConfig.getInitParameter("services.configuration.file");
+            if ((p == null) || (p.trim().length() == 0))
+            {
+                // no entry specified in web.xml, always use default and ServletResourceResolver
+                configurationPath = DEFAULT_CONFIG_PATH;
+                configurationResolver = new ServletResourceResolver(servletConfig.getServletContext());
+            }
+            else
+            {
+                // an entry was specified in web.xml,
+                configurationPath = p.trim();
+
+                // on windows, all paths starting with '/' should be available via the servlet resource resolver
+                // on other systems, you're not sure so try the servlet resource loader first it but don't throw an error,
+                //   after that try using LocalFileResolver
+                boolean isWindows = File.separator.equals("\\");
+                boolean isServletResource = isWindows && configurationPath.startsWith("/");
+                if (isServletResource || !isWindows)
+                {
+                    ServletResourceResolver resolver = new ServletResourceResolver(servletConfig.getServletContext());
+                    boolean available = resolver.isAvailable(configurationPath, isServletResource);
+                    if (available)
+                    {
+                        // it's available via the servlet resource loader
+                        configurationResolver = (ConfigurationFileResolver)resolver;
+                    }
+                    else
+                    {
+                        // it wasn't available via the servlet resource loader
+                        configurationResolver = new LocalFileResolver(LocalFileResolver.SERVER);
+                    }
+                }
+                else
+                {
+                    // it's windows but seems to be specified as a file
+                    configurationResolver = new LocalFileResolver(LocalFileResolver.SERVER);
+                }
+            }
+        }
+
+        // no entry specified in web.xml
+        else
+        {
+            ConfigurationException ce =  new ConfigurationException();
+            ce.setMessage("missing ServletConfig object");
+            throw ce;
+        }
+
+
+   }
+
+    protected void verifyMinimumJavaVersion() throws ConfigurationException
+    {
+        try
+        {
+            boolean minimum = false;
+            String version = System.getProperty("java.version");
+            String vendor = System.getProperty("java.vendor");
+
+            version = version.replace('.', ':');
+            version = version.replace('_', ':');
+            String[] split = version.split(":");
+
+            int first = Integer.parseInt(split[0]);
+            if (first > 1)
+            {
+                minimum = true;
+            }
+            else if (first == 1)
+            {
+                int second = Integer.parseInt(split[1]);
+                if (second > 4)
+                {
+                    minimum = true;
+                }
+                else  if (second == 4)
+                {
+                    int third = Integer.parseInt(split[2]);
+                    if (third > 2)
+                    {
+                        minimum = true;
+                    }
+                    else if (third == 2)
+                    {
+                        if ((vendor != null) && (vendor.indexOf("Sun") != -1))
+                        {
+                            // test at least 1.4.2_06 on Sun
+                            int fourth = Integer.parseInt(split[3]);
+                            if (fourth >= 6)
+                            {
+                                minimum = true;
+                            }
+                        }
+                        else
+                        {
+                            // test at least 1.4.2 on non-Sun
+                            minimum = true;
+                        }
+                    }
+                }
+            }
+
+            if (!minimum)
+            {
+                ConfigurationException cx = new ConfigurationException();
+
+                if ((vendor != null) && (vendor.indexOf("Sun") != -1))
+                {
+                    // The minimum required Java version was not found. Please install JDK 1.4.2_06 or above. Current version is XX.
+                    cx.setMessage(10139, new Object[] { System.getProperty("java.version")});
+                }
+                else
+                {
+                    // The minimum required Java version was not found. Please install JDK 1.4.2 or above. Current version is XX.
+                    cx.setMessage(10140, new Object[] { System.getProperty("java.version")});
+                }
+
+                throw cx;
+            }
+        }
+        catch (Throwable t)
+        {
+            if (t instanceof ConfigurationException)
+            {
+                throw ((ConfigurationException)t);
+            }
+            else
+            {
+                if (Trace.config)
+                {
+                    Trace.trace("Could not verified required java version. version=" + System.getProperty("java.version"));
+                }
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/config/MessageFilterSettings.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/config/MessageFilterSettings.java b/modules/core/src/flex/messaging/config/MessageFilterSettings.java
new file mode 100755
index 0000000..b4c2092
--- /dev/null
+++ b/modules/core/src/flex/messaging/config/MessageFilterSettings.java
@@ -0,0 +1,99 @@
+/*
+ * 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.messaging.config;
+
+/**
+ * Settings class for message filters.
+ * 
+ * @exclude
+ */
+public class MessageFilterSettings extends PropertiesSettings
+{
+    /**
+     * Filters belong to one of two types; those that filter messages
+     * asynchronously and those that filter messages synchronously.
+     */
+    public enum FilterType { ASYNC, SYNC };
+    
+    private String id;
+
+    /**
+     * Returns the id.
+     *
+     * @return The id.
+     */
+    public String getId()
+    {
+        return id;
+    }
+
+    /**
+     * Sets the id.
+     *
+     * @param value The id.
+     */
+    public void setId(String value)
+    {
+        id = value;
+    }    
+    
+    private String className;
+
+    /**
+     * Returns the class name.
+     *
+     * @return The class name.
+     */
+    public String getClassName()
+    {
+        return className;
+    }
+
+    /**
+     * Sets the class name.
+     *
+     * @param value The class name.
+     */
+    public void setClassName(String value)
+    {
+        className = value;
+    }
+    
+    private FilterType filterType;
+    
+    /**
+     * Returns the filter type.
+     * @see FilterType
+     * 
+     * @return The filter type.
+     */
+    public FilterType getFilterType()
+    {
+        return filterType;
+    }
+    
+    /**
+     * Sets the filter type.
+     * @see FilterType
+     * 
+     * @param value The filter type.
+     */
+    public void setFilterType(FilterType value)
+    {
+        filterType = value;
+    }
+}


[05/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/MessageException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/MessageException.java b/modules/core/src/flex/messaging/MessageException.java
new file mode 100755
index 0000000..f11c59a
--- /dev/null
+++ b/modules/core/src/flex/messaging/MessageException.java
@@ -0,0 +1,443 @@
+/*
+ * 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.messaging;
+
+import java.util.Map;
+
+import flex.messaging.log.Log;
+import flex.messaging.log.LogCategories;
+import flex.messaging.log.LogEvent;
+import flex.messaging.messages.ErrorMessage;
+import flex.messaging.messages.Message;
+import flex.messaging.util.ExceptionUtil;
+import flex.messaging.util.PropertyStringResourceLoader;
+import flex.messaging.util.ResourceLoader;
+import flex.messaging.util.StringUtils;
+
+/**
+ * The MessageException class is the basic exception type used throughout
+ * the server.  This class is extended to support more specific exception types.
+ */
+public class MessageException extends LocalizedException
+{
+    //--------------------------------------------------------------------------
+    //
+    // Static Constants
+    //
+    //--------------------------------------------------------------------------
+
+    // Message exception code strings.
+    public static final String CODE_SERVER_RESOURCE_UNAVAILABLE = "Server.ResourceUnavailable";
+
+    /** @exclude **/
+    static final long serialVersionUID = 3310842114461162689L;
+
+    //--------------------------------------------------------------------------
+    //
+    // Constructors
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Default constructor.
+     */
+    public MessageException()
+    {
+    }
+
+    /**
+     * Construct a message specifying a ResourceLoader to be used to load localized strings.
+     *
+     * @param loader
+     */
+    public MessageException(ResourceLoader loader)
+    {
+        super(loader);
+    }
+
+    /**
+     * Constructor with a message.
+     *
+     * @param message The detailed message for the exception.
+     */
+    public MessageException(String message)
+    {
+        setMessage(message);
+    }
+
+    /**
+     * Constructs a new exception with the specified message and the <code>Throwable</code> as the root cause.
+     *
+     * @param message The detailed message for the exception.
+     * @param t The root cause of the exception.
+     */
+    public MessageException(String message, Throwable t)
+    {
+        setMessage(message);
+        setRootCause(t);
+    }
+
+    /**
+     * Constructs a new exception with the specified <code>Throwable</code> as the root cause.
+     *
+     * @param t The root cause of the exception.
+     */
+    public MessageException(Throwable t)
+    {
+        String rootMessage = t.getMessage();
+        if (rootMessage == null)
+            rootMessage = t.toString();
+        setMessage(rootMessage);
+        setRootCause(t);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  code
+    //----------------------------------
+
+    /** @exclude **/
+    protected String code;
+
+    /**
+     * Returns the code of the exception.
+     *
+     * @return Code of the exception.
+     */
+    public String getCode()
+    {
+        return code;
+    }
+
+    /**
+     * Sets the code of the exception.
+     *
+     * @param code Code of the exception.
+     */
+    public void setCode(String code)
+    {
+        this.code = code;
+    }
+
+    //----------------------------------
+    //  defaultLogMessageIntro
+    //----------------------------------
+
+    /**
+     * Returns the default initial text for use in the log output generated by <code>logAtHingePoint()</code>.
+     */
+    public String getDefaultLogMessageIntro()
+    {
+        return "Error handling message: ";
+    }
+
+    //----------------------------------
+    //  extendedData
+    //----------------------------------
+
+    /** @exclude **/
+    protected Map extendedData;
+
+    /**
+     * Returns the extended data of the exception.
+     *
+     * @return The extended data of the exception.
+     */
+    public Map getExtendedData()
+    {
+        return extendedData;
+    }
+
+    /**
+     * Sets the extended data of the exception.
+     *
+     * @param extendedData The extended data of the exception.
+     */
+    public void setExtendedData(Map extendedData)
+    {
+        this.extendedData = extendedData;
+    }
+
+    //----------------------------------
+    //  errorMessage
+    //----------------------------------
+
+    /** @exclude **/
+    protected ErrorMessage errorMessage;
+
+    /**
+     * Returns the error message of the exception.
+     *
+     * @return The error message of the exception.
+     */
+    public ErrorMessage getErrorMessage()
+    {
+        if (errorMessage == null)
+        {
+            errorMessage = createErrorMessage();
+        }
+        return errorMessage;
+    }
+
+    /**
+     * Sets the error message of the exception.
+     *
+     * @param errorMessage The error message of the exception.
+     */
+    public void setErrorMessage(ErrorMessage errorMessage)
+    {
+        this.errorMessage = errorMessage;
+    }
+
+    //----------------------------------
+    //  logStackTraceEnabled
+    //----------------------------------
+
+    /**
+     * Indicates whether logging of this exception should include a full stack trace or not.
+     * Default is true.
+     *
+     * @see #logAtHingePoint(Message, ErrorMessage, String)
+     */
+    public boolean isLogStackTraceEnabled()
+    {
+        return true;
+    }
+
+    //----------------------------------
+    //  logged
+    //----------------------------------
+
+    protected boolean logged;
+
+    /**
+     * Indicates whether this exception has already been logged
+     * by a call to <code>logAtHingPoint()</code>.
+     * Manual logging for an exception can use <code>setLogged(true)</code>
+     * to suppress any further automatic logging of the exception.
+     *
+     * @return true if the exception has been logged; otherwise false.
+     */
+    public boolean isLogged()
+    {
+        return logged;
+    }
+
+    /**
+     * Records whether this exception has been logged.
+     *
+     * @param value true if the exception has been logged; otherwise false.
+     */
+    public void setLogged(boolean value)
+    {
+        logged = value;
+    }
+
+    //----------------------------------
+    //  peferredLogLevel
+    //----------------------------------
+
+    /**
+     * Returns the preferred log level for this exception instance.
+     * The default value is <code>LogEvent.ERROR</code>.
+     *
+     * @see #logAtHingePoint(Message, ErrorMessage, String)
+     */
+    public short getPreferredLogLevel()
+    {
+        return LogEvent.ERROR;
+    }
+
+    //----------------------------------
+    //  resourceLoader
+    //----------------------------------
+
+    /**
+     * Returns the <code>ResourceLoader</code> used to load localized strings.
+     *
+     * @return The <code>ResourceLoader</code> used to load localized strings.
+     */
+    @Override protected ResourceLoader getResourceLoader()
+    {
+        if (resourceLoader == null)
+        {
+            try
+            {
+                MessageBroker broker = FlexContext.getMessageBroker();
+                resourceLoader = broker != null? broker.getSystemSettings().getResourceLoader()
+                        : new PropertyStringResourceLoader();
+            }
+            catch (NoClassDefFoundError exception) // Could happen in client mode.
+            {
+                return new PropertyStringResourceLoader();
+            }
+        }
+
+        return resourceLoader;
+    }
+
+    //----------------------------------
+    //  rootCauseErrorMessage
+    //----------------------------------
+
+    /** @exclude **/
+    public Object getRootCauseErrorMessage()
+    {
+        if (rootCause == null)
+            return null;
+
+        // FIXME: serialize number field.
+        return rootCause instanceof MessageException?
+                ((MessageException)rootCause).createErrorMessage() : rootCause;
+    }
+
+    //----------------------------------
+    //  statusCode
+    //----------------------------------
+
+    protected int statusCode;
+
+    /**
+     * Returns the HTTP status code of the exception.
+     *
+     * @return The HTTP status code of the exception.
+     */
+    public int getStatusCode()
+    {
+        return statusCode;
+    }
+
+    /**
+     * Sets the HTTP status code of the exception.
+     *
+     * @param statusCode The HTTP status code of the exception.
+     */
+    public void setStatusCode(int statusCode)
+    {
+        this.statusCode = statusCode;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Creates an error message from the exception.
+     *
+     * @return The error message.
+     */
+    public ErrorMessage createErrorMessage()
+    {
+        ErrorMessage msg = new ErrorMessage();
+        msg.faultCode = code != null? code : "Server.Processing";
+        msg.faultString = message;
+        msg.faultDetail = details;
+        msg.rootCause = getRootCauseErrorMessage();
+        if (extendedData != null)
+            msg.extendedData = extendedData;
+        if (statusCode != 0)
+            msg.setHeader(Message.STATUS_CODE_HEADER, statusCode);
+        return msg;
+    }
+
+    /**
+     * Invoked at hinge-points in server processing where catch-all exception logging is performed.
+     * This method uses <code>isLogged()</code> and <code>setLogged()</code> to avoid repeat logging
+     * of the same exception and uses <code>getPreferredLogLevel()</code> which may be
+     * overridden in subclasses to control the log level that the logging is output at.
+     * The underlying exception stack traces are also conditionally included in log output
+     * if the exception class allows it and this is determined by invoking <code>isLogStackTraceEnabled()</code>
+     *
+     * @param inboundMessage The inbound message that triggered an exception during processing.
+     * @param outboundMessage The outbound <code>ErrorMessage</code>, which may be null depending on whether it has been generated
+     *                        or not at the point this method is invoked.
+     * @param logMessageIntro The beginning text for the log message, which may be null; default value is returned by <code>getDefaultLogMessageIntro()</code>.
+     */
+    public void logAtHingePoint(Message inboundMessage, ErrorMessage outboundMessage, String logMessageIntro)
+    {
+        if (!isLogged())
+        {
+            setLogged(true);
+
+            short preferredLevel = getPreferredLogLevel();
+            // If the preferred level is less than the current Log level; return early.
+            if (preferredLevel < Log.getTargetLevel())
+                return;
+
+            // Construct core log output.
+            StringBuffer output = new StringBuffer();
+            output.append((logMessageIntro != null) ? logMessageIntro : getDefaultLogMessageIntro());
+            output.append(this.toString());
+            output.append(StringUtils.NEWLINE);
+            output.append("  incomingMessage: ");
+            output.append(inboundMessage);
+            output.append(StringUtils.NEWLINE);
+            if (outboundMessage != null)
+            {
+                output.append("  errorReply: ");
+                output.append(outboundMessage);
+                output.append(StringUtils.NEWLINE);
+            }
+            if (isLogStackTraceEnabled())
+            {
+                output.append(ExceptionUtil.exceptionFollowedByRootCausesToString(this));
+                output.append(StringUtils.NEWLINE);
+            }
+
+            switch (preferredLevel)
+            {
+                case LogEvent.FATAL:
+                {
+                    Log.getLogger(LogCategories.MESSAGE_GENERAL).fatal(output.toString());
+                    break;
+                }
+                case LogEvent.ERROR:
+                {
+                    Log.getLogger(LogCategories.MESSAGE_GENERAL).error(output.toString());
+                    break;
+                }
+                case LogEvent.WARN:
+                {
+                    Log.getLogger(LogCategories.MESSAGE_GENERAL).warn(output.toString());
+                    break;
+                }
+                case LogEvent.INFO:
+                {
+                    Log.getLogger(LogCategories.MESSAGE_GENERAL).info(output.toString());
+                    break;
+                }
+                case LogEvent.DEBUG:
+                {
+                    Log.getLogger(LogCategories.MESSAGE_GENERAL).debug(output.toString());
+                    break;
+                }
+                default:
+                {
+                    Log.getLogger(LogCategories.MESSAGE_GENERAL).fatal("Failed to log exception for handling message due to an invalid preferred log level: " + preferredLevel);
+                    break;
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/MessageRoutedEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/MessageRoutedEvent.java b/modules/core/src/flex/messaging/MessageRoutedEvent.java
new file mode 100755
index 0000000..2cf0628
--- /dev/null
+++ b/modules/core/src/flex/messaging/MessageRoutedEvent.java
@@ -0,0 +1,54 @@
+/*
+ * 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.messaging;
+
+import flex.messaging.messages.Message;
+
+import java.util.EventObject;
+
+/**
+ * @exclude
+ * This event indicates that the source message has been routed to the outbound message queues
+ * for all target clients.
+ * This can be used as the trigger for performing optimized IO to flush these queued messages to 
+ * remote hosts over the network.
+ */
+public class MessageRoutedEvent extends EventObject
+{
+    /**
+     * @exclude
+     */
+    private static final long serialVersionUID = -3063794416424805005L;
+
+    /**
+     * Constructs a new <tt>MessageRoutedEvent</tt> using the supplied source <tt>Message</tt>.
+     * 
+     * @param message The message that has been routed.
+     */
+    public MessageRoutedEvent(Message message)
+    {
+        super(message);
+    }
+    
+    /**
+     * Returns the message that has been routed.
+     */
+    public Message getMessage()
+    {
+        return (Message)getSource();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/MessageRoutedListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/MessageRoutedListener.java b/modules/core/src/flex/messaging/MessageRoutedListener.java
new file mode 100755
index 0000000..4a04267
--- /dev/null
+++ b/modules/core/src/flex/messaging/MessageRoutedListener.java
@@ -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 flex.messaging;
+
+import java.util.EventListener;
+
+/**
+ * @exclude
+ * Provides notification for multicast message routing events to support optimized
+ * asynchronous IO to the target remote hosts.
+ */
+public interface MessageRoutedListener extends EventListener
+{    
+    /**
+     * Invoked when a message has been routed to the outbound queues for all target
+     * clients.
+     * 
+     * @param event The event containing the source message.
+     */
+    void messageRouted(MessageRoutedEvent event);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/MessageRoutedNotifier.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/MessageRoutedNotifier.java b/modules/core/src/flex/messaging/MessageRoutedNotifier.java
new file mode 100755
index 0000000..c2107ba
--- /dev/null
+++ b/modules/core/src/flex/messaging/MessageRoutedNotifier.java
@@ -0,0 +1,120 @@
+/*
+ * 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.messaging;
+
+import flex.messaging.messages.Message;
+
+import java.util.ArrayList;
+
+/**
+ * @exclude
+ * Supports registration and notification of <tt>MessageRoutedListener</tt>s.
+ * An instance of this class is exposed by <tt>FlexContext</tt> while a message is
+ * being routed, and once routing of the message to the outbound messages queues for
+ * target clients and registered listeners are notified.
+ * This class performs no synchronization because it is only used within the context
+ * of a single Thread, and only during the routing of a single message.
+ */
+public class MessageRoutedNotifier
+{
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     * Constructs a <tt>MessageRoutedNotifier</tt> for the supplied source message.
+     * 
+     * @param The source message being routed.
+     */
+    public MessageRoutedNotifier(Message message)
+    {
+        this.message = message;
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     * The source message being routed.
+     */
+    private final Message message;
+    
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  messageRoutedListeners
+    //----------------------------------
+    
+    private ArrayList listeners;
+    
+    /**
+     * Adds a <tt>MessageRoutedListener</tt>.
+     */
+    public void addMessageRoutedListener(MessageRoutedListener listener)
+    {
+        if (listener != null)
+        {
+            // Lazy-init only if necessary.
+            if (listeners == null)
+                listeners = new ArrayList();
+            
+            // Add if absent.
+            if (!listeners.contains(listener))
+                listeners.add(listener);
+        }
+    }
+    
+    /**
+     * Removes a <tt>MessageRoutedListener</tt>.
+     */
+    public void removeMessageRoutedListener(MessageRoutedListener listener)
+    {
+        if ((listener != null) && (listeners != null))
+            listeners.remove(listener);
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Notifies registered listeners of a routed message.
+     * 
+     * @param message The message that has been routed.
+     */
+    public void notifyMessageRouted()
+    {
+        if ((listeners != null) && !listeners.isEmpty())
+        {
+            MessageRoutedEvent event = new MessageRoutedEvent(message);
+            int n = listeners.size();
+            for (int i = 0; i < n; ++i)
+                ((MessageRoutedListener)listeners.get(i)).messageRouted(event);
+        }        
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/Server.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/Server.java b/modules/core/src/flex/messaging/Server.java
new file mode 100755
index 0000000..3022fe6
--- /dev/null
+++ b/modules/core/src/flex/messaging/Server.java
@@ -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 flex.messaging;
+
+/**
+ * The interface for a shared server instance that may be associated with a
+ * <tt>MessageBroker</tt> and used by endpoints.
+ */
+public interface Server extends FlexComponent
+{
+    /**
+     * Returns the id for the server.
+     * Endpoints can lookup server instances that have been associated with a <tt>MessageBroker</tt> using {@link MessageBroker#getServer(String)}.
+     */
+    String getId();
+
+    /**
+     * Sets the id for the server.
+     */
+    void setId(String value);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/ServiceValidationListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/ServiceValidationListener.java b/modules/core/src/flex/messaging/ServiceValidationListener.java
new file mode 100755
index 0000000..4cecbd7
--- /dev/null
+++ b/modules/core/src/flex/messaging/ServiceValidationListener.java
@@ -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.
+ */
+package flex.messaging;
+
+/**
+ * @exclude
+ */
+public interface ServiceValidationListener
+{
+    /**
+     * This method gets called before any other processing of the describeServices method.
+     * It allows a hook for external systems that need to update the service destinations at runtime.
+     */
+    void validateServices();
+    void validateDestination(String destination);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/VersionInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/VersionInfo.java b/modules/core/src/flex/messaging/VersionInfo.java
new file mode 100755
index 0000000..4ff2cc6
--- /dev/null
+++ b/modules/core/src/flex/messaging/VersionInfo.java
@@ -0,0 +1,116 @@
+/*
+ * 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.messaging;
+
+import flex.messaging.util.StringUtils;
+
+
+/**
+ * Class representing the build version of Data Services.
+ * 
+ *@exclude
+ */
+public class VersionInfo
+{
+    //Cache this info as it should not change during the time class is loaded
+    public static String BUILD_MESSAGE;
+    public static String BUILD_NUMBER_STRING;
+    public static String BUILD_TITLE;
+    public static long BUILD_NUMBER;
+    
+    private static final String LCDS_CLASS = "flex.data.DataService";
+
+    public static String buildMessage()
+    {
+        if (BUILD_MESSAGE == null)
+        {
+            try
+            {
+                //Ensure we've parsed build info
+                getBuild();
+
+                if (StringUtils.isEmpty(BUILD_NUMBER_STRING))
+                {
+                    BUILD_MESSAGE = BUILD_TITLE;
+                }
+                else
+                {
+                    BUILD_MESSAGE = BUILD_TITLE + ": " + BUILD_NUMBER_STRING;
+                }
+            }
+            catch (Throwable t)
+            {
+                BUILD_MESSAGE = BUILD_TITLE +": information unavailable";
+            }
+        }
+
+        return BUILD_MESSAGE;
+    }
+
+    public static long getBuildAsLong()
+    {
+        if (BUILD_NUMBER == 0)
+        {
+            getBuild();
+
+            if (BUILD_NUMBER_STRING != null && !BUILD_NUMBER_STRING.equals(""))
+            {
+                try
+                {
+                    BUILD_NUMBER = Long.parseLong(BUILD_NUMBER_STRING);
+                }
+                catch (NumberFormatException nfe)
+                {
+                    // ignore, just return 0
+                }
+            }
+        }
+
+        return BUILD_NUMBER;
+    }
+
+    public static String getBuild()
+    {
+        if (BUILD_NUMBER_STRING == null)
+        {
+            Class classToUseForManifest;  
+            
+            try
+            {
+                classToUseForManifest = Class.forName(LCDS_CLASS);
+            }
+            catch (ClassNotFoundException e)
+            {
+                classToUseForManifest = VersionInfo.class;
+            }
+            
+            try
+            {
+                BUILD_NUMBER_STRING = "";
+                Package pack = classToUseForManifest.getPackage();
+                BUILD_NUMBER_STRING = pack.getImplementationVersion();
+                BUILD_TITLE = pack.getImplementationTitle();
+            }
+            catch (Throwable t)
+            {
+                // ignore, just return empty string
+            }
+        }
+
+        return BUILD_NUMBER_STRING;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/AsyncPollHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/AsyncPollHandler.java b/modules/core/src/flex/messaging/client/AsyncPollHandler.java
new file mode 100755
index 0000000..64573e3
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/AsyncPollHandler.java
@@ -0,0 +1,31 @@
+/*
+ * 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.messaging.client;
+
+/**
+ * Defines the interface to handle asynchronous poll results.
+ */
+public interface AsyncPollHandler
+{
+    /**
+     * Invoked by the <tt>FlexClient</tt> when an asynchronous poll result is available.
+     * 
+     * @param flushResult The flush result containing messages to return in the poll response and
+     *         an optional wait time before the client should issue its next poll.
+     */
+    void asyncPollComplete(FlushResult flushResult);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/EndpointPushHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/EndpointPushHandler.java b/modules/core/src/flex/messaging/client/EndpointPushHandler.java
new file mode 100755
index 0000000..a043cb7
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/EndpointPushHandler.java
@@ -0,0 +1,79 @@
+/*
+ * 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.messaging.client;
+
+import java.util.List;
+
+import flex.messaging.MessageClient;
+import flex.messaging.messages.Message;
+
+/**
+ * Defines the interface for a handler that may be registered by an endpoint with a <tt>FlexClient</tt> in order
+ * to push messages to a connected client.
+ */
+public interface EndpointPushHandler
+{
+    /**
+     * Invoked to shut down the handler.
+     * It may be invoked by the endpoint when the underlying connection it manages to the client closes,
+     * or by the <tt>FlexClient</tt> if it is invalidated.
+     * The implementation of this method should release any resources, and should not attempt to notify the
+     * client of an explicit disconnect.
+     * 
+     * @see #close(boolean)
+     */
+    void close();
+    
+    /**
+     * Invoked to shut down the handler.
+     * It may be invoked by the endpoint when the underlying connection it manages to the client closes,
+     * or by the <tt>FlexClient</tt> if it is invalidated.
+     * The implementation of this method should release any resources, and may attempt to notify the client
+     * Channel that it has been disconnected in order to suppress automatic reconnect behavior.
+     * 
+     * @param disconnectChannel True to attempt to notify the client of an explicit disconnect in order to
+     *                          suppress automatic reconnect behavior.
+     */
+    void close(boolean disconnectChannel);
+    
+    /**
+     * Invoked by the <tt>FlexClient</tt> when it has messages to push to 
+     * the client.
+     * 
+     * @param messagesToPush The list of messages to push.
+     */
+    void pushMessages(List<Message> messagesToPush);
+    
+    /**
+     * Invoked to notify the handler that the <tt>MessageClient</tt> subscription is using this handler.
+     * If subscriptions should be invalidated if the handler is closed, it should retain references to
+     * all registered <tt>MessageClient</tt> instances and invalidate them when it closes.
+     * 
+     * @param messageClient The <tt>MessageClient</tt> subscription using this handler.
+     */
+    void registerMessageClient(MessageClient messageClient);
+    
+    /**
+     * Invoked to notify the handler that a <tt>MessageClient</tt> subscription that was using it has
+     * been invalidated.
+     * If the handler is tracking the set of <tt>MessageClient</tt> instances that are using it, the handler should
+     * remove the instance from its set.
+     * 
+     * @param messageClient The <tt>MessageClient</tt> subscription no longer using this handler.
+     */
+    void unregisterMessageClient(MessageClient messageClient);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/client/EndpointPushNotifier.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/client/EndpointPushNotifier.java b/modules/core/src/flex/messaging/client/EndpointPushNotifier.java
new file mode 100755
index 0000000..925f7e1
--- /dev/null
+++ b/modules/core/src/flex/messaging/client/EndpointPushNotifier.java
@@ -0,0 +1,461 @@
+/*
+ * 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.messaging.client;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import flex.messaging.FlexContext;
+import flex.messaging.FlexSession;
+import flex.messaging.FlexSessionListener;
+import flex.messaging.MessageClient;
+import flex.messaging.MessageClientListener;
+import flex.messaging.endpoints.BaseStreamingHTTPEndpoint;
+import flex.messaging.endpoints.Endpoint;
+import flex.messaging.log.Log;
+import flex.messaging.log.LogCategories;
+import flex.messaging.messages.AsyncMessage;
+import flex.messaging.messages.CommandMessage;
+import flex.messaging.util.TimeoutAbstractObject;
+import flex.messaging.util.UUIDUtils;
+
+/**
+ * @exclude
+ * Instances of this class are used by endpoints that support streaming
+ * outbound data to connected clients when the client is not polling and
+ * the FlexSession representing the connection does not support push directly.
+ * This generally requires that the client and endpoint establish a separate,
+ * physical connection for pushed data that is part of a larger, logical
+ * connection/session.
+ * <p>
+ * When the endpoint establishes this physical streaming connection it will
+ * create an instance of this class, register it with the FlexClient and then
+ * wait on the public <code>pushNeeded</code> condition variable.
+ * When data arrives to push to the remote client, the FlexClient will queue it
+ * with this notifier instance and the waiting endpoint will be notified.
+ * The endpoint will retrieve the queued messages from the notifier instance and will
+ * stream them to the client and then go back into a wait state on the
+ * <code>pushNeeded</code> condition variable.
+ * </p><p>
+ * Note that this implementation is based upon <code>Object.wait()</code>; it is not a
+ * non-blocking implementation.
+ * </p>
+ */
+public class EndpointPushNotifier extends TimeoutAbstractObject implements EndpointPushHandler, FlexSessionListener, MessageClientListener
+{
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Constructs a PushNotifier instance.
+     *
+     * @param endpoint The endpoint that will use this notifier.
+     * @param flexClient The FlexClient that will use this notifier.
+     */
+    public EndpointPushNotifier(Endpoint endpoint, FlexClient flexClient)
+    {
+        notifierId = UUIDUtils.createUUID(false /* doesn't need to be secure */);
+        this.endpoint = endpoint;
+        this.flexClient = flexClient;
+        flexClient.registerEndpointPushHandler(this, endpoint.getId());
+        flexSession = FlexContext.getFlexSession();
+        if (flexSession != null)
+            flexSession.addSessionDestroyedListener(this);
+        invalidateMessageClientOnStreamingClose = (endpoint instanceof BaseStreamingHTTPEndpoint)?
+                ((BaseStreamingHTTPEndpoint)endpoint).isInvalidateMessageClientOnStreamingClose() : false;
+        updateLastUse(); // Initialize last use timestamp to construct time.
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * The condition variable that the endpoint waits on for pushed data to arrive.
+     */
+    public final Object pushNeeded = new Object();
+
+    //--------------------------------------------------------------------------
+    //
+    // Private Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Flag indicating whether the notifier has been closed/shut down.
+     * This is used to signal a waiting endpoint that it should break out of its
+     * wait loop and close its streaming connection.
+     */
+    private volatile boolean closed;
+
+    /**
+     * Flag indicating that the notifier has started closing; used to allow only
+     * one thread to execute the close() logic and delay flipping closed to true
+     * to allow any final messages to be streamed to the client before the endpoint
+     * using the notifier breaks out of its wait/notify loop and terminates the
+     * streaming connection.
+     */
+    private volatile boolean closing;
+
+    /**
+     * The number of minutes a client can remain idle before the server
+     * times the notifier out.
+     */
+    private int idleTimeoutMinutes;
+
+    /**
+     * Whether to invalidate the message-client when the streaming connection is closed.
+     */
+    private final boolean invalidateMessageClientOnStreamingClose;
+
+    /**
+     * The endpoint that uses this notifier.
+     */
+    private final Endpoint endpoint;
+
+    /**
+     * The FlexClient this notifier is associated with.
+     */
+    private final FlexClient flexClient;
+
+    /**
+     * The FlexSession this notifier is associated with.
+     */
+    private final FlexSession flexSession;
+
+    /**
+     * Lock for instance-level synchronization.
+     */
+    private final Object lock = new Object();
+
+    /**
+     * Log category used by the notifier. Initialized to ENDPOINT_GENERAL but
+     * endpoints using this notifier should set it to their own log categories.
+     */
+    private String logCategory = LogCategories.ENDPOINT_GENERAL;
+
+    /**
+     * Queue of messages that the FlexClient will populate and the endpoint will drain to
+     * stream to the client.
+     */
+    private List<AsyncMessage> messages;
+
+    /**
+     * List of MessageClient subscriptions using this endpoint push notifier.
+     * When this notifier is closed, any associated subscriptions need to be invalidated.
+     */
+    private final CopyOnWriteArrayList<MessageClient> messageClients = new CopyOnWriteArrayList<MessageClient>();
+
+    /**
+     * Unique identifier for this instance.
+     */
+    private final String notifierId;
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Moves this notifier to a closed state, notifying any listeners,
+     * associated subscriptions and waiting endpoints.
+     * Does not attempt to notify the client Channel of the disconnect thereby allowing
+     * automatic reconnect processing to run.
+     */
+    public void close()
+    {
+        close(false);
+    }
+
+    /**
+     * Moves this notifier to a closed state, notifying any listeners,
+     * associated subscriptions and waiting endpoints.
+     * Attempts to notify the client Channel of an explicit disconnect, thereby suppressing
+     * automatic reconnect processing.
+     *
+     * @param disconnectChannel True to attempt to notify the client Channel of the disconnect
+     *                          and suppress automatic reconnect processing.
+     */
+    public void close(boolean disconnectChannel)
+    {
+        synchronized (lock)
+        {
+            if (closed || closing)
+                return;
+
+            closing = true;
+        }
+
+        cancelTimeout();
+
+        if (flexSession != null)
+            flexSession.removeSessionDestroyedListener(this);
+
+        // Shut down flow of further messages to this notifier.
+        flexClient.unregisterEndpointPushHandler(this, endpoint.getId());
+
+        // Push a disconnect command down to the client to suppress automatic reconnect.
+        if (disconnectChannel)
+        {
+            ArrayList<AsyncMessage> list = new ArrayList<AsyncMessage>(1);
+            CommandMessage disconnect = new CommandMessage(CommandMessage.DISCONNECT_OPERATION);
+            list.add(disconnect);
+            pushMessages(list);
+        }
+
+        // Invalidate associated subscriptions; this doesn't attempt to notify the client.
+        // Any client subscriptions made over this endpoint will be automatically invalidated
+        // on the client when it receives its channel disconnect event.
+        if (invalidateMessageClientOnStreamingClose)
+        {
+            for (Iterator<MessageClient> iter = messageClients.iterator() ; iter.hasNext();)
+                iter.next().invalidate();
+        }
+
+        // Move to final closed state; after this we need to notify one last time to stream
+        // any final messages to the client and allow the endpoint to shut down its streaming
+        // connection.
+        synchronized (lock)
+        {
+            closed = true;
+            closing = false;
+        }
+        synchronized (pushNeeded)
+        {
+            pushNeeded.notifyAll();
+        }
+    }
+
+    /**
+     * Returns any messages available to push to the client, and removes them
+     * from this notifier.
+     * Notified endpoints should invoke this method to retrieve messages, stream them
+     * to the client and then re-enter the wait state.
+     * This method acquires a lock on <code>pushNeeded</code>.
+     *
+     * @return The messages to push to the client.
+     */
+    public List<AsyncMessage> drainMessages()
+    {
+        synchronized (pushNeeded)
+        {
+            List<AsyncMessage> messagesToPush = messages;
+            messages = null;
+            return messagesToPush;
+        }
+    }
+
+    /**
+     * Returns whether the notifier has closed; used to break the endpoint's wait cycle.
+     *
+     * @return True if the notifier has closed; otherwise false.
+     */
+    public boolean isClosed()
+    {
+        return closed;
+    }
+
+    /**
+     * Returns the endpoint that is using this notifier.
+     *
+     * @return The endpoint using this notifier.
+     */
+    public Endpoint getEndpoint()
+    {
+        return endpoint;
+    }
+
+    /**
+     * Returns the idle timeout minutes used by the notifier.
+     *
+     * @return The idle timeout minutes used by the notifier.
+     */
+    public int getIdleTimeoutMinutes()
+    {
+        return idleTimeoutMinutes;
+    }
+
+    /**
+     * Sets the idle timeout minutes used by the notifier.
+     *
+     * @param idleTimeoutMinutes The idle timeout minutes used by the notifier.
+     */
+    public void setIdleTimeoutMinutes(int idleTimeoutMinutes)
+    {
+        this.idleTimeoutMinutes = idleTimeoutMinutes;
+    }
+
+    /**
+     * Returns the log category used by this notifier.
+     *
+     * @return The log category used by this notifier.
+     */
+    public String getLogCategory()
+    {
+        return logCategory;
+    }
+
+    /**
+     * Sets the log category used by this notifier. Endpoints using this notifier
+     * should set it to their own log categories.
+     *
+     * @param logCategory The log category for the notifier to use.
+     */
+    public void setLogCategory(String logCategory)
+    {
+        this.logCategory = logCategory;
+    }
+
+    /**
+     * Returns the unique id for this notifier.
+     *
+     * @return The unique id for this notifier.
+     */
+    public String getNotifierId()
+    {
+        return notifierId;
+    }
+
+    /**
+     * @exclude
+     * Implements TimeoutCapable.
+     * Determine the time, in milliseconds, that this object is allowed to idle
+     * before having its timeout method invoked.
+     */
+    public long getTimeoutPeriod()
+    {
+        return (idleTimeoutMinutes * 60 * 1000);
+    }
+
+    /**
+     * @exclude
+     */
+    public void messageClientCreated(MessageClient messageClient)
+    {
+        // No-op.
+    }
+
+    /**
+     * @exclude
+     */
+    public void messageClientDestroyed(MessageClient messageClient)
+    {
+        unregisterMessageClient(messageClient);
+    }
+
+    /**
+     * Used by FlexClient to push messages to the endpoint.
+     * This method will automatically notify a waiting endpoint, if one exists
+     * and it acquires a lock on <code>pushNeeded</code>.
+     *
+     * @param messages The messages to push to the client.
+     */
+    public void pushMessages(List messagesToPush)
+    {
+        if (!messagesToPush.isEmpty())
+        {
+            synchronized (pushNeeded)
+            {
+                // Push these straight on through; notify immediately.
+                if (messages == null)
+                    messages = messagesToPush;
+                else
+                    messages.addAll(messagesToPush);
+
+                // If the notifier isn't closing, notify; otherwise just add and the close will
+                // notify once it completes.
+                if (!closing)
+                    pushNeeded.notifyAll();
+            }
+        }
+    }
+
+    /**
+     * Registers a MessageClient subscription that depends on this notifier.
+     *
+     * @param messageClient A MessageClient that depends on this notifier.
+     */
+    public void registerMessageClient(MessageClient messageClient)
+    {
+        if (messageClient != null)
+        {
+            if (messageClients.addIfAbsent(messageClient))
+                messageClient.addMessageClientDestroyedListener(this);
+        }
+    }
+
+    /**
+     * Handle session creation events. This handler is a no-op because the notifier
+     * is only concerned with its associated session's destruction.
+     *
+     * @param flexSession The newly created FlexSession.
+     */
+    public void sessionCreated(FlexSession flexSession)
+    {
+        // No-op.
+    }
+
+    /**
+     * Handle session destruction events. This will be invoked when the notifier's
+     * associated session is invalidated, and this will trigger the notifier to close.
+     *
+     * @param flexSession The FlexSession being invalidated.
+     */
+    public void sessionDestroyed(FlexSession flexSession)
+    {
+        if (Log.isInfo())
+            Log.getLogger(logCategory).info("Endpoint with id '" + endpoint.getId() + "' is closing"
+                    + " a streaming connection for the FlexClient with id '" + flexClient.getId() + "'"
+                    + " since its associated session has been destroyed.");
+        close(true /* disconnect client Channel */);
+    }
+
+    /**
+     * @exclude
+     * Implements TimeoutCapable.
+     * Inform the object that it has timed out.
+     */
+    public void timeout()
+    {
+        if (Log.isInfo())
+            Log.getLogger(logCategory).info("Endpoint with id '" + endpoint.getId() + "' is timing out"
+                    + " a streaming connection for the FlexClient with id '" + flexClient.getId() + "'");
+        close(true /* disconnect client Channel */);
+    }
+
+    /**
+     * Unregisters a MessageClient subscription that depended on this notifier.
+     *
+     * @param messageClient A MessageClient that depended on this notifier.
+     */
+    public void unregisterMessageClient(MessageClient messageClient)
+    {
+        if (messageClient != null)
+        {
+            messageClient.removeMessageClientDestroyedListener(this);
+            messageClients.remove(messageClient);
+        }
+    }
+}
\ No newline at end of file


[49/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/ConsoleManager.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/ConsoleManager.as b/apps/ds-console/console/ConsoleManager.as
new file mode 100755
index 0000000..f8be6cb
--- /dev/null
+++ b/apps/ds-console/console/ConsoleManager.as
@@ -0,0 +1,1004 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 console
+{
+    import console.ConsoleTreeDataDescriptor;
+    import console.events.ManagementOperationInvokeEvent;
+    import flash.events.*;
+    import mx.collections.*;
+    import mx.containers.*;
+    import mx.controls.*;
+    import mx.controls.treeClasses.*;
+    import mx.events.*;
+    import mx.managers.*;
+    import mx.messaging.messages.*;
+    import mx.messaging.management.*;
+    import mx.rpc.events.*;
+    import mx.rpc.remoting.*;
+    import mx.utils.*;
+    import mx.rpc.remoting.RemoteObject;
+    import flash.display.DisplayObject;
+    import console.containers.UpdateManager;
+    import console.containers.UpdateListener;
+    import flash.utils.Timer;
+    import mx.core.LayoutContainer;
+        
+    public class ConsoleManager implements console.containers.UpdateManager
+    {
+        public static const GENERAL_SERVER:int = 1;
+        public static const GENERAL_POLLABLE:int = 2;
+        public static const GENERAL_OPERATION:int = 3;
+    
+        public static const GRAPH_BY_POLL_INTERVAL:int = 50;
+    
+        public static const ENDPOINT_SCALAR:int = 100;
+        public static const ENDPOINT_POLLABLE:int = 101;
+    
+        public static const DESTINATION_GENERAL:int = 150;
+        public static const DESTINATION_POLLABLE:int = 151;
+
+        public static const TIMER_INTERVAL:int = 3000;
+
+        ///////////////////////////
+        // Private data structures
+        ///////////////////////////
+        /**
+         * A generic object model of the MBean hierarchy, built from the flat set of object names.
+         * The model is an array of top level objects. Each object has the following slots:
+         * <ul>
+         *   <li>label:String - required - the label for the MBean instance or category name/app name</li>
+         *   <li>type:String - optional - the type value for a node that parents MBeans of similar type</li>
+         *   <li>objectName:ObjectName - optional - the ObjectName instance for an MBean</li>
+         *   <li>children:Array - optional - array of child objects</li>
+         * </ul>
+         */
+        private var _mbeanModel:Array;
+        public function get mbeanModel():Object
+        {
+            return _mbeanModel;
+        }
+        
+        /**
+        * The listeners map is keyed on the listeners and stores a property called types
+        * which is an array of all of the types that the listener uses and whether or not
+        * an individual type should poll.  Not all listeners are always updated however,
+        * there is another map 'activeListeners' which keeps track of which listeners are actively
+        * listening to the timer.  This is used because if one panel is hidden,
+        * we do not want to poll all of the data it listens for if it won't be displayed yet.
+        * 
+        * An example listeners map then looks like this:
+        * 
+        * listeners:Object -+-[listener1:String]-:- { reference: listenerObject,
+        *                   |                         types: [[TYPE1, POLL], 
+        *                   |                                 [TYPE2, NOPOLL]]
+        *                   +-[listener2:String]-:- { ... }
+        */
+        private var listeners:Object;
+        
+        
+        /**
+        * The activeListeners object stores all of the active listeners 
+        * for polling and is keyed on the type of data.  An example is:
+        * 
+        * activeListeners:Object -+-[ TYPE1:int ]-:- [ l1:UpdateListener , ... ]
+        *                         |
+        *                         + [ TYPE2:int ]-:- [ ... , ... , ... ]
+        */
+        private var activeListeners:Object;
+        
+        /**
+        * This map handles storing information about what mbeans are associated 
+        * with what display types.  It is keyed on the types of data (e.g. GENERAL_SCALAR, etc.),
+        * then on the application name stored as a string, then the MBean name.
+        * 
+        * An example displays map then looks like this:
+        * 
+        * displays:Object  -+-[TYPE1:int]-:[Application1]:- [mbean1] -> [attr1, attr2, attr3]
+        *                   |             |                 [mbean2] -> [attr1, attr2]
+        *                   |             |                 [mbean3] -> [...]
+        *                   |             +[Application2]:- [mbean...]
+        *                   |             |
+        *                   |
+        *                   +-[TYPE2:int]-:- [ ... ]
+        */
+        private var displays:Object;
+        
+        /**
+        * Temporarily holds onto data pulled from the server.  Anything in the buffer is
+        * always overridden by new data.
+        * 
+        * Is a map keyed on the data types which all reference maps keyed on mbeans which
+        * store arrays of associated attributes.
+        * 
+        * E.g.
+        * 
+        * dataBuffer:Object -+-[TYPE1:int]-+--[mbeanName: bean1] -:- [ attr1:String , attr2:String ] 
+        *                    |             +--[mbeanName: bean2] -:- [ attr1:String , attr2:String ] 
+        *                    |
+        *                    +-[TYPE2:int]----[mbeanName: bean3] ...
+        */
+        private var dataBuffer:Object;
+        
+        // is this necessary!? can any reference to types[] be replaced with the keyset of displays?
+        private var types:Array;
+        
+        
+        ///////////////////////////
+        // Private variables
+        ///////////////////////////
+        
+        private var minfo:MBeanInfo;
+        private var isInitialized:Boolean = false;
+        
+        /** 
+        * Map of ints, keeps track of how many mbeans of each type
+        * we've received from the server when processing getting
+        * data for any given type.
+        */
+        private var callbackCounters:Object;
+
+
+        private var _displayTypesObject:Object;
+         
+        /**
+         * Dictionary of callback handlers for remote call results
+         * keyed by message correlationId.
+         */
+        private var callbackMap:Object;
+        protected var callbacks:Object;
+
+        // Keeps track whether a mbeanServer related fault is already handled .
+        private var faultAlreadyHandled:Boolean = false;
+        
+        private var updateTimer:Object;
+
+        private var hiddenDomains:Array = [ "flex.runtime.Console" ];
+
+        ///////////////////////////
+        // Public console instance vars
+        ///////////////////////////
+        
+        private var _currentApp:String;
+        public function set currentApp(name:String):void
+        {
+            _currentApp = name;
+           
+            for (var listener:* in listeners)
+            {
+                // Todo: Update listeners so that they can clear their data buffers.
+                (listeners[listener].reference as UpdateListener).appChanged(name);
+            }
+        }
+        public function get currentApp():String
+        {
+            if (_currentApp == null)
+            {
+                if ((mbeanModel[0] != null) && (mbeanModel[0].label != null))
+                    _currentApp = mbeanModel[0].label
+                else
+                    return null
+                    
+            }
+            return _currentApp;
+        }
+
+        /**
+         * Handle to the MBean Server remote object.
+         */
+        private var _mbeanServer:RemoteObject;
+        public function get mbeanServer():RemoteObject
+        {
+            return _mbeanServer;
+        }
+
+        /**
+         * The MBeanName for the currently selected MBean.
+         */
+        private var _currentMBeanName:String;  
+        public function get currentMBeanName():String
+        {
+            return _currentMBeanName;
+        }
+        public function set currentMBeanName(s:String):void
+        {
+            _currentMBeanName = s;
+        }
+
+        /**
+         * The MBeanInfo for the currently selected MBean.
+         */
+        private var _currentMBeanInfo:MBeanInfo;    
+        public function get currentMBeanInfo():MBeanInfo
+        {
+            return _currentMBeanInfo;
+        }
+        public function set currentMBeanInfo(i:MBeanInfo):void
+        {
+            _currentMBeanInfo = i;
+        }
+        
+        protected var _parent:DisplayObject
+        public function set parent(p:DisplayObject):void
+        {
+            _parent = p;
+        }
+        
+        public function set timerInterval(interval:int):void
+        {            
+            if (interval > 0)
+            {
+                updateTimer.timer.stop();
+                updateTimer.timer = new Timer(interval, 0);
+                updateTimer.timer.addEventListener(TimerEvent.TIMER, pollServer);
+                updateTimer.timer.start();
+            }            
+        }
+        
+        protected static var privateCall:Boolean;
+        protected static var instance:ConsoleManager;
+
+
+        ////////////////////////////
+        // Console methods
+        ////////////////////////////
+        
+        public static function getInstance():ConsoleManager 
+        {
+            if (instance == null) 
+            {
+                privateCall = true;
+                ConsoleManager.instance = new ConsoleManager();
+                privateCall = false;
+            }
+            
+            return ConsoleManager.instance;
+        }
+
+        /**
+         * Initializes the console, and requests the names of
+         * registered Flex MBeans.
+         */
+        public function ConsoleManager():void
+        {
+            if (!privateCall)
+                throw new Error ("This is a Singleton Class!");
+                
+            // Create data structures used:
+            _mbeanModel = [];
+            callbacks = {};
+            displays = {};
+            listeners = {};
+            dataBuffer = {};
+            activeListeners = {}; 
+            _displayTypesObject = {};         
+            callbackCounters = {};
+            callbackCounters.dataFetch = {};
+            callbackCounters.typeCount = 0;
+            callbackCounters.appCount = 0;
+            
+            _mbeanServer = new RemoteObject("RuntimeManagement");
+            _mbeanServer.addEventListener("result", handleResult);
+            _mbeanServer.addEventListener("fault", handleFault);
+            
+            var token:Object = _mbeanServer.getFlexMBeanObjectNames();
+            callbacks[token.message.messageId] = handleMBeanObjectNames;
+        }
+        
+        
+        public function setAttribute(mbean:String, attribute:String, newValue:Object):void
+        {
+            var attr:Attribute = new Attribute;
+            attr.name = attribute;
+            attr.value = newValue;
+            mx.controls.Alert.show(attr.toString());
+            _mbeanServer.setAttribute(mbean, attr);
+        }
+        
+        /**
+        * Register a display panel that implements the UpdateListener interface, passing
+        * in an array, 'regtypes' which contains a list of every display type and
+        * whether or not the type should be polled.
+        */
+        public function registerListener(listener:UpdateListener, regtypes:Array):void
+        {
+            listeners[listener.name] = {reference: listener, types: regtypes};
+        }
+        
+        public function unregisterListener(listener:UpdateListener):void
+        {
+            if (listeners[listener.name])
+            {
+                deactivateListener(listener);
+                delete listeners[listener.name];
+            }         
+        }
+        
+        /**
+        * When a listener is activated using this method, the types are found in the listeners
+        * map and for each type:
+        * 
+        * If polling is enabled, we add the listener to the activeListeners map for the types
+        * it listens to.
+        * 
+        * If polling is not enabled, we just poll the server once.
+        */
+        public function activateListener(listener:UpdateListener):void
+        {
+            var typesForListener:Array;
+            try
+            {
+                typesForListener = listeners[listener.name].types;
+            }
+            catch (error:Error)
+            {
+                // nothing to do for this listener!
+            }
+
+            if (typesForListener == null)
+                return;
+
+            for (var i:int = 0; i < typesForListener.length; i++)
+            {
+                var type:int = typesForListener[i].type;
+                getDataForType(type, listener);
+                
+                if (typesForListener[i].poll)
+                {
+                    if (!activeListeners[type])
+                    {
+                        updateTimer.activeTypesCounter++;
+                        activeListeners[type] = new ArrayCollection;
+                    }
+                    
+                    (activeListeners[type] as ArrayCollection).addItem(listener);
+                    
+                    if (!updateTimer.timer.running)
+                        updateTimer.timer.start();
+                }
+            }
+        }
+        
+        public function deactivateListener(listener:UpdateListener):void
+        {
+            // can't deactivate a non-registered listener!
+            if (!listeners[listener.name])
+                return;
+
+            var typesForListener:Array = listeners[listener.name].types;
+            if (typesForListener == null)
+                return;
+
+            for (var i:int = 0; i < typesForListener.length; i++)
+            {
+                var type:int = typesForListener[i].type;
+                if (typesForListener[i].poll)
+                {
+                    if (activeListeners[type])
+                    {
+                        var indexOfListener:int = (activeListeners[type] as ArrayCollection).getItemIndex(listener);
+                        if (indexOfListener != -1)
+                            (activeListeners[type] as ArrayCollection).removeItemAt(indexOfListener);
+                        
+                        if ((activeListeners[type] as ArrayCollection).length == 0)
+                        {
+                            delete activeListeners[type];
+                            
+                            if (--updateTimer.activeTypesCounter == 0)
+                                updateTimer.timer.stop();
+                        }
+                    }
+                }
+            }
+        }
+        
+        public function addCallback(id:String, o:Object, f:Function):void
+        {
+            callbacks[id] = {object:o, callbackFunction:f};
+        }
+        
+         
+         public function getMBeanNamesForType(type:int):Array
+         {
+             if ((displays[type] == null) || (displays[type][_currentApp] == null))
+                return new Array;
+                
+             return (displays[type][_currentApp] as Array);
+         }
+
+        
+        public function getMBeanInfo(name:String, obj:Object, callback:Function):void
+        {
+            try
+            {
+                var token:Object = this.mbeanServer.getMBeanInfo(name);
+                this.addCallback(token.message.messageId,this,callback);
+            }
+            catch (e:Error)
+            {
+                // Ignore runtime error - we get a Fault back from the RPC operation.
+            }
+        }
+
+        /**
+         * Invoke an operation on an MBean.
+         */
+        public function invokeOperation(e:ManagementOperationInvokeEvent, callback:Function = null):void
+        {
+            if (callback == null)
+            {
+                callback = handleInvoke
+            }
+            
+            try
+            {
+                var token:Object = _mbeanServer.invoke(e.mbean, e.name, e.values, e.signature);
+                callbacks[token.message.messageId] = callback;
+            }
+            catch (e:Error)
+            {
+                // Ignore runtime error - we get a Fault back from the RPC operation.
+            }
+        }
+        
+        /**
+         * Request the current attribute values for an MBean.
+         */
+        public function getAllAttributes(name:String, info:MBeanInfo, obj:Object, callback:Function):void
+        {
+
+            // Fetch attribute values.
+            var attribNames:Array = [];
+            var n:int = info.attributes.length;
+            for (var i:int = 0; i < n; ++i)
+            {
+                var attribInfo:MBeanAttributeInfo = info.attributes[i];
+                // Ignore attributes that are MBean ObjectNames as all MBeans
+                // are rendered in the global tree and don't need to be repeated
+                // in the attributes this. Also ignore non-readable attributes.
+                if (attribInfo.readable && (attribInfo.type.indexOf("ObjectName") == -1))
+                {
+                    attribNames.push(attribInfo.name);
+                }
+            }
+            if (attribNames.length)
+            {
+                getAttributes(name, attribNames, obj, callback);
+            }
+
+        }
+        
+        public function getAttributes(name:String, attribs:Array, obj:Object, callback:Function):void
+        {
+            try
+            {
+                var token:Object = _mbeanServer.getAttributes(name, attribs);
+                this.addCallback(token.message.messageId, obj, callback);
+            }
+            catch (e:Error)
+            {
+                // Ignore runtime error - we get a Fault back from the RPC operation.
+            }
+        }
+
+        
+        public function getChildTrees(...children):Array
+        {
+            var ret:Array = new Array;
+            
+            for (var i:int = 0; i < children.length; i++)
+            {
+                if (children[i] is String)
+                {
+                    (getChildTree(children[i]) as Array)
+                        .forEach(function(it:*, i:int, a:Array):void { ret.push(it); });
+                }
+            }
+            return ret;
+        }
+        
+        public function getChildTree(childName:String):Array
+        {
+            var appTree:Array;
+            for each (var app:Object in _mbeanModel)
+            {
+                if (app.label == currentApp)
+                {
+                    // The only child of an application is the MessageBroker _class_ which could
+                    // have multiple messagebrokerX _instances_ beneath it, but the
+                    // first is selected. (Thus the multiple [0].children references.)
+                    try 
+                    {
+                        appTree = ((app.children as Array)[0].children as Array)[0].children as Array
+                    }
+                    catch (e:Error)
+                    {
+                        return new Array;
+                    }
+                }
+            }
+            
+            for each (var item:Object in appTree)
+            {
+                if (item.label == childName)
+                    return item.children as Array;
+            }
+            
+            return new Array;
+        }
+        
+        public function getTypesForAttribute(mbean:String, attr:String):Array
+        {
+            var types:Array = [];
+            for (var type:* in displays)
+            {
+                if (displays[type][_currentApp] != null)
+                {
+                    for (var b:String in displays[type][_currentApp])
+                    {
+                        if (mbean == b)
+                        {
+                            if ((displays[type][_currentApp][mbean] as Array).indexOf(attr) > -1)
+                                    types.push(type);
+                        }
+                    }
+                }
+            }
+            
+            return types;
+        }
+        
+        public function checkTypeForAttribute(type:int, mbean:String, attr:String):Boolean
+        {
+            if ((displays[type as String]) && (displays[type][_currentApp]) && (displays[type][_currentApp][mbean]))
+                    if ((displays[type][_currentApp][mbean] as Array).indexOf(attr) > -1)
+                        return true;
+                        
+            return false;
+        }
+        
+        public function updateData(listener:UpdateListener):void
+        {
+            var listenerObject:Object = listeners[listener.name];
+            if (!listenerObject)
+                return;
+                
+            for (var i:int = 0; i < (listenerObject.types as Array).length; i++)
+                getDataForType((listenerObject.types as Array)[i].type, listener);
+        }
+
+        private function getDataForType(type:int, singleListener:UpdateListener = null):void
+        {
+            if (!isInitialized)
+            {
+                // if we don't have the display data yet, we'll re-query the server and get the mbean object names
+                var objectnamesToken:Object = _mbeanServer.getFlexMBeanObjectNames();
+                callbacks[objectnamesToken.message.messageId] = handleMBeanObjectNames;
+
+                return;
+            }
+            
+                        
+            if ((displays[type] == null) || (displays[type][_currentApp] == null))
+                return
+            
+            // Dictionary of arrays keyed on mbeanName:the name of the 
+            // mbean, and the associated array is the attributes to query
+            var mbeans:Object = new Object;
+            var queryLength:int = 0;
+
+            for (var mbean:String in displays[type][_currentApp])
+                ++queryLength;
+            
+            for (var mbeanName:String in displays[type][_currentApp])
+            {
+                var token:Object = mbeanServer.getAttributes(currentApp+":"+mbeanName, 
+                    (displays[type][_currentApp][mbeanName] as ArrayCollection).toArray());
+                    
+                token.type = type;
+                token.mbeanName = mbeanName;
+                token.queryLength = queryLength;
+                token.singleListener = singleListener;
+                callbacks[token.message.messageId] = handleDataForType;
+            }
+        }
+        
+        private function handleDataForType(e:ResultEvent):void
+        {
+            var type:int = e.token.type as int;
+            var mbeanName:String = e.token.mbeanName as String;
+            var singleListener:UpdateListener = e.token.singleListener;
+            
+            if (!dataBuffer.hasOwnProperty(type))
+                dataBuffer[type] = new Object;
+            
+            // Put the data for the mbean for the specific type of data in the proper place in the array
+            if (dataBuffer[type].hasOwnProperty(mbeanName))
+                delete dataBuffer[type][mbeanName];
+                
+            dataBuffer[type][mbeanName] = e.result as Array;
+            
+            if (!callbackCounters.dataFetch.hasOwnProperty(type)) callbackCounters.dataFetch[type] = 0;
+            
+            if (++callbackCounters.dataFetch[type] == e.token.queryLength)
+            {
+                callbackCounters.dataFetch[type] = 0;
+                
+                if (!singleListener)
+                {
+                    var listenersToUpdate:ArrayCollection = activeListeners[type] as ArrayCollection;
+                    
+                    if (!listenersToUpdate)
+                        return;
+                        
+                    for (var i:int = 0; i < listenersToUpdate.length; i++)
+                    {
+                        (listenersToUpdate[i] as UpdateListener).dataUpdate(type, dataBuffer[type]);
+                    }
+                }
+                else
+                {
+                    singleListener.dataUpdate(type,  dataBuffer[type]);
+                }
+            }
+        }
+      
+        /**
+         * Handle any results from the MBean Server remote object by
+         * delegating to the associated callback based on correlationId.
+         */
+        protected function handleResult(e:ResultEvent):void
+        {
+            var msg:AsyncMessage = AsyncMessage(e.message);
+            if (msg.correlationId in callbacks)
+            {
+                var callback:Object = callbacks[msg.correlationId];
+                delete callbacks[msg.correlationId];
+                if (callback is Function)
+                {
+                    callback(e);
+                }
+                else
+                {
+                    if ((callback.hasOwnProperty("object")) && (callback.hasOwnProperty("callbackFunction")))
+                    {
+                        var f:Function = callback.callbackFunction;
+                        f.call(callback.object, e);
+                    }
+                }
+            }
+        }
+
+        /**
+         * Handle any faults from the MBean Server remote object by
+         * displaying an alert to the user.
+         */
+        protected function handleFault(e:FaultEvent):void
+        {
+            if (!faultAlreadyHandled)
+            {
+                mx.controls.Alert.show("Please restart the application since polling has stopped due to the following error: " + e.toString());
+                if (updateTimer != null)
+                {
+                    updateTimer.activeTypesCounter = 0;
+                    updateTimer.timer.stop();            
+                }
+                faultAlreadyHandled = true;
+            }
+        }
+
+        /**
+         * Handles the result of a getFlexMBeanObjectNames() call.
+         */
+        protected function handleMBeanObjectNames(e:ResultEvent):void
+        {
+            var i:int;
+            // Build the model for our MBeans.
+            var mbeanNames:Array = e.result as Array;
+            var domainNames:Array = [];
+            var domainMBeanNames:Object = {};
+            var mbeanName:ObjectName;
+            var n:int = mbeanNames.length;
+            if (n)
+            {
+                for (i = 0; i < n; ++i)
+                {
+                    mbeanName = mbeanNames[i];
+                    if (hiddenDomains.indexOf(mbeanName.domain) >= 0)
+                    {
+
+                    }
+                    else if (mbeanName.domain in domainMBeanNames)
+                    {
+                        domainMBeanNames[mbeanName.domain].push(mbeanName);
+                    }
+                    else
+                    {
+                        domainNames.push(mbeanName.domain);
+                        domainMBeanNames[mbeanName.domain] = [mbeanName];
+                    }
+                }
+                _mbeanModel = [];
+                domainNames.sort();
+                callbackCounters.appCount = domainNames.length;
+                var n2:int = domainNames.length;
+                for (i = 0; i < n2; ++i)
+                {
+                    buildDomain(domainNames[i], domainMBeanNames[domainNames[i]]);
+                    
+                    if (_displayTypesObject[domainNames[i]] != null)      
+                    {
+                        var token:Object = _mbeanServer.getAttributes(
+                            _displayTypesObject[domainNames[i]].canonicalName, ["SupportedTypes"]);
+                        
+                        token.beanName = _displayTypesObject[domainNames[i]].canonicalName;
+                        addCallback(token.message.messageId, this, handleSupportedTypesMBean);
+                    }
+                }
+                
+            }
+        }
+        
+        /**
+        * Process the display types that the server has registered.  Another function
+        * handles querying the MBean server for all of the actual attributes supported
+        * by the given display type.
+        */
+         private function handleSupportedTypesMBean(e:ResultEvent):void
+         {
+             if ((e.result as Array)[0].name != "SupportedTypes")
+             {
+                 return;
+             }
+             
+             types = (e.result as Array)[0].value;
+             callbackCounters.typeCount = types.length;
+             for (var i:int = 0; i < types.length; i++)
+             {
+                 var invokeEvent:ManagementOperationInvokeEvent = new ManagementOperationInvokeEvent(
+                    e.token.beanName, 
+                    "listForType", 
+                    [types[i]], 
+                    ["int"]);
+                    
+                 invokeOperation(invokeEvent, getTypesHandler);
+             }
+         }
+         
+        /**
+        * Handles the attribute _names_ for a given type which the server is sending
+        */
+         private function getTypesHandler(e:ResultEvent):void
+         {
+             --callbackCounters.typeCount;
+             
+             // Get the defined TYPE from the token
+             var type:int = e.token.message.body[2][0];
+
+             for each (var str:String in (e.result as Array))
+             {
+                 var mbeanAttr:Array = str.split(":");
+                    
+                 if (!displays.hasOwnProperty(type))
+                    displays[type] = new Object;
+                    
+                 if (!displays[type].hasOwnProperty(mbeanAttr[0]))
+                    displays[type][mbeanAttr[0]] = new Object;
+                    
+                 var exposedObjectInfo:Object = new Object;
+
+                 if (!displays[type][mbeanAttr[0]].hasOwnProperty(mbeanAttr[1]))
+                    displays[type][mbeanAttr[0]][mbeanAttr[1]] = new ArrayCollection();
+                     
+                 (displays[type][mbeanAttr[0]][mbeanAttr[1]] as ArrayCollection).addItem(mbeanAttr[2]);
+             }
+             
+             if (callbackCounters.typeCount == 0)
+             {
+                 initialize();
+             }
+         }
+
+        /**
+        * Function for handling what to do after all of the necessary mbea 
+        * data has been polled for the first time.
+        */
+        private function initialize():void
+        {
+             // now we can poll for data based on a given display type
+            isInitialized = true;
+             
+            // We've received and processed all of the display type information
+            // so we can notify the listeners
+            for each (var listener:Object in listeners)
+            {
+                (listener.reference as UpdateListener).mbeanModelUpdate(mbeanModel);
+            }
+            
+            updateTimer = new Object;
+            
+            updateTimer.timer = new Timer(TIMER_INTERVAL);
+            updateTimer.activeTypesCounter = 0;
+            updateTimer.timer.addEventListener(TimerEvent.TIMER, pollServer);
+        }
+               
+        private function pollServer(e:Event):void
+        {            
+            for (var type:* in activeListeners)
+            {
+                getDataForType(type);
+            }
+        }
+        
+        /**
+         * Builds a top level domain node containing all MBeans
+         * within the domain.
+         */
+        private function buildDomain(domain:String, objectNames:Array):void
+        {
+            var domainNode:Object = {label: domain, children: []};
+            // Process all of the MBean names in this domain.
+            // Put them in sorted order to optimize tree construction.
+            objectNames.sort(compareObjectNames);
+            var n:int = objectNames.length;
+            for (var i:int = 0; i < n; ++i)
+            {
+                buildMBeanNode(domainNode, objectNames[i]);
+            }
+            _mbeanModel.push(domainNode);
+        }
+
+        /**
+         * Comparator function for sorting MBean object names.
+         */
+        private function compareObjectNames(first:ObjectName, second:ObjectName):int
+        {
+            var firstType:String = first.getKeyProperty("type").toLowerCase();
+            var secondType:String = second.getKeyProperty("type").toLowerCase();
+            if (firstType > secondType)
+                return 1;
+            else if (firstType < secondType)
+                return -1;
+            else // Types match - compare on id.
+            {
+                var firstId:String = first.getKeyProperty("id").toLowerCase();
+                var secondId:String = second.getKeyProperty("id").toLowerCase();
+                return (firstId > secondId) ? 1 : (firstId < secondId) ? -1 : 0;
+            }
+        }
+
+        /**
+         * Builds and adds a tree node based on the MBean object name.
+         */
+        private function buildMBeanNode(parent:Object, name:ObjectName):void
+        {
+            var types:Array = name.getKeyProperty("type").split('.');
+            var mbeanId:String = name.getKeyProperty("id") as String;
+            // Sink to our insertion point in the type hierarchy, adding type nodes
+            // along the way when necessary.
+            var n:int = types.length;
+            for (var i:int = 0; i < n; ++i)
+            {
+                if (types[i] == "AdminConsoleDisplay")
+                {
+                    var app:String = ((name.canonicalName as String).split(":") as Array)[0];
+                    _displayTypesObject[app] = name;
+                    return;
+                }
+            }
+            
+            for (i = 0; i < n; ++i)
+            {
+                var createChildType:Boolean = true;
+                if (parent.children.length)
+                {
+                    // Search for a child matching on current type. This is a linear search,
+                    // but there generally aren't enough child nodes to warrant anything more performant.
+                    var children:Array = parent.children;
+                    var node:Object;
+                    var n2:int = children.length;
+                    for (var j:int = 0; j < n2; ++j)
+                    {
+                        node = children[j];
+                        if (node.hasOwnProperty("type") && node.type == types[i])
+                        {
+                            parent = children[j];
+                            createChildType = false;
+                            // Check whether the parent type (container) node contains a child MBean node
+                            // that matches on id. This is the ancestor MBean instance, out of all ancestors
+                            // of this current type, that we're parented under.
+                            // Again, a linear search because there generally aren't enough siblings of a
+                            // given type to warrant anything more performant.
+                            if (parent.children.length)
+                            {
+                                children = parent.children;
+                                var n3:int = children.length;
+                                for (var k:int = 0; k < n3; ++k)
+                                {
+                                    node = children[k];
+                                    if (node.hasOwnProperty("objectName") &&
+                                         (node.objectName.getKeyProperty("id") == name.getKeyProperty(types[i])))
+                                     {
+                                        parent = node;
+                                     }
+                                }
+                            }
+                            break;
+                        }
+                    }
+                }
+                if (createChildType)
+                {
+                    node = {label: types[i], type: types[i], children: []};
+                    parent.children.push(node);
+                    parent = node;
+                }
+            }
+            // We're done generating the ancestor hierarchy.
+            // Insert the MBean node.
+            if (parent.children.length)
+            {
+                // Simple linear search for insertion point among siblings for now.
+                var siblings:Array = parent.children;
+                var id:String = mbeanId.toLowerCase();
+                node;
+                n = siblings.length;
+                for (i = 0; i < n; ++i)
+                {
+                    node = siblings[i];
+                    if (node.hasOwnProperty("objectName") &&
+                        (node.objectName.getKeyProperty("id").toLowerCase() > id))
+                    {
+                        mbeanNode = {label: mbeanId, objectName: name, children: []};
+                        if (i == siblings.length)
+                            siblings.push(mbeanNode);
+                        else
+                            siblings.splice(i+1, 0, mbeanNode);
+                        return;
+                    }
+                }
+            }
+            // Add the MBean node without specifying an index; no insertion point was found for it.
+            var mbeanNode:Object = {label: mbeanId, objectName: name, children: []};
+            parent.children.push(mbeanNode);
+        }
+        
+
+        
+        /**
+         * Handles the result of invoke().
+         */
+        private function handleInvoke(e:ResultEvent):void
+        {
+            if (_parent)
+            {
+                var resultWindow:ConsoleResultWindow = ConsoleResultWindow(PopUpManager.createPopUp(_parent, ConsoleResultWindow, false));
+                PopUpManager.centerPopUp(resultWindow);
+                if (e.result != null)
+                {
+                    resultWindow.showResult(e.result);
+                }
+                else // A null result indicates success with a void return type.
+                {
+                    resultWindow.showSuccess();
+                }
+            }
+        }
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/ConsoleTreeDataDescriptor.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/ConsoleTreeDataDescriptor.as b/apps/ds-console/console/ConsoleTreeDataDescriptor.as
new file mode 100755
index 0000000..50e4a57
--- /dev/null
+++ b/apps/ds-console/console/ConsoleTreeDataDescriptor.as
@@ -0,0 +1,70 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 console {
+    
+import mx.collections.ArrayCollection;
+import mx.collections.ICollectionView;
+import mx.controls.treeClasses.ITreeDataDescriptor;
+    
+public class ConsoleTreeDataDescriptor implements ITreeDataDescriptor {
+
+        public function getChildren(node:Object, model:Object=null):ICollectionView
+	{
+	    if (node == null)
+	        return null;
+		else if (node.hasOwnProperty("children") && (node.children.length > 0))
+		    return new ArrayCollection(node.children);
+		else
+    		return null;
+	}
+	
+	public function hasChildren(node:Object, model:Object=null):Boolean
+        {
+            return true;
+        }
+
+
+	public function isBranch(node:Object, model:Object=null):Boolean
+	{
+	    if (node == null)
+	        return false;
+	    else
+    		return (node.hasOwnProperty("children") && (node.children.length > 0)) ? true : false;
+	}
+	
+	public function getData(node:Object, model:Object=null):Object 
+	{
+		return node;
+	}
+
+          
+        public function addChildAt(node:Object, child:Object, index:int, model:Object=null):Boolean
+	{
+           return true;
+	} 
+
+       public function removeChildAt(node:Object, child:Object, index:int, model:Object=null):Boolean
+       {
+            return true;
+       }
+    
+}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/AdvancedPanel.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/AdvancedPanel.as b/apps/ds-console/console/containers/AdvancedPanel.as
new file mode 100755
index 0000000..9140987
--- /dev/null
+++ b/apps/ds-console/console/containers/AdvancedPanel.as
@@ -0,0 +1,169 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 console.containers
+{
+    import console.ConsoleManager;
+    import console.containers.*;
+    import console.events.*;
+    import mx.collections.ListCollectionView;
+    import mx.rpc.events.ResultEvent;
+    import mx.messaging.management.MBeanInfo;
+    import mx.messaging.management.MBeanAttributeInfo;
+    import mx.events.*;
+    import mx.controls.Tree;
+    import mx.controls.DataGrid;
+    import flash.events.Event;
+    import flash.events.MouseEvent;
+    import mx.containers.Box;
+
+    public class AdvancedPanel extends UpdateListener
+    {
+        private var display:AdvancedPanelDisplay;
+        private var _manager:ConsoleManager;
+        private var _currentMBeanName:String;
+        private var _currentMBeanInfo:MBeanInfo;
+        
+        public function AdvancedPanel():void
+        {
+            super();
+            initialize();
+
+            percentWidth = 100;
+            percentHeight = 100;
+            
+            display = new AdvancedPanelDisplay();
+            this.addChild(display);
+            
+            label = "Generic Administration View";
+            
+            display.mbeanTree.addEventListener(ListEvent.CHANGE, manageMBean);
+            display.attributeGrid.addEventListener(ListEvent.CHANGE, showSelectedValue);
+            display.refreshButton.addEventListener(MouseEvent.CLICK, handleRefreshClick);
+            display.operationsUI.tabnav = display.main;
+            
+            _manager = ConsoleManager.getInstance();
+            _manager.registerListener(this, []);
+            display.operationsUI.addEventListener(ManagementOperationInvokeEvent.INVOKE, _manager.invokeOperation);
+        }
+        
+        public override function mbeanModelUpdate(model:Object):void
+        {
+            display.mbeanTree.dataProvider = model;
+        }
+         
+       /**
+         * Exposes a selected MBean for management.
+         */
+        private function manageMBean(e:Event):void
+        {
+            var node:Object = display.mbeanTree.selectedItem;
+            if (node && node.hasOwnProperty("objectName"))
+            {
+                _currentMBeanName = node["objectName"].canonicalName;
+                display.mbeanNameText.text = _currentMBeanName;
+                _manager.getMBeanInfo(_currentMBeanName, this, handleMBeanInfo);
+            }
+        }
+
+        /**
+         * Handles the result of getMBeanInfo().
+         */
+        public function handleMBeanInfo(e:ResultEvent):void
+        {
+            _currentMBeanInfo = MBeanInfo(e.result);
+            // Update string descriptions for the selected MBean.
+            display.mbeanClassText.text = _currentMBeanInfo.className;
+            display.mbeanDescriptionText.text = _currentMBeanInfo.description;
+            display.mbeanInfoOutput.text = _currentMBeanInfo.toString();
+            // Update the Operations tab.
+            display.operationsUI.mbeanInfo = _currentMBeanInfo;
+            display.operationsUI.mbeanName = _currentMBeanName;
+            // Fetch current attribute values for the selected MBean.
+            // Clear out currently selected attribute value.
+            display.selectedValueText.text = "";
+            
+            if (_currentMBeanInfo.attributes.length)
+            {
+                _manager.getAllAttributes(_currentMBeanName, _currentMBeanInfo, this, handleAttributes);
+            }
+        }
+
+        /**
+         * Handles the refresh button click.
+         */ 
+        private function handleRefreshClick(event:MouseEvent):void
+        {
+            refreshAttributes();    
+        }   
+         
+        /**
+         * Refreshes the displayed attribute values for the currently selected MBean.
+         */
+        private function refreshAttributes():void
+        {
+            if (_currentMBeanInfo != null)
+            {
+                _manager.getAllAttributes(_currentMBeanName, _currentMBeanInfo, this, handleAttributes);
+            }
+        }
+
+        /**
+         * Handles the result of getAttributes().
+         */
+        private function handleAttributes(e:ResultEvent):void
+        {
+            var attribs:Array = e.result as Array;
+            var attribLength:int = attribs.length;
+            display.attributeGrid.dataProvider = e.result;
+            // Show selected item value.
+            var index:int = display.attributeGrid.selectedIndex;
+            if (index != -1)
+            {
+		        var item:Object = ListCollectionView(display.attributeGrid.dataProvider).getItemAt(index);
+                if ((item != null) && (item.value != null))
+                {
+                    display.selectedValueText.text =  item.value.toString();
+                }
+            }
+            else
+            {
+                display.selectedValueText.text = "";
+            }
+        }
+        
+        
+        /**
+         * Hack function to show the selected grid value - we should get rid of this with
+         * a nice attributes grid that renders values nicely in a selectable fashion.
+         */
+        private function showSelectedValue(e:Event):void
+        {
+            var value:Object = DataGrid(e.target).selectedItem.value;
+            if (value != null)
+            {
+                display.selectedValueText.text =  value.toString();
+            }
+            else
+            {
+                display.selectedValueText.text = "null";
+            }
+        }
+        
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/AdvancedPanelDisplay.mxml
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/AdvancedPanelDisplay.mxml b/apps/ds-console/console/containers/AdvancedPanelDisplay.mxml
new file mode 100755
index 0000000..213e4a3
--- /dev/null
+++ b/apps/ds-console/console/containers/AdvancedPanelDisplay.mxml
@@ -0,0 +1,69 @@
+<?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:Box xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:console="console.containers.*" xmlns="*" width="100%" height="100%">
+
+    <mx:HDividedBox width="100%" height="100%">
+    
+        <mx:VBox height="100%" width="300">
+            <mx:Label text="MBeans"/>
+            <mx:Tree id="mbeanTree" height="100%" width="100%" />
+        </mx:VBox>
+        
+        <mx:VBox id="mbeanDetails" height="100%" width="100%">
+        
+            <mx:HBox width="100%">
+                <mx:Label text="Name: "/>
+                <mx:Text id="mbeanNameText" width="100%" selectable="true"/>
+            </mx:HBox>
+            
+            <mx:TabNavigator id="main" creationPolicy="all" width="100%" height="100%" tabWidth="150">
+            
+                <mx:VBox label="Attributes" width="100%" height="100%">
+                    <mx:HBox width="100%">
+                        <mx:Label text="Selected Value: "/>
+                        <mx:Text id="selectedValueText" text="" width="100%" selectable="true" />
+                    </mx:HBox>
+                    <mx:DataGrid id="attributeGrid" width="100%" height="100%" />
+                    <mx:Button label="Refresh" id="refreshButton" />
+                  </mx:VBox>
+                  
+                <mx:VBox label="Operations" id="operationTab" width="100%" height="100%">
+                    <console:OperationSet id="operationsUI" />
+                </mx:VBox>
+                
+                <mx:VBox label="Info" width="100%" height="100%" >
+                    <mx:HBox width="100%">
+                        <mx:Label text="MBean Class:"/>
+                        <mx:Text id="mbeanClassText" width="100%" selectable="true"/>
+                    </mx:HBox>
+                    <mx:HBox width="100%">
+                        <mx:Label text="Description:" />
+                        <mx:Text id="mbeanDescriptionText" width="100%" selectable="true"/>
+                    </mx:HBox>
+                    <mx:TextArea id="mbeanInfoOutput" height="100%" width="100%"/>
+                </mx:VBox>
+                
+            </mx:TabNavigator>
+            
+        </mx:VBox>
+    
+    </mx:HDividedBox>
+    
+</mx:Box>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/DefaultPanel.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/DefaultPanel.as b/apps/ds-console/console/containers/DefaultPanel.as
new file mode 100755
index 0000000..9b3bf0c
--- /dev/null
+++ b/apps/ds-console/console/containers/DefaultPanel.as
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 console.containers
+{
+    import console.ConsoleManager;
+    import mx.containers.Panel;
+    import flash.events.Event;
+    
+    public class DefaultPanel extends UpdateListener
+    {
+        private var display:DefaultPanelDisplay;
+        
+        public function DefaultPanel():void
+        {
+            super();
+            display = new DefaultPanelDisplay;
+            this.addChild(display);
+            label = "Console";
+            
+            // No data is ever used, but to ensure compatibility with the rest of
+            // the app this panel still registers with the ConsoleManager
+            ConsoleManager.getInstance().registerListener(this, []);
+        }                
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/DefaultPanelDisplay.mxml
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/DefaultPanelDisplay.mxml b/apps/ds-console/console/containers/DefaultPanelDisplay.mxml
new file mode 100755
index 0000000..16b3bea
--- /dev/null
+++ b/apps/ds-console/console/containers/DefaultPanelDisplay.mxml
@@ -0,0 +1,29 @@
+<?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:VBox  xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%">
+    <mx:TextArea width="100%" height="20%" editable="false" enabled="true" fontSize="12" paddingLeft="10" paddingRight="10">
+        <mx:htmlText>
+        <![CDATA[
+        <font size="18">Welcome to the <strong>Administration Console</font><br />
+        Get started by choosing a panel in the tab navigation above.<br />
+        ]]>
+        </mx:htmlText>
+    </mx:TextArea>
+</mx:VBox>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/DestinationManager.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/DestinationManager.as b/apps/ds-console/console/containers/DestinationManager.as
new file mode 100755
index 0000000..71ca7bc
--- /dev/null
+++ b/apps/ds-console/console/containers/DestinationManager.as
@@ -0,0 +1,238 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 console.containers
+{
+    import console.data.Bindable3DHashMap;
+    import console.ConsoleManager;
+    import mx.collections.ArrayCollection;
+    import mx.events.ListEvent;
+    import flash.events.Event;
+    import mx.charts.LineChart;
+    import mx.charts.series.LineSeries;
+    import mx.controls.listClasses.ListBase;
+    import mx.events.CollectionEvent;
+    
+    public class DestinationManager extends UpdateListener
+    {
+        private static const pollableTypes:Array = [
+            ConsoleManager.DESTINATION_POLLABLE ];
+            
+        private var _manager:ConsoleManager;
+        private var display:DestinationManagerDisplay;
+        private var selectedDestinationId:String;
+        private var selectedMBean:String;
+        private var dataCache:Bindable3DHashMap;
+        private var pollableAttributes:Object;
+        
+        [Bindable]
+        private var selectedBeanProperties:ArrayCollection;
+        
+        [Bindable]
+        private var selectedPropertyValues:ArrayCollection;
+        
+        public override function dataUpdate(type:int, data:Object):void
+        {
+            var dataArray:ArrayCollection = new ArrayCollection;
+            
+            // This finds any exposed properties under any destination node and
+            // adds them to the proper data structures so that all data in MBeans
+            // underneath destinations can be accesed by the destination's id 
+            for (var name:String in data)
+            {
+                var mapKey:String;
+                var mapValue:String;
+                
+                // Gets all properties for this MBean
+                var propertyArrayForMBean:Array = data[name];
+                
+                // split the mbean name on the commas, then split on the periods and get the last
+                // type.  if it contains destination, insert it into the array
+                // otherwise find the destination tag and insert it into it's data cache key.
+                var mbeanNames:Array = name.split(",");
+                
+                // find the actual type of this MBean, and if it is a Destination, we can use the id
+                // as the map key, otherwise, we have to find the MBean's parent which is a Destination
+                var types:Array = (mbeanNames[mbeanNames.length - 1] as String).split(".");
+                if ((types[types.length - 1] as String).indexOf("Destination") >= 0)
+                {
+                	// we are going after the id pairing here, most often it will be the second
+                	// to last pair but since WAS 6.1 inserts nodes and servers into 
+                	// the MBean name it may not be the case.  For optimization we'll still
+                	// go after the second to last pair, but will verify that this is indeed
+                	// the id pair and if not will look for it explicitly.
+                	var namePair:Array = (mbeanNames[mbeanNames.length - 2] as String).split("=");
+                	                	               
+                    mapKey = namePair[0];                    
+                    mapValue = namePair[1];     
+                    if (mapKey != "id")
+                    {
+                    	// did not find id where expected go through entire name pair collection
+                    	// looking for the id pair
+	                    for each (var mbeanNamePair:String in mbeanNames)
+	                    {
+	                    	var loopNamePair:Array = mbeanNamePair.split("=");
+	                    	mapKey =loopNamePair[0];
+	                    	mapValue = loopNamePair[1];	                    	
+	                        if (mapKey == "id")
+	                        {
+	                            break;
+	                        }
+	                    }                    	                    	
+                    }
+                }
+                else
+                {
+                    for each (var id:String in mbeanNames)
+                    {
+                        if (id.indexOf("Destination") >= 0)
+                        {
+                            // Get the Destination's id name as the key into the map
+                            mapValue = id.split("=")[1];
+                            break;
+                        }
+                    }
+                }
+                
+                // For each property, add the property and value to the appropriate map
+                for (var i:int = 0; i < propertyArrayForMBean.length; i++)
+                {
+                    if (pollableTypes.indexOf(type) >= 0)
+                        dataCache.update(mapValue, propertyArrayForMBean[i].name, propertyArrayForMBean[i].value);
+                    else
+                        dataCache.updateNoPollable(mapValue, propertyArrayForMBean[i].name, propertyArrayForMBean[i].value)
+                }
+            }
+        }
+        
+        public override function mbeanModelUpdate(model:Object):void
+        {
+            refreshDestinations();
+        }
+
+        public function DestinationManager():void
+        {
+            super();
+            display = new DestinationManagerDisplay;
+            this.addChild(display);
+            
+            this.label = "Destination Management";
+            
+            _manager = ConsoleManager.getInstance();
+            var registerTypes:Array = [ 
+                {type: ConsoleManager.DESTINATION_GENERAL, poll: false},
+                {type: ConsoleManager.DESTINATION_POLLABLE, poll: true},
+            ];
+            
+            _manager.registerListener(this, registerTypes);
+            display.dataList.addEventListener(ListEvent.CHANGE, selectedService);
+            display.httpList.addEventListener(ListEvent.CHANGE, selectedService);
+            display.messageList.addEventListener(ListEvent.CHANGE, selectedService);
+            display.remotingList.addEventListener(ListEvent.CHANGE, selectedService);
+            
+            display.destinationAttributes.addEventListener(ListEvent.CHANGE, selectedAttribute);
+
+            pollableAttributes = new Object;
+            dataCache = new Bindable3DHashMap();
+            
+            selectedBeanProperties = new ArrayCollection();
+            selectedPropertyValues = new ArrayCollection();
+        }
+        
+        private function selectedAttribute(e:Event):void
+        {
+            var property:String = e.target.selectedItem.Property as String;
+            var ret:ArrayCollection = dataCache.getBindableDataArray(selectedDestinationId, property);
+            if ((ret != null) && (ret.length >= 0))
+            {
+                display.attrgraph.dataProvider = ret;
+                display.graphLabel.text = property;
+            }
+            /*
+            return;
+
+            for (var type:* in pollableAttributes)
+            {
+                for each (var pollable:Object in pollableAttributes[type][selectedDestinationId])
+                {
+                    if (pollable.name == property) 
+                    {
+                        display.attrgraph.dataProvider = dataCache.getBindableDataArray(selectedDestinationId, property);
+                        display.graphLabel.text = property;
+                        return;
+                    }
+                }
+            }
+            */
+        }
+        
+        private function selectedService(e:Event):void
+        {
+            selectedDestinationId = e.currentTarget.selectedItem.label;
+            selectedMBean = e.currentTarget.selectedItem.objectName.canonicalName.split(":")[1];
+            display.destinationAttributes.dataProvider = dataCache.getBindableKeyArray(selectedDestinationId);
+            display.selectedProperty.text = e.currentTarget.selectedItem.label;
+            display.graphLabel.text = null;       
+            display.attrgraph.dataProvider = null;   
+            
+            if (e.currentTarget != display.httpList)
+                display.httpList.selectedIndex = -1;
+            if (e.currentTarget != display.messageList)
+                display.messageList.selectedIndex = -1;
+            if (e.currentTarget != display.dataList)
+                display.dataList.selectedIndex = -1;    
+            if (e.currentTarget != display.remotingList)
+                display.remotingList.selectedIndex = -1;  
+        }
+
+        public override function appChanged(s:String):void
+        {
+            dataCache.clearData();
+            refreshDestinations();
+            display.destinationAttributes.dataProvider = null;
+            display.selectedProperty.text = null;
+            display.graphLabel.text = null;       
+            display.attrgraph.dataProvider = null;     
+        }
+        
+        private function refreshDestinations():void
+        {
+            // TODO: Handle not having any specific services gracefully
+            display.dataList.dataProvider = getChildTree("DataService");
+            display.httpList.dataProvider = getChildTree("HTTPProxyService");
+            display.messageList.dataProvider = getChildTree("MessageService");
+            display.remotingList.dataProvider = getChildTree("RemotingService");
+        }
+        
+        /**
+        * This is just a helper method to find the proper MBeans for each Service
+        * from the ConsoleManager's model.  The model is a complicated structure
+        * of maps and arrays.
+        */
+        private function getChildTree(child:String):Array
+        {
+            var childArray:Array = _manager.getChildTree(child);
+            if ((childArray.length > 0) && (childArray[0].hasOwnProperty("children")))
+                childArray = childArray[0].children as Array;
+            if ((childArray.length > 0) && (childArray[0].hasOwnProperty("children")))
+                childArray = childArray[0].children as Array;            
+                    
+            return childArray;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/DestinationManagerDisplay.mxml
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/DestinationManagerDisplay.mxml b/apps/ds-console/console/containers/DestinationManagerDisplay.mxml
new file mode 100755
index 0000000..5e5d6a7
--- /dev/null
+++ b/apps/ds-console/console/containers/DestinationManagerDisplay.mxml
@@ -0,0 +1,61 @@
+<?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:Box xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%">
+    <mx:HDividedBox width="100%" height="100%">
+        <mx:VDividedBox height="100%" width="350">
+            <mx:DataGrid id="httpList" width="100%">
+                <mx:columns>
+                    <mx:DataGridColumn headerText="HTTP Proxy Service" dataField="label" />
+                </mx:columns>
+            </mx:DataGrid>
+            <mx:DataGrid id="messageList" width="100%">
+                <mx:columns>
+                    <mx:DataGridColumn headerText="Message Service" dataField="label" />
+                </mx:columns>
+            </mx:DataGrid>
+            <mx:DataGrid id="dataList" width="100%">
+                <mx:columns>
+                    <mx:DataGridColumn headerText="Data Service" dataField="label" />
+                </mx:columns>
+            </mx:DataGrid>
+            <mx:DataGrid id="remotingList" width="100%">
+                <mx:columns>
+                    <mx:DataGridColumn headerText="Remoting Service" dataField="label" />
+                </mx:columns>
+            </mx:DataGrid>
+        </mx:VDividedBox>
+        <mx:VDividedBox height="100%">
+            <mx:HBox>
+                <mx:Label text="Selected Attribute" />
+                <mx:Text id="selectedProperty" />
+            </mx:HBox>
+            <mx:DataGrid id="destinationAttributes" width="100%" height="50%" />
+            <mx:Label id="graphLabel" />
+            <mx:LineChart id="attrgraph" width="100%">
+                <mx:verticalAxis>
+                    <mx:LinearAxis id="attrgraphAxis" />
+                </mx:verticalAxis>
+                <mx:series>
+                    <mx:LineSeries id="attrgraphSeries" yField="Value" />
+                </mx:series>
+            </mx:LineChart>
+        </mx:VDividedBox>
+    </mx:HDividedBox>
+</mx:Box>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/EndpointManager.as
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/EndpointManager.as b/apps/ds-console/console/containers/EndpointManager.as
new file mode 100755
index 0000000..0c7a538
--- /dev/null
+++ b/apps/ds-console/console/containers/EndpointManager.as
@@ -0,0 +1,149 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 console.containers
+{
+    import console.data.Bindable3DHashMap;
+    import console.ConsoleManager;
+    import mx.collections.ArrayCollection;
+    import mx.events.ListEvent;
+    import flash.events.Event;
+    import mx.charts.LineChart;
+    import mx.charts.series.LineSeries;
+    import mx.controls.listClasses.ListBase;
+    import mx.events.CollectionEvent;
+    
+    public class EndpointManager extends UpdateListener
+    {
+        private static const pollableTypes:Array = [
+            ConsoleManager.ENDPOINT_POLLABLE ];
+            
+        private var _manager:ConsoleManager;
+        private var display:EndpointManagerDisplay;
+        private var selectedMBean:String;
+        private var dataCache:Bindable3DHashMap;
+        private var pollableAttributes:Object;
+        
+        [Bindable]
+        private var selectedBeanProperties:ArrayCollection;
+        
+        [Bindable]
+        private var selectedPropertyValues:ArrayCollection;
+        
+        public override function dataUpdate(type:int, data:Object):void
+        {
+            var dataArray:ArrayCollection = new ArrayCollection;
+            
+            for (var name:String in data)
+            {
+
+                var propertyArrayForMBean:Array = data[name];
+                
+                for (var i:int = 0; i < propertyArrayForMBean.length; i++)
+                {
+                    dataCache.update(name, propertyArrayForMBean[i].name, propertyArrayForMBean[i].value);
+                }
+            }
+            
+            if (pollableTypes.indexOf(type) >= 0)
+                pollableAttributes[type] = data;
+        }
+        
+        public override function mbeanModelUpdate(model:Object):void
+        {
+            refreshEndpoints();
+        }
+
+        public function EndpointManager():void
+        {
+            super();
+            display = new EndpointManagerDisplay;
+            this.addChild(display);
+            
+            this.label = "Endpoint Management";
+            
+            _manager = ConsoleManager.getInstance();
+            var registerTypes:Array = [
+                    {type: ConsoleManager.ENDPOINT_POLLABLE, poll: true},
+                    {type: ConsoleManager.ENDPOINT_SCALAR, poll: false}
+                ]
+            _manager.registerListener(this, registerTypes);
+            display.rtmpEndpointsList.addEventListener(ListEvent.CHANGE, selectedEndpoint);
+            display.amfEndpointsList.addEventListener(ListEvent.CHANGE, selectedEndpoint);
+            display.httpEndpointsList.addEventListener(ListEvent.CHANGE, selectedEndpoint);
+            
+            display.endpointAttributes.addEventListener(ListEvent.CHANGE, selectedAttribute);
+
+            pollableAttributes = new Object;
+            dataCache = new Bindable3DHashMap();
+            
+            selectedBeanProperties = new ArrayCollection();
+            selectedPropertyValues = new ArrayCollection();
+        }
+        
+        private function selectedAttribute(e:Event):void
+        {
+            var property:String = e.currentTarget.selectedItem.Property as String;
+            for (var type:* in pollableAttributes)
+            {
+                for each (var pollable:Object in pollableAttributes[type][selectedMBean])
+                {
+                    if (pollable.name == property) 
+                    {
+                        display.attrgraph.dataProvider = dataCache.getBindableDataArray(selectedMBean, property);
+                        display.graphLabel.text = property;
+                        return;
+                    }
+                }
+            }
+        }
+        
+        private function selectedEndpoint(e:Event):void
+        {
+            selectedMBean = ((e.currentTarget.selectedItem.objectName.canonicalName as String).split(":") as Array)[1];
+            display.endpointAttributes.dataProvider = dataCache.getBindableKeyArray(selectedMBean);
+            display.selectedProperty.text = e.currentTarget.selectedItem.label;
+            display.graphLabel.text = null;       
+            display.attrgraph.dataProvider = null;   
+            
+            if (e.currentTarget != display.amfEndpointsList)
+                display.amfEndpointsList.selectedIndex = -1;
+            if (e.currentTarget != display.httpEndpointsList)
+                display.httpEndpointsList.selectedIndex = -1;
+            if (e.currentTarget != display.rtmpEndpointsList)
+                display.rtmpEndpointsList.selectedIndex = -1;                
+        }
+
+        public override function appChanged(s:String):void
+        {
+            dataCache.clearData();
+            refreshEndpoints();
+            display.endpointAttributes.dataProvider = null;
+            display.selectedProperty.text = null;
+            display.graphLabel.text = null;       
+            display.attrgraph.dataProvider = null;     
+        }
+        
+        private function refreshEndpoints():void
+        {
+            display.httpEndpointsList.dataProvider = _manager.getChildTrees("HTTPEndpoint", "StreamingHTTPEndpoint", "NIOHTTPEndpoint", "StreamingNIOHTTPEndpoint");
+            display.rtmpEndpointsList.dataProvider = _manager.getChildTree("RTMPEndpoint");
+            display.amfEndpointsList.dataProvider = _manager.getChildTrees("AMFEndpoint", "StreamingAMFEndpoint", "NIOAMFEndpoint", "StreamingNIOAMFEndpoint");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/ds-console/console/containers/EndpointManagerDisplay.mxml
----------------------------------------------------------------------
diff --git a/apps/ds-console/console/containers/EndpointManagerDisplay.mxml b/apps/ds-console/console/containers/EndpointManagerDisplay.mxml
new file mode 100755
index 0000000..c5f69ef
--- /dev/null
+++ b/apps/ds-console/console/containers/EndpointManagerDisplay.mxml
@@ -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.
+
+-->
+<mx:Box xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%">
+    <mx:HDividedBox width="100%" height="100%">
+        <mx:VDividedBox height="100%" width="350">
+            <mx:DataGrid id="rtmpEndpointsList" width="100%">
+                <mx:columns>
+                    <mx:DataGridColumn headerText="RTMP Endpoints" dataField="label" />
+                </mx:columns>
+            </mx:DataGrid>
+            <mx:DataGrid id="httpEndpointsList" width="100%">
+                <mx:columns>
+                    <mx:DataGridColumn headerText="HTTP Endpoints" dataField="label" />
+                </mx:columns>
+            </mx:DataGrid>
+            <mx:DataGrid id="amfEndpointsList" width="100%">
+                <mx:columns>
+                    <mx:DataGridColumn headerText="AMF Endpoints" dataField="label" />
+                </mx:columns>
+            </mx:DataGrid>
+        </mx:VDividedBox>
+        <mx:VDividedBox height="100%">
+            <mx:HBox>
+                <mx:Label text="Selected Endpoint" />
+                <mx:Text id="selectedProperty" />
+            </mx:HBox>
+            <mx:DataGrid id="endpointAttributes" width="100%" height="50%" />
+            <mx:Label id="graphLabel" />
+            <mx:LineChart id="attrgraph" width="100%">
+                <mx:verticalAxis>
+                    <mx:LinearAxis id="attrgraphAxis" />
+                </mx:verticalAxis>
+                <mx:series>
+                    <mx:LineSeries id="attrgraphSeries" yField="Value" />
+                </mx:series>
+            </mx:LineChart>
+        </mx:VDividedBox>
+    </mx:HDividedBox>
+</mx:Box>


[10/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/Destination.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/Destination.java b/modules/core/src/flex/messaging/Destination.java
new file mode 100755
index 0000000..f1a7d1c
--- /dev/null
+++ b/modules/core/src/flex/messaging/Destination.java
@@ -0,0 +1,802 @@
+/*
+ * 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.messaging;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import flex.management.ManageableComponent;
+import flex.management.runtime.messaging.services.ServiceControl;
+import flex.messaging.log.LogCategories;
+import flex.messaging.log.Log;
+import flex.messaging.services.Service;
+import flex.messaging.services.ServiceAdapter;
+import flex.messaging.util.ClassUtil;
+import flex.messaging.cluster.ClusterManager;
+import flex.messaging.config.ClusterSettings;
+import flex.messaging.config.ConfigMap;
+import flex.messaging.config.ConfigurationConstants;
+import flex.messaging.config.ConfigurationException;
+import flex.messaging.config.NetworkSettings;
+import flex.messaging.config.SecurityConstraint;
+/**
+ * The <code>Destination</code> class is a source and sink for messages sent through
+ * a service destination and uses an adapter to process messages.
+ */
+public class Destination extends ManageableComponent implements java.io.Serializable
+{
+    static final long serialVersionUID = -977001797620881435L;
+
+    /** Default log category for <code>Destination</code>. */
+    public static final String LOG_CATEGORY = LogCategories.SERVICE_GENERAL;
+    
+    /** Hard coded id for the push destination */
+    public static final String PUSH_DESTINATION_ID = "_DS_PUSH_";
+
+    // Errors
+    private static final int NO_SERVICE = 11117;
+
+    // Destination's properties
+    protected ServiceAdapter adapter;
+    protected List<String> channelIds;
+    protected NetworkSettings networkSettings;
+    protected SecurityConstraint securityConstraint;
+    protected String securityConstraintRef;
+    protected HashMap<String, Object> extraProperties;
+    protected boolean initialized;
+    protected boolean clustered;
+    protected boolean clusteredCalculated;
+
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Constructs an unmanaged <code>Destination</code> instance.
+     */
+    public Destination()
+    {
+        this(false);
+    }
+
+    /**
+     * Constructs a <code>Destination</code> with the indicated management.
+     *
+     * @param enableManagement <code>true</code> if the <code>Destination</code>
+     * is manageable; otherwise <code>false</code>.
+     */
+    public Destination(boolean enableManagement)
+    {
+        super(enableManagement);
+
+        networkSettings = new NetworkSettings();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Initialize, validate, start, and stop methods.
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Initializes the <code>Destination</code> with the properties.
+     * If subclasses override, they must call <code>super.initialize()</code>.
+     *
+     * @param id The id of the destination.
+     * @param properties Properties for the destination.
+     */
+    @Override
+    public void initialize(String id, ConfigMap properties)
+    {
+        super.initialize(id, properties);
+
+        if (properties == null || properties.size() == 0)
+        {
+            initialized = true;
+            return;
+        }
+
+        ConfigMap network = properties.getPropertyAsMap(NetworkSettings.NETWORK_ELEMENT, null);
+
+        if (network != null)
+        {
+            networkSettings.setReliable(network.getPropertyAsBoolean(NetworkSettings.RELIABLE_ELEMENT, false));
+
+            ConfigMap clusterInfo = network.getPropertyAsMap(ClusterSettings.CLUSTER_ELEMENT, null);
+            if (clusterInfo != null)
+            {
+                // Mark these as used so we do not get warnings about them.
+                network.allowProperty(ClusterSettings.CLUSTER_ELEMENT);
+                clusterInfo.allowProperty(ClusterSettings.REF_ATTR);
+                clusterInfo.allowProperty(ClusterSettings.SHARED_BACKEND_ATTR);
+
+                String clusterId = clusterInfo.getPropertyAsString(ClusterSettings.REF_ATTR, null);
+                String coordinatorPolicy = clusterInfo.getPropertyAsString(ClusterSettings.SHARED_BACKEND_ATTR, null);
+                if (coordinatorPolicy != null)
+                    networkSettings.setSharedBackend(Boolean.valueOf(coordinatorPolicy));
+
+                networkSettings.setClusterId(clusterId);
+            }
+        }
+
+        initialized = true;
+    }
+
+    /**
+     *  Returns whether or not the destination has been initialized.
+     *
+     * @return True, if the destination has been initialized.
+     */
+    public boolean isInitialized()
+    {
+        return initialized;
+    }
+
+    /**
+     * Verifies that the <code>Destination</code> is in valid state before
+     * it is started. If subclasses override, they must call <code>super.validate()</code>.
+     */
+    @Override
+    protected void validate()
+    {
+        if (isValid())
+            return;
+
+        super.validate();
+
+        if (getAdapter() == null)
+        {
+            String defaultAdapterId = getService().getDefaultAdapter();
+            if (defaultAdapterId != null)
+            {
+                createAdapter(defaultAdapterId);
+            }
+            else
+            {
+                invalidate();
+                // Destination '{id}' must specify at least one adapter.
+                ConfigurationException ex = new ConfigurationException();
+                ex.setMessage(ConfigurationConstants.DEST_NEEDS_ADAPTER, new Object[]{getId()});
+                throw ex;
+            }
+        }
+
+        if (channelIds != null)
+        {
+            List<String> brokerChannelIds = getService().getMessageBroker().getChannelIds();
+            for (Iterator<String> iter = channelIds.iterator(); iter.hasNext();)
+            {
+                String id = iter.next();
+                if (brokerChannelIds == null || !brokerChannelIds.contains(id))
+                {
+                    iter.remove();
+                    if (Log.isWarn())
+                    {
+                        Log.getLogger(getLogCategory()).warn("No channel with id '{0}' is known by the MessageBroker." +
+                                " Removing the channel.",
+                                new Object[]{id});
+                    }
+                }
+            }
+        }
+
+        // Set the default channels if needed
+        if (channelIds == null)
+        {
+            List<String> defaultChannelIds = getService().getDefaultChannels();
+            if (defaultChannelIds != null && defaultChannelIds.size() > 0)
+            {
+                setChannels(defaultChannelIds);
+            }
+            else
+            {
+                invalidate();
+                // Destination '{id}' must specify at least one channel.
+                ConfigurationException ex = new ConfigurationException();
+                ex.setMessage(ConfigurationConstants.DEST_NEEDS_CHANNEL, new Object[]{getId()});
+                throw ex;
+            }
+        }
+
+        MessageBroker broker = getService().getMessageBroker();
+
+        // Validate the security constraint
+        if (securityConstraint == null && securityConstraintRef != null)
+        {
+            securityConstraint = broker.getSecurityConstraint(securityConstraintRef);
+            // No need to throw an error as MessageBroker automatically throws
+            // an error if no such constraint exists
+        }
+
+        ClusterManager cm = broker.getClusterManager();
+
+        // Set clustering if needed
+        if (getNetworkSettings().getClusterId() != null || cm.getDefaultClusterId() != null)
+        {
+            cm.clusterDestination(this);
+        }
+    }
+
+    /**
+     * Starts the destination if its associated <code>Service</code> is started
+     * and if the destination is not already running. The default implementation
+     * of this method starts the adapter of the destination. If subclasses
+     * override, they must call <code>super.start()</code>.
+     */
+    @Override
+    public void start()
+    {
+        if (isStarted())
+        {
+            // Needed for adapters added after startup.
+            getAdapter().start();
+            return;
+        }
+
+        // Check if the Service is started
+        Service service = getService();
+        if (!service.isStarted())
+        {
+            if (Log.isWarn())
+            {
+                Log.getLogger(getLogCategory()).warn("Destination with id '{0}' cannot be started" +
+                        " when its Service with id '{1}' is not started.",
+                        new Object[]{getId(), service.getId()});
+            }
+            return;
+        }
+
+        // Set up management
+        if (isManaged() && service.isManaged())
+        {
+            setupDestinationControl(service);
+            ServiceControl controller = (ServiceControl)service.getControl();
+            if (getControl() != null)
+                controller.addDestination(getControl().getObjectName());
+        }
+
+        super.start();
+
+        getAdapter().start();
+    }
+
+    /**
+     * The default implementation of this method stops all of the adapters
+     * of the destination.
+     * If subclasses override, they must call <code>super.stop()</code>.
+     *
+     */
+    @Override
+    public void stop()
+    {
+        if (!isStarted())
+            return;
+
+        getAdapter().stop();
+
+        super.stop();
+
+        // Remove management
+        if (isManaged() && getService().isManaged())
+        {
+            if (getControl() != null)
+            {
+                getControl().unregister();
+                setControl(null);
+            }
+            setManaged(false);
+        }
+
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Getters and Setters for Destination properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Returns the <code>ServiceAdapter</code> for the <code>Destination</code>.
+     *
+     * @return The <code>ServiceAdapter</code> for the <code>Destination</code>.
+     */
+    public ServiceAdapter getAdapter()
+    {
+        return adapter;
+    }
+
+    /**
+     * Creates a <code>ServiceAdapter</code> instance, sets its id, sets it manageable
+     * if the <code>Destination</code> that created it is manageable,
+     * and set its <code>Destination</code> to the <code>Destination</code> that
+     * created it.
+     *
+     * In order to use this method, <code>Destination</code> should have an assigned
+     * <code>Service</code> and the id provided for the adapter should already
+     * be registered with the <code>Service</code>.
+     *
+     * @param id The id of the <code>ServiceAdapter</code>.
+     * @return The <code>ServiceAdapter</code> instanced created.
+     */
+    public ServiceAdapter createAdapter(String id)
+    {
+        if (getService() == null)
+        {
+            // Destination cannot create adapter '{0}' without its Service set.
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(NO_SERVICE, new Object[]{id});
+            throw ex;
+        }
+        Map<String, String> adapterClasses = getService().getRegisteredAdapters();
+        if (!adapterClasses.containsKey(id))
+        {
+            // No adapter with id '{0}' is registered with the service '{1}'.
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(ConfigurationConstants.UNREGISTERED_ADAPTER, new Object[]{id, getService().getId()});
+            throw ex;
+        }
+
+        String adapterClassName = adapterClasses.get(id);
+        Class<?> adapterClass = ClassUtil.createClass(adapterClassName,
+                FlexContext.getMessageBroker() == null ?
+                      null : FlexContext.getMessageBroker().getClassLoader());
+
+        ServiceAdapter adapter = (ServiceAdapter)ClassUtil.createDefaultInstance(adapterClass, ServiceAdapter.class);
+        adapter.setId(id);
+        adapter.setManaged(isManaged());
+        adapter.setDestination(this);
+
+        return adapter;
+    }
+
+    /**
+     * Sets the <code>ServiceAdapter</code> of the <code>Destination</code>.
+     *
+     * <code>ServiceAdapter</code> needs to be started if the <code>Destination</code>
+     * is already running.
+     *
+     * @param adapter The adapter for the destination.
+     */
+    public void setAdapter(ServiceAdapter adapter)
+    {
+        if (getAdapter() == adapter) // No need to reset the adapter.
+            return;
+
+        if (adapter == null)
+        {
+            removeAdapter();
+            return;
+        }
+
+        addAdapter(adapter);
+    }
+
+    /**
+     * Used by setAdapter and it removes the old adapter of the destination
+     * and adds the new adapter.
+     *
+     * @param adapter The adapter for the destination.
+     */
+    private void addAdapter(ServiceAdapter adapter)
+    {
+        removeAdapter();
+
+        this.adapter = adapter;
+
+        if (adapter.getDestination() == null || adapter.getDestination() != this)
+            adapter.setDestination(this);
+    }
+
+    /**
+     * Used by setAdapter and addAdapter. It removes the current adapter
+     * of the destination
+     */
+    private void removeAdapter()
+    {
+        ServiceAdapter adapter = getAdapter();
+        if (adapter != null)
+        {
+            adapter.stop();
+        }
+        this.adapter = null;
+    }
+
+
+    /**
+     * The destination may be not clustered at all, may be clustered for channel failover and
+     * destination sharing, or it may be clustered for channel failover and also have a
+     * common backend, such as a common database or backend clustered JMS topic.
+     * If the destination is clustered and has a common backend to coordinate the cluster,
+     * this method returns true; otherwise it return false. Note that this method returns
+     * <code>false</code> if the <code>Destination</code> is not runnning.
+     *
+     * @return <code>true</code> if the clustered <code>Destination</code> shares a common backend;
+     * otherwise <code>false</code>.
+     */
+    public boolean isBackendShared()
+    {
+        if (!isStarted())
+            return false;
+
+        ClusterManager clm = getService().getMessageBroker().getClusterManager();
+        return clm.isBackendShared(getService().getClass().getName(), getId());
+    }
+
+    /**
+     * Returns the list of channel ids of the <code>Destination</code>.
+     *
+     * @return The list of channel ids of the <code>Destination</code>.
+     */
+    public List<String> getChannels()
+    {
+        return channelIds;
+    }
+
+    /**
+     * Adds a channel to the list of channels known by the <code>Destination</code>.
+     * <code>MessageBroker</code> has to know the channel. Otherwise, the channel
+     * is not added to the list.
+     *
+     * @param id The id of the channel.
+     */
+    public void addChannel(String id)
+    {
+        if (channelIds == null)
+            channelIds = new ArrayList<String>();
+        else if (channelIds.contains(id))
+            return;
+
+        if (isStarted())
+        {
+            List<String> brokerChannelIds = getService().getMessageBroker().getChannelIds();
+            if (brokerChannelIds == null || !brokerChannelIds.contains(id))
+            {
+                if (Log.isWarn())
+                {
+                    Log.getLogger(getLogCategory()).warn("No channel with id '{0}' is known by the MessageBroker." +
+                            " Not adding the channel.",
+                            new Object[]{id});
+                }
+                return;
+            }
+        }
+        // Either message broker knows about the channel, or destination is not
+        // running and channel will be checked before startup during validate
+        channelIds.add(id);
+    }
+
+    /**
+     * Removes the channel from the list of channels for the <code>Destination</code>.
+     *
+     * @param id The id of the channel.
+     * @return <code>true</code> if the list contained the channel id.
+     */
+    public boolean removeChannel(String id)
+    {
+        return channelIds != null && channelIds.remove(id);
+    }
+
+    /**
+     * Sets the channel list of the <code>Destination</code>.
+     * <code>MessageBroker</code> has to know the channels, otherwise they
+     * are not added to the list.
+     *
+     * @param ids List of channel ids.
+     */
+    public void setChannels(List<String> ids)
+    {
+        if (ids != null && isStarted())
+        {
+            List<String> brokerChannelIds = getService().getMessageBroker().getChannelIds();
+            for (Iterator<String> iter = ids.iterator(); iter.hasNext();)
+            {
+                String id = iter.next();
+                if (brokerChannelIds == null || !brokerChannelIds.contains(id))
+                {
+                    iter.remove();
+                    if (Log.isWarn())
+                    {
+                        Log.getLogger(getLogCategory()).warn("No channel with id '{0}' is known by the MessageBroker." +
+                                " Not adding the channel.",
+                                new Object[]{id});
+                    }
+                }
+            }
+        }
+        // Otherwise, channels will be checked before startup during validate
+        channelIds = ids;
+    }
+
+    /**
+     * The destination may be not clustered at all, may be clustered for channel failover
+     * only, or it may be clustered for channel failover and also have shared back ends.
+     * If the destination is clustered, regardless of whether or not it relies on a shared
+     * back end for cluster configuration, this method returns true. Note that this method
+     * returns <code>false</code> if the <code>Destination</code> is not runnning.
+     *
+     * @return <code>true</code> if the <code>Destination</code> is clustered; otherwise <code>false</code>.
+     */
+    public boolean isClustered()
+    {
+        if (!isStarted())
+            return false;
+
+        if (!clusteredCalculated)
+        {
+            ClusterManager clm = getService().getMessageBroker().getClusterManager();
+            clustered = clm.isDestinationClustered(getService().getClass().getName(), getId());
+            clusteredCalculated = true;
+        }
+        return clustered;
+    }
+
+    /**
+     * Sets the id of the <code>Destination</code>. If the <code>Destination</code>
+     * has a <code>Service</code> assigned, it also updates the id in the
+     * <code>Service</code>.
+     *
+     * @param id The id of the <code>Destination</code>.
+     */
+    @Override
+    public void setId(String id)
+    {
+        String oldId = getId();
+
+        super.setId(id);
+
+        // Update the destination id in the service and MessageBroker
+        Service service = getService();
+        if (service != null)
+        {
+            service.removeDestination(oldId);
+            service.addDestination(this);
+        }
+    }
+
+    /**
+     * Get the <code>NetworkSettings</code> of the <code>Destination</code>.
+     *
+     * @return The <code>NetworkSettings</code> of the <code>Destination</code>.
+     */
+    public NetworkSettings getNetworkSettings()
+    {
+        return networkSettings;
+    }
+
+    /**
+     * Set the <code>NetworkSettings</code> of the <code>Destination</code>.
+     *
+     * @param networkSettings The <code>NetworkSettings</code> of the <code>Destination</code>.
+     */
+    public void setNetworkSettings(NetworkSettings networkSettings)
+    {
+        this.networkSettings = networkSettings;
+    }
+
+    /**
+     * Returns the <code>Service</code> managing this <code>Destination</code>.
+     *
+     * @return The <code>Service</code> managing this <code>Destination</code>.
+     */
+    public Service getService()
+    {
+        return (Service)getParent();
+    }
+
+    /**
+     * Sets the <code>Service</code> managing this <code>Destination</code>.
+     * Removes the <code>Destination</code> from the old service
+     * (if there was one) and adds to the list of destination in the new service.
+     *
+     * @param service The <code>Service</code> managing this <code>Destination</code>.
+     */
+    public void setService(Service service)
+    {
+        Service oldService = getService();
+
+        setParent(service);
+
+        if (oldService != null)
+            oldService.removeDestination(getId());
+
+        // Add the destination to the service if needed
+        if (service.getDestination(getId()) != this)
+            service.addDestination(this);
+    }
+
+    /**
+     * Returns the Java class name for the <code>Service</code> managing this
+     * <code>Destination</code>. Returns null if there is no <code>Service</code>
+     * assigned to the <code>Destination</code> yet.
+     *
+     * @return The Java class name for the <code>Service</code> manageing this <code>Destination</code>.
+     */
+    public String getServiceType()
+    {
+        Service service = getService();
+        return service != null? service.getClass().getName() : null;
+    }
+
+    /**
+     * Returns the <code>SecurityConstraint</code> of the <code>Destination</code>.
+     * <code>SecurityConstraint</code> is constructed as the <code>Destination</code>
+     * starts up. Therefore, this could return null even if the <code>SecurityConstraint</code>
+     * reference is set but <code>Destination</code> is not started yet.
+     *
+     * @return The <code>SecurityConstraint</code> of the <code>Destination</code>.
+     */
+    public SecurityConstraint getSecurityConstraint()
+    {
+        return securityConstraint;
+    }
+
+    /**
+     * Sets the <code>SecurityConstraint</code> of the <code>Destination</code>.
+     *
+     * @param securityConstraint The <code>SecurityConstraint</code> of the <code>Destination</code>.
+     */
+    public void setSecurityConstraint(SecurityConstraint securityConstraint)
+    {
+        this.securityConstraint = securityConstraint;
+    }
+
+    /**
+     * Sets the <code>SecurityConstraint</code> reference of the <code>Destination</code>.
+     * <code>MessageBroker</code> has to know the <code>SecurityConstraint</code>
+     * reference. Note that <code>getSecurityConstraint</code> can return null
+     * if the reference is set but the <code>Destination</code> is not started yet.
+     *
+     * @param ref <code>SecurityConstraint</code> reference.
+     */
+    public void setSecurityConstraint(String ref)
+    {
+        if (isStarted())
+        {
+            MessageBroker msgBroker = getService().getMessageBroker();
+            securityConstraint = msgBroker.getSecurityConstraint(ref);
+            // No need to throw an error as MessageBroker automatically throws
+            // an error if no such constraint exists
+        }
+        securityConstraintRef = ref;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Other public APIs
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Calls {@link Destination#describeDestination(boolean)} with true boolean value.
+     *
+     * @return A <tt>ConfigMap</tt> of destination properties that the client needs.
+     * @see flex.messaging.Destination#describeDestination(boolean)
+     */
+    public ConfigMap describeDestination()
+    {
+        return describeDestination(true);
+    }
+
+    /**
+     * Returns a <tt>ConfigMap</tt> of destination properties that the client
+     * needs. Subclasses can add additional properties to <tt>super.describeDestination(boolean)</tt>,
+     * or return null if they don't want their properties to be sent to the client.
+     *
+     * @param onlyReliable Determines whether only reliable destination configuration should be returned.
+     * @return A <tt>ConfigMap</tt> of destination properties that the client needs.
+     */
+    public ConfigMap describeDestination(boolean onlyReliable)
+    {
+        boolean reliable = networkSettings != null && networkSettings.isReliable();
+        if (onlyReliable && !reliable)
+            return null;
+
+        ConfigMap destinationConfig = new ConfigMap();
+        destinationConfig.addProperty(ConfigurationConstants.ID_ATTR, getId());
+
+        // Include network settings if reliability for the destination is enabled.
+        if (reliable)
+        {
+            ConfigMap properties = new ConfigMap();
+            ConfigMap network = new ConfigMap();
+
+            ConfigMap reliableMap = new ConfigMap();
+            // Adding as a value rather than attribute to the parent
+            reliableMap.addProperty(ConfigurationConstants.EMPTY_STRING, Boolean.toString(networkSettings.isReliable()));
+
+            network.addProperty(NetworkSettings.RELIABLE_ELEMENT, reliableMap);
+            properties.addProperty(NetworkSettings.NETWORK_ELEMENT, network);
+
+            destinationConfig.addProperty(ConfigurationConstants.PROPERTIES_ELEMENT, properties);
+        }
+
+        ConfigMap channelsConfig = new ConfigMap();
+        for (String id : channelIds)
+        {
+            ConfigMap channelConfig = new ConfigMap();
+            channelConfig.addProperty(ConfigurationConstants.REF_ATTR, id);
+            channelsConfig.addProperty(ConfigurationConstants.CHANNEL_ELEMENT, channelConfig);
+        }
+
+        if (channelsConfig.size() > 0)
+            destinationConfig.addProperty(ConfigurationConstants.CHANNELS_ELEMENT, channelsConfig);
+
+        return destinationConfig;
+    }
+
+    /**
+     * Method for setting an extra property for the destination at runtime.
+     *
+     * @param name The name of the property.
+     * @param value The value of the property.
+     */
+    public void addExtraProperty(String name, Object value)
+    {
+        if (extraProperties == null)
+        {
+            extraProperties = new HashMap<String, Object>();
+        }
+
+        extraProperties.put(name, value);
+    }
+
+    /**
+     * Method for getting an extra property at runtime.
+     *
+     * @param name The name of the property.
+     * @return The value of the property or null if the property does not exist.
+     */
+    public Object getExtraProperty(String name)
+    {
+        return extraProperties != null? extraProperties.get(name) : null;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Protected/private APIs
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Returns the log category of the <code>Destination</code>. Subclasses
+     * can override to provide a more specific log category.
+     *
+     * @return The log category.
+     */
+    @Override
+    protected String getLogCategory()
+    {
+        return LOG_CATEGORY;
+    }
+
+    /**
+     * Invoked automatically to allow the <code>Destination</code> to setup its corresponding
+     * MBean control. Subclasses should override to setup and register their MBean control.
+     *
+     * @param service The <code>Service</code> that manages this <code>Destination</code>.
+     */
+    protected void setupDestinationControl(Service service)
+    {
+        // Manageable subclasses should override this template method.
+        setManaged(false);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/DestructibleFlexFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/DestructibleFlexFactory.java b/modules/core/src/flex/messaging/DestructibleFlexFactory.java
new file mode 100755
index 0000000..2fec7ea
--- /dev/null
+++ b/modules/core/src/flex/messaging/DestructibleFlexFactory.java
@@ -0,0 +1,34 @@
+/*
+ * 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.messaging;
+
+/**
+ * Implementors of <code>FlexFactory</code> should also implement this interface
+ * if their factory has custom destruction behavior.
+ */
+public interface DestructibleFlexFactory 
+{    
+    /**
+     * This method is called when a component that uses this factory is removed.
+     * This method gives the factory a chance to clean up resources that may have
+     * been allocated for the component and may now be ready for destruction.
+     * 
+     * @param instanceInfo The FactoryInstance to be destroyed
+     *
+     */
+    void destroyFactoryInstance(FactoryInstance instanceInfo);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FactoryDestination.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FactoryDestination.java b/modules/core/src/flex/messaging/FactoryDestination.java
new file mode 100755
index 0000000..74e18be
--- /dev/null
+++ b/modules/core/src/flex/messaging/FactoryDestination.java
@@ -0,0 +1,361 @@
+/*
+ * 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.messaging;
+
+import flex.messaging.config.ConfigMap;
+import flex.messaging.config.ConfigurationException;
+import flex.messaging.log.Log;
+
+public abstract class FactoryDestination extends Destination
+{   
+    private static final String FACTORY = "factory";       
+    private static final String DEFAULT_FACTORY = "java";
+    
+    // Errors
+    private static int INVALID_FACTORY = 11103;
+    private static int FACTORY_CANNOT_BE_RETURNED = 11118;
+    
+    // FactoryDestination's properties 
+    private FlexFactory factory;
+    private String source;
+    private String scope = FlexFactory.SCOPE_REQUEST;
+    
+    // FactoryDestination internal
+    private String factoryId = DEFAULT_FACTORY;
+    private FactoryInstance factoryInstance; 
+    private ConfigMap factoryProperties;
+    
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     * Constructs an unmanaged <code>FactoryDestination</code> instance.
+     */
+    public FactoryDestination()
+    {
+        this(false);
+    }
+    
+    /**
+     * Constructs a <code>FactoryDestination</code> with the indicated management.
+     * 
+     * @param enableManagement <code>true</code> if the <code>FactoryDestination</code>
+     * is manageable; otherwise <code>false</code>.
+     */
+    public FactoryDestination(boolean enableManagement)
+    {
+        super(enableManagement);
+    }
+    
+    //--------------------------------------------------------------------------
+    //
+    // Initialize, validate, start, and stop methods. 
+    //
+    //--------------------------------------------------------------------------
+    
+    /**
+     * Initializes the <code>FactoryDestination</code> with the properties. 
+     * @param id the factory id
+     * @param properties Properties for the <code>FactoryDestination</code>.
+     */
+    public void initialize(String id, ConfigMap properties)
+    {  
+        super.initialize(id, properties);
+        
+        if (properties == null || properties.size() == 0)
+            return;
+
+        // Need to cache this for later. TODO: We shouldn't need to do this.
+        factoryProperties = properties;
+
+        factoryId = properties.getPropertyAsString(FACTORY, factoryId);        
+        scope = properties.getPropertyAsString(FlexFactory.SCOPE, scope);
+        source = properties.getPropertyAsString(FlexFactory.SOURCE, source);
+
+        if (source == null)
+            source = getId();
+        
+        if (factory != null)
+            factory.initialize(getId(), factoryProperties);
+    }
+
+    /**
+     * Verifies that the <code>FactoryDestination</code> is in valid state before
+     * it is started.
+     */
+    protected void validate()
+    {               
+        if (isValid())
+            return; 
+       
+        super.validate();
+
+        if (factory == null)
+        {
+            if (factoryId == null)
+            {
+                factoryId = DEFAULT_FACTORY;
+            }
+            MessageBroker broker = getService().getMessageBroker();
+            FlexFactory f = broker.getFactory(factoryId);
+            if (f == null)
+            {
+                ConfigurationException ex = new ConfigurationException();
+                ex.setMessage(INVALID_FACTORY, new Object[] {getId(), factoryId});
+                throw ex;
+            }
+            factory = f;
+        }
+        
+        if (scope == null)
+            scope = FlexFactory.SCOPE_REQUEST;
+        
+        if (source == null)        
+            source = getId();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Getters and Setters for Destination properties
+    //         
+    //--------------------------------------------------------------------------    
+    
+    /**
+     * Returns the factory of the <code>FactoryDestination</code>. Before a valid
+     * <code>FlexFactory</code> can be returned, <code>MessageBroker</code> and
+     * hence <code>Service</code> of the <code>Destination</code> has to be set.
+     * @return FlexFactory the FlexFactory object
+     */
+    public FlexFactory getFactory()
+    {
+        if (factory == null)
+        {
+            if (factoryId == null)
+            {
+                factoryId = DEFAULT_FACTORY;
+            }
+            if (getService() == null)
+            {
+                // Factory cannot be returned without ''{0}'' set.
+                ConfigurationException ex = new ConfigurationException();
+                ex.setMessage(FACTORY_CANNOT_BE_RETURNED, new Object[] {"Service"});
+                throw ex;
+            }
+            if (getService().getMessageBroker() == null)
+            {
+                // Factory cannot be returned without ''{0}'' set.
+                ConfigurationException ex = new ConfigurationException();
+                ex.setMessage(FACTORY_CANNOT_BE_RETURNED, new Object[] {"MessageBroker"});
+                throw ex;
+            }
+            MessageBroker broker = getService().getMessageBroker();
+            FlexFactory f = broker.getFactory(factoryId);
+            if (f == null)
+            {
+                ConfigurationException ex = new ConfigurationException();
+                ex.setMessage(INVALID_FACTORY, new Object[] {getId(), factoryId});
+                throw ex;
+            }
+            factory = f;
+        }
+        return factory;
+    }
+
+    /**
+     * Sets the factory of the <code>FactoryDestination</code>. 
+     * <code>MessageBroker</code> has to know the factory before it can be
+     * assigned to the destination. 
+     * 
+     * @param id The id of the factory.
+     */    
+    public void setFactory(String id)
+    {        
+        if (isStarted())
+        {
+            MessageBroker broker = getService().getMessageBroker();
+            FlexFactory factory = broker.getFactory(id);
+            if (factory == null)
+            {
+                ConfigurationException ex = new ConfigurationException();
+                ex.setMessage(INVALID_FACTORY, new Object[] {getId(), factory});
+                throw ex;
+            }
+            setFactory(factory);
+        }
+        factoryId = id;
+    }
+    
+    /**
+     * Sets the factory of the <code>FactoryDestination</code>. 
+     * 
+     * @param factory the FlexFactory object
+     */
+    public void setFactory(FlexFactory factory)
+    {
+        this.factory = factory;
+    }
+    
+    /**
+     * Returns the <code>FactoryInstance</code>. <code>FactoryInstance</code> 
+     * stores configuration state used for retrieving an instance from
+     * the factory. This needs to be called after calling <code>setSource</code>
+     * and <code>setScope</code> methods.
+     * @return FactoryInstance current FactoryInstance object 
+     */
+    public FactoryInstance getFactoryInstance()
+    {
+        // This is needed for HibernateAssembler
+        return getFactoryInstance(factoryProperties);
+    }
+    
+    /**
+     * Returns a <code>FactoryInstance</code> using the properties passed in.
+     * 
+     * @param properties Properties to be used while creating the <code>FactoryInstance</code>. 
+     */
+    private FactoryInstance getFactoryInstance(ConfigMap properties)
+    {
+        // Automatically create a factory instance if not already set  
+        if (factoryInstance == null)
+            factoryInstance = createFactoryInstance(properties);
+
+        return factoryInstance;
+    }
+
+    /**
+     * Creates a factory instance using the properties passed in.
+     * 
+     * @param properties Properties to be used while creating the <code>FactoryInstance</code>. 
+     */
+    private FactoryInstance createFactoryInstance(ConfigMap properties)
+    {   
+        if (properties == null)
+            properties = new ConfigMap();
+        
+        properties.put(FlexFactory.SOURCE, source);
+        properties.put(FlexFactory.SCOPE, scope);
+        FactoryInstance factoryInstance = getFactory().createFactoryInstance(getId(), properties);
+        return factoryInstance;
+    }
+    
+    /**
+     * Returns the scope of the <code>FactoryDestination</code>.
+     * 
+     * @return scope of the <code>FactoryDestination</code>.
+     */
+    public String getScope()
+    {
+        return scope;
+    }
+
+    /**
+     * Sets the scope of the <code>FactoryDestination</code> that is used
+     * in <code>FactoryInstance</code> creation. Scope cannot be changed to and
+     * from application scope once <code>FactoryInstance</code> is initialized.
+     * 
+     * @param scope the scope
+     */
+    public void setScope(String scope)
+    {        
+        if (factoryInstance != null)
+        {
+            if (FlexFactory.SCOPE_APPLICATION.equals(this.scope) 
+                    && !FlexFactory.SCOPE_APPLICATION.equals(scope))
+            {
+                if (Log.isWarn())
+                    Log.getLogger(getLogCategory()).warn(
+                            "Current scope is "+FlexFactory.SCOPE_APPLICATION
+                            +" and it cannot be changed to "+scope
+                            +" once factory instance is initialized.");
+                return;
+            }
+            else if (!FlexFactory.SCOPE_APPLICATION.equals(this.scope) 
+                        && FlexFactory.SCOPE_APPLICATION.equals(scope))
+            {
+                if (Log.isWarn())
+                    Log.getLogger(getLogCategory()).warn(
+                            "Current scope is "+this.scope
+                            +" and it cannot be changed to "+FlexFactory.SCOPE_APPLICATION
+                            +" once factory instance is initialized.");
+                return;
+            }
+            factoryInstance.setScope(scope);
+        }
+        this.scope = scope;
+    }
+    
+    /**
+     * Gets the source of the <code>FactoryDestination</code>. 
+     * 
+     * @return the source of the <code>FactoryDestination</code>. 
+     */
+    public String getSource()
+    {
+        return source;
+    }
+
+    /**
+     * Sets the source of the <code>FactoryDestination</code> that is used
+     * in <code>FactoryInstance</code> creation. Source cannot be changed once  
+     * <code>FactoryInstance</code> is initialized and the scope is application.
+     * 
+     * @param source the source string
+     */
+    public void setSource(String source)
+    {   
+        if (factoryInstance != null)     
+        {
+            if (FlexFactory.SCOPE_APPLICATION.equals(scope))
+            {
+                if (Log.isWarn())
+                    Log.getLogger(getLogCategory()).warn(
+                            "Source of the destination cannot be changed once "
+                            + "factory instance is already initialized and it has "
+                            + FlexFactory.SCOPE_APPLICATION +" scope");
+                return;
+            }            
+            factoryInstance.setSource(source);
+        }
+        this.source = source;
+    }   
+    
+    /**
+     * This method first calls stop on its superclass <code>Destination</code> and then
+     * removes any assemblers from the ServletContext or Session that are ready for removal.
+     * If an assembler is only used by a single destination (attribute-id==destination-id) then
+     * it is removed.  If an assembler is shared across destinations, (attribute-id&lt;&gt;destination-id)
+     * then it is only removed if its reference count (maintained in <code>MessageBroker</code>) is
+     * down to zero
+     */
+    public void stop()
+    {
+        if (isStarted())
+        {
+            super.stop();
+            // destroy factory instance to free up resources
+            if (factory != null && (factory instanceof DestructibleFlexFactory))
+                ((DestructibleFlexFactory)factory).destroyFactoryInstance(factoryInstance);    
+        }
+        else
+        {
+            super.stop();
+        }
+    }    
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FactoryInstance.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FactoryInstance.java b/modules/core/src/flex/messaging/FactoryInstance.java
new file mode 100755
index 0000000..8b01292
--- /dev/null
+++ b/modules/core/src/flex/messaging/FactoryInstance.java
@@ -0,0 +1,179 @@
+/*
+ * 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.messaging;
+
+import flex.messaging.config.ConfigMap;
+import flex.messaging.config.ConfigurationException;
+
+/**
+ * This class is used by the FlexFactory to store the configuration
+ * for an instance created by the factory.  There is one of these for
+ * each destination currently since only destinations create these components.
+ *
+ * @see flex.messaging.FlexFactory
+ */
+public class FactoryInstance 
+{
+    private static final int INVALID_SCOPE = 10653;
+
+    private FlexFactory factory;
+    private String id;
+    private String scope = FlexFactory.SCOPE_REQUEST;
+    private String source;
+    private ConfigMap properties;
+
+    /**
+     * Normally FactoryInstances are constructed by Data Services during startup so you
+     * do not need to use this method.  It is typically called from the 
+     * FlexFactory.createFactoryInstance method as Data Services is parsing
+     * the destination configuration information for a given destination.  
+     * You can override this method to extract additional configuration for 
+     * your component from the properties argument.
+     *
+     * @param factory the FlexFactory this FactoryInstance is created from
+     * @param id the Destination's id
+     * @param properties the configuration properties for this destination.  
+     *
+     * @see flex.messaging.config.ConfigMap
+     */
+    public FactoryInstance(FlexFactory factory, String id, ConfigMap properties)
+    {
+        this.factory = factory;
+        this.id = id;
+        this.properties = properties;
+    }
+
+    /**
+     * Get the factory instance ID.
+     * @return The destination's id that this FactoryInstance is associated with.
+     */
+    public String getId()
+    {
+        return id;
+    }
+
+    /**
+     * Since many factories may provide components in different
+     * scopes, this is abstracted in the base factory instance class.
+     * @param scope the scope
+     */
+    public void setScope(String scope)
+    {
+        this.scope = scope;
+
+        if (!FlexFactory.SCOPE_SESSION.equals(scope)
+                && !FlexFactory.SCOPE_APPLICATION.equals(scope)
+                && !FlexFactory.SCOPE_REQUEST.equals(scope))
+        {
+            // Invalid scope setting for RemotingService destination '{id}'.
+            // Valid options are 'request', 'session', or 'application'.
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(INVALID_SCOPE, new Object[] {id, "\'request\', \'session\', or \'application\'"});
+            throw ex;
+        }
+
+    }
+    
+    /**
+     * Get the scope.
+     * @return String the scope
+     */
+    public String getScope()
+    {
+        return scope;
+    }
+
+    /**
+     * This is by convention the main property for the defining the 
+     * instance we create with this factory.  It may be the class name
+     * for the JavaFactory or the id for a factory that uses ids.
+     */
+    public void setSource(String source)
+    {
+        this.source = source;
+    }
+    
+    /**
+     * Get the source.
+     * @return String the source string
+     */
+    public String getSource()
+    {
+        return source;
+    }
+
+    /**
+     * If possible, returns the class for the underlying configuration.  
+     * This method can return null if the class is not known until the lookup
+     * method is called.  The goal is so the factories which know the class
+     * at startup time can provide earlier error detection.  If the class is not
+     * known, this method can return null and validation will wait until the
+     * first lookup call.
+     *
+     * @return the class for this configured instance or null if the class
+     * is not known until lookup time.
+     */
+    public Class getInstanceClass()
+    {
+        return null;
+    }
+
+    /**
+     * Returns the ConfigMap that this factory instance was created with.  You can
+     * use this ConfigMap to retrieve additional properties which this factory
+     * instance is configured with.  For example, if you are defining a remote object
+     * destination, your FactoryInstance can be configured with additional XML tags
+     * underneath the properties tag for your destination.  It is important that
+     * if you expect additional properties that you access in the ConfigMap or call 
+     * allowProperty on that property when the FactoryInstance is created.  Otherwise,
+     * these properties can generate warnings about "unexpected" configuration.
+     * @return ConfigMap the ConfigMap that this factory was created with
+     * @see flex.messaging.config.ConfigMap
+     */
+    public ConfigMap getProperties()
+    {
+        return properties;
+    }
+
+    /**
+     * Return an instance as appropriate for this instance of the given
+     * factory.  This just calls the lookup method on the factory that this
+     * instance was created on.  You override this method to return the
+     * specific component for this destination.
+     * @return Object the object lookup
+     */
+    public Object lookup()
+    {
+        return factory.lookup(this);
+    }
+
+    /**
+     * When the caller is done with the instance, this method is called.  For
+     * session scoped components, this gives you the opportunity to update
+     * any state modified in the instance in a remote persistence store.
+     * This method is not called when the object should be destroyed.
+     * To get a destroy notification, you should register for the appropriate
+     * events via the FlexContext.
+     *
+     * @param instance the instance returned via the lookup method for this
+     * destination for this operation.
+     */
+    public void operationComplete(Object instance)
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FlexComponent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FlexComponent.java b/modules/core/src/flex/messaging/FlexComponent.java
new file mode 100755
index 0000000..f37856c
--- /dev/null
+++ b/modules/core/src/flex/messaging/FlexComponent.java
@@ -0,0 +1,48 @@
+/*
+ * 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.messaging;
+
+/**
+ * Defines the lifecycle interface for FlexComponents, allowing
+ * the server to manage the running state of server components
+ * through a consistent interface.
+ */
+public interface FlexComponent extends FlexConfigurable
+{
+    /**
+     * Invoked to start the component.
+     * The {@link FlexConfigurable#initialize(String, flex.messaging.config.ConfigMap)} method inherited 
+     * from the {@link FlexConfigurable} interface must be invoked before this method is invoked.
+     * Once this method returns, {@link #isStarted()} must return true.
+     */
+    void start();
+
+    /**
+     * Invoked to stop the component.
+     * Once this method returns, {@link #isStarted()} must return false.
+     */
+    void stop();
+
+    /**
+     * Indicates whether the component is started and running.
+     * 
+     * @return <code>true</code> if the component has started; 
+     *         otherwise <code>false</code>.
+     */
+    boolean isStarted();   
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FlexConfigurable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FlexConfigurable.java b/modules/core/src/flex/messaging/FlexConfigurable.java
new file mode 100755
index 0000000..881b068
--- /dev/null
+++ b/modules/core/src/flex/messaging/FlexConfigurable.java
@@ -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 flex.messaging;
+
+import flex.messaging.config.ConfigMap;
+
+/**
+ * Components created in the Flex configuration environment can implement
+ * the FlexConfigurable interface to get access to the configuration
+ * properties like a regular component in the system.
+ */
+public interface FlexConfigurable
+{
+    /**
+     * Initializes the component with configuration information.
+     *
+     * @param id The id of the component.
+     * @param configMap The properties for configuring component.
+     */
+    void initialize(String id, ConfigMap configMap);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FlexContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FlexContext.java b/modules/core/src/flex/messaging/FlexContext.java
new file mode 100755
index 0000000..d7645b5
--- /dev/null
+++ b/modules/core/src/flex/messaging/FlexContext.java
@@ -0,0 +1,473 @@
+/*
+ * 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.messaging;
+
+import flex.messaging.client.FlexClient;
+import flex.messaging.endpoints.Endpoint;
+import flex.messaging.io.TypeMarshallingContext;
+import flex.messaging.security.LoginManager;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.security.Principal;
+
+/**
+ * The <tt>FlexContext</tt> is a utility class that exposes the current execution context.
+ * It provides access to <tt>FlexSession</tt> and <tt>FlexClient</tt> instances associated
+ * with the current message being processed, as well as global context via the <tt>MessageBroker</tt>,
+ * <tt>ServletContext</tt> and <tt>ServletConfig</tt> for the application.
+ * Any, or all, of the properties exposed by this class may be <code>null</code> depending upon
+ * the current execution context so test for that before attempting to interact with them.
+ */
+public class FlexContext
+{
+    private static ThreadLocal<FlexClient> flexClients = new ThreadLocal<FlexClient>();
+    private static ThreadLocal<FlexSession> sessions = new ThreadLocal<FlexSession>();
+    private static ThreadLocal<MessageBroker> messageBrokers = new ThreadLocal<MessageBroker>();
+    private static ThreadLocal<Endpoint> endpoints = new ThreadLocal<Endpoint>();
+    private static ThreadLocal<HttpServletResponse> responses = new ThreadLocal<HttpServletResponse>();
+    private static ThreadLocal<HttpServletRequest> requests = new ThreadLocal<HttpServletRequest>();
+    private static ThreadLocal<HttpServletRequest> tunnelRequests = new ThreadLocal<HttpServletRequest>();
+    private static ThreadLocal<ServletConfig> servletConfigs = new ThreadLocal<ServletConfig>();
+    private static ThreadLocal<Boolean> messageFromPeer = new ThreadLocal<Boolean>();
+    private static ThreadLocal<MessageRoutedNotifier> messageRoutedNotifiers = new ThreadLocal<MessageRoutedNotifier>();
+    private static ServletConfig lastGoodServletConfig;
+
+    private FlexContext()
+    {
+    }
+
+    /**
+     * Users should not call this.
+     * @exclude
+     */
+    public static void setThreadLocalObjects(FlexClient flexClient,
+                                             FlexSession session,
+                                             MessageBroker broker,
+                                             HttpServletRequest request,
+                                             HttpServletResponse response,
+                                             ServletConfig servletConfig)
+    {
+        if (flexClients == null) // In case releaseThreadLocalObjects has been called.
+            return;
+
+        flexClients.set(flexClient);
+        sessions.set(session);
+        messageBrokers.set(broker);
+        requests.set(request);
+        responses.set(response);
+        setThreadLocalServletConfig(servletConfig);
+        messageFromPeer.set(Boolean.FALSE);
+    }
+
+    /**
+     * Users should not call this.
+     * @exclude
+     */
+    public static void setThreadLocalObjects(FlexClient flexClient, FlexSession session, MessageBroker broker)
+    {
+        setThreadLocalObjects(flexClient, session, broker, null, null, null);
+    }
+
+    /**
+     * Users should not call this.
+     * @exclude
+     */
+    public static void clearThreadLocalObjects()
+    {
+        if (flexClients == null) // In case releaseThreadLocalObjects has been called.
+            return;
+
+        flexClients.remove();
+        sessions.remove();
+        messageBrokers.remove();
+        endpoints.remove();
+        requests.remove();
+        responses.remove();
+        tunnelRequests.remove();
+        servletConfigs.remove();
+        messageFromPeer.remove();
+        messageRoutedNotifiers.remove();
+
+        TypeMarshallingContext.clearThreadLocalObjects();
+    }
+
+    /**
+     * The HttpServletResponse for the current request if the request is via HTTP.
+     * Returns null if the client is using a non-HTTP channel.
+     * Available for users.
+     * @return HttpServletRequest current HttpServletRequest object
+     */
+    public static HttpServletRequest getHttpRequest()
+    {
+        return requests != null? requests.get() : null;
+    }
+
+    /**
+     * Users should not call this.
+     * @exclude
+     */
+    public static void setThreadLocalHttpRequest(HttpServletRequest value)
+    {
+        if (requests == null)
+            return;
+
+        if (value == null)
+            requests.remove();
+        else
+            requests.set(value);
+    }
+
+    /**
+     * The HttpServletResponse for the current request if the request is via HTTP.
+     * Returns null if the using an non-HTTP channel.
+     * Available for users.
+     * @return HttpServletResponse current HttpServletResponse object
+     */
+    public static HttpServletResponse getHttpResponse()
+    {
+        return responses != null? responses.get() : null;
+    }
+
+    /**
+     * Users should not call this.
+     * @exclude
+     */
+    public static void setThreadLocalHttpResponse(HttpServletResponse value)
+    {
+        if (responses == null)
+            return;
+
+        if (value == null)
+            responses.remove();
+        else
+            responses.set(value);
+    }
+
+    /**
+     * The HttpServletRequest for the current request if it is transporting a tunneled protocol.
+     * Returns null if the current request protocol it not tunneled.
+     * Available for users.
+     * @return HttpServletRequest tunnel HttpServletRequest object
+     */
+    public static HttpServletRequest getTunnelHttpRequest()
+    {
+        return tunnelRequests != null? tunnelRequests.get() : null;
+    }
+
+    /**
+     * Users should not call this.
+     * @exclude
+     */
+    public static void setThreadLocalTunnelHttpRequest(HttpServletRequest value)
+    {
+        if (tunnelRequests == null)
+            return;
+
+        if (value == null)
+            tunnelRequests.remove();
+        else
+            tunnelRequests.set(value);
+    }
+
+    /**
+     * The ServletConfig for the current request, uses the last known ServletConfig
+     * when the request is not via HTTP.  Available for users.
+     * @return ServletConfig current ServletConfig object
+     */
+    public static ServletConfig getServletConfig()
+    {
+        if (servletConfigs != null && servletConfigs.get() != null)
+        {
+            return servletConfigs.get();
+        }
+        return lastGoodServletConfig;
+    }
+
+    /**
+     * Users should not call this.
+     * @exclude
+     */
+    public static void setThreadLocalServletConfig(ServletConfig value)
+    {
+        if (servletConfigs == null)
+            return;
+
+        if (value == null)
+        {
+            servletConfigs.remove();
+        }
+        else
+        {
+            servletConfigs.set(value);
+            lastGoodServletConfig = value;
+        }
+    }
+
+    /**
+     * The ServletContext for the current web application.
+     * @return ServletContext current ServletContext object
+     */
+    public static ServletContext getServletContext()
+    {
+        return getServletConfig() != null? getServletConfig().getServletContext() : null;
+    }
+
+    /**
+     * The FlexClient for the current request. Available for users.
+     * @return FlexClient the current FlexClient object
+     */
+    public static FlexClient getFlexClient()
+    {
+        return flexClients != null? flexClients.get() : null;
+    }
+
+    /**
+     * Users should not call this.
+     * @exclude
+     */
+    public static void setThreadLocalFlexClient(FlexClient flexClient)
+    {
+        if (flexClients == null)
+            return;
+
+        if (flexClient == null)
+            flexClients.remove();
+        else
+            flexClients.set(flexClient);
+    }
+
+    /**
+     * The FlexSession for the current request.  Available for users.
+     * @return FlexSession the current FlexSession object
+     */
+    public static FlexSession getFlexSession()
+    {
+        return sessions != null? sessions.get() : null;
+    }
+
+    /**
+     * Users should not call this.
+     * @exclude
+     */
+    public static void setThreadLocalSession(FlexSession session)
+    {
+        if (sessions == null)
+            return;
+
+        if (session == null)
+            sessions.remove();
+        else
+            sessions.set(session);
+    }
+
+    /**
+     * The MessageBroker for the current request.  Not available for users.
+     *
+     * @exclude
+     */
+    public static MessageBroker getMessageBroker()
+    {
+        return messageBrokers != null? messageBrokers.get() : null;
+    }
+
+    /**
+     * Users should not call this.
+     * @exclude
+     */
+    public static void setThreadLocalMessageBroker(MessageBroker value)
+    {
+        // This is a special case because MessageBroker is sometimes accessed by
+        // services, destinations, adapters during shutdown so it needs to be set
+        // on the context even if a previous MessageBrokerServlet#destroy called
+        // releaseThreadLocalObjects.
+        if (messageBrokers == null)
+            messageBrokers = new ThreadLocal<MessageBroker>();
+
+        if (value == null)
+            messageBrokers.remove();
+        else
+            messageBrokers.set(value);
+    }
+
+    /**
+     * The Endpoint for the current message. Not available for users.
+     * @exclude
+     */
+    public static Endpoint getEndpoint()
+    {
+        return endpoints != null? endpoints.get() : null;
+    }
+
+    /**
+     * Users should not call this.
+     * @exclude
+     */
+    public static void setThreadLocalEndpoint(Endpoint value)
+    {
+        if (endpoints == null)
+            return;
+
+        if (value == null)
+            endpoints.remove();
+        else
+            endpoints.set(value);
+    }
+
+    /**
+     * Users should not call this.
+     * @exclude
+     */
+    public static MessageRoutedNotifier getMessageRoutedNotifier()
+    {
+        return messageRoutedNotifiers != null? messageRoutedNotifiers.get() : null;
+    }
+
+    /**
+     * Users should not call this.
+     * @exclude
+     */
+    public static void setMessageRoutedNotifier(MessageRoutedNotifier value)
+    {
+        if (messageRoutedNotifiers == null)
+            return;
+
+        if (value == null)
+            messageRoutedNotifiers.remove();
+        else
+            messageRoutedNotifiers.set(value);
+    }
+
+    /**
+     * Indicates whether the current message being processed came from a server peer
+     * in a cluster.
+     *
+     * @return true if message from a peer
+     */
+    public static boolean isMessageFromPeer()
+    {
+        return messageFromPeer != null? messageFromPeer.get() : false;
+    }
+
+    /**
+     * Sets a thread local indicating whether the message being processed came from
+     * a server peer in a cluster.
+     *
+     * @param value True if the message came from a peer; otherwise false.
+     *
+     * @exclude
+     */
+    public static void setMessageFromPeer(boolean value)
+    {
+        if (messageFromPeer == null)
+            return;
+
+        messageFromPeer.set(value);
+    }
+
+    /**
+     * Users should not call this.
+     * @exclude
+     */
+    public static boolean isPerClientAuthentication()
+    {
+        MessageBroker messageBroker = getMessageBroker();
+        if (messageBroker == null)
+            return false;
+
+        LoginManager loginManager = messageBroker.getLoginManager();
+        return loginManager == null? false : loginManager.isPerClientAuthentication();
+    }
+
+    /**
+     * Returns the principal associated with the session or client depending on whether
+     * perClientauthentication is being used.  If the client has not
+     * authenticated the principal will be null.
+     *
+     * @return The principal associated with the session.
+     */
+    public static Principal getUserPrincipal()
+    {
+        if (isPerClientAuthentication())
+        {
+            FlexClient client = getFlexClient();
+            return client != null? client.getUserPrincipal() : null;
+        }
+
+        FlexSession session = getFlexSession();
+        return session != null? session.getUserPrincipal() : null;
+    }
+
+    /**
+     * Sets the Principal on either the current FlexClient or FlexSession depending upon whether
+     * perClientAuthentication is in use.
+     *
+     * @param userPrincipal The principal to associate with the FlexClient or FlexSession
+     * depending upon whether perClientAuthentication is in use.
+     */
+    public static void setUserPrincipal(Principal userPrincipal)
+    {
+        if (isPerClientAuthentication())
+            getFlexClient().setUserPrincipal(userPrincipal);
+        else
+            getFlexSession().setUserPrincipal(userPrincipal);
+    }
+
+    /**
+     * @exclude
+     * Create the static thread local storage.
+     */
+    public static void createThreadLocalObjects()
+    {
+        if (flexClients == null) // Allocate if needed.
+        {
+            flexClients = new ThreadLocal<FlexClient>();
+            sessions = new ThreadLocal<FlexSession>();
+            messageBrokers = new ThreadLocal<MessageBroker>();
+            endpoints = new ThreadLocal<Endpoint>();
+            responses = new ThreadLocal<HttpServletResponse>();
+            requests = new ThreadLocal<HttpServletRequest>();
+            tunnelRequests = new ThreadLocal<HttpServletRequest>();
+            servletConfigs = new ThreadLocal<ServletConfig>();
+            messageFromPeer = new ThreadLocal<Boolean>();
+            messageRoutedNotifiers = new ThreadLocal<MessageRoutedNotifier>();
+        }
+    }
+
+    /**
+     * @exclude
+     * Destroy the static thread local storage.
+     * Call ONLY on shutdown
+     */
+    public static void releaseThreadLocalObjects()
+    {
+        clearThreadLocalObjects();
+        
+        flexClients = null;
+        sessions = null;
+        messageBrokers = null;
+        endpoints = null;
+        responses = null;
+        requests = null;
+        tunnelRequests = null;
+        servletConfigs = null;
+        messageFromPeer = null;
+        messageRoutedNotifiers = null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FlexFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FlexFactory.java b/modules/core/src/flex/messaging/FlexFactory.java
new file mode 100755
index 0000000..3a762c5
--- /dev/null
+++ b/modules/core/src/flex/messaging/FlexFactory.java
@@ -0,0 +1,87 @@
+/*
+ * 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.messaging;
+
+import flex.messaging.config.ConfigMap;
+
+/**
+ * The FlexFactory interface is implemented by factory components that provide
+ * instances to the Flex messaging framework.  You can implement this interface
+ * if you want to tie together Flex Data Services with another system which maintains
+ * component instances (often called the "services layer" in a typical enterprise
+ * architecture).  By implementing FlexFactory, you can configure a Flex
+ * RemoteObject destination or a Flex Data Management Services assembler which
+ * uses a Java object instance in your services layer rather than having Data Services
+ * create a new component instance.  In some cases, this means you avoid writing
+ * glue code for each service you want to expose to flex clients.
+ */
+public interface FlexFactory extends FlexConfigurable
+{
+    /** Request scope string. */
+    String SCOPE_REQUEST = "request";
+    /** Session scope string. */
+    String SCOPE_SESSION = "session";
+    /** Application scope string .*/
+    String SCOPE_APPLICATION = "application";
+    /** Scope string. */
+    String SCOPE = "scope";
+    /** Source string. */
+    String SOURCE = "source";
+
+    /**
+     * Called when the
+     * definition of an instance that this factory looks up is initialized.
+     * It should validate that
+     * the properties supplied are valid to define an instance
+     * and returns an instance of the type FactoryInstance
+     * that contains all configuration necessary to construct
+     * an instance of this object.  If the instance is application
+     * scoped, the FactoryInstance may contain a reference to the
+     * instance directly.
+     * <p>
+     * Any valid properties used for this configuration
+     * must be accessed to avoid warnings about unused configuration
+     * elements.  If your factory is only used for application
+     * scoped components, you do not need to implement
+     * this method as the lookup method itself can be used
+     * to validate its configuration.
+     * </p><p>
+     * The id property is used as a name to help you identify
+     * this factory instance for any errors it might generate.
+     * </p>
+     *
+     */
+    FactoryInstance createFactoryInstance(String id, ConfigMap properties);
+
+    /**
+     * This method is called by the default implementation of FactoryInstance.lookup.
+     * When Data Services wants an instance of a given factory destination, it calls the
+     * FactoryInstance.lookup to retrieve that instance.  That method in turn
+     * calls this method by default.
+     *
+     * For simple FlexFactory implementations which do not need to
+     * add additional configuration properties or logic to the FactoryInstance class,
+     * by implementing this method you can avoid having to add an additional subclass of
+     * FactoryInstance for your factory.  If you do extend FactoryInstance, it is
+     * recommended that you just override FactoryInstance.lookup and put your logic
+     * there to avoid the extra level of indirection.
+     *
+     * @param instanceInfo The FactoryInstance for this destination
+     * @return the Object instance to use for the given operation for this destination.
+     */
+    Object lookup(FactoryInstance instanceInfo);
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/core/src/flex/messaging/FlexRemoteCredentials.java
----------------------------------------------------------------------
diff --git a/modules/core/src/flex/messaging/FlexRemoteCredentials.java b/modules/core/src/flex/messaging/FlexRemoteCredentials.java
new file mode 100755
index 0000000..bd0f695
--- /dev/null
+++ b/modules/core/src/flex/messaging/FlexRemoteCredentials.java
@@ -0,0 +1,93 @@
+/*
+ * 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.messaging;
+
+/**
+ * A wrapper object used for holding onto remote credentials.  When you are using
+ * the proxy service, the remote credentials are used for authenticating against
+ * the proxy server.  The remote credentials are distinct from the local credentials
+ * used to authenticate against the local server.  You use this class along with
+ * the FlexSession methods getRemoteCredentials and putRemoteCredentials to associate
+ * the remote credentials with a specific destination.
+ */
+public class FlexRemoteCredentials
+{
+    private String service;
+
+    private String destination;
+
+    private String username;
+
+    private Object credentials;
+
+    /**
+     * Normally you do not have to create the FlexRemoteCredentials as they are
+     * created automatically when the client specifies them via the setRemoteCredentials
+     * method in ActionScript.  You'd use this if you wanted to set your remote credentials
+     * on the server and not have them specified on the client.
+     * @param service the service id
+     * @param destination the destination id
+     * @param username the user name
+     * @param credentials the user credentials
+     */
+    public FlexRemoteCredentials(String service, String destination, 
+            String username, Object credentials)
+    {
+        super();
+        this.service = service;
+        this.destination = destination;
+        this.username = username;
+        this.credentials = credentials;
+    }
+
+    /**
+     * Returns the user name from the remote credentials.
+     * @return String the user name
+     */
+    public String getUsername()
+    {
+        return username;
+    }
+
+    /**
+     * Returns the credentials themselves (usually a password).
+     * @return Object the credentials object
+     */
+    public Object getCredentials()
+    {
+        return credentials;
+    }
+
+    /**
+     * Returns the id of the service these credentials are registered for.
+     * @return String the service id
+     */
+    public String getService()
+    {
+        return service;
+    }
+
+    /**
+     * Returns the destination for the service.
+     * @return String the destination id
+     */
+    public String getDestination()
+    {
+        return destination;
+    }
+}


[44/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/feedstarter/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/feedstarter/.project b/apps/samples-spring/WEB-INF/flex-src/feedstarter/.project
new file mode 100755
index 0000000..582bf63
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/feedstarter/.project
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>feedstarter</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/feedstarter/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/feedstarter/build.xml b/apps/samples-spring/WEB-INF/flex-src/feedstarter/build.xml
new file mode 100755
index 0000000..d74e1db
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/feedstarter/build.xml
@@ -0,0 +1,76 @@
+<?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-spring.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="context.root" value="samples-spring" />
+    <property name="application.name" value="feedstarter" />
+    <property name="application.file" value="feedstarter" />
+    <property name="application.bin.dir" value="${samples-spring.war}/feedstarter" />
+    <property name="application.src.dir" value="${samples-spring.war}/WEB-INF/flex-src/feedstarter/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-spring.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"
+            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-spring/WEB-INF/flex-src/feedstarter/html-template/history/history.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/history/history.css b/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/history/history.css
new file mode 100755
index 0000000..4a7f791
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/history/history.css
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/history/history.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/history/history.js b/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/history/history.js
new file mode 100755
index 0000000..0f82450
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/history/history.js
@@ -0,0 +1,722 @@
+/*
+ * 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.
+ */
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        ie8: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+        if (browser.version == 8)
+        {
+            browser.ie = false;
+            browser.ie8 = true;
+        }
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    function hashChangeHandler()
+    {
+        currentHref = document.location.href;
+        var flexAppUrl = getHash();
+        //ADR: to fix multiple
+        if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+            var pl = getPlayers();
+            for (var i = 0; i < pl.length; i++) {
+                pl[i].browserURLChange(flexAppUrl);
+            }
+        } else {
+            getPlayer().browserURLChange(flexAppUrl);
+        }
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+        var i;
+
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+                for (i = 0; i < o.length; i++) {
+                    if (typeof o[i].browserURLChange != "undefined")
+                        return o[i];
+                }
+                for (i = 0; i < e.length; i++) {
+                    if (typeof e[i].browserURLChange != "undefined")
+                        return e[i];
+                }
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+            for (i = 0; i < e.length; i++) {
+                if (typeof e[i].browserURLChange != "undefined")
+                {
+                    return e[i];
+                }
+            }
+            for (i = 0; i < o.length; i++) {
+                if (typeof o[i].browserURLChange != "undefined")
+                {
+                    return o[i];
+                }
+            }
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var i;
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+                        currentHref = document.location.href;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                var flexAppUrl = getHash();
+                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
+                {    
+                    // If it did change and we're running Safari 3.x or earlier, 
+                    // then we have to look the old state up in our hand-maintained 
+                    // array since document.location.hash won't have changed, 
+                    // then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                    flexAppUrl = historyHash[currentHistoryLength];
+                }
+
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            iframe.src = 'javascript:false;'; 
+
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox || browser.ie8)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+
+        if (browser.ie8)        
+            document.body.onhashchange = hashChangeHandler;
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        },
+        getUserAgent: function() {
+            return navigator.userAgent;
+        },
+        getPlatform: function() {
+            return navigator.platform;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/history/historyFrame.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/history/historyFrame.html b/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/history/historyFrame.html
new file mode 100755
index 0000000..63bdd3e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/history/historyFrame.html
@@ -0,0 +1,45 @@
+<!--
+  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>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/index.template.html b/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/index.template.html
new file mode 100755
index 0000000..e3e9c81
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/swfobject.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/swfobject.js b/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/swfobject.js
new file mode 100755
index 0000000..07730fa
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/feedstarter/html-template/swfobject.js
@@ -0,0 +1,793 @@
+/*
+ * 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.
+ */
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+	
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+		ON_READY_STATE_CHANGE = "onreadystatechange",
+		
+		win = window,
+		doc = document,
+		nav = navigator,
+		
+		plugin = false,
+		domLoadFnArr = [main],
+		regObjArr = [],
+		objIdArr = [],
+		listenersArr = [],
+		storedAltContent,
+		storedAltContentId,
+		storedCallbackFn,
+		storedCallbackObj,
+		isDomLoaded = false,
+		isExpressInstallActive = false,
+		dynamicStylesheet,
+		dynamicStylesheetMedia,
+		autoHideShow = true,
+	
+	/* Centralized function for browser feature detection
+		- User agent string detection is only used when no good alternative is possible
+		- Is executed directly for optimal performance
+	*/	
+	ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+			u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+				plugin = true;
+				ie = false; // cascaded feature detection for Internet Explorer
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			try {
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+				if (a) { // a will return null when ActiveX is disabled
+					d = a.GetVariable("$version");
+					if (d) {
+						ie = true; // cascaded feature detection for Internet Explorer
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+			}
+			catch(e) {}
+		}
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+	}(),
+	
+	/* Cross-browser onDomLoad
+		- Will fire an event as soon as the DOM of a web page is loaded
+		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+		- Regular onload serves as fallback
+	*/ 
+	onDomLoad = function() {
+		if (!ua.w3) { return; }
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+			callDomLoadFunctions();
+		}
+		if (!isDomLoaded) {
+			if (typeof doc.addEventListener != UNDEF) {
+				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+			}		
+			if (ua.ie && ua.win) {
+				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+					if (doc.readyState == "complete") {
+						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+						callDomLoadFunctions();
+					}
+				});
+				if (win == top) { // if not inside an iframe
+					(function(){
+						if (isDomLoaded) { return; }
+						try {
+							doc.documentElement.doScroll("left");
+						}
+						catch(e) {
+							setTimeout(arguments.callee, 0);
+							return;
+						}
+						callDomLoadFunctions();
+					})();
+				}
+			}
+			if (ua.wk) {
+				(function(){
+					if (isDomLoaded) { return; }
+					if (!/loaded|complete/.test(doc.readyState)) {
+						setTimeout(arguments.callee, 0);
+						return;
+					}
+					callDomLoadFunctions();
+				})();
+			}
+			addLoadEvent(callDomLoadFunctions);
+		}
+	}();
+	
+	function callDomLoadFunctions() {
+		if (isDomLoaded) { return; }
+		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+			t.parentNode.removeChild(t);
+		}
+		catch (e) { return; }
+		isDomLoaded = true;
+		var dl = domLoadFnArr.length;
+		for (var i = 0; i < dl; i++) {
+			domLoadFnArr[i]();
+		}
+	}
+	
+	function addDomLoadEvent(fn) {
+		if (isDomLoaded) {
+			fn();
+		}
+		else { 
+			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+		}
+	}
+	
+	/* Cross-browser onload
+		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+		- Will fire an event as soon as a web page including all of its assets are loaded 
+	 */
+	function addLoadEvent(fn) {
+		if (typeof win.addEventListener != UNDEF) {
+			win.addEventListener("load", fn, false);
+		}
+		else if (typeof doc.addEventListener != UNDEF) {
+			doc.addEventListener("load", fn, false);
+		}
+		else if (typeof win.attachEvent != UNDEF) {
+			addListener(win, "onload", fn);
+		}
+		else if (typeof win.onload == "function") {
+			var fnOld = win.onload;
+			win.onload = function() {
+				fnOld();
+				fn();
+			};
+		}
+		else {
+			win.onload = fn;
+		}
+	}
+	
+	/* Main function
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
+	*/
+	function main() { 
+		if (plugin) {
+			testPlayerVersion();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Detect the Flash Player version for non-Internet Explorer browsers
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+		  a. Both release and build numbers can be detected
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+	*/
+	function testPlayerVersion() {
+		var b = doc.getElementsByTagName("body")[0];
+		var o = createElement(OBJECT);
+		o.setAttribute("type", FLASH_MIME_TYPE);
+		var t = b.appendChild(o);
+		if (t) {
+			var counter = 0;
+			(function(){
+				if (typeof t.GetVariable != UNDEF) {
+					var d = t.GetVariable("$version");
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				else if (counter < 10) {
+					counter++;
+					setTimeout(arguments.callee, 10);
+					return;
+				}
+				b.removeChild(o);
+				t = null;
+				matchVersions();
+			})();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Perform Flash Player and SWF version matching; static publishing only
+	*/
+	function matchVersions() {
+		var rl = regObjArr.length;
+		if (rl > 0) {
+			for (var i = 0; i < rl; i++) { // for each registered object element
+				var id = regObjArr[i].id;
+				var cb = regObjArr[i].callbackFn;
+				var cbObj = {success:false, id:id};
+				if (ua.pv[0] > 0) {
+					var obj = getElementById(id);
+					if (obj) {
+						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+							setVisibility(id, true);
+							if (cb) {
+								cbObj.success = true;
+								cbObj.ref = getObjectById(id);
+								cb(cbObj);
+							}
+						}
+						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+							var att = {};
+							att.data = regObjArr[i].expressInstall;
+							att.width = obj.getAttribute("width") || "0";
+							att.height = obj.getAttribute("height") || "0";
+							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+							// parse HTML object param element's name-value pairs
+							var par = {};
+							var p = obj.getElementsByTagName("param");
+							var pl = p.length;
+							for (var j = 0; j < pl; j++) {
+								if (p[j].getAttribute("name").toLowerCase() != "movie") {
+									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+								}
+							}
+							showExpressInstall(att, par, id, cb);
+						}
+						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+							displayAltContent(obj);
+							if (cb) { cb(cbObj); }
+						}
+					}
+				}
+				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+					setVisibility(id, true);
+					if (cb) {
+						var o = getObjectById(id); // test whether there is an HTML object element or not
+						if (o && typeof o.SetVariable != UNDEF) { 
+							cbObj.success = true;
+							cbObj.ref = o;
+						}
+						cb(cbObj);
+					}
+				}
+			}
+		}
+	}
+	
+	function getObjectById(objectIdStr) {
+		var r = null;
+		var o = getElementById(objectIdStr);
+		if (o && o.nodeName == "OBJECT") {
+			if (typeof o.SetVariable != UNDEF) {
+				r = o;
+			}
+			else {
+				var n = o.getElementsByTagName(OBJECT)[0];
+				if (n) {
+					r = n;
+				}
+			}
+		}
+		return r;
+	}
+	
+	/* Requirements for Adobe Express Install
+		- only one instance can be active at a time
+		- fp 6.0.65 or higher
+		- Win/Mac OS only
+		- no Webkit engines older than version 312
+	*/
+	function canExpressInstall() {
+		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+	}
+	
+	/* Show the Adobe Express Install dialog
+		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+	*/
+	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+		isExpressInstallActive = true;
+		storedCallbackFn = callbackFn || null;
+		storedCallbackObj = {success:false, id:replaceElemIdStr};
+		var obj = getElementById(replaceElemIdStr);
+		if (obj) {
+			if (obj.nodeName == "OBJECT") { // static publishing
+				storedAltContent = abstractAltContent(obj);
+				storedAltContentId = null;
+			}
+			else { // dynamic publishing
+				storedAltContent = obj;
+				storedAltContentId = replaceElemIdStr;
+			}
+			att.id = EXPRESS_INSTALL_ID;
+			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+				fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+			if (typeof par.flashvars != UNDEF) {
+				par.flashvars += "&" + fv;
+			}
+			else {
+				par.flashvars = fv;
+			}
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			if (ua.ie && ua.win && obj.readyState != 4) {
+				var newObj = createElement("div");
+				replaceElemIdStr += "SWFObjectNew";
+				newObj.setAttribute("id", replaceElemIdStr);
+				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						obj.parentNode.removeChild(obj);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			createSWF(att, par, replaceElemIdStr);
+		}
+	}
+	
+	/* Functions to abstract and display alternative content
+	*/
+	function displayAltContent(obj) {
+		if (ua.ie && ua.win && obj.readyState != 4) {
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			var el = createElement("div");
+			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+			el.parentNode.replaceChild(abstractAltContent(obj), el);
+			obj.style.display = "none";
+			(function(){
+				if (obj.readyState == 4) {
+					obj.parentNode.removeChild(obj);
+				}
+				else {
+					setTimeout(arguments.callee, 10);
+				}
+			})();
+		}
+		else {
+			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+		}
+	} 
+
+	function abstractAltContent(obj) {
+		var ac = createElement("div");
+		if (ua.win && ua.ie) {
+			ac.innerHTML = obj.innerHTML;
+		}
+		else {
+			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+			if (nestedObj) {
+				var c = nestedObj.childNodes;
+				if (c) {
+					var cl = c.length;
+					for (var i = 0; i < cl; i++) {
+						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+							ac.appendChild(c[i].cloneNode(true));
+						}
+					}
+				}
+			}
+		}
+		return ac;
+	}
+	
+	/* Cross-browser dynamic SWF creation
+	*/
+	function createSWF(attObj, parObj, id) {
+		var r, el = getElementById(id);
+		if (ua.wk && ua.wk < 312) { return r; }
+		if (el) {
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+				attObj.id = id;
+			}
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+				var att = "";
+				for (var i in attObj) {
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+						if (i.toLowerCase() == "data") {
+							parObj.movie = attObj[i];
+						}
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							att += ' class="' + attObj[i] + '"';
+						}
+						else if (i.toLowerCase() != "classid") {
+							att += ' ' + i + '="' + attObj[i] + '"';
+						}
+					}
+				}
+				var par = "";
+				for (var j in parObj) {
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+					}
+				}
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+				r = getElementById(attObj.id);	
+			}
+			else { // well-behaving browsers
+				var o = createElement(OBJECT);
+				o.setAttribute("type", FLASH_MIME_TYPE);
+				for (var m in attObj) {
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							o.setAttribute("class", attObj[m]);
+						}
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+							o.setAttribute(m, attObj[m]);
+						}
+					}
+				}
+				for (var n in parObj) {
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+						createObjParam(o, n, parObj[n]);
+					}
+				}
+				el.parentNode.replaceChild(o, el);
+				r = o;
+			}
+		}
+		return r;
+	}
+	
+	function createObjParam(el, pName, pValue) {
+		var p = createElement("param");
+		p.setAttribute("name", pName);	
+		p.setAttribute("value", pValue);
+		el.appendChild(p);
+	}
+	
+	/* Cross-browser SWF removal
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
+	*/
+	function removeSWF(id) {
+		var obj = getElementById(id);
+		if (obj && obj.nodeName == "OBJECT") {
+			if (ua.ie && ua.win) {
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						removeObjectInIE(id);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			else {
+				obj.parentNode.removeChild(obj);
+			}
+		}
+	}
+	
+	function removeObjectInIE(id) {
+		var obj = getElementById(id);
+		if (obj) {
+			for (var i in obj) {
+				if (typeof obj[i] == "function") {
+					obj[i] = null;
+				}
+			}
+			obj.parentNode.removeChild(obj);
+		}
+	}
+	
+	/* Functions to optimize JavaScript compression
+	*/
+	function getElementById(id) {
+		var el = null;
+		try {
+			el = doc.getElementById(id);
+		}
+		catch (e) {}
+		return el;
+	}
+	
+	function createElement(el) {
+		return doc.createElement(el);
+	}
+	
+	/* Updated attachEvent function for Internet Explorer
+		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+	*/	
+	function addListener(target, eventType, fn) {
+		target.attachEvent(eventType, fn);
+		listenersArr[listenersArr.length] = [target, eventType, fn];
+	}
+	
+	/* Flash Player and SWF content version matching
+	*/
+	function hasPlayerVersion(rv) {
+		var pv = ua.pv, v = rv.split(".");
+		v[0] = parseInt(v[0], 10);
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+		v[2] = parseInt(v[2], 10) || 0;
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+	}
+	
+	/* Cross-browser dynamic CSS creation
+		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+	*/	
+	function createCSS(sel, decl, media, newStyle) {
+		if (ua.ie && ua.mac) { return; }
+		var h = doc.getElementsByTagName("head")[0];
+		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+		var m = (media && typeof media == "string") ? media : "screen";
+		if (newStyle) {
+			dynamicStylesheet = null;
+			dynamicStylesheetMedia = null;
+		}
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+			// create dynamic stylesheet + get a global reference to it
+			var s = createElement("style");
+			s.setAttribute("type", "text/css");
+			s.setAttribute("media", m);
+			dynamicStylesheet = h.appendChild(s);
+			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+			}
+			dynamicStylesheetMedia = m;
+		}
+		// add style rule
+		if (ua.ie && ua.win) {
+			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+				dynamicStylesheet.addRule(sel, decl);
+			}
+		}
+		else {
+			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+			}
+		}
+	}
+	
+	function setVisibility(id, isVisible) {
+		if (!autoHideShow) { return; }
+		var v = isVisible ? "visible" : "hidden";
+		if (isDomLoaded && getElementById(id)) {
+			getElementById(id).style.visibility = v;
+		}
+		else {
+			createCSS("#" + id, "visibility:" + v);
+		}
+	}
+
+	/* Filter to avoid XSS attacks
+	*/
+	function urlEncodeIfNecessary(s) {
+		var regex = /[\\\"<>\.;]/;
+		var hasBadChars = regex.exec(s) != null;
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+	}
+	
+	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+	*/
+	var cleanup = function() {
+		if (ua.ie && ua.win) {
+			window.attachEvent("onunload", function() {
+				// remove listeners to avoid memory leaks
+				var ll = listenersArr.length;
+				for (var i = 0; i < ll; i++) {
+					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+				}
+				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+				var il = objIdArr.length;
+				for (var j = 0; j < il; j++) {
+					removeSWF(objIdArr[j]);
+				}
+				// cleanup library's main closures to avoid memory leaks
+				for (var k in ua) {
+					ua[k] = null;
+				}
+				ua = null;
+				for (var l in swfobject) {
+					swfobject[l] = null;
+				}
+				swfobject = null;
+			});
+		}
+	}();
+	
+	return {
+		/* Public API
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
+		*/ 
+		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+			if (ua.w3 && objectIdStr && swfVersionStr) {
+				var regObj = {};
+				regObj.id = objectIdStr;
+				regObj.swfVersion = swfVersionStr;
+				regObj.expressInstall = xiSwfUrlStr;
+				regObj.callbackFn = callbackFn;
+				regObjArr[regObjArr.length] = regObj;
+				setVisibility(objectIdStr, false);
+			}
+			else if (callbackFn) {
+				callbackFn({success:false, id:objectIdStr});
+			}
+		},
+		
+		getObjectById: function(objectIdStr) {
+			if (ua.w3) {
+				return getObjectById(objectIdStr);
+			}
+		},
+		
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+			var callbackObj = {success:false, id:replaceElemIdStr};
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+				setVisibility(replaceElemIdStr, false);
+				addDomLoadEvent(function() {
+					widthStr += ""; // auto-convert to string
+					heightStr += "";
+					var att = {};
+					if (attObj && typeof attObj === OBJECT) {
+						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+							att[i] = attObj[i];
+						}
+					}
+					att.data = swfUrlStr;
+					att.width = widthStr;
+					att.height = heightStr;
+					var par = {}; 
+					if (parObj && typeof parObj === OBJECT) {
+						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+							par[j] = parObj[j];
+						}
+					}
+					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+							if (typeof par.flashvars != UNDEF) {
+								par.flashvars += "&" + k + "=" + flashvarsObj[k];
+							}
+							else {
+								par.flashvars = k + "=" + flashvarsObj[k];
+							}
+						}
+					}
+					if (hasPlayerVersion(swfVersionStr)) { // create SWF
+						var obj = createSWF(att, par, replaceElemIdStr);
+						if (att.id == replaceElemIdStr) {
+							setVisibility(replaceElemIdStr, true);
+						}
+						callbackObj.success = true;
+						callbackObj.ref = obj;
+					}
+					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+						att.data = xiSwfUrlStr;
+						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+						return;
+					}
+					else { // show alternative content
+						setVisibility(replaceElemIdStr, true);
+					}
+					if (callbackFn) { callbackFn(callbackObj); }
+				});
+			}
+			else if (callbackFn) { callbackFn(callbackObj);	}
+		},
+		
+		switchOffAutoHideShow: function() {
+			autoHideShow = false;
+		},
+		
+		ua: ua,
+		
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		},
+		
+		hasFlashPlayerVersion: hasPlayerVersion,
+		
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
+			if (ua.w3) {
+				return createSWF(attObj, parObj, replaceElemIdStr);
+			}
+			else {
+				return undefined;
+			}
+		},
+		
+		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+			if (ua.w3 && canExpressInstall()) {
+				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+			}
+		},
+		
+		removeSWF: function(objElemIdStr) {
+			if (ua.w3) {
+				removeSWF(objElemIdStr);
+			}
+		},
+		
+		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+			if (ua.w3) {
+				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+			}
+		},
+		
+		addDomLoadEvent: addDomLoadEvent,
+		
+		addLoadEvent: addLoadEvent,
+		
+		getQueryParamValue: function(param) {
+			var q = doc.location.search || doc.location.hash;
+			if (q) {
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+				if (param == null) {
+					return urlEncodeIfNecessary(q);
+				}
+				var pairs = q.split("&");
+				for (var i = 0; i < pairs.length; i++) {
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+					}
+				}
+			}
+			return "";
+		},
+		
+		// For internal usage only
+		expressInstallCallback: function() {
+			if (isExpressInstallActive) {
+				var obj = getElementById(EXPRESS_INSTALL_ID);
+				if (obj && storedAltContent) {
+					obj.parentNode.replaceChild(storedAltContent, obj);
+					if (storedAltContentId) {
+						setVisibility(storedAltContentId, true);
+						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+					}
+					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+				}
+				isExpressInstallActive = false;
+			} 
+		}
+	};
+}();

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/feedstarter/src/feedstarter.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/feedstarter/src/feedstarter.mxml b/apps/samples-spring/WEB-INF/flex-src/feedstarter/src/feedstarter.mxml
new file mode 100755
index 0000000..524e150
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/feedstarter/src/feedstarter.mxml
@@ -0,0 +1,53 @@
+<?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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx">
+
+	<fx:Declarations>
+
+		<mx:ChannelSet id="cs">
+			<mx:AMFChannel uri="/samples-spring/messagebroker/amf"/>
+		</mx:ChannelSet>
+
+		<mx:RemoteObject id="simpleFeedStarter" destination="simpleFeedStarter" channelSet="{cs}"/>
+		<mx:RemoteObject id="marketFeedStarter" destination="marketFeedStarter" channelSet="{cs}"/>
+	
+	</fx:Declarations>
+	
+	<s:layout>
+		<s:VerticalLayout paddingTop="20" paddingLeft="20" gap="20"/>
+	</s:layout>
+	
+	<s:Label text="Feed Administration" fontSize="18" fontWeight="bold"/>
+	
+	<s:HGroup verticalAlign="middle">
+		<s:Label text="Simple Feed" width="120"/>
+		<s:Button label="Start" click="simpleFeedStarter.start()"/>
+		<s:Button label="Stop" click="simpleFeedStarter.stop()"/>
+	</s:HGroup>
+	
+	<s:HGroup verticalAlign="middle">
+		<s:Label text="Market Feed" width="120"/>
+		<s:Button label="Start" click="marketFeedStarter.start()"/>
+		<s:Button label="Stop" click="marketFeedStarter.stop()"/>
+	</s:HGroup>
+		
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync01/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync01/.actionScriptProperties b/apps/samples-spring/WEB-INF/flex-src/insync01/.actionScriptProperties
new file mode 100755
index 0000000..1bb4b6f
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync01/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="insync01.mxml" projectUUID="f3f5b870-6817-40ea-a5e2-dce3eb832d79" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="insync01.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync01/.flexProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync01/.flexProperties b/apps/samples-spring/WEB-INF/flex-src/insync01/.flexProperties
new file mode 100755
index 0000000..1d99468
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync01/.flexProperties
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync01/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync01/.project b/apps/samples-spring/WEB-INF/flex-src/insync01/.project
new file mode 100755
index 0000000..89e861d
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync01/.project
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>insync01</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync01/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync01/build.xml b/apps/samples-spring/WEB-INF/flex-src/insync01/build.xml
new file mode 100755
index 0000000..fd6f62a
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync01/build.xml
@@ -0,0 +1,76 @@
+<?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-spring.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="context.root" value="samples-spring" />
+    <property name="application.name" value="insync01" />
+    <property name="application.file" value="insync01" />
+    <property name="application.bin.dir" value="${samples-spring.war}/insync01" />
+    <property name="application.src.dir" value="${samples-spring.war}/WEB-INF/flex-src/insync01/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-spring.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"
+            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-spring/WEB-INF/flex-src/insync01/html-template/history/history.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/history/history.css b/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/history/history.css
new file mode 100755
index 0000000..4a7f791
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/history/history.css
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }


[41/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/history/history.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/history/history.js b/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/history/history.js
new file mode 100755
index 0000000..0f82450
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/history/history.js
@@ -0,0 +1,722 @@
+/*
+ * 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.
+ */
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        ie8: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+        if (browser.version == 8)
+        {
+            browser.ie = false;
+            browser.ie8 = true;
+        }
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    function hashChangeHandler()
+    {
+        currentHref = document.location.href;
+        var flexAppUrl = getHash();
+        //ADR: to fix multiple
+        if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+            var pl = getPlayers();
+            for (var i = 0; i < pl.length; i++) {
+                pl[i].browserURLChange(flexAppUrl);
+            }
+        } else {
+            getPlayer().browserURLChange(flexAppUrl);
+        }
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+        var i;
+
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+                for (i = 0; i < o.length; i++) {
+                    if (typeof o[i].browserURLChange != "undefined")
+                        return o[i];
+                }
+                for (i = 0; i < e.length; i++) {
+                    if (typeof e[i].browserURLChange != "undefined")
+                        return e[i];
+                }
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+            for (i = 0; i < e.length; i++) {
+                if (typeof e[i].browserURLChange != "undefined")
+                {
+                    return e[i];
+                }
+            }
+            for (i = 0; i < o.length; i++) {
+                if (typeof o[i].browserURLChange != "undefined")
+                {
+                    return o[i];
+                }
+            }
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var i;
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+                        currentHref = document.location.href;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                var flexAppUrl = getHash();
+                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
+                {    
+                    // If it did change and we're running Safari 3.x or earlier, 
+                    // then we have to look the old state up in our hand-maintained 
+                    // array since document.location.hash won't have changed, 
+                    // then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                    flexAppUrl = historyHash[currentHistoryLength];
+                }
+
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            iframe.src = 'javascript:false;'; 
+
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox || browser.ie8)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+
+        if (browser.ie8)        
+            document.body.onhashchange = hashChangeHandler;
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        },
+        getUserAgent: function() {
+            return navigator.userAgent;
+        },
+        getPlatform: function() {
+            return navigator.platform;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/history/historyFrame.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/history/historyFrame.html b/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/history/historyFrame.html
new file mode 100755
index 0000000..63bdd3e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/history/historyFrame.html
@@ -0,0 +1,45 @@
+<!--
+  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>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/index.template.html b/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/index.template.html
new file mode 100755
index 0000000..e3e9c81
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/swfobject.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/swfobject.js b/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/swfobject.js
new file mode 100755
index 0000000..07730fa
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync03/html-template/swfobject.js
@@ -0,0 +1,793 @@
+/*
+ * 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.
+ */
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+	
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+		ON_READY_STATE_CHANGE = "onreadystatechange",
+		
+		win = window,
+		doc = document,
+		nav = navigator,
+		
+		plugin = false,
+		domLoadFnArr = [main],
+		regObjArr = [],
+		objIdArr = [],
+		listenersArr = [],
+		storedAltContent,
+		storedAltContentId,
+		storedCallbackFn,
+		storedCallbackObj,
+		isDomLoaded = false,
+		isExpressInstallActive = false,
+		dynamicStylesheet,
+		dynamicStylesheetMedia,
+		autoHideShow = true,
+	
+	/* Centralized function for browser feature detection
+		- User agent string detection is only used when no good alternative is possible
+		- Is executed directly for optimal performance
+	*/	
+	ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+			u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+				plugin = true;
+				ie = false; // cascaded feature detection for Internet Explorer
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			try {
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+				if (a) { // a will return null when ActiveX is disabled
+					d = a.GetVariable("$version");
+					if (d) {
+						ie = true; // cascaded feature detection for Internet Explorer
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+			}
+			catch(e) {}
+		}
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+	}(),
+	
+	/* Cross-browser onDomLoad
+		- Will fire an event as soon as the DOM of a web page is loaded
+		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+		- Regular onload serves as fallback
+	*/ 
+	onDomLoad = function() {
+		if (!ua.w3) { return; }
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+			callDomLoadFunctions();
+		}
+		if (!isDomLoaded) {
+			if (typeof doc.addEventListener != UNDEF) {
+				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+			}		
+			if (ua.ie && ua.win) {
+				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+					if (doc.readyState == "complete") {
+						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+						callDomLoadFunctions();
+					}
+				});
+				if (win == top) { // if not inside an iframe
+					(function(){
+						if (isDomLoaded) { return; }
+						try {
+							doc.documentElement.doScroll("left");
+						}
+						catch(e) {
+							setTimeout(arguments.callee, 0);
+							return;
+						}
+						callDomLoadFunctions();
+					})();
+				}
+			}
+			if (ua.wk) {
+				(function(){
+					if (isDomLoaded) { return; }
+					if (!/loaded|complete/.test(doc.readyState)) {
+						setTimeout(arguments.callee, 0);
+						return;
+					}
+					callDomLoadFunctions();
+				})();
+			}
+			addLoadEvent(callDomLoadFunctions);
+		}
+	}();
+	
+	function callDomLoadFunctions() {
+		if (isDomLoaded) { return; }
+		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+			t.parentNode.removeChild(t);
+		}
+		catch (e) { return; }
+		isDomLoaded = true;
+		var dl = domLoadFnArr.length;
+		for (var i = 0; i < dl; i++) {
+			domLoadFnArr[i]();
+		}
+	}
+	
+	function addDomLoadEvent(fn) {
+		if (isDomLoaded) {
+			fn();
+		}
+		else { 
+			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+		}
+	}
+	
+	/* Cross-browser onload
+		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+		- Will fire an event as soon as a web page including all of its assets are loaded 
+	 */
+	function addLoadEvent(fn) {
+		if (typeof win.addEventListener != UNDEF) {
+			win.addEventListener("load", fn, false);
+		}
+		else if (typeof doc.addEventListener != UNDEF) {
+			doc.addEventListener("load", fn, false);
+		}
+		else if (typeof win.attachEvent != UNDEF) {
+			addListener(win, "onload", fn);
+		}
+		else if (typeof win.onload == "function") {
+			var fnOld = win.onload;
+			win.onload = function() {
+				fnOld();
+				fn();
+			};
+		}
+		else {
+			win.onload = fn;
+		}
+	}
+	
+	/* Main function
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
+	*/
+	function main() { 
+		if (plugin) {
+			testPlayerVersion();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Detect the Flash Player version for non-Internet Explorer browsers
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+		  a. Both release and build numbers can be detected
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+	*/
+	function testPlayerVersion() {
+		var b = doc.getElementsByTagName("body")[0];
+		var o = createElement(OBJECT);
+		o.setAttribute("type", FLASH_MIME_TYPE);
+		var t = b.appendChild(o);
+		if (t) {
+			var counter = 0;
+			(function(){
+				if (typeof t.GetVariable != UNDEF) {
+					var d = t.GetVariable("$version");
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				else if (counter < 10) {
+					counter++;
+					setTimeout(arguments.callee, 10);
+					return;
+				}
+				b.removeChild(o);
+				t = null;
+				matchVersions();
+			})();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Perform Flash Player and SWF version matching; static publishing only
+	*/
+	function matchVersions() {
+		var rl = regObjArr.length;
+		if (rl > 0) {
+			for (var i = 0; i < rl; i++) { // for each registered object element
+				var id = regObjArr[i].id;
+				var cb = regObjArr[i].callbackFn;
+				var cbObj = {success:false, id:id};
+				if (ua.pv[0] > 0) {
+					var obj = getElementById(id);
+					if (obj) {
+						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+							setVisibility(id, true);
+							if (cb) {
+								cbObj.success = true;
+								cbObj.ref = getObjectById(id);
+								cb(cbObj);
+							}
+						}
+						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+							var att = {};
+							att.data = regObjArr[i].expressInstall;
+							att.width = obj.getAttribute("width") || "0";
+							att.height = obj.getAttribute("height") || "0";
+							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+							// parse HTML object param element's name-value pairs
+							var par = {};
+							var p = obj.getElementsByTagName("param");
+							var pl = p.length;
+							for (var j = 0; j < pl; j++) {
+								if (p[j].getAttribute("name").toLowerCase() != "movie") {
+									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+								}
+							}
+							showExpressInstall(att, par, id, cb);
+						}
+						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+							displayAltContent(obj);
+							if (cb) { cb(cbObj); }
+						}
+					}
+				}
+				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+					setVisibility(id, true);
+					if (cb) {
+						var o = getObjectById(id); // test whether there is an HTML object element or not
+						if (o && typeof o.SetVariable != UNDEF) { 
+							cbObj.success = true;
+							cbObj.ref = o;
+						}
+						cb(cbObj);
+					}
+				}
+			}
+		}
+	}
+	
+	function getObjectById(objectIdStr) {
+		var r = null;
+		var o = getElementById(objectIdStr);
+		if (o && o.nodeName == "OBJECT") {
+			if (typeof o.SetVariable != UNDEF) {
+				r = o;
+			}
+			else {
+				var n = o.getElementsByTagName(OBJECT)[0];
+				if (n) {
+					r = n;
+				}
+			}
+		}
+		return r;
+	}
+	
+	/* Requirements for Adobe Express Install
+		- only one instance can be active at a time
+		- fp 6.0.65 or higher
+		- Win/Mac OS only
+		- no Webkit engines older than version 312
+	*/
+	function canExpressInstall() {
+		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+	}
+	
+	/* Show the Adobe Express Install dialog
+		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+	*/
+	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+		isExpressInstallActive = true;
+		storedCallbackFn = callbackFn || null;
+		storedCallbackObj = {success:false, id:replaceElemIdStr};
+		var obj = getElementById(replaceElemIdStr);
+		if (obj) {
+			if (obj.nodeName == "OBJECT") { // static publishing
+				storedAltContent = abstractAltContent(obj);
+				storedAltContentId = null;
+			}
+			else { // dynamic publishing
+				storedAltContent = obj;
+				storedAltContentId = replaceElemIdStr;
+			}
+			att.id = EXPRESS_INSTALL_ID;
+			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+				fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+			if (typeof par.flashvars != UNDEF) {
+				par.flashvars += "&" + fv;
+			}
+			else {
+				par.flashvars = fv;
+			}
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			if (ua.ie && ua.win && obj.readyState != 4) {
+				var newObj = createElement("div");
+				replaceElemIdStr += "SWFObjectNew";
+				newObj.setAttribute("id", replaceElemIdStr);
+				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						obj.parentNode.removeChild(obj);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			createSWF(att, par, replaceElemIdStr);
+		}
+	}
+	
+	/* Functions to abstract and display alternative content
+	*/
+	function displayAltContent(obj) {
+		if (ua.ie && ua.win && obj.readyState != 4) {
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			var el = createElement("div");
+			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+			el.parentNode.replaceChild(abstractAltContent(obj), el);
+			obj.style.display = "none";
+			(function(){
+				if (obj.readyState == 4) {
+					obj.parentNode.removeChild(obj);
+				}
+				else {
+					setTimeout(arguments.callee, 10);
+				}
+			})();
+		}
+		else {
+			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+		}
+	} 
+
+	function abstractAltContent(obj) {
+		var ac = createElement("div");
+		if (ua.win && ua.ie) {
+			ac.innerHTML = obj.innerHTML;
+		}
+		else {
+			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+			if (nestedObj) {
+				var c = nestedObj.childNodes;
+				if (c) {
+					var cl = c.length;
+					for (var i = 0; i < cl; i++) {
+						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+							ac.appendChild(c[i].cloneNode(true));
+						}
+					}
+				}
+			}
+		}
+		return ac;
+	}
+	
+	/* Cross-browser dynamic SWF creation
+	*/
+	function createSWF(attObj, parObj, id) {
+		var r, el = getElementById(id);
+		if (ua.wk && ua.wk < 312) { return r; }
+		if (el) {
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+				attObj.id = id;
+			}
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+				var att = "";
+				for (var i in attObj) {
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+						if (i.toLowerCase() == "data") {
+							parObj.movie = attObj[i];
+						}
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							att += ' class="' + attObj[i] + '"';
+						}
+						else if (i.toLowerCase() != "classid") {
+							att += ' ' + i + '="' + attObj[i] + '"';
+						}
+					}
+				}
+				var par = "";
+				for (var j in parObj) {
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+					}
+				}
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+				r = getElementById(attObj.id);	
+			}
+			else { // well-behaving browsers
+				var o = createElement(OBJECT);
+				o.setAttribute("type", FLASH_MIME_TYPE);
+				for (var m in attObj) {
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							o.setAttribute("class", attObj[m]);
+						}
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+							o.setAttribute(m, attObj[m]);
+						}
+					}
+				}
+				for (var n in parObj) {
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+						createObjParam(o, n, parObj[n]);
+					}
+				}
+				el.parentNode.replaceChild(o, el);
+				r = o;
+			}
+		}
+		return r;
+	}
+	
+	function createObjParam(el, pName, pValue) {
+		var p = createElement("param");
+		p.setAttribute("name", pName);	
+		p.setAttribute("value", pValue);
+		el.appendChild(p);
+	}
+	
+	/* Cross-browser SWF removal
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
+	*/
+	function removeSWF(id) {
+		var obj = getElementById(id);
+		if (obj && obj.nodeName == "OBJECT") {
+			if (ua.ie && ua.win) {
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						removeObjectInIE(id);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			else {
+				obj.parentNode.removeChild(obj);
+			}
+		}
+	}
+	
+	function removeObjectInIE(id) {
+		var obj = getElementById(id);
+		if (obj) {
+			for (var i in obj) {
+				if (typeof obj[i] == "function") {
+					obj[i] = null;
+				}
+			}
+			obj.parentNode.removeChild(obj);
+		}
+	}
+	
+	/* Functions to optimize JavaScript compression
+	*/
+	function getElementById(id) {
+		var el = null;
+		try {
+			el = doc.getElementById(id);
+		}
+		catch (e) {}
+		return el;
+	}
+	
+	function createElement(el) {
+		return doc.createElement(el);
+	}
+	
+	/* Updated attachEvent function for Internet Explorer
+		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+	*/	
+	function addListener(target, eventType, fn) {
+		target.attachEvent(eventType, fn);
+		listenersArr[listenersArr.length] = [target, eventType, fn];
+	}
+	
+	/* Flash Player and SWF content version matching
+	*/
+	function hasPlayerVersion(rv) {
+		var pv = ua.pv, v = rv.split(".");
+		v[0] = parseInt(v[0], 10);
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+		v[2] = parseInt(v[2], 10) || 0;
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+	}
+	
+	/* Cross-browser dynamic CSS creation
+		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+	*/	
+	function createCSS(sel, decl, media, newStyle) {
+		if (ua.ie && ua.mac) { return; }
+		var h = doc.getElementsByTagName("head")[0];
+		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+		var m = (media && typeof media == "string") ? media : "screen";
+		if (newStyle) {
+			dynamicStylesheet = null;
+			dynamicStylesheetMedia = null;
+		}
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+			// create dynamic stylesheet + get a global reference to it
+			var s = createElement("style");
+			s.setAttribute("type", "text/css");
+			s.setAttribute("media", m);
+			dynamicStylesheet = h.appendChild(s);
+			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+			}
+			dynamicStylesheetMedia = m;
+		}
+		// add style rule
+		if (ua.ie && ua.win) {
+			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+				dynamicStylesheet.addRule(sel, decl);
+			}
+		}
+		else {
+			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+			}
+		}
+	}
+	
+	function setVisibility(id, isVisible) {
+		if (!autoHideShow) { return; }
+		var v = isVisible ? "visible" : "hidden";
+		if (isDomLoaded && getElementById(id)) {
+			getElementById(id).style.visibility = v;
+		}
+		else {
+			createCSS("#" + id, "visibility:" + v);
+		}
+	}
+
+	/* Filter to avoid XSS attacks
+	*/
+	function urlEncodeIfNecessary(s) {
+		var regex = /[\\\"<>\.;]/;
+		var hasBadChars = regex.exec(s) != null;
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+	}
+	
+	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+	*/
+	var cleanup = function() {
+		if (ua.ie && ua.win) {
+			window.attachEvent("onunload", function() {
+				// remove listeners to avoid memory leaks
+				var ll = listenersArr.length;
+				for (var i = 0; i < ll; i++) {
+					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+				}
+				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+				var il = objIdArr.length;
+				for (var j = 0; j < il; j++) {
+					removeSWF(objIdArr[j]);
+				}
+				// cleanup library's main closures to avoid memory leaks
+				for (var k in ua) {
+					ua[k] = null;
+				}
+				ua = null;
+				for (var l in swfobject) {
+					swfobject[l] = null;
+				}
+				swfobject = null;
+			});
+		}
+	}();
+	
+	return {
+		/* Public API
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
+		*/ 
+		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+			if (ua.w3 && objectIdStr && swfVersionStr) {
+				var regObj = {};
+				regObj.id = objectIdStr;
+				regObj.swfVersion = swfVersionStr;
+				regObj.expressInstall = xiSwfUrlStr;
+				regObj.callbackFn = callbackFn;
+				regObjArr[regObjArr.length] = regObj;
+				setVisibility(objectIdStr, false);
+			}
+			else if (callbackFn) {
+				callbackFn({success:false, id:objectIdStr});
+			}
+		},
+		
+		getObjectById: function(objectIdStr) {
+			if (ua.w3) {
+				return getObjectById(objectIdStr);
+			}
+		},
+		
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+			var callbackObj = {success:false, id:replaceElemIdStr};
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+				setVisibility(replaceElemIdStr, false);
+				addDomLoadEvent(function() {
+					widthStr += ""; // auto-convert to string
+					heightStr += "";
+					var att = {};
+					if (attObj && typeof attObj === OBJECT) {
+						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+							att[i] = attObj[i];
+						}
+					}
+					att.data = swfUrlStr;
+					att.width = widthStr;
+					att.height = heightStr;
+					var par = {}; 
+					if (parObj && typeof parObj === OBJECT) {
+						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+							par[j] = parObj[j];
+						}
+					}
+					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+							if (typeof par.flashvars != UNDEF) {
+								par.flashvars += "&" + k + "=" + flashvarsObj[k];
+							}
+							else {
+								par.flashvars = k + "=" + flashvarsObj[k];
+							}
+						}
+					}
+					if (hasPlayerVersion(swfVersionStr)) { // create SWF
+						var obj = createSWF(att, par, replaceElemIdStr);
+						if (att.id == replaceElemIdStr) {
+							setVisibility(replaceElemIdStr, true);
+						}
+						callbackObj.success = true;
+						callbackObj.ref = obj;
+					}
+					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+						att.data = xiSwfUrlStr;
+						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+						return;
+					}
+					else { // show alternative content
+						setVisibility(replaceElemIdStr, true);
+					}
+					if (callbackFn) { callbackFn(callbackObj); }
+				});
+			}
+			else if (callbackFn) { callbackFn(callbackObj);	}
+		},
+		
+		switchOffAutoHideShow: function() {
+			autoHideShow = false;
+		},
+		
+		ua: ua,
+		
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		},
+		
+		hasFlashPlayerVersion: hasPlayerVersion,
+		
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
+			if (ua.w3) {
+				return createSWF(attObj, parObj, replaceElemIdStr);
+			}
+			else {
+				return undefined;
+			}
+		},
+		
+		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+			if (ua.w3 && canExpressInstall()) {
+				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+			}
+		},
+		
+		removeSWF: function(objElemIdStr) {
+			if (ua.w3) {
+				removeSWF(objElemIdStr);
+			}
+		},
+		
+		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+			if (ua.w3) {
+				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+			}
+		},
+		
+		addDomLoadEvent: addDomLoadEvent,
+		
+		addLoadEvent: addLoadEvent,
+		
+		getQueryParamValue: function(param) {
+			var q = doc.location.search || doc.location.hash;
+			if (q) {
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+				if (param == null) {
+					return urlEncodeIfNecessary(q);
+				}
+				var pairs = q.split("&");
+				for (var i = 0; i < pairs.length; i++) {
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+					}
+				}
+			}
+			return "";
+		},
+		
+		// For internal usage only
+		expressInstallCallback: function() {
+			if (isExpressInstallActive) {
+				var obj = getElementById(EXPRESS_INSTALL_ID);
+				if (obj && storedAltContent) {
+					obj.parentNode.replaceChild(storedAltContent, obj);
+					if (storedAltContentId) {
+						setVisibility(storedAltContentId, true);
+						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+					}
+					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+				}
+				isExpressInstallActive = false;
+			} 
+		}
+	};
+}();

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync03/src/Contact.as
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync03/src/Contact.as b/apps/samples-spring/WEB-INF/flex-src/insync03/src/Contact.as
new file mode 100755
index 0000000..003b0e0
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync03/src/Contact.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
+{
+	[Bindable]
+	[RemoteClass(alias="org.springframework.flex.samples.contact.Contact")]
+	public class Contact
+	{
+		public var id:int;
+		public var firstName:String;
+		public var lastName:String;
+		public var email:String;
+		public var phone:String;
+		public var address:String;
+		public var city:String;
+		public var state:String;
+		public var zip:String;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync03/src/ContactForm.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync03/src/ContactForm.mxml b/apps/samples-spring/WEB-INF/flex-src/insync03/src/ContactForm.mxml
new file mode 100755
index 0000000..1f015d1
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync03/src/ContactForm.mxml
@@ -0,0 +1,112 @@
+<?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:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		   xmlns:s="library://ns.adobe.com/flex/spark" 
+		   xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%">
+
+	<fx:Script>
+		<![CDATA[
+
+			import mx.rpc.events.FaultEvent;
+			import mx.rpc.events.ResultEvent;
+			import mx.controls.Alert;
+			
+			[Bindable] public var contact:Contact;
+			
+			private function save():void
+			{
+				contact.firstName = firstName.text;
+				contact.lastName = lastName.text;
+				contact.email = email.text;
+				contact.phone = phone.text;
+				contact.address = address.text;
+				contact.city = city.text;
+				contact.state = state.text;
+				contact.zip = zip.text;
+				ro.update(contact);
+			}
+			
+			private function update_resultHandler(event:ResultEvent):void
+			{
+				Alert.show("Contact " + contact.id + " updated successfully");
+			}
+			
+			private function deleteItem():void
+			{
+				ro.remove(contact);		
+			}
+			
+			private function remove_resultHandler(event:ResultEvent):void
+			{
+				contact = null;
+			}
+			
+			private function faultHandler(event:FaultEvent):void
+			{
+				Alert.show(event.fault.faultDetail);
+			}
+			
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<mx:RemoteObject id="ro" destination="contactService" fault="faultHandler(event)" endpoint="{&apos;http://{server.name}:{server.port}/samples-spring/messagebroker/amf&apos;}">
+			<mx:method name="update" result="update_resultHandler(event)"/>
+			<mx:method name="remove" result="remove_resultHandler(event)"/>
+		</mx:RemoteObject>
+	</fx:Declarations>
+
+	<mx:Form>
+		<mx:FormItem label="Id">
+			<mx:TextInput text="{contact.id}" enabled="false"/>
+		</mx:FormItem>
+		<mx:FormItem label="First Name">
+			<mx:TextInput id="firstName" text="{contact.firstName}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Last Name">
+			<mx:TextInput id="lastName" text="{contact.lastName}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Email">
+			<mx:TextInput id="email" text="{contact.email}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Phone">
+			<mx:TextInput id="phone" text="{contact.phone}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Address">
+			<mx:TextInput id="address" text="{contact.address}"/>
+		</mx:FormItem>
+		<mx:FormItem label="City">
+			<mx:TextInput id="city" text="{contact.city}"/>
+		</mx:FormItem>
+		<mx:FormItem label="State">
+			<mx:TextInput id="state" text="{contact.state}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Zip">
+			<mx:TextInput id="zip" text="{contact.zip}"/>
+		</mx:FormItem>
+	</mx:Form>
+	
+	<s:HGroup left="8" bottom="8">
+		<s:Button label="Save" click="save()" enabled="{contact != null}"/>
+		<s:Button label="Delete" click="deleteItem()" enabled="{contact != null}"/>
+	</s:HGroup>
+
+</mx:Canvas>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync03/src/insync03.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync03/src/insync03.mxml b/apps/samples-spring/WEB-INF/flex-src/insync03/src/insync03.mxml
new file mode 100755
index 0000000..199b28a
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync03/src/insync03.mxml
@@ -0,0 +1,71 @@
+<?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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:local="*">
+	
+	<fx:Script>
+		<![CDATA[
+			
+			import mx.collections.ArrayCollection;
+			import mx.controls.Alert;
+			import mx.rpc.events.FaultEvent;
+			import mx.rpc.events.ResultEvent;
+			
+			[Bindable] private var contacts:ArrayCollection;
+			
+			private function resultHandler(event:ResultEvent):void
+			{
+				contacts = event.result as ArrayCollection
+			}
+			
+			private function faultHandler(event:FaultEvent):void
+			{
+				Alert.show(event.fault.faultDetail);
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<s:RemoteObject id="ro" destination="contactService" fault="faultHandler(event)" endpoint="{&apos;http://{server.name}:{server.port}/samples-spring/messagebroker/amf&apos;}">
+			<s:method name="findByName" result="resultHandler(event)"/>
+		</s:RemoteObject>
+	</fx:Declarations>
+	
+	<s:controlBarContent>
+		<s:TextInput id="searchStr"/>
+		<s:Button label="Search" click="ro.findByName(searchStr.text)"/>
+	</s:controlBarContent>
+	
+	<mx:HDividedBox top="8" left="8" right="8" bottom="8">
+		
+		<mx:DataGrid id="dg" dataProvider="{contacts}" width="30%" height="100%">
+			<mx:columns>
+				<mx:DataGridColumn dataField="firstName" headerText="First Name"/>
+				<mx:DataGridColumn dataField="lastName" headerText="Last Name"/>
+			</mx:columns>
+		</mx:DataGrid>
+		
+		<local:ContactForm contact="{dg.selectedItem as Contact}" width="70%" height="100%"/>
+
+	</mx:HDividedBox>
+	
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync04/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync04/.actionScriptProperties b/apps/samples-spring/WEB-INF/flex-src/insync04/.actionScriptProperties
new file mode 100755
index 0000000..9b5ef0c
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync04/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="insync04.mxml" projectUUID="c091ffc5-d356-4296-9974-5dcd4d2c8d67" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="insync04.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync04/.flexProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync04/.flexProperties b/apps/samples-spring/WEB-INF/flex-src/insync04/.flexProperties
new file mode 100755
index 0000000..1d99468
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync04/.flexProperties
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync04/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync04/.project b/apps/samples-spring/WEB-INF/flex-src/insync04/.project
new file mode 100755
index 0000000..74b028b
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync04/.project
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>insync04</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync04/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync04/build.xml b/apps/samples-spring/WEB-INF/flex-src/insync04/build.xml
new file mode 100755
index 0000000..8de353a
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync04/build.xml
@@ -0,0 +1,76 @@
+<?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-spring.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="context.root" value="samples-spring" />
+    <property name="application.name" value="insync04" />
+    <property name="application.file" value="insync04" />
+    <property name="application.bin.dir" value="${samples-spring.war}/insync04" />
+    <property name="application.src.dir" value="${samples-spring.war}/WEB-INF/flex-src/insync04/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-spring.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"
+            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-spring/WEB-INF/flex-src/insync04/html-template/history/history.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/history/history.css b/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/history/history.css
new file mode 100755
index 0000000..4a7f791
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync04/html-template/history/history.css
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }


[45/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/history/history.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/history/history.js b/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/history/history.js
new file mode 100755
index 0000000..0f82450
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/history/history.js
@@ -0,0 +1,722 @@
+/*
+ * 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.
+ */
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        ie8: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+        if (browser.version == 8)
+        {
+            browser.ie = false;
+            browser.ie8 = true;
+        }
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    function hashChangeHandler()
+    {
+        currentHref = document.location.href;
+        var flexAppUrl = getHash();
+        //ADR: to fix multiple
+        if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+            var pl = getPlayers();
+            for (var i = 0; i < pl.length; i++) {
+                pl[i].browserURLChange(flexAppUrl);
+            }
+        } else {
+            getPlayer().browserURLChange(flexAppUrl);
+        }
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+        var i;
+
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+                for (i = 0; i < o.length; i++) {
+                    if (typeof o[i].browserURLChange != "undefined")
+                        return o[i];
+                }
+                for (i = 0; i < e.length; i++) {
+                    if (typeof e[i].browserURLChange != "undefined")
+                        return e[i];
+                }
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+            for (i = 0; i < e.length; i++) {
+                if (typeof e[i].browserURLChange != "undefined")
+                {
+                    return e[i];
+                }
+            }
+            for (i = 0; i < o.length; i++) {
+                if (typeof o[i].browserURLChange != "undefined")
+                {
+                    return o[i];
+                }
+            }
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var i;
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+                        currentHref = document.location.href;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                var flexAppUrl = getHash();
+                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
+                {    
+                    // If it did change and we're running Safari 3.x or earlier, 
+                    // then we have to look the old state up in our hand-maintained 
+                    // array since document.location.hash won't have changed, 
+                    // then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                    flexAppUrl = historyHash[currentHistoryLength];
+                }
+
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            iframe.src = 'javascript:false;'; 
+
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox || browser.ie8)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+
+        if (browser.ie8)        
+            document.body.onhashchange = hashChangeHandler;
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        },
+        getUserAgent: function() {
+            return navigator.userAgent;
+        },
+        getPlatform: function() {
+            return navigator.platform;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/history/historyFrame.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/history/historyFrame.html b/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/history/historyFrame.html
new file mode 100755
index 0000000..63bdd3e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/history/historyFrame.html
@@ -0,0 +1,45 @@
+<!--
+  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>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/index.template.html b/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/index.template.html
new file mode 100755
index 0000000..e3e9c81
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/swfobject.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/swfobject.js b/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/swfobject.js
new file mode 100755
index 0000000..07730fa
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/html-template/swfobject.js
@@ -0,0 +1,793 @@
+/*
+ * 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.
+ */
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+	
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+		ON_READY_STATE_CHANGE = "onreadystatechange",
+		
+		win = window,
+		doc = document,
+		nav = navigator,
+		
+		plugin = false,
+		domLoadFnArr = [main],
+		regObjArr = [],
+		objIdArr = [],
+		listenersArr = [],
+		storedAltContent,
+		storedAltContentId,
+		storedCallbackFn,
+		storedCallbackObj,
+		isDomLoaded = false,
+		isExpressInstallActive = false,
+		dynamicStylesheet,
+		dynamicStylesheetMedia,
+		autoHideShow = true,
+	
+	/* Centralized function for browser feature detection
+		- User agent string detection is only used when no good alternative is possible
+		- Is executed directly for optimal performance
+	*/	
+	ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+			u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+				plugin = true;
+				ie = false; // cascaded feature detection for Internet Explorer
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			try {
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+				if (a) { // a will return null when ActiveX is disabled
+					d = a.GetVariable("$version");
+					if (d) {
+						ie = true; // cascaded feature detection for Internet Explorer
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+			}
+			catch(e) {}
+		}
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+	}(),
+	
+	/* Cross-browser onDomLoad
+		- Will fire an event as soon as the DOM of a web page is loaded
+		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+		- Regular onload serves as fallback
+	*/ 
+	onDomLoad = function() {
+		if (!ua.w3) { return; }
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+			callDomLoadFunctions();
+		}
+		if (!isDomLoaded) {
+			if (typeof doc.addEventListener != UNDEF) {
+				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+			}		
+			if (ua.ie && ua.win) {
+				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+					if (doc.readyState == "complete") {
+						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+						callDomLoadFunctions();
+					}
+				});
+				if (win == top) { // if not inside an iframe
+					(function(){
+						if (isDomLoaded) { return; }
+						try {
+							doc.documentElement.doScroll("left");
+						}
+						catch(e) {
+							setTimeout(arguments.callee, 0);
+							return;
+						}
+						callDomLoadFunctions();
+					})();
+				}
+			}
+			if (ua.wk) {
+				(function(){
+					if (isDomLoaded) { return; }
+					if (!/loaded|complete/.test(doc.readyState)) {
+						setTimeout(arguments.callee, 0);
+						return;
+					}
+					callDomLoadFunctions();
+				})();
+			}
+			addLoadEvent(callDomLoadFunctions);
+		}
+	}();
+	
+	function callDomLoadFunctions() {
+		if (isDomLoaded) { return; }
+		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+			t.parentNode.removeChild(t);
+		}
+		catch (e) { return; }
+		isDomLoaded = true;
+		var dl = domLoadFnArr.length;
+		for (var i = 0; i < dl; i++) {
+			domLoadFnArr[i]();
+		}
+	}
+	
+	function addDomLoadEvent(fn) {
+		if (isDomLoaded) {
+			fn();
+		}
+		else { 
+			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+		}
+	}
+	
+	/* Cross-browser onload
+		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+		- Will fire an event as soon as a web page including all of its assets are loaded 
+	 */
+	function addLoadEvent(fn) {
+		if (typeof win.addEventListener != UNDEF) {
+			win.addEventListener("load", fn, false);
+		}
+		else if (typeof doc.addEventListener != UNDEF) {
+			doc.addEventListener("load", fn, false);
+		}
+		else if (typeof win.attachEvent != UNDEF) {
+			addListener(win, "onload", fn);
+		}
+		else if (typeof win.onload == "function") {
+			var fnOld = win.onload;
+			win.onload = function() {
+				fnOld();
+				fn();
+			};
+		}
+		else {
+			win.onload = fn;
+		}
+	}
+	
+	/* Main function
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
+	*/
+	function main() { 
+		if (plugin) {
+			testPlayerVersion();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Detect the Flash Player version for non-Internet Explorer browsers
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+		  a. Both release and build numbers can be detected
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+	*/
+	function testPlayerVersion() {
+		var b = doc.getElementsByTagName("body")[0];
+		var o = createElement(OBJECT);
+		o.setAttribute("type", FLASH_MIME_TYPE);
+		var t = b.appendChild(o);
+		if (t) {
+			var counter = 0;
+			(function(){
+				if (typeof t.GetVariable != UNDEF) {
+					var d = t.GetVariable("$version");
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				else if (counter < 10) {
+					counter++;
+					setTimeout(arguments.callee, 10);
+					return;
+				}
+				b.removeChild(o);
+				t = null;
+				matchVersions();
+			})();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Perform Flash Player and SWF version matching; static publishing only
+	*/
+	function matchVersions() {
+		var rl = regObjArr.length;
+		if (rl > 0) {
+			for (var i = 0; i < rl; i++) { // for each registered object element
+				var id = regObjArr[i].id;
+				var cb = regObjArr[i].callbackFn;
+				var cbObj = {success:false, id:id};
+				if (ua.pv[0] > 0) {
+					var obj = getElementById(id);
+					if (obj) {
+						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+							setVisibility(id, true);
+							if (cb) {
+								cbObj.success = true;
+								cbObj.ref = getObjectById(id);
+								cb(cbObj);
+							}
+						}
+						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+							var att = {};
+							att.data = regObjArr[i].expressInstall;
+							att.width = obj.getAttribute("width") || "0";
+							att.height = obj.getAttribute("height") || "0";
+							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+							// parse HTML object param element's name-value pairs
+							var par = {};
+							var p = obj.getElementsByTagName("param");
+							var pl = p.length;
+							for (var j = 0; j < pl; j++) {
+								if (p[j].getAttribute("name").toLowerCase() != "movie") {
+									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+								}
+							}
+							showExpressInstall(att, par, id, cb);
+						}
+						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+							displayAltContent(obj);
+							if (cb) { cb(cbObj); }
+						}
+					}
+				}
+				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+					setVisibility(id, true);
+					if (cb) {
+						var o = getObjectById(id); // test whether there is an HTML object element or not
+						if (o && typeof o.SetVariable != UNDEF) { 
+							cbObj.success = true;
+							cbObj.ref = o;
+						}
+						cb(cbObj);
+					}
+				}
+			}
+		}
+	}
+	
+	function getObjectById(objectIdStr) {
+		var r = null;
+		var o = getElementById(objectIdStr);
+		if (o && o.nodeName == "OBJECT") {
+			if (typeof o.SetVariable != UNDEF) {
+				r = o;
+			}
+			else {
+				var n = o.getElementsByTagName(OBJECT)[0];
+				if (n) {
+					r = n;
+				}
+			}
+		}
+		return r;
+	}
+	
+	/* Requirements for Adobe Express Install
+		- only one instance can be active at a time
+		- fp 6.0.65 or higher
+		- Win/Mac OS only
+		- no Webkit engines older than version 312
+	*/
+	function canExpressInstall() {
+		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+	}
+	
+	/* Show the Adobe Express Install dialog
+		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+	*/
+	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+		isExpressInstallActive = true;
+		storedCallbackFn = callbackFn || null;
+		storedCallbackObj = {success:false, id:replaceElemIdStr};
+		var obj = getElementById(replaceElemIdStr);
+		if (obj) {
+			if (obj.nodeName == "OBJECT") { // static publishing
+				storedAltContent = abstractAltContent(obj);
+				storedAltContentId = null;
+			}
+			else { // dynamic publishing
+				storedAltContent = obj;
+				storedAltContentId = replaceElemIdStr;
+			}
+			att.id = EXPRESS_INSTALL_ID;
+			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+				fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+			if (typeof par.flashvars != UNDEF) {
+				par.flashvars += "&" + fv;
+			}
+			else {
+				par.flashvars = fv;
+			}
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			if (ua.ie && ua.win && obj.readyState != 4) {
+				var newObj = createElement("div");
+				replaceElemIdStr += "SWFObjectNew";
+				newObj.setAttribute("id", replaceElemIdStr);
+				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						obj.parentNode.removeChild(obj);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			createSWF(att, par, replaceElemIdStr);
+		}
+	}
+	
+	/* Functions to abstract and display alternative content
+	*/
+	function displayAltContent(obj) {
+		if (ua.ie && ua.win && obj.readyState != 4) {
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			var el = createElement("div");
+			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+			el.parentNode.replaceChild(abstractAltContent(obj), el);
+			obj.style.display = "none";
+			(function(){
+				if (obj.readyState == 4) {
+					obj.parentNode.removeChild(obj);
+				}
+				else {
+					setTimeout(arguments.callee, 10);
+				}
+			})();
+		}
+		else {
+			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+		}
+	} 
+
+	function abstractAltContent(obj) {
+		var ac = createElement("div");
+		if (ua.win && ua.ie) {
+			ac.innerHTML = obj.innerHTML;
+		}
+		else {
+			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+			if (nestedObj) {
+				var c = nestedObj.childNodes;
+				if (c) {
+					var cl = c.length;
+					for (var i = 0; i < cl; i++) {
+						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+							ac.appendChild(c[i].cloneNode(true));
+						}
+					}
+				}
+			}
+		}
+		return ac;
+	}
+	
+	/* Cross-browser dynamic SWF creation
+	*/
+	function createSWF(attObj, parObj, id) {
+		var r, el = getElementById(id);
+		if (ua.wk && ua.wk < 312) { return r; }
+		if (el) {
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+				attObj.id = id;
+			}
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+				var att = "";
+				for (var i in attObj) {
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+						if (i.toLowerCase() == "data") {
+							parObj.movie = attObj[i];
+						}
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							att += ' class="' + attObj[i] + '"';
+						}
+						else if (i.toLowerCase() != "classid") {
+							att += ' ' + i + '="' + attObj[i] + '"';
+						}
+					}
+				}
+				var par = "";
+				for (var j in parObj) {
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+					}
+				}
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+				r = getElementById(attObj.id);	
+			}
+			else { // well-behaving browsers
+				var o = createElement(OBJECT);
+				o.setAttribute("type", FLASH_MIME_TYPE);
+				for (var m in attObj) {
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							o.setAttribute("class", attObj[m]);
+						}
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+							o.setAttribute(m, attObj[m]);
+						}
+					}
+				}
+				for (var n in parObj) {
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+						createObjParam(o, n, parObj[n]);
+					}
+				}
+				el.parentNode.replaceChild(o, el);
+				r = o;
+			}
+		}
+		return r;
+	}
+	
+	function createObjParam(el, pName, pValue) {
+		var p = createElement("param");
+		p.setAttribute("name", pName);	
+		p.setAttribute("value", pValue);
+		el.appendChild(p);
+	}
+	
+	/* Cross-browser SWF removal
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
+	*/
+	function removeSWF(id) {
+		var obj = getElementById(id);
+		if (obj && obj.nodeName == "OBJECT") {
+			if (ua.ie && ua.win) {
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						removeObjectInIE(id);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			else {
+				obj.parentNode.removeChild(obj);
+			}
+		}
+	}
+	
+	function removeObjectInIE(id) {
+		var obj = getElementById(id);
+		if (obj) {
+			for (var i in obj) {
+				if (typeof obj[i] == "function") {
+					obj[i] = null;
+				}
+			}
+			obj.parentNode.removeChild(obj);
+		}
+	}
+	
+	/* Functions to optimize JavaScript compression
+	*/
+	function getElementById(id) {
+		var el = null;
+		try {
+			el = doc.getElementById(id);
+		}
+		catch (e) {}
+		return el;
+	}
+	
+	function createElement(el) {
+		return doc.createElement(el);
+	}
+	
+	/* Updated attachEvent function for Internet Explorer
+		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+	*/	
+	function addListener(target, eventType, fn) {
+		target.attachEvent(eventType, fn);
+		listenersArr[listenersArr.length] = [target, eventType, fn];
+	}
+	
+	/* Flash Player and SWF content version matching
+	*/
+	function hasPlayerVersion(rv) {
+		var pv = ua.pv, v = rv.split(".");
+		v[0] = parseInt(v[0], 10);
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+		v[2] = parseInt(v[2], 10) || 0;
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+	}
+	
+	/* Cross-browser dynamic CSS creation
+		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+	*/	
+	function createCSS(sel, decl, media, newStyle) {
+		if (ua.ie && ua.mac) { return; }
+		var h = doc.getElementsByTagName("head")[0];
+		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+		var m = (media && typeof media == "string") ? media : "screen";
+		if (newStyle) {
+			dynamicStylesheet = null;
+			dynamicStylesheetMedia = null;
+		}
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+			// create dynamic stylesheet + get a global reference to it
+			var s = createElement("style");
+			s.setAttribute("type", "text/css");
+			s.setAttribute("media", m);
+			dynamicStylesheet = h.appendChild(s);
+			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+			}
+			dynamicStylesheetMedia = m;
+		}
+		// add style rule
+		if (ua.ie && ua.win) {
+			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+				dynamicStylesheet.addRule(sel, decl);
+			}
+		}
+		else {
+			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+			}
+		}
+	}
+	
+	function setVisibility(id, isVisible) {
+		if (!autoHideShow) { return; }
+		var v = isVisible ? "visible" : "hidden";
+		if (isDomLoaded && getElementById(id)) {
+			getElementById(id).style.visibility = v;
+		}
+		else {
+			createCSS("#" + id, "visibility:" + v);
+		}
+	}
+
+	/* Filter to avoid XSS attacks
+	*/
+	function urlEncodeIfNecessary(s) {
+		var regex = /[\\\"<>\.;]/;
+		var hasBadChars = regex.exec(s) != null;
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+	}
+	
+	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+	*/
+	var cleanup = function() {
+		if (ua.ie && ua.win) {
+			window.attachEvent("onunload", function() {
+				// remove listeners to avoid memory leaks
+				var ll = listenersArr.length;
+				for (var i = 0; i < ll; i++) {
+					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+				}
+				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+				var il = objIdArr.length;
+				for (var j = 0; j < il; j++) {
+					removeSWF(objIdArr[j]);
+				}
+				// cleanup library's main closures to avoid memory leaks
+				for (var k in ua) {
+					ua[k] = null;
+				}
+				ua = null;
+				for (var l in swfobject) {
+					swfobject[l] = null;
+				}
+				swfobject = null;
+			});
+		}
+	}();
+	
+	return {
+		/* Public API
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
+		*/ 
+		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+			if (ua.w3 && objectIdStr && swfVersionStr) {
+				var regObj = {};
+				regObj.id = objectIdStr;
+				regObj.swfVersion = swfVersionStr;
+				regObj.expressInstall = xiSwfUrlStr;
+				regObj.callbackFn = callbackFn;
+				regObjArr[regObjArr.length] = regObj;
+				setVisibility(objectIdStr, false);
+			}
+			else if (callbackFn) {
+				callbackFn({success:false, id:objectIdStr});
+			}
+		},
+		
+		getObjectById: function(objectIdStr) {
+			if (ua.w3) {
+				return getObjectById(objectIdStr);
+			}
+		},
+		
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+			var callbackObj = {success:false, id:replaceElemIdStr};
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+				setVisibility(replaceElemIdStr, false);
+				addDomLoadEvent(function() {
+					widthStr += ""; // auto-convert to string
+					heightStr += "";
+					var att = {};
+					if (attObj && typeof attObj === OBJECT) {
+						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+							att[i] = attObj[i];
+						}
+					}
+					att.data = swfUrlStr;
+					att.width = widthStr;
+					att.height = heightStr;
+					var par = {}; 
+					if (parObj && typeof parObj === OBJECT) {
+						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+							par[j] = parObj[j];
+						}
+					}
+					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+							if (typeof par.flashvars != UNDEF) {
+								par.flashvars += "&" + k + "=" + flashvarsObj[k];
+							}
+							else {
+								par.flashvars = k + "=" + flashvarsObj[k];
+							}
+						}
+					}
+					if (hasPlayerVersion(swfVersionStr)) { // create SWF
+						var obj = createSWF(att, par, replaceElemIdStr);
+						if (att.id == replaceElemIdStr) {
+							setVisibility(replaceElemIdStr, true);
+						}
+						callbackObj.success = true;
+						callbackObj.ref = obj;
+					}
+					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+						att.data = xiSwfUrlStr;
+						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+						return;
+					}
+					else { // show alternative content
+						setVisibility(replaceElemIdStr, true);
+					}
+					if (callbackFn) { callbackFn(callbackObj); }
+				});
+			}
+			else if (callbackFn) { callbackFn(callbackObj);	}
+		},
+		
+		switchOffAutoHideShow: function() {
+			autoHideShow = false;
+		},
+		
+		ua: ua,
+		
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		},
+		
+		hasFlashPlayerVersion: hasPlayerVersion,
+		
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
+			if (ua.w3) {
+				return createSWF(attObj, parObj, replaceElemIdStr);
+			}
+			else {
+				return undefined;
+			}
+		},
+		
+		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+			if (ua.w3 && canExpressInstall()) {
+				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+			}
+		},
+		
+		removeSWF: function(objElemIdStr) {
+			if (ua.w3) {
+				removeSWF(objElemIdStr);
+			}
+		},
+		
+		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+			if (ua.w3) {
+				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+			}
+		},
+		
+		addDomLoadEvent: addDomLoadEvent,
+		
+		addLoadEvent: addLoadEvent,
+		
+		getQueryParamValue: function(param) {
+			var q = doc.location.search || doc.location.hash;
+			if (q) {
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+				if (param == null) {
+					return urlEncodeIfNecessary(q);
+				}
+				var pairs = q.split("&");
+				for (var i = 0; i < pairs.length; i++) {
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+					}
+				}
+			}
+			return "";
+		},
+		
+		// For internal usage only
+		expressInstallCallback: function() {
+			if (isExpressInstallActive) {
+				var obj = getElementById(EXPRESS_INSTALL_ID);
+				if (obj && storedAltContent) {
+					obj.parentNode.replaceChild(storedAltContent, obj);
+					if (storedAltContentId) {
+						setVisibility(storedAltContentId, true);
+						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+					}
+					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+				}
+				isExpressInstallActive = false;
+			} 
+		}
+	};
+}();

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/companymgr/src/BindableComboBox.as
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/src/BindableComboBox.as b/apps/samples-spring/WEB-INF/flex-src/companymgr/src/BindableComboBox.as
new file mode 100755
index 0000000..6749a38
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/src/BindableComboBox.as
@@ -0,0 +1,73 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 flash.events.Event;
+	
+	import mx.collections.IList;
+	import mx.events.CollectionEvent;
+	
+	import spark.components.ComboBox;
+	
+	public class BindableComboBox extends ComboBox
+	{
+		private var _value:Object;
+		
+		public var valueField:String = "data";
+		
+		public function set value(value:Object):void 
+		{
+			_value = value;
+			selectIndex();	
+		}
+		
+		public function get value():Object
+		{
+			return selectedItem[valueField];
+		}
+		
+		override public function set dataProvider(dataProvider:IList):void 
+		{
+			super.dataProvider = dataProvider;
+			dataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGE, 
+				function(event:Event):void
+				{
+					selectIndex();
+				});
+			selectIndex();
+		}
+		
+		private function selectIndex():void
+		{
+			if (!_value || !dataProvider)
+			{
+				return;
+			}
+			for (var i:int = 0; i < dataProvider.length; i++) 
+			{
+				if (_value == dataProvider[i][valueField])
+				{
+					selectedIndex = i;
+					return;
+				}
+			}
+		}
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/companymgr/src/Company.as
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/src/Company.as b/apps/samples-spring/WEB-INF/flex-src/companymgr/src/Company.as
new file mode 100755
index 0000000..234f2be
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/src/Company.as
@@ -0,0 +1,34 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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="org.springframework.flex.samples.company.Company")]
+	public class Company
+	{
+		public var id:int = -1;
+		public var name:String;
+		public var address:String;
+		public var city:String;
+		public var state:String;
+		public var zip:String;
+		public var phone:String;
+		public var industry:Industry;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/companymgr/src/CompanyEvent.as
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/src/CompanyEvent.as b/apps/samples-spring/WEB-INF/flex-src/companymgr/src/CompanyEvent.as
new file mode 100755
index 0000000..c1157ae
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/src/CompanyEvent.as
@@ -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
+{
+	import flash.events.Event;
+
+	public class CompanyEvent extends Event
+	{
+		public static const CREATED:String = "companyCreated";
+		public static const UPDATED:String = "companyUpdated";
+		public static const DELETED:String = "companyDeleted";
+	
+		public var company:Company;
+		
+		public function CompanyEvent(type:String, company:Company, bubbles:Boolean = true, cancelable:Boolean = false)
+   		{
+   			this.company = company;
+			super(type, bubbles, cancelable);
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/companymgr/src/CompanyForm.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/src/CompanyForm.mxml b/apps/samples-spring/WEB-INF/flex-src/companymgr/src/CompanyForm.mxml
new file mode 100755
index 0000000..e3b4bb8
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/src/CompanyForm.mxml
@@ -0,0 +1,156 @@
+<?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:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		   xmlns:s="library://ns.adobe.com/flex/spark" 
+		   xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"
+		   label="{company.id>-1?company.name:'New Company'}" xmlns:local="*">
+
+	<fx:Metadata>
+        [Event(name="companyCreated", type="CompanyEvent")]
+        [Event(name="companyUpdated", type="CompanyEvent")]
+        [Event(name="companyDeleted", type="CompanyEvent")]
+    </fx:Metadata>
+	
+	<fx:Script>
+		<![CDATA[
+
+		import mx.collections.ArrayCollection;
+		import mx.controls.Alert;
+		import mx.rpc.Fault;
+		import mx.rpc.events.FaultEvent;
+		import mx.rpc.events.ResultEvent;
+		
+		[Bindable] public var company:Company;
+		[Bindable] public var industries:ArrayCollection;
+
+		private function save():void
+		{
+			company.name = companyName.text;
+			company.address = address.text;
+			company.city = city.text;
+			company.state = state.text;
+			company.zip = zip.text;
+			company.phone = phone.text;
+			company.industry = industry.selectedItem as Industry;
+			if (company.industry == null)
+			{
+				Alert.show("Please enter/choose an industry from the dropdown for the operation to be successful.", "Save Company");
+			}
+			else
+			{
+				if (company.id == -1)
+				{
+					ro.create(company);	
+				}
+				else
+				{
+					ro.update(company);
+				}
+		        }
+		}
+		private function deleteItem():void
+		{
+			ro.remove(company);		
+		}
+			
+		private function closeItem():void
+		{
+			parent.removeChild(this);
+		}
+			
+		private function create_resultHandler(event:ResultEvent):void
+		{
+			company.id = event.result.id;
+			dispatchEvent(new CompanyEvent(CompanyEvent.CREATED, company));			
+		}
+
+		private function update_resultHandler(event:ResultEvent):void
+		{
+			dispatchEvent(new CompanyEvent(CompanyEvent.UPDATED, company));			
+		}
+
+		private function remove_resultHandler(event:ResultEvent):void
+		{
+			dispatchEvent(new CompanyEvent(CompanyEvent.DELETED, company));			
+		}
+			
+		private function remove_faultHandler(event:FaultEvent):void
+		{
+				if (event.fault.faultCode == "Server.ResourceUnavailable")
+				{
+					Alert.show("This is not allowed, as the 'remove(Company company)' method in the CompanyDAO class is excluded from remoting. To allow deletion, change the annotation on method to @RemotingInclude and try again.",
+						"Delete Company");
+				}
+				else
+				{
+					Alert.show(event.fault.faultDetail);
+				}
+		}
+			
+		private function faultHandler(event:FaultEvent):void
+		{
+			Alert.show(event.fault.faultDetail);
+		}
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<s:RemoteObject id="ro" destination="companyService" endpoint="{&apos;http://{server.name}:{server.port}/samples-spring/messagebroker/amf&apos;}">
+		<s:method name="create" result="create_resultHandler(event)"/>
+		<s:method name="update" result="update_resultHandler(event)"/>
+		<s:method name="remove" result="remove_resultHandler(event)" fault="remove_faultHandler(event)"/>
+		</s:RemoteObject>
+	</fx:Declarations>
+	
+	<mx:Form>
+		<mx:FormItem label="Id">
+			<s:TextInput text="{company.id}" enabled="false"/>
+		</mx:FormItem>
+		<mx:FormItem label="Name">
+			<s:TextInput id="companyName" text="{company.name}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Industry">
+			<local:BindableComboBox id="industry" dataProvider="{industries}" labelField="name" valueField="id" value="{company.industry.id}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Address">
+			<s:TextInput id="address" text="{company.address}"/>
+		</mx:FormItem>
+		<mx:FormItem label="City">
+			<s:TextInput id="city" text="{company.city}"/>
+		</mx:FormItem>
+		<mx:FormItem label="State">
+			<s:TextInput id="state" text="{company.state}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Zip">
+			<s:TextInput id="zip" text="{company.zip}"/>
+		</mx:FormItem>
+		<mx:FormItem label="Phone">
+			<s:TextInput id="phone" text="{company.phone}"/>
+		</mx:FormItem>
+	</mx:Form>
+
+	<s:HGroup left="8" bottom="8">
+		<s:Button label="Close" click="closeItem()"/>
+		<s:Button label="Save" click="save()"/>
+		<s:Button label="Delete" click="deleteItem()"/>
+	</s:HGroup>
+	
+</mx:Canvas>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/companymgr/src/Industry.as
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/src/Industry.as b/apps/samples-spring/WEB-INF/flex-src/companymgr/src/Industry.as
new file mode 100755
index 0000000..a126d4c
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/src/Industry.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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="org.springframework.flex.samples.industry.Industry")]
+	public class Industry
+	{
+		public var id:int;
+		public var name:String;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/companymgr/src/companymgr.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/companymgr/src/companymgr.mxml b/apps/samples-spring/WEB-INF/flex-src/companymgr/src/companymgr.mxml
new file mode 100755
index 0000000..d6d1fcf
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/companymgr/src/companymgr.mxml
@@ -0,0 +1,130 @@
+<?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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
+			   applicationComplete="init()">
+	
+	<fx:Script>
+		<![CDATA[
+
+			import mx.rpc.events.FaultEvent;
+			import mx.controls.Alert;
+			import mx.collections.ArrayCollection;
+			import mx.rpc.events.ResultEvent;
+			
+			[Bindable] private var companies:ArrayCollection;
+			[Bindable] private var industries:ArrayCollection;
+			
+			private function init():void
+			{
+				roIndustry.findAll();
+			}
+			
+			private function company_findByName_resultHandler(event:ResultEvent):void
+			{
+				companies = event.result as ArrayCollection
+			}
+			
+			private function industry_findAll_resultHandler(event:ResultEvent):void
+			{
+				industries = event.result as ArrayCollection
+			}
+			
+			private function faultHandler(event:FaultEvent):void
+			{
+				Alert.show(event.fault.faultDetail);
+			}
+			
+			public function openCompany(company:Company):void
+			{
+				var children:Array = tn.getChildren();
+				for (var i:int = 0; i<children.length; i++)
+				{
+					if (CompanyForm(children[i]).company.id == company.id)
+					{
+						tn.selectedChild = children[i];
+						return;
+					}
+				}
+				
+				var form:CompanyForm = new CompanyForm();
+				form.addEventListener(CompanyEvent.CREATED, companyCreatedHandler);
+				form.addEventListener(CompanyEvent.UPDATED, companyUpdatedHandler);
+				form.addEventListener(CompanyEvent.DELETED, companyDeletedHandler);
+				tn.addChild(form);
+				form.company = company;
+				form.industries = industries;
+				tn.selectedChild = form;
+			}
+			
+			private function search():void
+			{
+				roCompany.findByName(searchStr.text);
+			}
+			
+			private function companyCreatedHandler(event:CompanyEvent):void
+			{
+				search();				
+			}
+			
+			private function companyUpdatedHandler(event:CompanyEvent):void
+			{
+				search();				
+			}
+			
+			private function companyDeletedHandler(event:CompanyEvent):void
+			{
+				tn.removeChild(event.target as CompanyForm);
+				search();				
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<s:RemoteObject id="roCompany" destination="companyService" endpoint="{&apos;http://{server.name}:{server.port}/samples-spring/messagebroker/amf&apos;}">
+			<s:method name="findByName" result="company_findByName_resultHandler(event)"/>
+		</s:RemoteObject>
+		
+		<s:RemoteObject id="roIndustry" destination="industryService" endpoint="{&apos;http://{server.name}:{server.port}/samples-spring/messagebroker/amf&apos;}">
+			<s:method name="findAll" result="industry_findAll_resultHandler(event)"/>
+		</s:RemoteObject>
+	</fx:Declarations>
+
+	<s:controlBarContent>
+		<s:TextInput id="searchStr"/>
+		<s:Button label="Search" click="search()"/>
+		<s:Button label="New Company" click="openCompany(new Company())"/>
+	</s:controlBarContent>
+
+	<mx:HDividedBox top="8" bottom="8" left="8" right="8">
+		<mx:DataGrid id="dg" dataProvider="{companies}" width="30%" height="100%"
+					 doubleClickEnabled="{dg.selectedItem != null}"
+					 doubleClick="openCompany(dg.selectedItem as Company)">
+			<mx:columns>
+				<mx:DataGridColumn dataField="name" headerText="Name"/>
+				<mx:DataGridColumn dataField="city" headerText="City"/>
+			</mx:columns>
+		</mx:DataGrid>
+		<mx:TabNavigator id="tn" width="70%" height="100%"/>
+	</mx:HDividedBox>
+	
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/feedstarter/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/feedstarter/.actionScriptProperties b/apps/samples-spring/WEB-INF/flex-src/feedstarter/.actionScriptProperties
new file mode 100755
index 0000000..07db27c
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/feedstarter/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="feedstarter.mxml" projectUUID="41a33f5d-7732-4b6b-a1c2-dac03458be92" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="feedstarter.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/feedstarter/.flexProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/feedstarter/.flexProperties b/apps/samples-spring/WEB-INF/flex-src/feedstarter/.flexProperties
new file mode 100755
index 0000000..1d99468
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/feedstarter/.flexProperties
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>


[19/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/frameworks/local-swcs/readme.txt
----------------------------------------------------------------------
diff --git a/frameworks/local-swcs/readme.txt b/frameworks/local-swcs/readme.txt
new file mode 100755
index 0000000..e78fc84
--- /dev/null
+++ b/frameworks/local-swcs/readme.txt
@@ -0,0 +1,36 @@
+Check in "local" swcs to the FlexSDK3 or FledSDK4 directory that is under this directory to 
+override any "accepted" swcs with a matching name in the /enterprise/frameworks/libs directory 
+as part of an enterprise build.
+
+SWCs that were compiled against Flex SDK 3 should go in the FlexSDK3 directory and SWCs that were 
+compiled against Flex SDK 4 should go in the FlexSDK4 directory. Ideally, if you are checking in a 
+"local" version of the SWC, it should be compiled against both Flex SDK 3 and Flex SDK 4 so the "local"
+version will be used when LCDS is built with both Flex SDK 3 and Flex SDK 4. 
+
+To enable this override, set the "use.local.swcs" property in the /enterprise/build.properties 
+file to true.
+
+The build process unpacks the contents of /resources/flex_sdk/flex_sdk_3.zip into the
+frameworks/libs directory as part of a build, but some of your changes may be part of 
+rpc.swc in which case you'll need to use a current rpc.swc built from SDK 
+mainline for the enterprise build rather than the currently approved rpc.swc in the 
+flex_sdk_3.zip or flex_sdk_4.zip files.
+
+While rpc.swc will be the most common swc that this use case applies to, you can override any
+of the currently approved swcs by placing your updated version in the frameworks/local-swcs/
+directory (or an appropriate sub-directory). Your frameworks/local-swcs/ directory and 
+subdirectories need to be symmetrical to the /frameworks/libs directory structure so that the 
+overlay process overwrites the proper files. If any local swcs are present in perforce when you 
+get to this point, open them for delete, add only the swcs that you need to override for your 
+specific changelist and proceed.
+
+After rebuilding and running checkintests with your updated local swcs, submit your changelist
+containing your changes to rpc code in SDK mainline along with your changes to fds code in
+enterprise mainline as well as your local swc override(s) in the /local-swcs/ directory and the
+build.properties file with use.local.swcs=true.
+
+This will allow the build to run and complete successfully on the build machine.
+
+Approval builds will always revert the "use.local.swcs" property to false and will build using 
+an approved set of swcs (that will pick up the changes you've now committed for non-enterprise 
+swcs).
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/kick-build.txt
----------------------------------------------------------------------
diff --git a/kick-build.txt b/kick-build.txt
new file mode 100755
index 0000000..6913810
--- /dev/null
+++ b/kick-build.txt
@@ -0,0 +1,2 @@
+Kick it me one more time
+

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/build.xml
----------------------------------------------------------------------
diff --git a/modules/common/build.xml b/modules/common/build.xml
new file mode 100755
index 0000000..0f3e4ec
--- /dev/null
+++ b/modules/common/build.xml
@@ -0,0 +1,97 @@
+<?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="modules/common/build.xml" default="main" basedir="../..">
+
+    <!-- properties -->
+    <property file="${basedir}/build.properties"/>
+    <property name="module.dir" value="${basedir}/modules/common"/>
+
+    <property name="lib.dir" value="${basedir}/lib"/>
+    <property name="module.lib.dir" location="${module.dir}/lib"/>
+    <property name="module.src" value="${module.dir}/src"/>
+    <property name="module.classes" value="${module.dir}/classes"/>
+    <property name="module.jar" value="${lib.dir}/flex-messaging-common.jar"/>
+
+    <property name="build.number" value=""/>
+    
+    <!-- j2ee apis required to compile -->
+    <path id="classpath">
+        <fileset dir="${lib.dir}" includes="**/*.jar"/>
+    </path>
+
+     <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
+
+    <target name="main" depends="clean,prepare,run-depend,jar" description="cleans and runs the full build"/>
+
+    <target name="prepare">
+        <echo>${ant.file}</echo>
+        <mkdir dir="${lib.dir}"/>
+        <mkdir dir="${module.classes}"/>
+    </target>
+
+    <target name="run-depend" if="src.depend">
+        <echo message="Removing class files that changed and dependent class files."/>
+        <depend cache="${module.classes}" srcdir="${module.src}" destdir="${module.classes}"/>
+    </target>
+
+    <target name="compile" depends="prepare" description="compile">
+        <javac target="1.4" source="1.4" debug="${src.debug}" destdir="${module.classes}" srcdir="${module.src}"
+            includes="**/*.java" classpathref="classpath"/>
+        <echo file="${module.classes}/flex/messaging/version.properties" append="false">build=${build.number}</echo> 
+    </target>
+                
+    <!-- jar containing messaging common infrastructure -->
+    <target name="jar" depends="compile">
+
+        <copy todir="${module.classes}/flex/messaging" overwrite="true">
+            <fileset dir="${module.src}/flex/messaging" includes="*.properties"/>
+        </copy>
+
+        <jar destfile="${module.jar}" basedir="${module.classes}">
+            <include name="flex/**"/>
+            <exclude name=".dependency-info/**"/>
+        	<manifest>
+        		<attribute name="Sealed" value="${manifest.sealed}"/>
+        		<attribute name="Implementation-Title" value="${manifest.Implementation-Title} - Common Library"/>
+			    <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}"/> 
+			    <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/>
+        	</manifest>
+        </jar>
+    	
+        <delete failonerror="false">
+            <fileset dir="${module.classes}/flex/messaging" includes="*.properties"/>
+        </delete>
+
+    </target>
+
+    <target name="clean" description="clean">
+        <delete file="${module.jar}" failonerror="false"/>
+        <delete failonerror="false" includeEmptyDirs="true">
+            <fileset dir="${module.classes}">
+                <include name="**/*"/>
+                <exclude name="dependencies.txt"/>
+                <exclude name=".dependency-info/**"/>
+            </fileset>
+        </delete>
+        <delete quiet="true" dir="${module.classes}"/>
+
+    </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/pom.xml
----------------------------------------------------------------------
diff --git a/modules/common/pom.xml b/modules/common/pom.xml
new file mode 100755
index 0000000..3d009ab
--- /dev/null
+++ b/modules/common/pom.xml
@@ -0,0 +1,54 @@
+<!--
+
+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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>com.adobe.blazeds</groupId>
+		<artifactId>blazeds</artifactId>
+		<version>4.5.0.0-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+	<name>${project.artifactId}</name>
+	<description>${project.groupId} ${project.artifactId}</description>
+
+	<artifactId>flex-messaging-common</artifactId>
+
+	<dependencies>
+		<dependency>
+			<groupId>xalan</groupId>
+			<artifactId>xalan</artifactId>
+			<version>2.6.0</version>
+		</dependency>
+
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>3.8.2</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<finalName>flex-messaging-common</finalName>
+		<sourceDirectory>src</sourceDirectory>
+		<testSourceDirectory>test/src</testSourceDirectory>
+	</build>
+</project>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/graphics/ImageSnapshot.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/graphics/ImageSnapshot.java b/modules/common/src/flex/graphics/ImageSnapshot.java
new file mode 100755
index 0000000..cc4498a
--- /dev/null
+++ b/modules/common/src/flex/graphics/ImageSnapshot.java
@@ -0,0 +1,147 @@
+/*
+ * 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.graphics;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * This class corresponds to mx.graphics.ImageSnapshot on the client.  Clients may choose
+ * to capture images and send them to the server via a RemoteObject call.  The PDF generation 
+ * feature of LCDS may then be used to generate PDF's from these images.  
+ *
+ */
+public class ImageSnapshot extends HashMap
+{
+    private static final long serialVersionUID = 7914317354403674061L;
+
+    /**
+     * Default constructor.
+     */
+    public ImageSnapshot()
+    {
+    }
+
+    private Map properties;
+    private String contentType;
+    private byte[] data;
+    private int height;
+    private int width;
+
+    /**
+     * The content type for the image encoding format that was used to capture
+     * this snapshot.
+     * 
+     * @return content type of this image
+     */
+    public String getContentType()
+    {
+        return contentType;
+    }
+
+    /**
+     * Sets content type of this snapshot.
+     * 
+     * @param value content type
+     */
+    public void setContentType(String value)
+    {
+        contentType = value;
+    }
+
+    /**
+     * The encoded data representing the image snapshot.
+     * 
+     * @return encoded image data
+     */
+    public byte[] getData()
+    {
+        return data;
+    }
+
+    /**
+     * Set the encoded data representing the image snapshot.
+     * 
+     * @param value byte array of image data
+     */
+    public void setData(byte[] value)
+    {
+        data = value;
+    }
+
+    /**
+     * The image height in pixels.
+     * 
+     * @return image height in pixels
+     */
+    public int getHeight()
+    {
+        return height;
+    }
+
+    /**
+     * Set image height in pixels.
+     * 
+     * @param value image height in pixels.
+     */
+    public void setHeight(int value)
+    {
+        height = value;
+    }
+
+    /**
+     * Additional properties of the image.
+     * 
+     * @return a map containing the dynamically set properties on this snapshot
+     */
+    public Map getProperties()
+    {
+        return properties;
+    }
+
+    /**
+     * Sets the map of dynamic properties for this snapshot.
+     * 
+     * @param value map containing dynamic properties for this snapshot
+     */
+    public void setProperties(Map value)
+    {
+        properties = value;
+    }
+
+    /**
+     * The image width in pixels.
+     * 
+     * @return width in pixels
+     */
+    public int getWidth()
+    {
+        return width;
+    }
+
+    /**
+     * Set width in pixels.
+     * 
+     * @param value width in pixels.
+     */
+    public void setWidth(int value)
+    {
+        width = value;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/graphics/package-info.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/graphics/package-info.java b/modules/common/src/flex/graphics/package-info.java
new file mode 100755
index 0000000..dcec8c8
--- /dev/null
+++ b/modules/common/src/flex/graphics/package-info.java
@@ -0,0 +1,18 @@
+/*
+ * 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.graphics;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/LocalizedException.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/LocalizedException.java b/modules/common/src/flex/messaging/LocalizedException.java
new file mode 100755
index 0000000..d1967d3
--- /dev/null
+++ b/modules/common/src/flex/messaging/LocalizedException.java
@@ -0,0 +1,379 @@
+/*
+ * 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.messaging;
+
+import java.util.Locale;
+
+import flex.messaging.util.PropertyStringResourceLoader;
+import flex.messaging.util.ResourceLoader;
+
+/**
+ * The LocalizedException class is the base class for server
+ * exceptions that use localized error message and details strings. This class overloads
+ * <code>setMessage</code> and <code>setDetails</code> to support passing an error
+ * number and an optional message variant that is used to look up a localized error
+ * message or details string using a <code>ResourceLoader</code>. These methods also
+ * set the number property of the exception instance.
+ * <p>
+ * The various overloads optionally support specifying a target locale as well as
+ * arguments to substitute into the localized string if it is parameterized.
+ * </p><p>
+ * Localized error message and details strings are stored in the flex.messaging.errors
+ * resource bundle. Entries must have the following format.
+ * <ul>
+ *  <li>Error message: {number}[-{variant}]={message}</li>
+ *  <li>Error details: {number}[-{variant}]-details={details}</li>
+ * </ul>
+ * </p>
+ *
+ * @see ResourceLoader
+ */
+public class LocalizedException extends RuntimeException
+{
+    /** @exclude - transient, the resourceLoader for localized strings doesn't need to serialize.  */
+    protected transient ResourceLoader resourceLoader;
+    /** @exclude */
+    protected int number;
+    /** @exclude */
+    protected String message;
+    /** @exclude */
+    protected String details;
+    /** @exclude */
+    protected Throwable rootCause;
+
+    /**
+     * This number was generated using the 'serialver' command line tool.
+     * This number should remain consistent with the version used by
+     * ColdFusion to communicate with the message broker over RMI.
+     */
+    private static final long serialVersionUID = 7980539484335065853L;
+
+    /**
+     * Create a LocalizedException with the default ResourceLoader.
+     */
+    public LocalizedException()
+    {
+        super();
+    }
+
+    /**
+     * Create a LocalizedException that will use the specified
+     * ResourceLoader.
+     *
+     * @param resourceLoader The resource loader to use.
+     */
+    public LocalizedException(ResourceLoader resourceLoader)
+    {
+        this.resourceLoader = resourceLoader;
+    }
+
+    /**
+     * Returns the exception details.
+     *
+     * @return The exception details.
+     */
+    public String getDetails()
+    {
+        return details;
+    }
+
+    /**
+     * Sets the exception details.
+     *
+     * @param details The exception details.
+     */
+    public void setDetails(String details)
+    {
+        this.details = details;
+    }
+
+    /**
+     * Sets the message property to a localized string based on error number.
+     *
+     * @param number The error number for this exception instance.
+     */
+    public void setMessage(int number)
+    {
+        setMessage(number, null, null, null);
+    }
+
+    /**
+     * Sets the message property to a localized string based on error number and target locale.
+     *
+     * @param number The error number for this exception instance.
+     * @param locale The target locale for error message lookup.
+     */
+    public void setMessage(int number, Locale locale)
+    {
+        setMessage(number, null, locale, null);
+    }
+
+    /**
+     * Sets the message property to a localized string based on error number.
+     * The passed arguments are substituted into the parameterized error message string.
+     *
+     * @param number The error number for this exception instance.
+     * @param arguments The arguments to substitute into the error message.
+     */
+    public void setMessage(int number, Object[] arguments)
+    {
+        setMessage(number, null, null, arguments);
+    }
+
+    /**
+     * Sets the message property to a localized string based on error number and variant.
+     *
+     * @param number The error number for this exception instance.
+     * @param variant The variant of the error message for this instance.
+     */
+    public void setMessage(int number, String variant)
+    {
+        setMessage(number, variant, null, null);
+    }
+
+    /**
+     * Sets the message property to a localized string based on error number, variant
+     * and target locale.
+     *
+     * @param number The error number for this exception instance.
+     * @param variant The variant of the error message for this instance.
+     * @param locale The target locale for error message lookup.
+     */
+    public void setMessage(int number, String variant, Locale locale)
+    {
+        setMessage(number, variant, locale, null);
+    }
+
+    /**
+     * Sets the message property to a localized string based on error number and variant.
+     * The passed arguments are substituted into the parameterized error message string.
+     *
+     * @param number The error number for this exception instance.
+     * @param variant The varient of the error message for this instance.
+     * @param arguments The arguments to substitute into the error message.
+     */
+    public void setMessage(int number, String variant, Object[] arguments)
+    {
+        setMessage(number, variant, null, arguments);
+    }
+
+    /**
+     * Sets the message property to a localized string based on error number, variant and
+     * target locale. The passed arguments are substituted into the parameterized error
+     * message string.
+     *
+     * @param number The error number for this exception instance.
+     * @param variant The variant of the error message for this instance.
+     * @param locale The target locale for error message lookup.
+     * @param arguments The arguments to substitute into the error message.
+     */
+    public void setMessage(int number, String variant, Locale locale, Object[] arguments)
+    {
+        setNumber(number);
+        ResourceLoader resources = getResourceLoader();
+        setMessage(resources.getString(generateFullKey(number, variant), locale, arguments));
+    }
+
+    /**
+     * Returns the exception message.
+     *
+     * @return The exception message.
+     */
+    public String getMessage()
+    {
+        return message;
+    }
+
+    /**
+     * Sets the exception message.
+     *
+     * @param message The exception message.
+     */
+    public void setMessage(String message)
+    {
+        this.message = message;
+    }
+
+    /**
+     * Sets the localized exception number.
+     *
+     * @param number The localized exception number.
+     */
+    public void setNumber(int number)
+    {
+        this.number = number;
+    }
+
+    /**
+     * Returns the localized exception number.
+     *
+     * @return The localized exception number.
+     */
+    public int getNumber()
+    {
+        return number;
+    }
+
+    /**
+     * Sets the details property to a localized string based on error number.
+     *
+     * @param number The error number to lookup details for.
+     */
+    public void setDetails(int number)
+    {
+        setDetails(number, null, null, null);
+    }
+
+    /**
+     * Sets the details property to a localized string based on error number and variant.
+     *
+     * @param number The error number to lookup details for.
+     * @param variant The variant of the details string to lookup.
+     */
+    public void setDetails(int number, String variant)
+    {
+        setDetails(number, variant, null, null);
+    }
+
+    /**
+     * Sets the details property to a localized string based on error number, variant
+     * and target locale.
+     *
+     * @param number The error number to lookup details for.
+     * @param variant The variant of the details string to lookup.
+     * @param locale The target locale for the lookup.
+     */
+    public void setDetails(int number, String variant, Locale locale)
+    {
+        setDetails(number, variant, locale, null);
+    }
+
+    /**
+     * Sets the details property to a localized string based on error number and variant.
+     * The passed arguments are substituted into the parameterized error details string.
+     *
+     * @param number The error number to lookup details for.
+     * @param variant The variant of the details string to lookup.
+     * @param arguments The arguments to substitute into the details string.
+     */
+    public void setDetails(int number, String variant, Object[] arguments)
+    {
+        setDetails(number, variant, null, arguments);
+    }
+
+
+    /**
+     * Sets the details property to a localized string based on error number, variant,
+     * and target locale. The passed arguments are substituted into the parameterized error
+     * details string.
+     *
+     * @param number The error number to lookup a localized details string for.
+     * @param variant The variant of the details string to lookup.
+     * @param locale The target locale for the lookup.
+     * @param arguments The arguments to substitute into the details string.
+     */
+    public void setDetails(int number, String variant, Locale locale, Object[] arguments)
+    {
+        setNumber(number);
+        ResourceLoader resources = getResourceLoader();
+        setDetails(resources.getString(generateDetailsKey(number, variant), locale, arguments));
+    }
+
+    /**
+     * Returns the root cause for this exception.
+     *
+     * @return The root cause for this exception.
+     */
+    public Throwable getRootCause()
+    {
+        return rootCause;
+    }
+
+    /**
+     * Sets the root cause for this exception.
+     *
+     * @param cause The root cause for this exception.
+     */
+    public void setRootCause(Throwable cause)
+    {        
+        rootCause = cause;
+        // Assign through to the base cause property to include it in general stack traces.
+        initCause(cause);
+    }
+
+    /**
+     * Returns the <code>ResourceLoader</code> used to load localized strings.
+     *
+     * @return The <code>ResourceLoader</code> used to load localized strings.
+     */
+    protected ResourceLoader getResourceLoader()
+    {
+        if (resourceLoader == null)
+            resourceLoader = new PropertyStringResourceLoader();
+
+        return resourceLoader;
+    }
+
+    /**
+     * Generates the full key to lookup a localized error message based on an error number
+     * and an optional variant followed by a "-details" suffix. If the variant is null, the
+     * lookup key is the error number.
+     *
+     * @param number The error number.
+     * @param variant The variant of the error message.
+     * @return The full lookup key for a localized error message.
+     */
+    private String generateFullKey(int number, String variant)
+    {
+        return (variant != null) ? (number + "-" + variant) : String.valueOf(number);
+    }
+
+    /**
+     * Generates the full key to lookup a localized details string based on an error number
+     * and an optional variant followed by a "-details" suffix. If the variant is null, the
+     * lookup key is the error number followed by a "-details" suffix.
+     *
+     * @param number The error number.
+     * @param variant The variant of the details message.
+     * @return The full lookup key for a localized details message.
+     */
+    private String generateDetailsKey(int number, String variant)
+    {
+        return (generateFullKey(number, variant) + "-details");
+    }
+
+    /**
+     * Returns a string represenation of the exception.
+     *
+     * @return A string representation of the exception.
+     */
+    public String toString()
+    {
+        String result = super.toString();
+        if (details != null)
+        {
+            StringBuffer buffer = new StringBuffer(result);
+            if (!result.endsWith("."))
+            {
+                buffer.append(".");
+            }
+            buffer.append(' ').append(details);
+            result = buffer.toString();
+        }
+        return result;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/AbstractConfigurationParser.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/AbstractConfigurationParser.java b/modules/common/src/flex/messaging/config/AbstractConfigurationParser.java
new file mode 100755
index 0000000..98fcfce
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/AbstractConfigurationParser.java
@@ -0,0 +1,559 @@
+/*
+ * 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.messaging.config;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+import flex.messaging.util.FileUtils;
+
+/**
+ * Provides a common base for DOM / XPath based ConfigurationParsers.
+ *
+ * @author Peter Farland
+ * @exclude
+ */
+public abstract class AbstractConfigurationParser implements ConfigurationParser, ConfigurationConstants, EntityResolver
+{
+    protected ServicesConfiguration config;
+    protected DocumentBuilder docBuilder;
+    protected ConfigurationFileResolver fileResolver;
+    protected TokenReplacer tokenReplacer;
+
+    private Map fileByDocument = new HashMap();
+
+    protected AbstractConfigurationParser()
+    {
+        initializeDocumentBuilder();
+        tokenReplacer = new TokenReplacer();
+    }
+
+    /**
+     * Parse the configurations in the configuration file.
+     * <p/>
+     * @param path the configuration file path
+     * @param fileResolver the ConfigurationFileResolver object
+     * @param config the ServicesConfiguration object
+     **/
+    public void parse(String path, ConfigurationFileResolver fileResolver, ServicesConfiguration config)
+    {
+        this.config = config;
+        this.fileResolver = fileResolver;
+        Document doc = loadDocument(path, fileResolver.getConfigurationFile(path));
+        initializeExpressionQuery();
+        parseTopLevelConfig(doc);
+    }
+
+    /**
+     * Report Tokens.
+     * <p/> 
+     **/
+    public void reportTokens()
+    {
+        tokenReplacer.reportTokens();
+    }
+
+    protected void initializeDocumentBuilder()
+    {
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        factory.setIgnoringComments(true);
+        factory.setIgnoringElementContentWhitespace(true);
+
+        try
+        {
+            docBuilder = factory.newDocumentBuilder();
+            docBuilder.setEntityResolver(this);
+        }
+        catch (ParserConfigurationException ex)
+        {
+            // Error initializing configuration parser.
+            ConfigurationException e = new ConfigurationException();
+            e.setMessage(PARSER_INIT_ERROR);
+            e.setRootCause(ex);
+            throw e;
+        }
+    }
+
+    protected Document loadDocument(String path, InputStream in)
+    {
+        try
+        {
+            Document doc;
+
+            if (!in.markSupported())
+                in = new BufferedInputStream(in);
+
+            // Consume UTF-8 Byte Order Mark (BOM). The InputStream must support mark()
+            // as FileUtils.consumeBOM sets a mark for 3 bytes in order to check for a BOM.
+            String encoding = FileUtils.consumeBOM(in, null);
+            if (FileUtils.UTF_8.equals(encoding) || FileUtils.UTF_16.equals(encoding))
+            {
+                InputSource inputSource = new InputSource(in);
+                inputSource.setEncoding(encoding);
+                doc = docBuilder.parse(inputSource);
+            }
+            else
+            {
+                doc = docBuilder.parse(in);
+            }
+
+            addFileByDocument(path, doc);
+            doc.getDocumentElement().normalize();
+            return doc;
+        }
+        catch (SAXParseException ex)
+        {
+            Integer line = new Integer(ex.getLineNumber());
+            Integer col = new Integer(ex.getColumnNumber());
+            String message = ex.getMessage();
+
+            // Configuration error on line {line}, column {col}:  '{message}'
+            ConfigurationException e = new ConfigurationException();
+            e.setMessage(XML_PARSER_ERROR, new Object[]{line, col, message});
+            e.setRootCause(ex);
+            throw e;
+        }
+        catch (SAXException ex)
+        {
+            ConfigurationException e = new ConfigurationException();
+            e.setMessage(ex.getMessage());
+            e.setRootCause(ex);
+            throw e;
+        }
+        catch (IOException ex)
+        {
+            ConfigurationException e = new ConfigurationException();
+            e.setMessage(ex.getMessage());
+            e.setRootCause(ex);
+            throw e;
+        }
+    }
+
+    protected void addFileByDocument(String path, Node node)
+    {
+        String shortPath = path;
+        if (shortPath != null && ((shortPath.indexOf('/') != -1) || (shortPath.indexOf("\\") != -1)) )
+        {
+            int start = 0;
+            start = shortPath.lastIndexOf('/');
+            if (start == -1)
+            {
+                start = shortPath.lastIndexOf("\\");
+            }
+            shortPath = path.substring(start + 1);
+        }
+        fileByDocument.put(node, shortPath);
+    }
+
+    protected String getSourceFileOf(Node node)
+    {
+        return (String)fileByDocument.get(node.getOwnerDocument());
+    }
+
+    protected abstract void parseTopLevelConfig(Document doc);
+
+    protected abstract void initializeExpressionQuery();
+    protected abstract Node selectSingleNode(Node source, String expression);
+    protected abstract NodeList selectNodeList(Node source, String expression);
+    protected abstract Object evaluateExpression(Node source, String expression);
+
+    /**
+     * Recursively processes all child elements for each of the properties in the provided
+     * node list.
+     * <p>
+     * If a property is a simple element with a text value then it is stored as a String
+     * using the element name as the property name. If the same element appears again then
+     * the element is converted to a List of values and further occurences are simply added
+     * to the List.
+     * </p>
+     * <p>
+     * If a property element has child elements the children are recursively processed
+     * and added as a Map.
+     * </p>
+     * <p>
+     * The sourceFileName argument is used as a parameter for token replacement in order
+     * to generate a meaningful error message when a token is failed to be replaced.
+     * </p>
+     * @param properties the NodeList object
+     * @return ConfigMap the ConfigMap object
+     */
+    public ConfigMap properties(NodeList properties)
+    {
+        return properties(properties, ConfigurationConstants.UNKNOWN_SOURCE_FILE);
+    }
+
+    /**
+     * Recursively processes all child elements for each of the properties in the provided
+     * node list.
+     * <p/>
+     * @param properties the NodeList object
+     * @param sourceFileName the source file name
+     * @return ConfigMap the ConfigMap object
+     */
+    public ConfigMap properties(NodeList properties, String sourceFileName)
+    {
+        int length = properties.getLength();
+        ConfigMap map = new ConfigMap(length);
+
+        for (int p = 0; p < length; p++)
+        {
+            Node prop = properties.item(p);
+            String propName = prop.getNodeName();
+
+            if (propName != null)
+            {
+                propName = propName.trim();
+                if (prop.getNodeType() == Node.ELEMENT_NODE)
+                {
+                    NodeList attributes = selectNodeList(prop, "@*");
+                    NodeList children = selectNodeList(prop, "*");
+                    if (children.getLength() > 0 || attributes.getLength() > 0)
+                    {
+                        ConfigMap childMap = new ConfigMap();
+
+                        if (children.getLength() > 0)
+                            childMap.addProperties(properties(children, sourceFileName));
+
+                        if (attributes.getLength() > 0)
+                            childMap.addProperties(properties(attributes, sourceFileName));
+
+                        map.addProperty(propName, childMap);
+                    }
+                    else
+                    {
+                        // replace tokens before setting property
+                        tokenReplacer.replaceToken(prop, sourceFileName);
+                        String propValue = evaluateExpression(prop, ".").toString();
+                        map.addProperty(propName, propValue);
+                    }
+                }
+                else
+                {
+                    // replace tokens before setting property
+                    tokenReplacer.replaceToken(prop, sourceFileName);
+                    map.addProperty(propName, prop.getNodeValue());
+                }
+            }
+        }
+
+        return map;
+    }
+    
+    /**
+     * Get the item value by name if the item is present in the current node as attribute or child element. 
+     * <p/>
+     * @param node the current Node object
+     * @param name item name
+     * @return String the value of item
+     **/
+    public String getAttributeOrChildElement(Node node, String name)
+    {
+        String attr = evaluateExpression(node, "@" + name).toString().trim();
+        if (attr.length() == 0)
+        {
+            attr = evaluateExpression(node, name).toString().trim();
+        }
+        return attr;
+    }
+    
+    /**
+     * Check whether the required items are present in the current node as child elements. 
+     * <p/>
+     * @param node the current Node object
+     * @param allowed the String array of the allowed items
+     **/
+    public void allowedChildElements(Node node, String[] allowed)
+    {
+        NodeList children = selectNodeList(node, "*");
+
+        String unexpected = unexpected(children, allowed);
+        if (unexpected != null)
+        {
+            // Unexpected child element '{0}' found in '{1}'.
+            ConfigurationException ex = new ConfigurationException();
+            Object[] args = {unexpected, node.getNodeName(), getSourceFilename(node)};
+            ex.setMessage(UNEXPECTED_ELEMENT, args);
+            throw ex;
+        }
+
+        NodeList textNodes = selectNodeList(node, "text()");
+        for (int i = 0; i < textNodes.getLength(); i++)
+        {
+            String text = evaluateExpression(textNodes.item(i), ".").toString().trim();
+            if (text.length() > 0)
+            {
+                //Unexpected text '{0}' found in '{1}'.
+                ConfigurationException ex = new ConfigurationException();
+                Object[] args = {text, node.getNodeName(), getSourceFilename(node)};
+                ex.setMessage(UNEXPECTED_TEXT, args);
+                throw ex;
+            }
+        }
+    }
+    
+    /**
+     * Check whether the required items are present in the current node as attributes. 
+     * <p/>
+     * @param node the current Node object
+     * @param allowed the String array of the allowed items
+     **/
+
+    public void allowedAttributes(Node node, String[] allowed)
+    {
+        NodeList attributes = selectNodeList(node, "@*");
+        String unexpectedAttribute = unexpected(attributes, allowed);
+        if (unexpectedAttribute != null)
+        {
+            //Unexpected attribute '{0}' found in '{1}'.
+            ConfigurationException ex = new ConfigurationException();
+            Object[] args =
+                {unexpectedAttribute, node.getNodeName(), getSourceFilename(node)};
+            ex.setMessage(UNEXPECTED_ATTRIBUTE, args);
+            throw ex;
+        }
+    }
+
+    private String getSourceFilename(Node node)
+    {
+        return getSourceFileOf(node);
+    }
+    
+    /**
+     * Check whether the allowed items are present in the current node as elements or attributes. 
+     * <p/>
+     * @param node the current Node object
+     * @param allowed the String array of the allowed items
+     **/
+
+    public void allowedAttributesOrElements(Node node, String[] allowed)
+    {
+        allowedAttributes(node, allowed);
+        allowedChildElements(node, allowed);
+    }
+
+    /**
+     * Check whether the required items are present in the current node as elements or attributes. 
+     * <p/>
+     * @param node the current Node object
+     * @param required the String array of the required items
+     **/
+    public void requiredAttributesOrElements(Node node, String[] required)
+    {
+        String nodeName = node.getNodeName();
+        NodeList attributes = selectNodeList(node, "@*");
+
+        List list = new ArrayList();
+        for (int i = 0; i < required.length; i++)
+        {
+            list.add(required[i]);
+        }
+
+        String missingAttribute = null;
+
+        do
+        {
+            missingAttribute = required(attributes, list);
+            if (missingAttribute != null)
+            {
+                Node child = selectSingleNode(node, missingAttribute);
+                if (child != null)
+                {
+                    list.remove(missingAttribute);
+                }
+                else
+                {
+                    // Attribute '{0}' must be specified for element '{1}'
+                    ConfigurationException ex = new ConfigurationException();
+                    ex.setMessage(MISSING_ATTRIBUTE, new Object[]{missingAttribute, nodeName});
+                    throw ex;
+                }
+            }
+        }
+        while (missingAttribute != null && list.size() > 0);
+    }
+
+    /**
+     * Check whether the required items are present in the current node (Child elements). 
+     * <p/>
+     * @param node the current Node object
+     * @param required the String array of the required items
+     **/
+    public void requiredChildElements(Node node, String[] required)
+    {
+        String nodeName = node.getNodeName();
+        NodeList children = selectNodeList(node, "*");
+
+        List list = new ArrayList();
+        for (int i = 0; i < required.length; i++)
+        {
+            list.add(required[i]);
+        }
+
+        String missing = required(children, list);
+        if (missing != null)
+        {
+            // Child element '{0}' must be specified for element '{1}'
+            ConfigurationException ex = new ConfigurationException();
+            ex.setMessage(MISSING_ELEMENT, new Object[]{missing, nodeName});
+            throw ex;
+        }
+    }
+
+    /**
+     * Check whether there is any unexpected item in the node list object.
+     * <p/>
+     * @param attributes the current NodeList object
+     * @param allowed, the String array of allowed items
+     * @return Name of the first unexpected item from the list of allowed attributes, or null if all
+     *         items present were allowed.
+     **/
+    public String unexpected(NodeList attributes, String[] allowed)
+    {
+        for (int i = 0; i < attributes.getLength(); i++)
+        {
+            Node attrib = attributes.item(i);
+            String attribName = attrib.getNodeName();
+            boolean match = false;
+
+            for (int j = 0; j < allowed.length; j++)
+            {
+                String a = allowed[j];
+                if (a.equals(attribName))
+                {
+                    match = true;
+                    break;
+                }
+            }
+
+            if (!match)
+            {
+                return attribName;
+            }
+
+            // Go ahead and replace tokens in node values.
+            tokenReplacer.replaceToken(attrib, getSourceFilename(attrib));
+        }
+
+        return null;
+    }
+
+    /**
+     * Check whether all the required items are present in the node list.
+     * @param attributes the NodeList object
+     * @param required a list of required items
+     * @return Name of the first missing item from the list of required attributes, or null if all required
+     *         items were present.
+     **/
+    public String required(NodeList attributes, List required)
+    {
+        for (int i = 0; i < required.size(); i++)
+        {
+            boolean found = false;
+            String req = (String)required.get(i);
+
+            Node attrib = null;
+            for (int j = 0; j < attributes.getLength(); j++)
+            {
+                attrib = attributes.item(j);
+                String attribName = attrib.getNodeName();
+
+                if (req.equals(attribName))
+                {
+                    found = true;
+                    break;
+                }
+            }
+
+            if (!found)
+            {
+                return req;
+            }
+
+            // Go ahead and replace tokens in node values.
+            tokenReplacer.replaceToken(attrib, getSourceFilename(attrib));
+
+        }
+
+        return null;
+    }
+
+
+    /**
+     * Tests whether a configuration element's id is a valid
+     * identifier. An id must be a String that is not null,
+     * greater than 0 characters in length and not contain
+     * any of the list delimiter characters, i.e. commas,
+     * semi-colons or colons.
+     * @param id the Id String
+     * @return boolean true if the id string is valid identification
+     * @see ConfigurationConstants#LIST_DELIMITERS
+     */
+    public static boolean isValidID(String id)
+    {
+        if (id != null && id.length() > 0 && id.length() < 256)
+        {
+            char[] chars = id.toCharArray();
+            for (int i = 0; i < chars.length; i++)
+            {
+                char c = chars[i];
+                if (LIST_DELIMITERS.indexOf(c) != -1)
+                {
+                    return false;
+                }
+            }
+
+            return true;
+        }
+
+        return false;
+    }
+    
+    /**
+     * Implement {@link org.xml.sax.EntityResolver#resolveEntity(String, String)}.
+     * 
+     * Flex Configuration does not need or use external entities, so disallow external entities
+     * to prevent external entity injection attacks. 
+     * @param publicId the public Id
+     * @param systemId the system Id
+     * @throws SAXException, IOException when the parsing process failed with exceptions
+     * @return InputSource the InputSource object
+     */
+    public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
+    {
+        // Flex Configuration does not allow external entity defined by publicId {0} and SystemId {1}
+        ConfigurationException ex = new ConfigurationException();
+        ex.setMessage(EXTERNAL_ENTITY_NOT_ALLOW, new Object[] { publicId, systemId });
+        throw ex;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/AdapterSettings.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/AdapterSettings.java b/modules/common/src/flex/messaging/config/AdapterSettings.java
new file mode 100755
index 0000000..8d53ff2
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/AdapterSettings.java
@@ -0,0 +1,130 @@
+/*
+ * 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.messaging.config;
+
+/**
+ * A service must register the adapters that it will use
+ * to process messages. Each destination selects an adapter
+ * that processes the request by referring to it by id.
+ * <p>
+ * Adapters can also be configured with initialization
+ * properties.
+ * </p>
+ *
+ * @see flex.messaging.services.ServiceAdapter
+ * @author Peter Farland
+ * @exclude
+ */
+public class AdapterSettings extends PropertiesSettings
+{
+    private final String id;
+    private String sourceFile;
+    private String className;
+    private boolean defaultAdapter;
+
+    /**
+     * Used to construct a new set of properties to describe an adapter. Note
+     * that an identity is required in order for destinations to refer to this
+     * adapter.
+     *
+     * @param id the <code>String</code> representing the unique identity for
+     * this adapter.
+     */
+    public AdapterSettings(String id)
+    {
+        super();
+        this.id = id;
+    }
+
+    /**
+     * The identity that destinations will refer to when assigning and adapter.
+     *
+     * @return the adapter identity as a <code>String</code>.
+     */
+    public String getId()
+    {
+        return id;
+    }
+
+    /**
+     * Gets the name of the Java class implementation for this adapter.
+     *
+     * @return String The name of the adapter implementation.
+     * @see flex.messaging.services.ServiceAdapter
+     */
+    public String getClassName()
+    {
+        return className;
+    }
+
+    /**
+     * Sets name of the Java class implementation for this adapter. The
+     * implementation is resolved from the current classpath and must extend
+     * <code>flex.messaging.services.ServiceAdapter</code>.
+     *
+     * @param name the <code>String</code>
+     */
+    public void setClassName(String name)
+    {
+        className = name;
+    }
+
+    /**
+     * Returns a boolean flag that determines whether this adapter is the
+     * default for a service's destinations. Only one default adapter can be
+     * set for a given service.
+     *
+     * @return boolean true if this adapter is the default.
+     */
+    public boolean isDefault()
+    {
+        return defaultAdapter;
+    }
+
+    /**
+     * Sets a flag to determine whether an adapter will be used as the default
+     * (for example, in the event that a destination did not specify an adapter
+     * explicitly).
+     *
+     * Only one default can be set for a given service.
+     *
+     * @param b a <code>boolean</code> flag, true if this adapter should be
+     * used as the default for the service.
+     */
+    public void setDefault(boolean b)
+    {
+        defaultAdapter = b;
+    }
+
+    /**
+     * Internal use only.
+     * @exclude
+     */
+    String getSourceFile()
+    {
+        return sourceFile;
+    }
+
+    /**
+     * Internal use only.
+     * @exclude
+     */
+    void setSourceFile(String file)
+    {
+        this.sourceFile = file;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/ApacheXPathClientConfigurationParser.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/ApacheXPathClientConfigurationParser.java b/modules/common/src/flex/messaging/config/ApacheXPathClientConfigurationParser.java
new file mode 100755
index 0000000..6ad4468
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/ApacheXPathClientConfigurationParser.java
@@ -0,0 +1,87 @@
+/*
+ * 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.messaging.config;
+
+import org.apache.xpath.CachedXPathAPI;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import javax.xml.transform.TransformerException;
+
+/**
+ * Uses Apache XPath on a DOM representation of a messaging configuration
+ * file.
+ * <p>
+ * NOTE: Since reference ids are used between elements, certain
+ * sections of the document need to be parsed first.
+ * </p>
+ *
+ * @author Peter Farland
+ * @exclude
+ */
+public class ApacheXPathClientConfigurationParser extends ClientConfigurationParser
+{
+    private CachedXPathAPI xpath;
+
+    protected void initializeExpressionQuery()
+    {
+        this.xpath = new CachedXPathAPI();
+    }
+
+    protected Node selectSingleNode(Node source, String expression)
+    {
+        try
+        {
+            return xpath.selectSingleNode(source, expression);
+        }
+        catch (TransformerException transformerException)
+        {
+            throw wrapException(transformerException);
+        }
+    }
+
+    protected NodeList selectNodeList(Node source, String expression)
+    {
+        try
+        {
+            return xpath.selectNodeList(source, expression);
+        }
+        catch (TransformerException transformerException)
+        {
+            throw wrapException(transformerException);
+        }
+    }
+
+    protected Object evaluateExpression(Node source, String expression)
+    {
+        try
+        {
+            return xpath.eval(source, expression);
+        }
+        catch (TransformerException transformerException)
+        {
+            throw wrapException(transformerException);
+        }
+    }
+
+    private ConfigurationException wrapException(TransformerException exception)
+    {
+       ConfigurationException result = new ConfigurationException();
+       result.setDetails(PARSER_INTERNAL_ERROR);
+       result.setRootCause(exception);
+       return result;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/ChannelSettings.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/ChannelSettings.java b/modules/common/src/flex/messaging/config/ChannelSettings.java
new file mode 100755
index 0000000..b1ee664
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/ChannelSettings.java
@@ -0,0 +1,335 @@
+/*
+ * 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.messaging.config;
+import flex.messaging.util.StringUtils;
+
+/**
+ * The channel configuration is intentionally generic so that
+ * other channels can be added in the future. This format also allows
+ * server-endpoint specific and client code-generation specific settings
+ * to be modified without affecting needing to update the configuration
+ * parser.
+ *
+ * @author Peter Farland
+ * @exclude
+ */
+public class ChannelSettings extends PropertiesSettings
+{
+    protected String id;
+    protected boolean remote;
+    protected String serverId;
+    private String sourceFile;
+
+    protected SecurityConstraint constraint;
+
+    // ENDPOINT
+    protected String uri;
+    protected int port;
+    protected String endpointType;
+    protected String clientType;
+    protected boolean serverOnly;
+
+    protected String parsedUri;
+    protected boolean contextParsed;
+    protected String parsedClientUri;
+    protected boolean clientContextParsed;
+
+    public ChannelSettings(String id)
+    {
+        this.id = id;
+    }
+
+    public String getId()
+    {
+        return id;
+    }
+
+    public boolean isRemote()
+    {
+        return remote;
+    }
+
+    public void setRemote(boolean value)
+    {
+        remote = value;
+    }
+
+    public String getServerId()
+    {
+        return serverId;
+    }
+
+    public void setServerId(String value)
+    {
+        serverId = value;
+    }
+
+    public String getClientType()
+    {
+        return clientType;
+    }
+
+    public void setClientType(String type)
+    {
+        this.clientType = type;
+    }
+
+    public boolean getServerOnly()
+    {
+        return serverOnly;
+    }
+
+    public void setServerOnly(boolean serverOnly)
+    {
+        this.serverOnly = serverOnly;
+    }
+
+    String getSourceFile()
+    {
+        return sourceFile;
+    }
+
+    void setSourceFile(String sourceFile)
+    {
+        this.sourceFile = sourceFile;
+    }
+
+    /**
+     * A return value of 0 denotes no port in channel url.
+     *
+     * @return the port number for this channel
+     * or 0 if channel url does not contain a port number
+     */
+    public int getPort()
+    {
+        return port;
+    }
+
+    public String getUri()
+    {
+        return uri;
+    }
+
+    public void setUri(String uri)
+    {
+        this.uri = uri;
+        port = parsePort(uri);
+        port = (port == -1)? 0 : port; // Replace -1 with 0.
+        contextParsed = false;
+        clientContextParsed = false;
+    }
+
+    public String getClientParsedUri(String contextPath)
+    {
+        if (!clientContextParsed)
+            parseClientUri(this, contextPath);
+
+        return parsedClientUri;
+    }
+
+    public String getEndpointType()
+    {
+        return endpointType;
+    }
+
+    public void setEndpointType(String type)
+    {
+        this.endpointType = type;
+    }
+
+    public SecurityConstraint getConstraint()
+    {
+        return constraint;
+    }
+
+    public void setConstraint(SecurityConstraint constraint)
+    {
+        this.constraint = constraint;
+    }
+
+    /**
+     * In this client version of the URI parser we're just looking to
+     * replace the context root tokens.
+     */
+    private static void parseClientUri(ChannelSettings cs, String contextPath)
+    {
+        if (!cs.clientContextParsed)
+        {
+            String channelEndpoint = cs.getUri().trim();
+
+            // either {context-root} or {context.root} is legal
+            channelEndpoint = StringUtils.substitute(channelEndpoint, "{context-root}", ConfigurationConstants.CONTEXT_PATH_TOKEN);
+
+            if ((contextPath == null) && (channelEndpoint.indexOf(ConfigurationConstants.CONTEXT_PATH_TOKEN) != -1))
+            {
+                // context root must be specified before it is used
+                ConfigurationException e = new ConfigurationException();
+                e.setMessage(ConfigurationConstants.UNDEFINED_CONTEXT_ROOT, new Object[]{cs.getId()});
+                throw e;
+            }
+
+            // simplify the number of combinations to test by ensuring our
+            // context path always starts with a slash
+            if (contextPath != null && !contextPath.startsWith("/"))
+            {
+                contextPath = "/" + contextPath;
+            }
+
+            // avoid double-slashes from context root by replacing /{context.root}
+            // in a single replacement step
+            if (channelEndpoint.indexOf(ConfigurationConstants.SLASH_CONTEXT_PATH_TOKEN) != -1)
+            {
+                // but avoid double-slash for /{context.root}/etc when we have
+                // the default context root
+                if ("/".equals(contextPath) && !ConfigurationConstants.SLASH_CONTEXT_PATH_TOKEN.equals(channelEndpoint))
+                    contextPath = "";
+
+                channelEndpoint = StringUtils.substitute(channelEndpoint, ConfigurationConstants.SLASH_CONTEXT_PATH_TOKEN, contextPath);
+            }
+            // otherwise we have something like {server.name}:{server.port}{context.root}...
+            else
+            {
+                // but avoid double-slash for {context.root}/etc when we have
+                // the default context root
+                if ("/".equals(contextPath) && !ConfigurationConstants.CONTEXT_PATH_TOKEN.equals(channelEndpoint))
+                    contextPath = "";
+
+                channelEndpoint = StringUtils.substitute(channelEndpoint, ConfigurationConstants.CONTEXT_PATH_TOKEN, contextPath);
+            }
+
+            cs.parsedClientUri = channelEndpoint;
+            cs.clientContextParsed = true;
+        }
+    }
+    
+    /**
+     * Returns the host name in the URL, or an empty <tt>String</tt> if the URL does not contain a host name.
+     * 
+     * @param url The URL to parse for a host name.
+     * @return The host name or an empty <tt>String</tt> if the URL does not contain a host name.
+     */
+    // The reason for this method, rather than just using java.net.URL, is that the Java class
+    // doesn't recognize many of our protocol types/schemes (e.g. rtmp, amfsocket, etc.)
+    public static String parseHost(String url)
+    {
+        int start = url.indexOf(":/");
+        if (start == -1)
+            return "";
+        
+        start = start + 3; // Advance past all of '://' to beginning of host name.
+        int end = url.indexOf('/', start);
+        String hostnameWithPort = end == -1 ? url.substring(start) : url.substring(start, end);
+        
+        // IPv6 hostnames may contain ':' but the full value is wrapped in [] - skip past if necessary.
+        int delim = hostnameWithPort.indexOf(']');
+        delim = (delim != -1) ? hostnameWithPort.indexOf(':', delim) : hostnameWithPort.indexOf(':');
+        if (delim == -1) // No port.
+            return hostnameWithPort;
+        else
+            return hostnameWithPort.substring(0, delim);
+    }
+    
+    /**
+     * Returns the port number specified in the URL, or 0 if the URL
+     * does not contain a port number, or -1 if the URL contains a server.port
+     * token.
+     *
+     * @param url The URL to parse for a contained port number.
+     * @return the port number in the URL, or 0 if the URL does not 
+     * contain a port number, or -1 if the URL contains a server.port token.
+     */
+    // The reason for this method, rather than just using java.net.URL, is that the Java class
+    // doesn't recognize many of our protocol types/schemes (e.g. rtmp, amfsocket, etc.)
+    public static int parsePort(String url)
+    {
+        // rtmp://localhost:2035/foo/bar
+        // Find first slash with colon
+        int start = url.indexOf(":/");
+        if (start == -1)
+            return 0;
+
+        // Second slash should be +1, so start 3 after for ://
+        start = start + 3;
+        int end = url.indexOf('/', start);
+
+        // take everything up until the next slash for servername:port
+        String snp = end == -1 ? url.substring(start) : url.substring(start, end);
+
+        // If IPv6 is in use, start looking after the square bracket.
+        int delim = snp.indexOf(']');
+        delim = (delim > -1)? snp.indexOf(':', delim) : snp.indexOf(':');
+        if (delim == -1)
+            return 0;
+
+        int port = 0;
+        try
+        {
+            int p = Integer.parseInt(snp.substring(delim + 1));
+            port = (p > 0)? p : 0; 
+        }
+        catch (Throwable t)
+        {
+            port = -1; // To denote that the url contained server.port token.
+        }
+        return port;
+    }
+
+    /**
+     * Remove protocol, host, port and context-root from a given url.
+     * Unlike parseClientUri, this method does not check if the channel
+     * setting has been parsed before.
+     *
+     * @param url Original url.
+     * @return Url with protocol, host, port and context-root removed.
+     */
+    public static String removeTokens(String url)
+    {
+        String channelEndpoint = url.toLowerCase().trim();
+
+        // remove protocol and host info
+        if (channelEndpoint.startsWith("http://") ||
+                channelEndpoint.startsWith("https://") ||
+                channelEndpoint.startsWith("rtmp://") ||
+                channelEndpoint.startsWith("rtmps://")) {
+            int nextSlash = channelEndpoint.indexOf('/', 8);
+            // Check to see if there is a 'next slash', and also that the next
+            // slash isn't the last character
+            if ((nextSlash > 0) && (nextSlash != channelEndpoint.length()-1))
+                channelEndpoint = channelEndpoint.substring(nextSlash);
+        }
+
+        // either {context-root} or {context.root} is legal
+        channelEndpoint = StringUtils.substitute(channelEndpoint, "{context-root}", ConfigurationConstants.CONTEXT_PATH_TOKEN);
+
+        // Remove context path info
+        if (channelEndpoint.startsWith(ConfigurationConstants.CONTEXT_PATH_TOKEN))
+        {
+            channelEndpoint = channelEndpoint.substring(ConfigurationConstants.CONTEXT_PATH_TOKEN.length());
+        }
+        else if (channelEndpoint.startsWith(ConfigurationConstants.SLASH_CONTEXT_PATH_TOKEN))
+        {
+            channelEndpoint = channelEndpoint.substring(ConfigurationConstants.SLASH_CONTEXT_PATH_TOKEN.length());
+        }
+
+        // We also don't match on trailing slashes
+        if (channelEndpoint.endsWith("/"))
+        {
+            channelEndpoint = channelEndpoint.substring(0, channelEndpoint.length() - 1);
+        }
+        return channelEndpoint;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/config/ClientConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/config/ClientConfiguration.java b/modules/common/src/flex/messaging/config/ClientConfiguration.java
new file mode 100755
index 0000000..43cefbd
--- /dev/null
+++ b/modules/common/src/flex/messaging/config/ClientConfiguration.java
@@ -0,0 +1,192 @@
+/*
+ * 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.messaging.config;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @exclude
+ */
+public class ClientConfiguration implements ServicesConfiguration
+{
+    protected final Map channelSettings;
+    protected final List defaultChannels;
+    protected final List serviceSettings;
+    protected LoggingSettings loggingSettings;
+    protected Map configPaths;
+    protected final Map clusterSettings;
+    protected FlexClientSettings flexClientSettings;
+
+    public ClientConfiguration()
+    {
+        channelSettings = new HashMap();
+        defaultChannels = new ArrayList(4);
+        clusterSettings = new HashMap();
+        serviceSettings = new ArrayList();
+        configPaths = new HashMap();
+    }
+
+    /*
+     * CHANNEL CONFIGURATION
+     */
+
+    public void addChannelSettings(String id, ChannelSettings settings)
+    {
+        channelSettings.put(id, settings);
+    }
+
+    public ChannelSettings getChannelSettings(String ref)
+    {
+        return (ChannelSettings)channelSettings.get(ref);
+    }
+
+    public Map getAllChannelSettings()
+    {
+        return channelSettings;
+    }
+
+    /*
+     * DEFAULT CHANNELS CONFIGURATION
+     */
+    public void addDefaultChannel(String id)
+    {
+        defaultChannels.add(id);
+    }
+
+    public List getDefaultChannels()
+    {
+        return defaultChannels;
+    }
+
+    /*
+     * SERVICE CONFIGURATION
+     */
+
+    public void addServiceSettings(ServiceSettings settings)
+    {
+        serviceSettings.add(settings);
+    }
+
+    public ServiceSettings getServiceSettings(String serviceType)
+    {
+        for (Iterator iter = serviceSettings.iterator(); iter.hasNext();)
+        {
+            ServiceSettings serviceSettings = (ServiceSettings) iter.next();
+            if (serviceSettings.getId().equals(serviceType))
+                return serviceSettings;
+        }
+        return null;
+    }
+
+    public List getAllServiceSettings()
+    {
+        return serviceSettings;
+    }
+
+    /*
+     * CLUSTER CONFIGURATION
+     */
+
+    public void addClusterSettings(ClusterSettings settings)
+    {
+        if (settings.isDefault())
+        {
+            for (Iterator it = clusterSettings.values().iterator(); it.hasNext(); )
+            {
+                ClusterSettings cs = (ClusterSettings) it.next();
+
+                if (cs.isDefault())
+                {
+                    ConfigurationException cx = new ConfigurationException();
+                    cx.setMessage(10214, new Object[] { settings.getClusterName(), cs.getClusterName() });
+                    throw cx;
+                }
+            }
+        }
+        if (clusterSettings.containsKey(settings.getClusterName()))
+        {
+            ConfigurationException cx = new ConfigurationException();
+            cx.setMessage(10206, new Object[] { settings.getClusterName() });
+            throw cx;
+        }
+        clusterSettings.put(settings.getClusterName(), settings);
+    }
+
+    public ClusterSettings getClusterSettings(String clusterId)
+    {
+        for (Iterator it = clusterSettings.values().iterator(); it.hasNext(); )
+        {
+            ClusterSettings cs = (ClusterSettings) it.next();
+            if (cs.getClusterName() == null && clusterId == null)
+                return cs; // handle null case
+            if (cs.getClusterName() != null && cs.getClusterName().equals(clusterId))
+                return cs;
+        }
+        return null;
+    }
+
+    public ClusterSettings getDefaultCluster()
+    {
+        for (Iterator it = clusterSettings.values().iterator(); it.hasNext(); )
+        {
+            ClusterSettings cs = (ClusterSettings) it.next();
+            if (cs.isDefault())
+                return cs;
+        }
+        return null;
+    }
+
+    /*
+     * LOGGING CONFIGURATION
+     */
+    public void setLoggingSettings(LoggingSettings settings)
+    {
+        loggingSettings = settings;
+    }
+
+    public LoggingSettings getLoggingSettings()
+    {
+        return loggingSettings;
+    }
+
+
+    public void addConfigPath(String path, long modified)
+    {
+        configPaths.put(path, new Long(modified));
+    }
+
+    public Map getConfigPaths()
+    {
+        return configPaths;
+    }
+    
+    public void setFlexClientSettings(FlexClientSettings value)
+    {
+        flexClientSettings = value;
+    }
+    
+    public FlexClientSettings getFlexClientSettings()
+    {
+        return flexClientSettings;
+    }
+
+}


[16/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/errors.properties
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/errors.properties b/modules/common/src/flex/messaging/errors.properties
new file mode 100755
index 0000000..f76c681
--- /dev/null
+++ b/modules/common/src/flex/messaging/errors.properties
@@ -0,0 +1,432 @@
+# 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.
+
+# IMPORTANT: Error messages are now split between two files in BlazeDS and LCDS.
+# This file is for BlazeDS error messages (which can be used by LCDS code as well).
+# LCDS only messages now live in a separate file in the LCDS branch. While editing
+# these files, keep in mind that both files are part of the same numeric sequence.
+#
+# Error and details messages for LocalizedMessageExceptions are stored in the following format:
+# Error message: {number}[-{variant}]={message}
+# Details message: {number}[-{variant}]-details={details}
+#
+# Server error numbers start at 10000.
+#
+# Error numbers are chosen by taking the next available value in a numeric sequence.
+# Each functional component or group of components should claim a unique block of 50
+# numbers to use for error and details messages. If this initial set of 50 values
+# are exhausted, the component should claim the next available block of 50 values for
+# its use. This means that an error-ridden component may well use a disjoint set of
+# error numbers. Here's an example:
+# Feature        Error numbers claimed
+# -----------------------------------
+# Security      10050-10099
+# Configuration 10100-10149
+# Security      10150-10199 <- Security exhausted its first block, so it claims the next
+#                              available block of 50 values for its continued use.
+#
+# Constants to lookup error/details strings by 'number', and optional 'variant',
+# should be defined in the classes that use them. When a class needs to define a new
+# error and/or details string, add the necessary string(s) to this file using the next
+# available numeric value in the corresponding range.
+#
+# The structure of this file should be maintained according to increasing error number. This
+# means that for features that throw many errors, blocks of corresponding message strings
+# won't necessarily be contiguous, but this simplifies identifying the starting value for
+# the next available block of values and simplifies validation that duplicate error numbers
+# are not being used.
+# * Caution: Reusing a property key doesn't generate any error, so watch for typos.
+#            The last defined property with a duplicate key clobbers the earlier values.
+
+# 10000-10049: General LocalizedException messages (in MessageBrokerFilter and MessageBroker).
+10000=There was an unhandled failure on the server. {0}
+10001=Null endpoint id arrived on message.
+10002=No such endpoint: {0}
+10003=No configured channel has an endpoint path ''{0}''.
+10004=The supplied destination id is not registered with any service.
+10005=Destination ''{0}'' not accessible over channel ''{1}''.
+10006=Error occurred while attempting to convert an input argument''s type.
+10007=Cannot invoke method ''{0}''.
+10007-0-details=Method ''{0}'' not found.
+10007-1-details={0} arguments were sent but {1} were expected.
+10007-2-details=The expected argument types are ({0}) but the supplied types were ({1}) and converted to ({2}).
+10007-3-details=The expected argument types are ({0}) but the supplied types were ({1}) with none successfully converted.
+10007-4-details=The expected argument types are ({0}) but no arguments were provided.
+10007-5-details=No arguments were expected but the following types were supplied ({0}).
+10008=Cannot create class of type ''{0}''.
+10008-0-details=Type ''{0}'' not found.
+10009=Given type ''{0}'' is not of expected type ''{1}''.
+10010=Unable to create a new instance of type ''{0}''.
+10010-0-details=Types must have a public, no arguments constructor.
+10010-1-details=Interfaces cannot be instantiated.
+10010-2-details=Abstract types cannot be instantiated.
+10010-3-details=Types cannot be instantiated without a public, no arguments constructor.
+10011=A security exception occurred while creating an instance of type ''{0}''.
+10012=An unknown exception occurred while creating an instance of type ''{0}''.
+10013=Invalid target specified. Target must not be null.
+10014=Categories must be at least one character in length.
+10015=Categories can not contain any of the following characters: ''{0}''
+10016=Error for filter ''{0}''. The following characters are not valid: {1}
+10017=Error for filter ''{0}''. ''*'' must be the right most character.
+10018=The server configuration parser requires an instance of MessagingConfiguration.
+10019=The FlexSession is invalid.
+10020=Unknown remote credentials format.
+10021=Failed to get property ''{0}'' on type ''{1}''.
+10022=Failed to set property ''{0}'' on type ''{1}''.
+10023=Property ''{0}'' is not readable on class ''{1}''.
+10024=Property ''{0}'' is not writable on class ''{1}''.
+10025=Property ''{0}'' not found on class ''{1}''.
+10026=Cannot send a null Map key for type ''{0}''.
+10027=The FlexClient is invalid.
+10028=The client has no active subscriptions over endpoint ''{0}''.
+10029=MessageBroker cannot service the message because message has null id.
+10030=Destination ''{0}'' requires FlexClient support which was introduced in version 2.5. Please recompile the client application with an updated client framework.
+10031=LogManager has a null Log reference.
+10032=Session map not initialized for session with id: ''{0}''.
+10033=FlexClient ''{0}'' already has a push listener registered for endpoint ''{1}''.
+10034=Channel endpoint does not support polling.
+10034-details=Client attempted to contact a server endpoint that does not support a polling channel.
+10035=Duplicate HTTP-based FlexSession error: A request for FlexClient ''{0}'' arrived over a new FlexSession ''{1}'', but FlexClient is already associated with  FlexSession ''{2}'', therefore it cannot be associated with the new session.
+10036=The client has no active subscriptions over endpoint ''{0}'' but this may be due to mismatched client and server libraries. Old versions of rpc.swc do not handle URL session tokens correctly which may cause this issue. Please ensure that the client application has been compiled using version 3.1 of rpc.swc or newer.
+10037=Invalid request type of ''{0}'' which is not of type flex.messaging.messages.Message.
+10038={0} ''{1}'' cannot service message ''{2}'' in stopped state.
+10039=Cannot create ''{0}'' with null id.
+10040=Cannot create ''{0}'' with id ''{1}''; another ''{0}'' is already registered with the same id.
+
+# 10050-10099: SecurityException messages.
+10050=Invalid login.
+10051=Login required.
+10053=External login command required. Please check your security configuration.
+10054=Cannot re-authenticate in the same session.
+10055=Access denied. User not authorized.
+10056=Login required before authorization can proceed.
+10057=A resource protected by a security constraint ''{0}'' that specifies Basic security was accessed via the ''{1}'' endpoint which does not support HTTP Basic security. Please use custom security or an alternate endpoint.
+10060=Authentication failed.
+10061=No security manager found on this application server. Cannot authenticate.
+10062=Security constraint {0} is not defined.
+10063=It is an error to specify both a security constraint and run-as for a DataService object adapter operation.
+10064=Invalid credential format.
+10065=Cannot use application server authentication together with per client authentication.
+10066=Secure endpoint ''{0}'' must be contacted via a secure protocol.
+10067=SSO Cookie created sessions may only be invalidated by removal of Cookie on the client.
+10068=HTTP endpoint ''{0}'' must be contacted via a HTTP request with proper content type.
+
+# 10100-10149: Server configuration error messages.
+10100=Error initializing configuration parser.
+10101=An internal error occurred while parsing the services configuration.
+10102=Configuration error encountered on line {0}, column {1}: ''{2}''
+10103=The services configuration root element must be ''{0}''.
+10104=Child element ''{0}'' must be specified for element ''{1}''.
+10105=Attribute ''{0}'' must be specified for element ''{1}''.
+10106=Unexpected child element ''{0}'' found in ''{1}'' from file: {2}.
+10107=Unexpected attribute ''{0}'' found in ''{1}'' from file: {2}.
+10108=''{0}'' must occur no more than once for ''{1}''.
+10109={0} not found for reference ''{1}''.
+10110=Invalid {0} id ''{1}''.
+10110-details=An id must be non-empty and not contain any list delimiter characters, i.e. commas, semi-colons or colons.
+10111=Invalid endpoint port ''{0}'' specified for channel definition ''{1}''.
+10112=The {0} root element in file {1} must be ''{2}'' or ''{3}''.
+10113=Duplicate service definition ''{0}''.
+10114=Class not specified for {0} ''{1}''.
+10115=Message type(s) not specified for {0} ''{1}''.
+10116=A default channel was specified without a reference for service ''{0}''.
+10117=Duplicate default adapter ''{0}'' in service ''{1}''. ''{2}'' has already been selected as the default.
+10118=The element ''{0}'' must specify either the ''{1}'' or ''{2}'' attribute.
+10119=Invalid {0} id ''{1}'' for service ''{2}''.
+10120={0} not found for reference ''{1}'' in destination ''{2}''.
+10121=Invalid {0} reference ''{1}'' in destination ''{2}''.
+10122=Duplicate destination ''{0}'' in service ''{1}''.
+10123=Destination ''{0}'' must specify at least one channel.
+10124=Destination ''{0}'' is configured to use an unsupported throttle policy, ''{1}''.
+10125=Invalid channel endpoint class ''{0}'' specified for ''{1}''.
+10126=Invalid logging target class ''{0}''.
+10127=Destination ''{0}'' must specify at least one adapter.
+10128=Cannot add ''{0}'' with null url to the ''{1}''.
+10129={0} token cannot be resolved in the url. Please specify the url completely.
+10129-0={0} token cannot be resolved in the url as the destination was not accessed via HTTP. Please switch to an HTTP based channel or specify the url completely.
+10130={0} token cannot be resolved in the url. Please specify the url completely, using * to indicate all ports.
+10131=Error parsing dynamic URLs.
+10132=Invalid {0} reference ''{1}'' in channel ''{2}''.
+10133=No <keystore-file> property was specified for the secure RTMP channel.
+10134=A <keystore-password> or <keystore-password-file> property must be specified for the secure RTMP channel.
+10135=Secure RTMP endpoints are only supported on Java 1.5 or above.
+10136=Invalid RTMP Endpoint URI: {0}
+10137=MessageBroker already defined from MessageBrokerServlet with init parameter messageBrokerId = ''{0}''
+10138=Unable to create a parser to load messaging configuration.
+10139=The minimum required Java version was not found. Please install JDK 1.4.2_06 or above. Current version is {0}.
+10140=The minimum required Java version was not found. Please install JDK 1.4.2 or above. Current version is {0}.
+10141=This RTMP channel with id ''{0}'' requires that ''websphere-workmanager-jndi-name'' be defined.
+10142=WebSphere RTMP Server failed to find WorkManager at {0}.
+10143=Unable to start WebSphere RTMP Server.
+10144=The RTMP channel bind address, ''{0}'', is not valid.
+10145=The secure RTMP channel could not be constructed: {0}
+10146=The whitelist ip, ''{0}'', is not valid.
+10146-pattern=The whitelist ip pattern, ''{0}'', is not valid.
+10147=The blacklist ip, ''{0}'', is not valid.
+10147-pattern=The blacklist ip pattern, ''{0}'', is not valid.
+10148=The bind address, ''{0}'', is not a defined address for any local network interface.
+10149=Unrecognized tag found in <properties>.  Please consult the documentation to determine if the tag is invalid or belongs inside of a different tag: {0}
+10149-pattern-details=''{0}'' in {1} with id: ''{2}'' from file: {3}
+#No more here - continues to 11100-11150 block
+
+# 10150-10199: DataService error messages (in LCDS errors.properties)
+# These two were in DataService error messages block even though they are general server errors, so they are kept here.
+10163=Unable to locate a MessageBroker initialized with server id ''{0}''
+10169=Unexpected multiple values for property ''{0}''.
+
+# 10200-10249: Clustering error messages
+10200=Unable to create a cluster id named {0}.
+10201=Could not create replicated map of cluster nodes for cluster id {0}.
+10202=The cluster library is not available, please configure the destination ''{0}'' for single-host deployment.
+10203=In order to use the channel with a clustered destination, the endpoint for channel ''{0}'' must be a fully-qualified URL.
+10204=Unable to broadcast a replicated service operation to the service peers for cluster id ''{0}''.
+10205=Unable to replicate a service operation received from a broadcast on cluster id ''{0}''.
+10206=A cluster named ''{0}'' already exists. The same cluster id may not be configured more than once.
+10207=The destination ''{0}'' contains a reference to cluster ''{1}'' which does not exist, please check the cluster name.
+10208=The cluster properties file ''{0}'' does not exist.
+10209=The clustered destination ''{0}'' cannot use the channel ''{1}'' because the endpoint URI for the channel contains the token ''{2}''. Token replacement is not supported for clustered destinations when url-load-balancing is true for that destination.
+10210=The cluster implementation does not provide the expected constructor.
+10211=The cluster implementation cannot be instantiated.
+10212=Unable to broadcast a replicated service operation to the service peers for cluster id ''{0}'' because ''{1}'' is not Serializable.
+10213=The cluster properties file ''{0}'' cannot be read.
+10214=Only one cluster tag can have the default=true attribute ''{0}'' and ''{1}'' both have default set to true.
+10215=Default attribute to cluster tag: ''{0}'' must be true or false not: ''{1}''.
+10216=url-load-balancing attribute in cluster tag: ''{0}'' must be true or false not: ''{1}''
+10217=Destination ''{0}'' is referencing an undefined cluster ''{1}''. Please correct your destination configuration and restart.
+10218=Unable to create a cluster id named {0} because the root region could not be found.
+10219=Unable to service an endpoint operation received from a broadcast on cluster id ''{0}''.
+
+# 10300-10349: Serialization error messages
+10300=Error deserializing typed AMF object because the target server type ''{0}'' cannot be found.
+10301=Unknown AMF type ''{0}''.
+10302=Unsupported type found in AMF stream.
+10303=Unexpected object end tag in AMF stream.
+10304=AMF Recordsets are not supported.
+10305=Class ''{0}'' must implement java.io.Externalizable to receive client IExternalizable instances.
+10306=An unhandled error occurred while processing client request(s).
+10307=Error deserializing client message.
+10308=Error serializing response.
+10309=Unsupported RTMP extended command message data format {0}.
+10310=Unsupported AMF version {0}.
+10311=Creation validation for class ''{0}'' failed.
+10312=Assignment validation of the object with type ''{0}'' for the property ''{1}'' failed.
+10313=Assignment validation of the object with type ''{0}'' for the index ''{1}'' failed.
+10314=Error deserializing the string with length ''{0}'', it exceeds the max-string-bytes limit of ''{1}''.
+10315=Error serialization exceeds the max object nest level of ''{0}''.
+10316=Error serialization exceeds the max collection object nest level of ''{0}''.
+
+# 10400-10449: Management error messages
+10400=The specified object name, ''{0}'', is malformed and cannot be used to create an ObjectName instance.
+10401=The MBean, ''{0}'', could not be unregistered because its preDeregister() method threw an exception.
+10402=The MBean, ''{0}'', could not be unregistered because it is not currently registered.
+10403=The MBean, ''{0}'', could not be registered because its preRegister() method threw an exception.
+10404=The MBean, ''{0}'', could not be registered because it is already registered.
+10405=The MBean, ''{0}'', is not compliant and could not be registered.
+10406=An exception was thrown while introspecting the MBean, ''{0}''.
+10407=The MBean, ''{0}'', could not be found.
+10408=An exception was thrown trying to invoke the getMBeanInfo method for the dynamic MBean, ''{0}''.
+10409=The attribute, ''{0}'', was not found in the MBean, ''{1}''.
+10410=The getter for the attribute, ''{0}'', on MBean, ''{1}'', threw an exception.
+10411=A reflection exception was thrown while invoking the getter for the attribute, ''{0}'', on MBean, ''{1}''
+10412=The attribute name to get is null. Please provide a non-null attribute name.
+10413=A reflection exception was thrown while invoking the getAttributes method for the dynamic MBean, ''{0}''
+10414=One of the supplied attribute names is null. Please ensure that all attribute names are not null.
+10415=A reflection exception was thrown while trying to invoke the method, ''{0}'', on MBean, ''{1}''.
+10416=An exception was thrown by the invoked method, ''{0}'', on MBean, ''{1}''.
+10417=An exception was thrown creating MBean, ''{0}''.
+10418=The MBean, ''{0}'', already exists and is registered with the MBean server.
+10419=The MBean class, ''{0}'', is not JMX compliant.
+10420=The preRegister method of the MBean, ''{0}'', threw an exception so the MBean was not registered.
+10421=The preDeregister method of the MBean, ''{0}'', threw an exception so the MBean was not unregistered.
+10422=A reflection exception was thrown while invoking the setter for the attribute, ''{0}'', on MBean, ''{1}''
+10423=The setter for the attribute, ''{0}'', on MBean, ''{1}'', threw an exception.
+10424=The value, ''{0}'', specified for the attribute, ''{1}'', on MBean, ''{2}'', is not valid.
+10425=A reflection exception was thrown while invoking the setAttributes method for the dynamic MBean, ''{0}''
+10426=The MBean, ''{0}'', cannot be registered because the previous MBean with the same name could not be unregistered possibly due to some security setting on the application server. This can be avoided by setting manageable property to false in the configuration file.
+10427=MBeanServerLocator ''{0}'' failed to retrieve MBeanServer.
+10428=The admin console registrar could not be found.
+
+# 10450-10499: Service error messages
+10450=Unable to create service ''{0}'' for ''{1}'' due to the following error: {2}.
+10451=Command forbidden on service ''{0}''.
+10452=Unable to create service ''{0}'' for ''{1}'' due to the following error: class ''{2}'' could not be found in the classpath.
+10453=Unable to create service ''{0}'' for ''{1}'' due to a dependency on commons-logging.jar. To resolve this, copy commons-logging.jar from WEB-INF/flex/jars to WEB-INF/lib or add your desired version of commons-logging.jar to the classpath for this web application.
+10454=The ''{0}'' service can only process messages of type ''{1}''.
+10455=Destination ''{0}'' is not registered with service ''{1}''.
+
+
+# 10500-10549: Data adapter error messages. (in LCDS errors.properties)
+
+# 10550-10599: MessageService error messages.
+10550=The selector expression is not valid: {0}
+10551=Not subscribed to destination ''{0}''.
+10552=Unknown CommandMessage operation: {0}
+10553=Attempt to subscribe or unsubscribe to the subtopic, ''{0}'', on destination, ''{1}'', that does not allow subtopics failed.
+10554=The subtopic, ''{0}'', is not valid.
+10556=The sent message contains a subtopic wildcard, ''{0}'', which is not allowed.
+10557=Your subscribe request to the subtopic, ''{0}'', was denied.
+10558=Your sent message to the subtopic, ''{0}'', was blocked.
+10559=Duplicate subscription. Another client has already subscribed with the clientId, ''{0}''.
+10560=Attempt to subscribe to the subtopic, ''{0}'', on destination, ''{1}'', that does not allow wildcard subtopics failed.
+
+# 10600-10649: Message selector error messages.
+10600=Failed to parse the selector ''{0}''. {1}
+10601=Selector ''{0}'' attempted to match a value using an incompatible data type. Please review your selector expression and ensure that any string values you intend to match are quoted and non-string values are not.
+10602=Matching the selector ''{0}'' generated a parser error. {1}
+
+# 10650 - 10699: Remoting Service error messages.
+10650=Destination ''{0}'' is not registered with the Remoting Service.
+10652=Cannot create session scoped component for destination ''{0}'' because a session is not available.
+10653=Invalid scope setting for remoting destination ''{0}''. Valid options are {1}.
+10654=Invalid class found in attribute-id ''{0}'' for component of scope ''{1}'' for destination ''{2}''.  Expected an instance of class: ''{3}'' but found class ''{4}''.
+10656=Error instantiating application scoped instance of type ''{0}'' for destination ''{1}''.
+10657=MessageBroker with server id ''{0}'' does not contain a service with class flex.messaging.services.RemotingService
+10658=The remoting method being configured for remoting destination ''{0}'' must have a non-null name.
+10659=The remoting method ''{0}'' for remoting destination ''{1}'' is attempting to reference security constraint ''{2}'' that is not defined.
+10660=The remoting method ''{0}'' is not defined by the source class for remoting destination ''{1}''.
+
+# 10700 - 10749: HTTP Proxy Service error messages.
+10700=Can't use ''..'' in URLs (security violation).
+10701=A destination that allows multiple domains or ports does not allow authentication.
+10702=The URL specified ''{0}'' is not allowed by the selected destination ''{1}''.
+Dynamic URL is not configured in the whitelist.
+10703=Flex does not allow {0} cookies to be sent in a single request.
+10704=The relative URL ''{0}'' cannot be supported as the request was not made via HTTP.
+10705=A valid target URL was not specified: ''{0}''
+10706=Error sending request
+10706-1-details={0}
+10707=Unknown Host: {0}
+10708={0}
+10708-1-details={0}
+10709=HTTP Proxy response stream was null.
+10710=Cannot stream response to client. Request was not sent via HTTP.
+10711=Error writing response from HTTP Proxy: {0}
+10712=Invalid URL - only HTTP or HTTPS URLs allowed.
+10713=Invalid URL - can''t access HTTPS URLs when accessing proxy via HTTP.
+10714=Cannot support Basic Authentication. Request was not sent via HTTP.
+10715=A disallowed status code was returned - the proxy does not allow BASIC authentication attempts on a web service. Please secure your WSDL or use custom authentication.
+10716=The Flex proxy and the specified endpoint do not have the same domain, and so basic authentication cannot be used.  Please set use-custom-auth to true or set remote-username and remote-password services not located on the same domain as the Flex proxy.
+10717=Login required.
+10718=Access denied. User not authorized.
+10719=Invalid HTTP method ''{0}''
+
+# 10750-10799: RTMPS error messages. (in LCDS errors.properties)
+
+# 10800-10849: JMSAdapter error messages.
+10800=A <property> element for the <initial-context-environment> settings for the ''{0}'' destination does not specify both <name> and <value> subelements.
+10801=A <property> element for the <initial-context-environment> settings for the ''{0}'' destination specifies an invalid javax.naming.Context field for its <name>: {1}
+10802=A <property> element for the <initial-context-environment> settings for the ''{0}'' destination specifies an inaccessible javax.naming.Context field for its <name>: {1}
+10803=The <initial-context-environment> settings for the ''{0}'' destination does not include any <property> subelements.
+10804=JMS connection factory of message destinations with JMS Adapters must be specified.
+10805=JMS Adapter destination type must be Topic or Queue.
+# 10806=Client with the id ''{0}'' is not subscribed with the JMS adapter.
+10807=JNDI names for message destinations with JMS Adapters must be specified.
+10808=Invalid Acknowledge Mode ''{0}''. Valid values are AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, and CLIENT_ACKNOWLEDGE.
+10809=Invalid Delivery Mode ''{0}''. Valid values are DEFAULT_DELIVERY_MODE, PERSISTENT, and NON_PERSISTENT.
+10810=The body of the Flex message could not be converted to a Serializable Java Object.
+10811=Unsupported JMS Message Type ''{0}''. Valid values are javax.jms.TextMessage, javax.jms.ObjectMessage, and javax.jms.MapMessage.
+10812=The body of the Flex message could not be converted to a Java Map object.
+10813=JMS queue proxy for JMS destination ''{0}'' has a destination type of ''{1}'' which is not Queue.
+10814=JMS queue proxy for JMS destination ''{0}'' has a connection factory type of ''{1}'' which is not QueueConnectionFactory.
+10815=JMS topic proxy for JMS destination ''{0}'' has a destination type of ''{1}'' which is not Topic.
+10816=JMS topic proxy for JMS destination ''{0}'' has a connection factory type of ''{1}'' which is not TopicConnectionFactory.
+10817=Invalid delivery-settings mode ''{0}''. Valid values are async and sync.
+10818=JMS consumer for JMS destination ''{0}'' is configured to use async message receiver but the application server does not allow ''{1}'' call used in async message receiver. Please switch to sync message receiver.
+10819=JMS topic consumer for JMS destination ''{0}'' is configured to use durable subscriptions but the application server does not permit javax.jms.Connection.setClientID method needed to support durable subscribers. Set durable property to false.
+10820=Client is unsubscribed because its corresponding JMS consumer for JMS destination ''{0}'' encountered an error during message delivery: {1}
+10821=Client is unsubscribed because its corresponding JMS consumer has been removed from the JMS adapter.
+10822=Client is unsubscribed because its corresponding JMS consumer for JMS destination ''{0}'' has been stopped.
+10823=JMS topic consumer for JMS destination ''{0}'' is configured to use durable subscriptions but it does not have a durable subscription name.
+10824=JMS invocation caught exception: {0}.
+# 10850-10899: RTMP error messages. (in LCDS errors.properties)
+
+# 11100-11149: Server configuration error messages. (continuation from 10100-10149 block)
+11100=Invalid channel endpoint URI, {0}, must begin with {1}.
+11101=The factory tag with class ''{0}'' does not implement the flex.messaging.FlexFactory interface.
+11102=An error occurred trying to construct FlexFactory ''{0}''.   The underlying cause is: ''{1}''.
+11103=Invalid factory id: ''{1}'' for destination ''{0}''.  Look for a factory tag with this id under the factories tag for your configuration.
+11104=Unexpected text ''{0}'' found in ''{1}'' from file: {2}.
+11105=Please specify a valid ''flex.write.path'' in web.xml.
+11106=Please specify a valid <services/> file path in flex-config.xml.
+11107=Please specify a valid include file. ''{0}'' is invalid.
+11108=Please specify a valid ''services.configuration.file'' in web.xml. You specified ''{0}''. This is not a valid file system path reachable via the app server and is also not a path to a resource in your J2EE application archive.
+11109=Could not register endpoint ''{0}'' because its URL, ''{1}'', is already used by endpoint ''{2}''
+11110=Cannot add null ''{0}'' to the ''{1}''
+11111=Cannot add ''{0}'' with null id to the ''{1}''
+11112=Cannot add a {0} with the id ''{1}'' that is already registered with the {2}
+11113=Please specify a valid include directory. ''{0}'' is invalid.
+11114=No adapter with id ''{0}'' is registered with the service ''{1}''.
+11115=Cannot change the ''{0}'' property of a component after startup.
+11116=The ''{0}'' property of a component cannot be null.
+11117=Destination cannot create adapter ''{0}'' without its Service set.
+11118=Factory cannot be returned without ''{0}'' set.
+11119=Cannot add destination with id ''{0}'' to service with id ''{1}'' because another service with id ''{2}'' already has a destination with the same id.
+11120=The services configuration includes a channel-definition ''{0}'' that has an endpoint with a context.root token but a context root has not been defined. Please specify a context-root compiler argument.
+11121=The value of the cluster-message-routing attribute needs to be either the value 'server-to-server' (the default) or 'broadcast'.
+11122=Invalid location: ''{0}''. Please specify a valid LiveCycle Data Services Configuration file via the LiveCycle Admin UI.
+11123=Invalid <timeout-minutes> value ''{0}'' in the <flex-client> configuration section. Please specify a positive value or leave the element undefined in which case flex client instances on the server will be timed out when all associated sessions/connections have shut down.
+11124=Invalid default-security-constraint reference ''{0}'' in service ''{1}''.
+11125=Token ''{0}'' in ''{1}'' was not replaced. Either supply a value to this token with a JVM option or remove it from the configuration.
+11126=Invalid ''{0}'' value, ''{1}'', for ''{2}'' with id ''{3}''.
+11127=Cannot have multiple channels with the same id ''{0}''.
+11128=The endpoint, ''{0}'', is attempting to use a referenced server, ''{1}'', but no shared server is defined with this id.
+11129=The configuration is attempting to use functionality that requires the flex.messaging.services.AdvancedMessagingSupport service to be registered. This includes 'reliable' network settings for destinations, buffer/conflate throttling policies, and adaptive server-to-client message frequency settings.
+11130=Invalid inbound throttle policy ''{0}'' for destination ''{1}''. Valid values are 'NONE', 'ERROR', and 'IGNORE'.
+11131=Invalid {0} for destination ''{1}''. {0} ''{2}'' cannot be more than the incoming destination frequency ''{3}''.
+11132=Invalid {0} for destination ''{1}''. {0} ''{2}'' cannot be less than the incoming client frequency ''{3}''.
+11133=Invalid {0} for destination ''{1}''. {0} ''{2}'' cannot be more than the outgoing destination frequency ''{3}''.
+11134=Invalid {0} for destination ''{1}''. {0} ''{2}'' cannot be less than the outgoing client frequency ''{3}''.
+11135=Invalid {0} for destination ''{1}''. {0} cannot be negative.
+11136=Cannot add multiple validators with the same type ''{0}''.
+11137=Invalid <reliable-reconnect-duration-millis> value ''{0}'' in the <flex-client> configuration section. Please specify a positive value or leave the element undefined.
+11138=Failed to add an asynchronous message filter with id ''{0}'' to broker''s filter chain.
+11139=Endpoint ''{0}'' needs to have either class or server-only attribute defined.
+11140=Endpoint ''{0}'' cannot have both class and server-only attribute defined.
+11141=Invalid {0} configuration for endpoint ''{1}''; no urls defined.
+11142=Invalid {0} configuration for endpoint ''{1}''; cannot add empty url.
+11143=Failed to add a synchronous message filter with id ''{0}'' to broker''s filter chain.
+11144=The filter with id ''{0}'' registered within <async-message-filters> does not subclass the asynchronous flex.messaging.filters.BaseAsyncMessageFilter either directly or indirectly.
+11145=The filter with id ''{0}'' registered within <sync-message-filters> does not subclass the synchronous flex.messaging.filters.BaseSyncMessageFilter either directly or indirectly.
+11146=Invalid <heartbeat-interval-millis> value ''{0}'' in the <flex-client> configuration section. Please specify a positive value or leave the element undefined.
+11147=Invalid {0} configuration for endpoint ''{1}''; cannot add url with tokens.
+11148=UUID Generator class is not a valid subclass of ''{0}''.
+11149=Flex Configuration does not allow external entity defined by publicId ''{0}'' and SystemId ''{1}''
+# continued again in the 11400-11449 block
+
+# 11150-11199: license messages (in LCDS errors.properties)
+
+# 11200-11249: Data adapter error messages. (in LCDS errors.properties)
+
+# 11250-11300: SQL assembler error messages. (in LCDS errors.properties)
+
+# 11300-11349: Live Cycle Remoting error messages. (in LCDS errors.properties)
+
+# 11350-11399: WSRP Generation error messages. (in LCDS errors.properties)
+
+# 11400-11449: Server configuration error messages. (continuation from 11100-11149 block)
+11400=Only one validator is allowed to implement DeserializationValidator.  ''{0}'' has already been added.  ''{1}'' cannot be added as a validator.
+
+# 12000-12499: PDF Services error messages. (in LCDS errors.properties)
+
+# 13000-13499: Collaboration Services error messages.
+
+# 13500-13549: General SSL error messages. (in LCDS errors.properties)
+
+# 13550-13599: General socket server error messages (in LCDS errors.properties)
+
+# 13600-13649: flex.messaging.util.concurrent.Executor and related error messages.
+13600=Cannot create AsyncBeansWorkManagerExecutor because no WorkManager is bound in JNDI under the name ''{0}''.
+
+# 13650-13699: General NIO Endpoints error messages (in LCDS errors.properties)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/log/AbstractTarget.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/log/AbstractTarget.java b/modules/common/src/flex/messaging/log/AbstractTarget.java
new file mode 100755
index 0000000..82b455f
--- /dev/null
+++ b/modules/common/src/flex/messaging/log/AbstractTarget.java
@@ -0,0 +1,268 @@
+/*
+ * 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.messaging.log;
+
+import flex.messaging.LocalizedException;
+import flex.messaging.config.ConfigMap;
+import flex.messaging.util.UUIDUtils;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @exclude
+ */
+public abstract class AbstractTarget implements Target
+{
+    private static final int INVALID_FILTER_CHARS = 10016;
+    private static final int INVALID_FILTER_STAR = 10017;
+
+    protected final String id;
+    protected List filters;
+    protected volatile short level;
+    protected volatile int loggerCount;
+    private final Object lock = new Object();
+    private boolean usingDefaultFilter = false;
+
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Default constructor.
+     */
+    public AbstractTarget()
+    {
+        id = UUIDUtils.createUUID();
+        level = LogEvent.ERROR;
+        filters = new ArrayList();
+        filters.add("*");
+        usingDefaultFilter = true;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Initialize, validate, start, and stop methods.
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Initializes the target with id and properties. Subclasses can overwrite.
+     *
+     * @param id id for the target which is ignored.
+     * @param properties ConfigMap of properties for the target.
+     */
+    public void initialize(String id, ConfigMap properties)
+    {
+        // No-op
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Getters and Setters for AbstractTarget properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Return a read-only snap-shot of the current filters for this target.
+     *
+     * @return An unmodifiable list of filters.
+     */
+    public List getFilters()
+    {
+        return Collections.unmodifiableList(new ArrayList(filters));
+    }
+
+    /**
+     * Adds a filter to this target.
+     *
+     * @param value Filter to be added.
+     */
+    public void addFilter(String value)
+    {
+        if (value != null)
+            validateFilter(value);
+        else // Default to "*"
+            value = "*";
+
+        boolean filterWasAdded = false;
+        synchronized (lock)
+        {
+            if (!filters.contains(value))
+            {
+                // If the default filter is being used, remove it.
+                if (usingDefaultFilter)
+                {
+                    removeFilter("*");
+                    usingDefaultFilter = false;
+                }
+                filters.add(value);
+                filterWasAdded = true;
+            }
+        }
+        if (filterWasAdded)
+            Log.processTargetFilterAdd(this, value);
+    }
+
+    /**
+     * Removes a filter from this target.
+     *
+     * @param value Filter to be removed.
+     */
+    public void removeFilter(String value)
+    {
+        boolean filterWasRemoved;
+        synchronized (lock)
+        {
+            filterWasRemoved = filters.remove(value);
+        }
+        if (filterWasRemoved)
+            Log.processTargetFilterRemove(this, value);
+    }
+
+    /**
+     * Sets the list of filters for this target.
+     *
+     * @param value List of filters.
+     */
+    public void setFilters(List value)
+    {
+        if (value != null && value.size() > 0)
+        {
+            // a valid filter value will be fully qualified or have a wildcard
+            // in it.  the wild card can only be located at the end of the
+            // expression.  valid examples  xx*, xx.*,  *
+            for (int i = 0; i < value.size(); i++)
+            {
+                validateFilter((String) value.get(i));
+            }
+        }
+        else
+        {
+            // if null was specified then default to all
+            value = new ArrayList();
+            value.add("*");
+        }
+
+        Log.removeTarget(this);
+        synchronized (lock)
+        {
+            filters = value;
+            usingDefaultFilter = false;
+        }
+        Log.addTarget(this);
+    }
+
+    /**
+     * Return the log level for this target.
+     */
+    public short getLevel()
+    {
+        return level;
+    }
+
+    /**
+     * Return the target's unique ID.
+     */
+    public String getId()
+    {
+        return id;
+    }
+
+    /**
+     * Sets the log level for this target. If not set, defaults to <code>LogEvent.ERROR</code>.
+     */
+    public void setLevel(short value)
+    {
+        level = value;
+        Log.resetTargetLevel();
+    }
+
+    /**
+     * Sets up this target with the specified logger.
+     * This allows this target to receive log events from the specified logger.
+     *
+     * @param logger this target should listen to.
+     */
+    public void addLogger(Logger logger)
+    {
+        if (logger != null)
+        {
+            synchronized (lock)
+            {
+                loggerCount++;
+            }
+            logger.addTarget(this);
+        }
+    }
+
+    /**
+     * Stops this target from receiving events from the specified logger.
+     *
+     * @param logger this target should ignore.
+     */
+    public void removeLogger(Logger logger)
+    {
+        if (logger != null)
+        {
+            synchronized (lock)
+            {
+                loggerCount--;
+            }
+            logger.removeTarget(this);
+        }
+    }
+
+    /**
+     * @param filter category to check against the filters defined for this target
+     * @return whether filter is defined
+     */
+    public boolean containsFilter(String filter)
+    {
+        return filters.contains(filter);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Protected/private methods.
+    //
+    //--------------------------------------------------------------------------
+
+    private void validateFilter(String value)
+    {
+        // check for invalid characters
+        if (Log.hasIllegalCharacters(value))
+        {
+            //Error for filter '{filter}'. The following characters are not valid: {Log.INVALID_CHARS}
+            LocalizedException ex = new LocalizedException();
+            ex.setMessage(INVALID_FILTER_CHARS, new Object[]{value, Log.INVALID_CHARS});
+            throw ex;
+        }
+
+        int index = value.indexOf('*');
+        if ((index >= 0) && (index != (value.length() - 1)))
+        {
+            //Error for filter '{filter}'. '*' must be the right most character.
+            LocalizedException ex = new LocalizedException();
+            ex.setMessage(INVALID_FILTER_STAR, new Object[]{value});
+            throw ex;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/log/ConsoleTarget.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/log/ConsoleTarget.java b/modules/common/src/flex/messaging/log/ConsoleTarget.java
new file mode 100755
index 0000000..d33c1e0
--- /dev/null
+++ b/modules/common/src/flex/messaging/log/ConsoleTarget.java
@@ -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.
+ */
+package flex.messaging.log;
+
+/**
+ * @exclude
+ */
+public class ConsoleTarget extends LineFormattedTarget
+{
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Default constructor.
+     */
+    public ConsoleTarget()
+    {
+        super();
+    }
+
+    protected void internalLog(String message)
+    {
+        System.out.println(message);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/log/LineFormattedTarget.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/log/LineFormattedTarget.java b/modules/common/src/flex/messaging/log/LineFormattedTarget.java
new file mode 100755
index 0000000..d72387b
--- /dev/null
+++ b/modules/common/src/flex/messaging/log/LineFormattedTarget.java
@@ -0,0 +1,286 @@
+/*
+ * 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.messaging.log;
+
+import flex.messaging.config.ConfigMap;
+import flex.messaging.util.ExceptionUtil;
+import flex.messaging.util.StringUtils;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * @exclude
+ */
+public class LineFormattedTarget extends AbstractTarget
+{
+    /**
+     * Indicates if the date should be added to the trace.
+     */
+    protected boolean includeDate;
+
+    /**
+     * Indicates if the time should be added to the trace.
+     */
+    protected boolean includeTime;
+
+    /**
+     * Indicates if the level for the event should added to the trace.
+     */
+    protected boolean includeLevel;
+
+    /**
+     * Indicates if the category for this target should added to the trace.
+     */
+    protected boolean includeCategory;
+
+    /**
+     * A prefix to prepend onto each logged message.
+     */
+    protected String prefix = null;
+
+    /**
+     * The formatter to write the date as part of the logging statement.
+     * Defaults to MM/dd/yyyy format.
+     */
+    protected DateFormat dateFormater = new SimpleDateFormat("MM/dd/yyyy");
+
+    /**
+     * The formatter to write the time as part of the logging statement.
+     * Defaults to HH:mm:ss.SSS format.
+     */
+    protected DateFormat timeFormatter = new SimpleDateFormat("HH:mm:ss.SSS");
+
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Default constructor.
+     */
+    public LineFormattedTarget()
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Initialize, validate, start, and stop methods.
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Initializes the target with id and properties. Subclasses can overwrite.
+     *
+     * @param id id for the target which is ignored.
+     * @param properties ConfigMap of properties for the target.
+     */
+    public void initialize(String id, ConfigMap properties)
+    {
+        super.initialize(id, properties);
+
+        includeTime = properties.getPropertyAsBoolean("includeTime", false);
+        includeDate = properties.getPropertyAsBoolean("includeDate", false);
+        includeCategory = properties.getPropertyAsBoolean("includeCategory", false);
+        includeLevel = properties.getPropertyAsBoolean("includeLevel", false);
+        prefix = properties.getPropertyAsString("prefix", null);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Getters and Setters for AbstractService properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Returns includeCategory property.
+     *
+     * @return <code>true</code> if category is included; <code>false</code> otherwise.
+     */
+    public boolean isIncludeCategory()
+    {
+        return includeCategory;
+    }
+
+    /**
+     * Sets includeCategory property.
+     *
+     * @param includeCategory the include category
+     */
+    public void setIncludeCategory(boolean includeCategory)
+    {
+        this.includeCategory = includeCategory;
+    }
+
+    /**
+     * Returns includeDate property.
+     *
+     * @return <code>true</code> if date is included; <code>false</code> otherwise.
+     */
+    public boolean isIncludeDate()
+    {
+        return includeDate;
+    }
+
+    /**
+     * Sets includeDate property.
+     *
+     * @param includeDate the include date 
+     */
+    public void setIncludeDate(boolean includeDate)
+    {
+        this.includeDate = includeDate;
+    }
+
+    /**
+     * Returns includeLevel property.
+     *
+     * @return <code>true</code> if level is included; <code>false</code> otherwise.
+     */
+    public boolean isIncludeLevel()
+    {
+        return includeLevel;
+    }
+
+    /**
+     * Sets includeLevel property.
+     *
+     * @param includeLevel the include level
+     */
+    public void setIncludeLevel(boolean includeLevel)
+    {
+        this.includeLevel = includeLevel;
+    }
+
+    /**
+     * Returns includeTime property.
+     *
+     * @return <code>true</code> if time is included; <code>false</code> otherwise.
+     */
+    public boolean isIncludeTime()
+    {
+        return includeTime;
+    }
+
+    /**
+     * Sets includeTime property.
+     *
+     * @param includeTime the include time
+     */
+    public void setIncludeTime(boolean includeTime)
+    {
+        this.includeTime = includeTime;
+    }
+
+    /**
+     * Returns prefix property.
+     *
+     * @return The prefix for log messages.
+     */
+    public String getPrefix()
+    {
+        return prefix;
+    }
+
+    /**
+     * Sets prefix property.
+     *
+     * @param prefix the prefix string
+     */
+    public void setPrefix(String prefix)
+    {
+        this.prefix = prefix;
+    }
+
+    /**
+     * This method handles a <code>LogEvent</code> from an associated logger.
+     * A target uses this method to translate the event into the appropriate
+     * format for transmission, storage, or display.
+     * This method will be called only if the event's level is in range of the
+     * target's level.
+     * @param event the log event
+     */
+    public void logEvent(LogEvent event)
+    {
+        String pre = "";
+        if (prefix != null)
+        {
+            pre = prefix + " "; // any space is stripped from config
+        }
+
+        String date = "";
+        if (includeDate || includeTime)
+        {
+            StringBuffer buffer = new StringBuffer();
+            Date d = new Date();
+            if (includeDate)
+            {
+                buffer.append(dateFormater.format(d));
+                buffer.append(" ");
+            }
+            if (includeTime)
+            {
+                buffer.append(timeFormatter.format(d));
+                buffer.append(" ");
+            }
+            date = buffer.toString();
+        }
+
+        String cat = includeCategory ?
+                           ("[" + event.logger.getCategory() + "] ") : "";
+        String level = "";
+        if (includeLevel)
+        {
+            StringBuffer buffer = new StringBuffer();
+            buffer.append("[");
+            buffer.append(LogEvent.getLevelString(event.level));
+            buffer.append("]");
+            buffer.append(" ");
+            level = buffer.toString();
+        }
+        StringBuffer result = new StringBuffer(pre);
+        result.append(date).append(level).append(cat).append(event.message);
+
+        if (event.throwable != null)
+            result.append(StringUtils.NEWLINE).append(ExceptionUtil.toString(event.throwable));
+
+        internalLog(result.toString());
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Protected/private methods.
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Descendants of this class should override this method to direct the
+     * specified message to the desired output.
+     *
+     * @param  message String containing preprocessed log message which may
+     * include time, date, category, etc. based on property settings,
+     * such as <code>includeDate</code>, <code>includeCategory</code>,
+     * etc.
+     */
+    protected void internalLog(String message)
+    {
+        // override this method to perform the redirection to the desired output
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/log/Log.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/log/Log.java b/modules/common/src/flex/messaging/log/Log.java
new file mode 100755
index 0000000..4ae4d20
--- /dev/null
+++ b/modules/common/src/flex/messaging/log/Log.java
@@ -0,0 +1,704 @@
+/*
+ * 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.messaging.log;
+
+import flex.messaging.LocalizedException;
+import flex.messaging.config.ConfigMap;
+import flex.messaging.util.PrettyPrinter;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.HashSet;
+
+/**
+ * @exclude
+ */
+public class Log
+{
+
+    /** @exclude **/
+    public static final String INVALID_CHARS = "[]~$^&\\/(){}<>+=`!#%?,:;\'\"@";
+
+    // Errors
+    private static final int INVALID_TARGET = 10013;
+    private static final int INVALID_CATEGORY = 10014;
+    private static final int INVALID_CATEGORY_CHARS = 10015;
+
+    private static Log log;
+    private static PrettyPrinter prettyPrinter;
+    private static String prettyPrinterClass = "BasicPrettyPrinter";
+
+    private static final HashSet excludedProperties = new HashSet();
+    /** @exclude **/
+    public static final String VALUE_SUPRESSED = "** [Value Suppressed] **";
+
+    private volatile short targetLevel;
+    private final Map loggers;
+    private final List targets;
+    private final Map targetMap;
+    private static final Object staticLock = new Object();
+
+
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Private constructor.
+     */
+    private Log()
+    {
+        targetLevel = LogEvent.NONE;
+        loggers = new HashMap();
+        targets = new ArrayList();
+        targetMap = new LinkedHashMap();
+    }
+
+
+    /**
+     * Creates the log on first access, returns already created log on
+     * subsequent calls.
+     *
+     * @return log.
+     */
+    public static Log createLog()
+    {
+        synchronized (staticLock)
+        {
+            if (log == null)
+                log = new Log();
+
+            return log;
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Initialize, validate, start, and stop methods.
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Initializes Log with id and properties.
+     *
+     * @param id Id for the Log which is ignored, though is used by the ManageableComponent superclass
+     * @param properties ConfigMap of properties for the Log.
+     */
+    public static synchronized void initialize(String id, ConfigMap properties)
+    {
+        String value = properties.getPropertyAsString("pretty-printer", null);
+        if (value != null)
+            prettyPrinterClass = value;
+
+        // Create a HashSet with the properties that we want to exclude from the
+        // list of properties given by 'getPropertiesAsList'
+        ConfigMap excludeMap = properties.getPropertyAsMap("exclude-properties", null);
+        if (excludeMap != null)
+        {
+            if (excludeMap.getPropertyAsList("property", null) != null)
+                excludedProperties.addAll(excludeMap.getPropertyAsList("property", null));
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Public Getters and Setters for Log properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Indicates whether a fatal level log event will be processed by a log target.
+     * @return boolean true if it is Fatal level
+     */
+    public static boolean isFatal()
+    {
+        return log == null ? false : log.targetLevel <= LogEvent.FATAL;
+    }
+
+    /**
+     * Indicates whether an error level log event will be processed by a log target.
+     * @return boolean true if it is Error level
+     */
+    public static boolean isError()
+    {
+        return log == null ? false : log.targetLevel <= LogEvent.ERROR;
+    }
+
+    /**
+     * Indicates whether a warn level log event will be processed by a log target.
+     * @return boolean true if it is Warn level
+     */
+    public static boolean isWarn()
+    {
+        return log == null ? false : log.targetLevel <= LogEvent.WARN;
+    }
+
+    /**
+     * Indicates whether an info level log event will be processed by a log target.
+     * @return boolean true if it is Info level
+     */
+    public static boolean isInfo()
+    {
+        return log == null ? false : log.targetLevel <= LogEvent.INFO;
+    }
+
+    /**
+     * Indicates whether a debug level log event will be processed by a log target.
+     * @return boolean true if it is debug level
+     */
+    public static boolean isDebug()
+    {
+        return log == null ? false : log.targetLevel <= LogEvent.DEBUG;
+    }
+
+    /**
+     * Indicates whether a log property should be excluded.
+     * @param property the property to check
+     * @return boolean true if the property should be excluded
+     */
+    public static boolean isExcludedProperty(String property)
+    {
+        return !excludedProperties.isEmpty() && excludedProperties.contains(property);
+    }
+
+
+    /**
+     * Given a category, returns the logger associated with the category.
+     *
+     * @param category Categogry for the logger.
+     * @return Logger associated with the category.
+     */
+    public static Logger getLogger(String category)
+    {
+        if (log != null)
+            return getLogger(log, category);
+
+        // Return a dummy logger?
+        return new Logger(category);
+    }
+
+    /**
+     * @exclude
+     */
+    public static Logger getLogger(Log log, String category)
+    {
+        checkCategory(category);
+
+        synchronized (staticLock)
+        {
+            Logger result = (Logger) log.loggers.get(category);
+            if (result == null)
+            {
+                result = new Logger(category);
+
+                // Check to see if there are any targets for this logger.
+                for (Iterator iter = log.targets.iterator(); iter.hasNext();)
+                {
+                    Target target = (Target) iter.next();
+                    if (categoryMatchInFilterList(category, target.getFilters()))
+                        target.addLogger(result);
+                }
+
+                log.loggers.put(category, result);
+            }
+            return result;
+        }
+    }
+
+    /**
+     * Returns an unmodifiable snapshot of the targets registered with this Log when the
+     * method is invoked.
+     * @return List the list of targets 
+     */
+    public static List getTargets()
+    {
+        if (log != null)
+        {
+            List currentTargets;
+            // Snapshot the current target list (shallow copy) and return it.
+            synchronized (staticLock)
+            {
+                currentTargets = Collections.unmodifiableList(new ArrayList(log.targets));
+            }
+            return currentTargets;
+        }
+        return null;
+    }
+
+    /**
+     * Return the Log's map of targets keyed on their human-readable ids (e.g. ConsoleTarget0, ConsoleTarget1, etc.)
+     * @return Map the target map
+     */
+    public static Map getTargetMap()
+    {
+        if (log != null)
+        {
+            Map currentTargets;
+            synchronized (staticLock)
+            {
+                currentTargets = new LinkedHashMap(log.targetMap);
+            }
+            return currentTargets;
+        }
+        return null;
+    }
+
+    /**
+     * Returns the target associated with the unique ID searchId.  Returns null if no
+     * such target exists.
+     * @param searchId the search ID
+     * @return Target the associated target
+     */
+    public static Target getTarget(String searchId)
+    {
+        if (log != null)
+        {
+            synchronized (staticLock)
+            {
+                return (Target) log.targetMap.get(searchId);
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Return the categories for all of the loggers
+     * @return String[] the categories for all of the loggers
+     */
+    public String[] getLoggers()
+    {
+        String[] currentCategories;
+        if (log != null)
+        {
+            synchronized (staticLock)
+            {
+                Object[] currentCategoryObjects = loggers.keySet().toArray();
+                currentCategories = new String[currentCategoryObjects.length];
+                for (int i = 0; i < currentCategoryObjects.length; i++)
+                {
+                    currentCategories[i] = (String)(currentCategoryObjects[i]);
+                }
+            }
+        }
+        else
+        {
+            currentCategories = new String[0];
+        }
+
+        return currentCategories;
+    }
+
+    /**
+     * Adds a target to the log.
+     *
+     * @param target Target to be added.
+     */
+    public static void addTarget(Target target)
+    {
+        if (log != null)
+        {
+            if (target != null)
+            {
+                synchronized (staticLock)
+                {
+                    List filters = target.getFilters();
+
+                    // need to find what filters this target matches and set the specified
+                    // target as a listener for that logger.
+                    Iterator it = log.loggers.keySet().iterator();
+                    while (it.hasNext())
+                    {
+                        String key = (String) it.next();
+                        if (categoryMatchInFilterList(key, filters))
+                            target.addLogger((Logger) log.loggers.get(key));
+                    }
+                    // if we found a match all is good, otherwise we need to
+                    // put the target in a waiting queue in the event that a logger
+                    // is created that this target cares about.
+                    if (!log.targets.contains(target))
+                        log.targets.add(target);
+
+                    if (!log.targetMap.containsValue(target))
+                    {
+                        String name = target.getClass().getName();
+
+                        if (name.indexOf(".") > -1)
+                        {
+                            String[] classes = name.split("\\.");
+                            name = classes[classes.length - 1];
+                        }
+
+                        log.targetMap.put(new String(name + log.targetMap.size()), target);
+                    }
+
+                    // update our global target log level if this target is more verbose.
+                    short targetLevel = target.getLevel();
+                    if (log.targetLevel == LogEvent.NONE)
+                        log.targetLevel = targetLevel;
+                    else if (targetLevel < log.targetLevel)
+                    {
+                        log.targetLevel = targetLevel;
+                    }
+                }
+            }
+            else
+            {
+                // Invalid target specified. Target must not be null.
+                LocalizedException ex = new LocalizedException();
+                ex.setMessage(INVALID_TARGET);
+                throw ex;
+            }
+        }
+    }
+
+    /**
+     * Removes a target from the log.
+     *
+     * @param target The target to be removed.
+     */
+    public static void removeTarget(Target target)
+    {
+        if (log != null)
+        {
+            if (target != null)
+            {
+                synchronized (staticLock)
+                {
+                    // Remove the target from any associated loggers.
+                    List filters = target.getFilters();
+                    Iterator it = log.loggers.keySet().iterator();
+                    while (it.hasNext())
+                    {
+                        String key = (String) it.next();
+                        if (categoryMatchInFilterList(key, filters))
+                            target.removeLogger((Logger) log.loggers.get(key));
+                    }
+                    // Remove the target from the Log set.
+                    log.targets.remove(target);
+                    resetTargetLevel();
+                }
+            }
+            else
+            {
+                // Invalid target specified. Target must not be null.
+                LocalizedException ex = new LocalizedException();
+                ex.setMessage(INVALID_TARGET);
+                throw ex;
+            }
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Other Public APIs
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * This method removes all of the current loggers and targets from the cache.
+     * and resets target level.
+     */
+    public static synchronized void reset()
+    {
+        flush();
+    }
+
+    /**
+     * @exclude
+     */
+    public static void flush()
+    {
+        if (log != null)
+        {
+            log.loggers.clear();
+            log.targets.clear();
+            log.targetLevel = LogEvent.NONE;
+        }
+    }
+
+    /**
+     * @exclude
+     */
+    public static short readLevel(String l)
+    {
+        short lvl = LogEvent.ERROR;
+        if ((l != null) && (l.length() > 0))
+        {
+            l = l.trim().toLowerCase();
+            char c = l.charAt(0);
+            switch (c)
+            {
+                case 'n':
+                    lvl = LogEvent.NONE;
+                    break;
+                case 'e':
+                    lvl = LogEvent.ERROR;
+                    break;
+                case 'w':
+                    lvl = LogEvent.WARN;
+                    break;
+                case 'i':
+                    lvl = LogEvent.INFO;
+                    break;
+                case 'd':
+                    lvl = LogEvent.DEBUG;
+                    break;
+                case 'a':
+                    lvl = LogEvent.ALL;
+                    break;
+                default:
+                    lvl = LogEvent.ERROR;
+            }
+        }
+
+        return lvl;
+    }
+
+    /**
+     * @exclude
+     * This method checks the specified string value for illegal characters.
+     *
+     * @param value to check for illegal characters.
+     *              The following characters are not valid:
+     *              []~$^&amp;\/(){}&lt;&gt;+=`!#%?,:;'"&amp;#64;
+     * @return <code>true</code> if there are any illegal characters found,
+     *         <code>false</code> otherwise
+     */
+    public static boolean hasIllegalCharacters(String value)
+    {
+        char[] chars = value.toCharArray();
+        for (int i = 0; i < chars.length; i++)
+        {
+            char c = chars[i];
+            if (INVALID_CHARS.indexOf(c) != -1)
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * @exclude
+     * Returns the PrettyPrinter used by the Log.
+     */
+    public static PrettyPrinter getPrettyPrinter()
+    {
+        if (prettyPrinter == null ||
+                !prettyPrinter.getClass().getName().equals(prettyPrinterClass))
+        {
+            try
+            {
+                Class c = Class.forName(prettyPrinterClass);
+                prettyPrinter = (PrettyPrinter)c.newInstance();
+            }
+            catch (Throwable t)
+            {
+            }
+        }
+        return (PrettyPrinter)prettyPrinter.copy();
+    }
+
+    /**
+     * @exclude
+     * Returns the current target level for the Log.
+     */
+    public static short getTargetLevel()
+    {
+        return log == null ? LogEvent.NONE : log.targetLevel;
+    }
+
+    /**
+     * @exclude
+     * Sets the pretty printer class name used by the log.
+     *
+     * @param value Name of the pretty printer class.
+     */
+    public static void setPrettyPrinterClass(String value)
+    {
+        prettyPrinterClass = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Protected/private methods.
+    //
+    //--------------------------------------------------------------------------
+
+    /* package */ static void resetTargetLevel()
+    {
+        if (log != null)
+        {
+            synchronized (staticLock)
+            {
+                short maxTargetLevel = LogEvent.NONE;
+                for (Iterator iter = log.targets.iterator(); iter.hasNext();)
+                {
+                    short targetLevel = ((Target) iter.next()).getLevel();
+                    if (maxTargetLevel == LogEvent.NONE || targetLevel < maxTargetLevel)
+                        maxTargetLevel = targetLevel;
+                }
+                log.targetLevel = maxTargetLevel;
+            }
+        }
+    }
+
+    /* package */ static void processTargetFilterAdd(Target target, String filter)
+    {
+        if (log != null)
+        {
+            synchronized (staticLock)
+            {
+                List filters = new ArrayList();
+                filters.add(filter);
+
+                // Find the loggers this target matches and add the
+                // target as a listener for log events from these loggers.
+                Iterator it = log.loggers.keySet().iterator();
+                while (it.hasNext())
+                {
+                    String key = (String) it.next();
+                    if (categoryMatchInFilterList(key, filters))
+                        target.addLogger((Logger) log.loggers.get(key));
+                }
+            }
+        }
+    }
+
+    /* package */ static void processTargetFilterRemove(Target target, String filter)
+    {
+        if (log != null)
+        {
+            synchronized (staticLock)
+            {
+                // Remove the target from any matching loggers.
+                List filters = new ArrayList();
+                filters.add(filter);
+                Iterator it = log.loggers.keySet().iterator();
+                while (it.hasNext())
+                {
+                    String key = (String) it.next();
+                    if (categoryMatchInFilterList(key, filters))
+                        target.removeLogger((Logger) log.loggers.get(key));
+                }
+            }
+        }
+    }
+
+    /**
+     * This method checks that the specified category matches any of the filter
+     * expressions provided in the filters array.
+     *
+     * @param category to match against
+     * @param filters  - list of strings to check category against.
+     * @return <code>true</code> if the specified category matches any of the
+     *         filter expressions found in the filters list, <code>false</code>
+     *         otherwise.
+     */
+    private static boolean categoryMatchInFilterList(String category, List filters)
+    {
+        if (filters == null)
+            return false;
+
+        for (int i = 0; i < filters.size(); i++)
+        {
+            String filter = (String) filters.get(i);
+            // match category to filter based on the presence of a wildcard
+            if (checkFilterToCategory(filter,category))
+                return true;
+        }
+        return false;
+    }
+
+    /**
+     * Check whether the category match with the filter.
+     * @param filter The filter string to check against a specific category
+     * @param category The category which the filter could match
+     * @return whether the filter matches a specific category
+     */
+    public static boolean checkFilterToCategory(String filter, String category)
+    {
+        int index = -1;
+        index = filter.indexOf("*");
+
+        if (index == 0) // match all
+        {
+            return true;
+        }
+        else if (index < 0) // match full category to filter
+        {
+            if (category.equals(filter))
+            {
+                return true;
+            }
+        }
+        else // match partial category to filter
+        {
+            if ((category.length() >= index) && category.substring(0, index).equals(filter.substring(0, index)))
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * This method will ensure that a valid category string has been specified.
+     * If the category is not valid an exception will be thrown.
+     *
+     * Categories can not contain any blanks or any of the following characters:
+     * []`*~,!#$%^&amp;()]{}+=\|'";?&gt;&lt;./&amp;#64; or be less than 1 character in length.
+     */
+    private static void checkCategory(String category)
+    {
+        if (category == null || category.length() == 0)
+        {
+            // Categories must be at least one character in length.
+            LocalizedException ex = new LocalizedException();
+            ex.setMessage(INVALID_CATEGORY);
+            throw ex;
+        }
+
+        if (hasIllegalCharacters(category) || (category.indexOf("*") != -1))
+        {
+            // Categories can not contain any of the following characters: 'INVALID_CHARS'
+            LocalizedException ex = new LocalizedException();
+            ex.setMessage(INVALID_CATEGORY_CHARS, new Object[]{INVALID_CHARS});
+            throw ex;
+        }
+    }
+
+    /**
+     * Clean up static member variables.
+     */
+    public static void clear()
+    {
+        log = null;
+        prettyPrinter = null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/log/LogCategories.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/log/LogCategories.java b/modules/common/src/flex/messaging/log/LogCategories.java
new file mode 100755
index 0000000..3f6945b
--- /dev/null
+++ b/modules/common/src/flex/messaging/log/LogCategories.java
@@ -0,0 +1,112 @@
+/*
+ * 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.messaging.log;
+
+/**
+ * @exclude
+ *
+ * This class contains all the log categories used in our classes. When adding
+ * a new log category, make sure the sample configuration file is updated
+ * as well.
+ *
+ */
+public interface LogCategories
+{
+    String CLIENT_FLEXCLIENT = "Client.FlexClient";
+    String CLIENT_FLEXCLIENT_ADAPTIVE = "Client.FlexClient.Adaptive";
+    String CLIENT_MESSAGECLIENT = "Client.MessageClient";
+
+    String CONFIGURATION = "Configuration";
+    String CONFIGURATION_SPRING = "Configuration.Spring";
+
+    String ENDPOINT_GENERAL = "Endpoint.General";
+    String ENDPOINT_AMF = "Endpoint.AMF";
+    String ENDPOINT_NIO_AMF = "Endpoint.NIOAMF";
+    String ENDPOINT_FLEXSESSION = "Endpoint.FlexSession";
+    String ENDPOINT_GATEWAY = "Endpoint.Gateway";
+    String ENDPOINT_HTTP = "Endpoint.HTTP";
+    String ENDPOINT_NIO_HTTP = "Endpoint.NIOHTTP";
+    String ENDPOINT_RTMP = "Endpoint.RTMP";
+    String ENDPOINT_STREAMING_AMF = "Endpoint.StreamingAMF";
+    String ENDPOINT_STREAMING_NIO_AMF = "Endpoint.StreamingNIOAMF";
+    String ENDPOINT_STREAMING_HTTP = "Endpoint.StreamingHTTP";
+    String ENDPOINT_STREAMING_NIO_HTTP = "Endpoint.StreamingNIOHTTP";
+    String ENDPOINT_WEBSOCKET_NIO_AMF = "Endpoint.WebSocketNIOAMF";
+    String ENDPOINT_TYPE = "Endpoint.Type";
+
+    String EXECUTOR = "Executor";
+
+    String MANAGEMENT_GENERAL = "Management.General";
+    String MANAGEMENT_MBEANSERVER = "Management.MBeanServer";
+
+    String MESSAGE_GENERAL = "Message.General";
+    String MESSAGE_COMMAND = "Message.Command";
+    String MESSAGE_DATA = "Message.Data";
+    String MESSAGE_FILTER = "Message.Filter";
+    String MESSAGE_REMOTING = "Message.Remoting";
+    String MESSAGE_RPC = "Message.RPC";
+    String MESSAGE_SELECTOR = "Message.Selector";
+    String MESSAGE_TIMING = "Message.Timing";
+
+    String PROTOCOL_AMFSOCKET = "Protocol.AMFSocket";
+    String PROTOCOL_HTTP = "Protocol.HTTP";
+    String PROTOCOL_RTMP = "Protocol.RTMP";
+    String PROTOCOL_RTMPT = "Protocol.RTMPT";
+
+    String RESOURCE = "Resource";
+
+    String SERVICE_GENERAL = "Service.General";
+    String SERVICE_CLUSTER = "Service.Cluster";
+    String SERVICE_COLLABORATION = "Service.Collaboration";
+    String SERVICE_DATA = "Service.Data"; // Not a category but used by TargetSettings to replace DataService
+    String SERVICE_DATA_GENERAL = "Service.Data.General";
+    String SERVICE_DATA_HIBERNATE = "Service.Data.Hibernate";
+    String SERVICE_DATA_SQL = "Service.Data.SQL";
+    String SERVICE_DATA_TRANSACTION = "Service.Data.Transaction";
+    String SERVICE_ADVANCED_MESSAGING = "Service.AdvancedMessaging";
+    String SERVICE_NOTIFICATION = "Service.Notification";
+    String SERVICE_GATEWAY = "Service.Gateway";
+    String SERVICE_GATEWAY_CONNECTOR = "Service.Gateway.Connector";
+    String SERVICE_HTTP = "Service.HTTP";
+    String SERVICE_MESSAGE = "Service.Message";
+    String SERVICE_MESSAGE_JMS = "Service.Message.JMS";
+    String SERVICE_REMOTING = "Service.Remoting";
+
+    String SECURITY = "Security";
+
+    String SOCKET_SERVER_GENERAL = "SocketServer.General";
+    String SOCKET_SERVER_BYTE_BUFFER_MANAGEMENT = "SocketServer.ByteBufferManagement";
+
+    String SSL = "SSL";
+
+    String STARTUP_MESSAGEBROKER = "Startup.MessageBroker";
+    String STARTUP_SERVICE = "Startup.Service";
+    String STARTUP_DESTINATION = "Startup.Destination";
+
+    String TIMEOUT = "Timeout";
+
+    String TRANSPORT_RELIABLE = "Transport.Reliable";
+    String TRANSPORT_THROTTLE = "Transport.Throttle";
+    String TRANSPORT_THROTTLE_BUFFER = "Transport.Throttle.Buffer";
+    String TRANSPORT_THROTTLE_CONFLATE = "Transport.Throttle.Conflate";
+
+    String WSRP_GENERAL = "WSRP.General";
+
+    String RDS = "RDS";
+
+    String FBSERVICES_INTROSPECTION = "FBServices.Introspection";
+}

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/modules/common/src/flex/messaging/log/LogEvent.java
----------------------------------------------------------------------
diff --git a/modules/common/src/flex/messaging/log/LogEvent.java b/modules/common/src/flex/messaging/log/LogEvent.java
new file mode 100755
index 0000000..04a168b
--- /dev/null
+++ b/modules/common/src/flex/messaging/log/LogEvent.java
@@ -0,0 +1,116 @@
+/*
+ * 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.messaging.log;
+
+/**
+ * @exclude
+ */
+public class LogEvent
+{
+    public static final short NONE = 2000;
+    public static final short FATAL = 1000;
+    public static final short ERROR = 8;
+    public static final short WARN = 6;
+    public static final short INFO = 4;
+    public static final short DEBUG = 2;
+    public static final short ALL = 0;
+
+    /**
+     * Provides access to the level for this log event.
+     * Valid values are:
+     * <ul>
+     * <li><code>LogEvent.DEBUG</code> designates informational
+     * level messages that are fine grained and most helpful when
+     * debugging an application.</li>
+     *
+     * <li><code>LogEvent.INFO</code> designates informational messages
+     * that highlight the progress of the application at
+     * coarse-grained level.</li>
+     *
+     * <li><code>LogEvent.WARN</code> designates events that could be
+     * harmful to the application operation.</li>
+     *
+     * <li><code>LogEvent.ERROR</code> designates error events that might
+     * still allow the application to continue running.</li>
+     *
+     * <li><code>LogEvent.FATAL</code> designates events that are very
+     * harmful and will eventually lead to application failure.</li>
+     *
+     * </ul>
+     */
+    public short level;
+
+    /**
+     * Provides access to the message that was logged.
+     */
+    public String message;
+
+    /**
+     * Logger instance that raised the log event.
+     */
+    public Logger logger;
+
+    /**
+     * Related exception, if applicable.
+     */
+    public Throwable throwable;
+
+    /**
+     * Constructor.
+     *
+     * @param lgr Logger instance that raised the log event.
+     * @param msg Message that was logged.
+     * @param lvl The level for the log event.
+     * @param t Related exception, if applicable.
+     */
+    public LogEvent(Logger lgr, String msg, short lvl, Throwable t)
+    {
+        logger = lgr;
+        message = msg;
+        level = lvl;
+        throwable = t;
+    }
+
+    /**
+     * Returns a string value representing the level specified.
+     *
+     * @param value the level a string is desired for.
+     * @return the level specified in english
+     */
+    public static String getLevelString(short value)
+    {
+        switch (value)
+        {
+            case NONE:
+                return ("NONE");
+            case FATAL:
+                return ("FATAL");
+            case ERROR:
+                return ("ERROR");
+            case WARN:
+                return ("WARN");
+            case INFO:
+                return ("INFO");
+            case DEBUG:
+                return ("DEBUG");
+            case ALL:
+                return ("ALL");
+            default:
+                return ("UNKNOWN");
+        }
+    }
+}


[34/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/history/history.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/history/history.js b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/history/history.js
new file mode 100755
index 0000000..0f82450
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/history/history.js
@@ -0,0 +1,722 @@
+/*
+ * 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.
+ */
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        ie8: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+        if (browser.version == 8)
+        {
+            browser.ie = false;
+            browser.ie8 = true;
+        }
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    function hashChangeHandler()
+    {
+        currentHref = document.location.href;
+        var flexAppUrl = getHash();
+        //ADR: to fix multiple
+        if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+            var pl = getPlayers();
+            for (var i = 0; i < pl.length; i++) {
+                pl[i].browserURLChange(flexAppUrl);
+            }
+        } else {
+            getPlayer().browserURLChange(flexAppUrl);
+        }
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+        var i;
+
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+                for (i = 0; i < o.length; i++) {
+                    if (typeof o[i].browserURLChange != "undefined")
+                        return o[i];
+                }
+                for (i = 0; i < e.length; i++) {
+                    if (typeof e[i].browserURLChange != "undefined")
+                        return e[i];
+                }
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+            for (i = 0; i < e.length; i++) {
+                if (typeof e[i].browserURLChange != "undefined")
+                {
+                    return e[i];
+                }
+            }
+            for (i = 0; i < o.length; i++) {
+                if (typeof o[i].browserURLChange != "undefined")
+                {
+                    return o[i];
+                }
+            }
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var i;
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+                        currentHref = document.location.href;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                var flexAppUrl = getHash();
+                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
+                {    
+                    // If it did change and we're running Safari 3.x or earlier, 
+                    // then we have to look the old state up in our hand-maintained 
+                    // array since document.location.hash won't have changed, 
+                    // then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                    flexAppUrl = historyHash[currentHistoryLength];
+                }
+
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            iframe.src = 'javascript:false;'; 
+
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox || browser.ie8)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+
+        if (browser.ie8)        
+            document.body.onhashchange = hashChangeHandler;
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        },
+        getUserAgent: function() {
+            return navigator.userAgent;
+        },
+        getPlatform: function() {
+            return navigator.platform;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/history/historyFrame.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/history/historyFrame.html b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/history/historyFrame.html
new file mode 100755
index 0000000..63bdd3e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/history/historyFrame.html
@@ -0,0 +1,45 @@
+<!--
+  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>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/index.template.html b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/index.template.html
new file mode 100755
index 0000000..e3e9c81
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/swfobject.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/swfobject.js b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/swfobject.js
new file mode 100755
index 0000000..07730fa
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/html-template/swfobject.js
@@ -0,0 +1,793 @@
+/*
+ * 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.
+ */
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+	
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+		ON_READY_STATE_CHANGE = "onreadystatechange",
+		
+		win = window,
+		doc = document,
+		nav = navigator,
+		
+		plugin = false,
+		domLoadFnArr = [main],
+		regObjArr = [],
+		objIdArr = [],
+		listenersArr = [],
+		storedAltContent,
+		storedAltContentId,
+		storedCallbackFn,
+		storedCallbackObj,
+		isDomLoaded = false,
+		isExpressInstallActive = false,
+		dynamicStylesheet,
+		dynamicStylesheetMedia,
+		autoHideShow = true,
+	
+	/* Centralized function for browser feature detection
+		- User agent string detection is only used when no good alternative is possible
+		- Is executed directly for optimal performance
+	*/	
+	ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+			u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+				plugin = true;
+				ie = false; // cascaded feature detection for Internet Explorer
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			try {
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+				if (a) { // a will return null when ActiveX is disabled
+					d = a.GetVariable("$version");
+					if (d) {
+						ie = true; // cascaded feature detection for Internet Explorer
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+			}
+			catch(e) {}
+		}
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+	}(),
+	
+	/* Cross-browser onDomLoad
+		- Will fire an event as soon as the DOM of a web page is loaded
+		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+		- Regular onload serves as fallback
+	*/ 
+	onDomLoad = function() {
+		if (!ua.w3) { return; }
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+			callDomLoadFunctions();
+		}
+		if (!isDomLoaded) {
+			if (typeof doc.addEventListener != UNDEF) {
+				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+			}		
+			if (ua.ie && ua.win) {
+				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+					if (doc.readyState == "complete") {
+						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+						callDomLoadFunctions();
+					}
+				});
+				if (win == top) { // if not inside an iframe
+					(function(){
+						if (isDomLoaded) { return; }
+						try {
+							doc.documentElement.doScroll("left");
+						}
+						catch(e) {
+							setTimeout(arguments.callee, 0);
+							return;
+						}
+						callDomLoadFunctions();
+					})();
+				}
+			}
+			if (ua.wk) {
+				(function(){
+					if (isDomLoaded) { return; }
+					if (!/loaded|complete/.test(doc.readyState)) {
+						setTimeout(arguments.callee, 0);
+						return;
+					}
+					callDomLoadFunctions();
+				})();
+			}
+			addLoadEvent(callDomLoadFunctions);
+		}
+	}();
+	
+	function callDomLoadFunctions() {
+		if (isDomLoaded) { return; }
+		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+			t.parentNode.removeChild(t);
+		}
+		catch (e) { return; }
+		isDomLoaded = true;
+		var dl = domLoadFnArr.length;
+		for (var i = 0; i < dl; i++) {
+			domLoadFnArr[i]();
+		}
+	}
+	
+	function addDomLoadEvent(fn) {
+		if (isDomLoaded) {
+			fn();
+		}
+		else { 
+			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+		}
+	}
+	
+	/* Cross-browser onload
+		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+		- Will fire an event as soon as a web page including all of its assets are loaded 
+	 */
+	function addLoadEvent(fn) {
+		if (typeof win.addEventListener != UNDEF) {
+			win.addEventListener("load", fn, false);
+		}
+		else if (typeof doc.addEventListener != UNDEF) {
+			doc.addEventListener("load", fn, false);
+		}
+		else if (typeof win.attachEvent != UNDEF) {
+			addListener(win, "onload", fn);
+		}
+		else if (typeof win.onload == "function") {
+			var fnOld = win.onload;
+			win.onload = function() {
+				fnOld();
+				fn();
+			};
+		}
+		else {
+			win.onload = fn;
+		}
+	}
+	
+	/* Main function
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
+	*/
+	function main() { 
+		if (plugin) {
+			testPlayerVersion();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Detect the Flash Player version for non-Internet Explorer browsers
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+		  a. Both release and build numbers can be detected
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+	*/
+	function testPlayerVersion() {
+		var b = doc.getElementsByTagName("body")[0];
+		var o = createElement(OBJECT);
+		o.setAttribute("type", FLASH_MIME_TYPE);
+		var t = b.appendChild(o);
+		if (t) {
+			var counter = 0;
+			(function(){
+				if (typeof t.GetVariable != UNDEF) {
+					var d = t.GetVariable("$version");
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				else if (counter < 10) {
+					counter++;
+					setTimeout(arguments.callee, 10);
+					return;
+				}
+				b.removeChild(o);
+				t = null;
+				matchVersions();
+			})();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Perform Flash Player and SWF version matching; static publishing only
+	*/
+	function matchVersions() {
+		var rl = regObjArr.length;
+		if (rl > 0) {
+			for (var i = 0; i < rl; i++) { // for each registered object element
+				var id = regObjArr[i].id;
+				var cb = regObjArr[i].callbackFn;
+				var cbObj = {success:false, id:id};
+				if (ua.pv[0] > 0) {
+					var obj = getElementById(id);
+					if (obj) {
+						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+							setVisibility(id, true);
+							if (cb) {
+								cbObj.success = true;
+								cbObj.ref = getObjectById(id);
+								cb(cbObj);
+							}
+						}
+						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+							var att = {};
+							att.data = regObjArr[i].expressInstall;
+							att.width = obj.getAttribute("width") || "0";
+							att.height = obj.getAttribute("height") || "0";
+							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+							// parse HTML object param element's name-value pairs
+							var par = {};
+							var p = obj.getElementsByTagName("param");
+							var pl = p.length;
+							for (var j = 0; j < pl; j++) {
+								if (p[j].getAttribute("name").toLowerCase() != "movie") {
+									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+								}
+							}
+							showExpressInstall(att, par, id, cb);
+						}
+						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+							displayAltContent(obj);
+							if (cb) { cb(cbObj); }
+						}
+					}
+				}
+				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+					setVisibility(id, true);
+					if (cb) {
+						var o = getObjectById(id); // test whether there is an HTML object element or not
+						if (o && typeof o.SetVariable != UNDEF) { 
+							cbObj.success = true;
+							cbObj.ref = o;
+						}
+						cb(cbObj);
+					}
+				}
+			}
+		}
+	}
+	
+	function getObjectById(objectIdStr) {
+		var r = null;
+		var o = getElementById(objectIdStr);
+		if (o && o.nodeName == "OBJECT") {
+			if (typeof o.SetVariable != UNDEF) {
+				r = o;
+			}
+			else {
+				var n = o.getElementsByTagName(OBJECT)[0];
+				if (n) {
+					r = n;
+				}
+			}
+		}
+		return r;
+	}
+	
+	/* Requirements for Adobe Express Install
+		- only one instance can be active at a time
+		- fp 6.0.65 or higher
+		- Win/Mac OS only
+		- no Webkit engines older than version 312
+	*/
+	function canExpressInstall() {
+		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+	}
+	
+	/* Show the Adobe Express Install dialog
+		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+	*/
+	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+		isExpressInstallActive = true;
+		storedCallbackFn = callbackFn || null;
+		storedCallbackObj = {success:false, id:replaceElemIdStr};
+		var obj = getElementById(replaceElemIdStr);
+		if (obj) {
+			if (obj.nodeName == "OBJECT") { // static publishing
+				storedAltContent = abstractAltContent(obj);
+				storedAltContentId = null;
+			}
+			else { // dynamic publishing
+				storedAltContent = obj;
+				storedAltContentId = replaceElemIdStr;
+			}
+			att.id = EXPRESS_INSTALL_ID;
+			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+				fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+			if (typeof par.flashvars != UNDEF) {
+				par.flashvars += "&" + fv;
+			}
+			else {
+				par.flashvars = fv;
+			}
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			if (ua.ie && ua.win && obj.readyState != 4) {
+				var newObj = createElement("div");
+				replaceElemIdStr += "SWFObjectNew";
+				newObj.setAttribute("id", replaceElemIdStr);
+				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						obj.parentNode.removeChild(obj);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			createSWF(att, par, replaceElemIdStr);
+		}
+	}
+	
+	/* Functions to abstract and display alternative content
+	*/
+	function displayAltContent(obj) {
+		if (ua.ie && ua.win && obj.readyState != 4) {
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			var el = createElement("div");
+			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+			el.parentNode.replaceChild(abstractAltContent(obj), el);
+			obj.style.display = "none";
+			(function(){
+				if (obj.readyState == 4) {
+					obj.parentNode.removeChild(obj);
+				}
+				else {
+					setTimeout(arguments.callee, 10);
+				}
+			})();
+		}
+		else {
+			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+		}
+	} 
+
+	function abstractAltContent(obj) {
+		var ac = createElement("div");
+		if (ua.win && ua.ie) {
+			ac.innerHTML = obj.innerHTML;
+		}
+		else {
+			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+			if (nestedObj) {
+				var c = nestedObj.childNodes;
+				if (c) {
+					var cl = c.length;
+					for (var i = 0; i < cl; i++) {
+						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+							ac.appendChild(c[i].cloneNode(true));
+						}
+					}
+				}
+			}
+		}
+		return ac;
+	}
+	
+	/* Cross-browser dynamic SWF creation
+	*/
+	function createSWF(attObj, parObj, id) {
+		var r, el = getElementById(id);
+		if (ua.wk && ua.wk < 312) { return r; }
+		if (el) {
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+				attObj.id = id;
+			}
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+				var att = "";
+				for (var i in attObj) {
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+						if (i.toLowerCase() == "data") {
+							parObj.movie = attObj[i];
+						}
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							att += ' class="' + attObj[i] + '"';
+						}
+						else if (i.toLowerCase() != "classid") {
+							att += ' ' + i + '="' + attObj[i] + '"';
+						}
+					}
+				}
+				var par = "";
+				for (var j in parObj) {
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+					}
+				}
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+				r = getElementById(attObj.id);	
+			}
+			else { // well-behaving browsers
+				var o = createElement(OBJECT);
+				o.setAttribute("type", FLASH_MIME_TYPE);
+				for (var m in attObj) {
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							o.setAttribute("class", attObj[m]);
+						}
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+							o.setAttribute(m, attObj[m]);
+						}
+					}
+				}
+				for (var n in parObj) {
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+						createObjParam(o, n, parObj[n]);
+					}
+				}
+				el.parentNode.replaceChild(o, el);
+				r = o;
+			}
+		}
+		return r;
+	}
+	
+	function createObjParam(el, pName, pValue) {
+		var p = createElement("param");
+		p.setAttribute("name", pName);	
+		p.setAttribute("value", pValue);
+		el.appendChild(p);
+	}
+	
+	/* Cross-browser SWF removal
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
+	*/
+	function removeSWF(id) {
+		var obj = getElementById(id);
+		if (obj && obj.nodeName == "OBJECT") {
+			if (ua.ie && ua.win) {
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						removeObjectInIE(id);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			else {
+				obj.parentNode.removeChild(obj);
+			}
+		}
+	}
+	
+	function removeObjectInIE(id) {
+		var obj = getElementById(id);
+		if (obj) {
+			for (var i in obj) {
+				if (typeof obj[i] == "function") {
+					obj[i] = null;
+				}
+			}
+			obj.parentNode.removeChild(obj);
+		}
+	}
+	
+	/* Functions to optimize JavaScript compression
+	*/
+	function getElementById(id) {
+		var el = null;
+		try {
+			el = doc.getElementById(id);
+		}
+		catch (e) {}
+		return el;
+	}
+	
+	function createElement(el) {
+		return doc.createElement(el);
+	}
+	
+	/* Updated attachEvent function for Internet Explorer
+		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+	*/	
+	function addListener(target, eventType, fn) {
+		target.attachEvent(eventType, fn);
+		listenersArr[listenersArr.length] = [target, eventType, fn];
+	}
+	
+	/* Flash Player and SWF content version matching
+	*/
+	function hasPlayerVersion(rv) {
+		var pv = ua.pv, v = rv.split(".");
+		v[0] = parseInt(v[0], 10);
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+		v[2] = parseInt(v[2], 10) || 0;
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+	}
+	
+	/* Cross-browser dynamic CSS creation
+		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+	*/	
+	function createCSS(sel, decl, media, newStyle) {
+		if (ua.ie && ua.mac) { return; }
+		var h = doc.getElementsByTagName("head")[0];
+		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+		var m = (media && typeof media == "string") ? media : "screen";
+		if (newStyle) {
+			dynamicStylesheet = null;
+			dynamicStylesheetMedia = null;
+		}
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+			// create dynamic stylesheet + get a global reference to it
+			var s = createElement("style");
+			s.setAttribute("type", "text/css");
+			s.setAttribute("media", m);
+			dynamicStylesheet = h.appendChild(s);
+			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+			}
+			dynamicStylesheetMedia = m;
+		}
+		// add style rule
+		if (ua.ie && ua.win) {
+			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+				dynamicStylesheet.addRule(sel, decl);
+			}
+		}
+		else {
+			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+			}
+		}
+	}
+	
+	function setVisibility(id, isVisible) {
+		if (!autoHideShow) { return; }
+		var v = isVisible ? "visible" : "hidden";
+		if (isDomLoaded && getElementById(id)) {
+			getElementById(id).style.visibility = v;
+		}
+		else {
+			createCSS("#" + id, "visibility:" + v);
+		}
+	}
+
+	/* Filter to avoid XSS attacks
+	*/
+	function urlEncodeIfNecessary(s) {
+		var regex = /[\\\"<>\.;]/;
+		var hasBadChars = regex.exec(s) != null;
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+	}
+	
+	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+	*/
+	var cleanup = function() {
+		if (ua.ie && ua.win) {
+			window.attachEvent("onunload", function() {
+				// remove listeners to avoid memory leaks
+				var ll = listenersArr.length;
+				for (var i = 0; i < ll; i++) {
+					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+				}
+				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+				var il = objIdArr.length;
+				for (var j = 0; j < il; j++) {
+					removeSWF(objIdArr[j]);
+				}
+				// cleanup library's main closures to avoid memory leaks
+				for (var k in ua) {
+					ua[k] = null;
+				}
+				ua = null;
+				for (var l in swfobject) {
+					swfobject[l] = null;
+				}
+				swfobject = null;
+			});
+		}
+	}();
+	
+	return {
+		/* Public API
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
+		*/ 
+		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+			if (ua.w3 && objectIdStr && swfVersionStr) {
+				var regObj = {};
+				regObj.id = objectIdStr;
+				regObj.swfVersion = swfVersionStr;
+				regObj.expressInstall = xiSwfUrlStr;
+				regObj.callbackFn = callbackFn;
+				regObjArr[regObjArr.length] = regObj;
+				setVisibility(objectIdStr, false);
+			}
+			else if (callbackFn) {
+				callbackFn({success:false, id:objectIdStr});
+			}
+		},
+		
+		getObjectById: function(objectIdStr) {
+			if (ua.w3) {
+				return getObjectById(objectIdStr);
+			}
+		},
+		
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+			var callbackObj = {success:false, id:replaceElemIdStr};
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+				setVisibility(replaceElemIdStr, false);
+				addDomLoadEvent(function() {
+					widthStr += ""; // auto-convert to string
+					heightStr += "";
+					var att = {};
+					if (attObj && typeof attObj === OBJECT) {
+						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+							att[i] = attObj[i];
+						}
+					}
+					att.data = swfUrlStr;
+					att.width = widthStr;
+					att.height = heightStr;
+					var par = {}; 
+					if (parObj && typeof parObj === OBJECT) {
+						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+							par[j] = parObj[j];
+						}
+					}
+					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+							if (typeof par.flashvars != UNDEF) {
+								par.flashvars += "&" + k + "=" + flashvarsObj[k];
+							}
+							else {
+								par.flashvars = k + "=" + flashvarsObj[k];
+							}
+						}
+					}
+					if (hasPlayerVersion(swfVersionStr)) { // create SWF
+						var obj = createSWF(att, par, replaceElemIdStr);
+						if (att.id == replaceElemIdStr) {
+							setVisibility(replaceElemIdStr, true);
+						}
+						callbackObj.success = true;
+						callbackObj.ref = obj;
+					}
+					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+						att.data = xiSwfUrlStr;
+						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+						return;
+					}
+					else { // show alternative content
+						setVisibility(replaceElemIdStr, true);
+					}
+					if (callbackFn) { callbackFn(callbackObj); }
+				});
+			}
+			else if (callbackFn) { callbackFn(callbackObj);	}
+		},
+		
+		switchOffAutoHideShow: function() {
+			autoHideShow = false;
+		},
+		
+		ua: ua,
+		
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		},
+		
+		hasFlashPlayerVersion: hasPlayerVersion,
+		
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
+			if (ua.w3) {
+				return createSWF(attObj, parObj, replaceElemIdStr);
+			}
+			else {
+				return undefined;
+			}
+		},
+		
+		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+			if (ua.w3 && canExpressInstall()) {
+				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+			}
+		},
+		
+		removeSWF: function(objElemIdStr) {
+			if (ua.w3) {
+				removeSWF(objElemIdStr);
+			}
+		},
+		
+		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+			if (ua.w3) {
+				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+			}
+		},
+		
+		addDomLoadEvent: addDomLoadEvent,
+		
+		addLoadEvent: addLoadEvent,
+		
+		getQueryParamValue: function(param) {
+			var q = doc.location.search || doc.location.hash;
+			if (q) {
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+				if (param == null) {
+					return urlEncodeIfNecessary(q);
+				}
+				var pairs = q.split("&");
+				for (var i = 0; i < pairs.length; i++) {
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+					}
+				}
+			}
+			return "";
+		},
+		
+		// For internal usage only
+		expressInstallCallback: function() {
+			if (isExpressInstallActive) {
+				var obj = getElementById(EXPRESS_INSTALL_ID);
+				if (obj && storedAltContent) {
+					obj.parentNode.replaceChild(storedAltContent, obj);
+					if (storedAltContentId) {
+						setVisibility(storedAltContentId, true);
+						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+					}
+					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+				}
+				isExpressInstallActive = false;
+			} 
+		}
+	};
+}();

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/traderdesktop/src/BackgroundColorRenderer.as
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/traderdesktop/src/BackgroundColorRenderer.as b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/src/BackgroundColorRenderer.as
new file mode 100755
index 0000000..d6245f7
--- /dev/null
+++ b/apps/samples-spring/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-spring/WEB-INF/flex-src/traderdesktop/src/ColorRenderer.as
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/traderdesktop/src/ColorRenderer.as b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/src/ColorRenderer.as
new file mode 100755
index 0000000..93a6553
--- /dev/null
+++ b/apps/samples-spring/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-spring/WEB-INF/flex-src/traderdesktop/src/org/springframework/flex/samples/marketfeed/Stock.as
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/traderdesktop/src/org/springframework/flex/samples/marketfeed/Stock.as b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/src/org/springframework/flex/samples/marketfeed/Stock.as
new file mode 100755
index 0000000..984bdf0
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/src/org/springframework/flex/samples/marketfeed/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 org.springframework.flex.samples.marketfeed
+{
+	[RemoteClass(alias="org.springframework.flex.samples.marketfeed.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-spring/WEB-INF/flex-src/traderdesktop/src/traderdesktop.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/traderdesktop/src/traderdesktop.mxml b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/src/traderdesktop.mxml
new file mode 100755
index 0000000..0e9c849
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/traderdesktop/src/traderdesktop.mxml
@@ -0,0 +1,147 @@
+<?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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" 
+			   applicationComplete="initApp()">
+
+	<fx:Script>
+		<![CDATA[
+			import mx.collections.ArrayCollection;
+			import mx.controls.Alert;
+			import mx.messaging.MultiTopicConsumer;
+			import mx.messaging.events.MessageEvent;
+			
+			import org.springframework.flex.samples.marketfeed.Stock;
+		
+			[Bindable] private var items:ArrayCollection;
+			
+			private var stockMap:Object;
+			
+			private function initApp():void
+			{
+				stockMap = new Object();
+				items = new ArrayCollection();
+				addSymbol("IBM");
+				addSymbol("JBLU");
+				addSymbol("ADBE");
+				addSymbol("GE");
+				addSymbol("C");
+				consumer.subscribe();
+			}
+			
+			private function deleteSymbol():void
+			{
+				var symbol:String = dg.selectedItem.symbol;
+				consumer.removeSubscription(symbol);
+				items.removeItemAt(dg.selectedIndex);
+				delete stockMap[symbol];
+			}
+			
+			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);
+				consumer.addSubscription(symbol);
+			}
+			
+			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]);
+			}
+		
+		
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+
+		<mx:ChannelSet id="cs">
+			<mx:StreamingAMFChannel uri="/samples-spring/messagebroker/streamingamf"/>
+			<mx:AMFChannel uri="/samples-spring/messagebroker/amflongpolling"/>
+			<mx:AMFChannel uri="/samples-spring/messagebroker/amfpolling"/>
+		</mx:ChannelSet>
+		
+		<mx:MultiTopicConsumer id="consumer" destination="market-feed" channelSet="{cs}" message="messageHandler(event)"/>		
+		<mx:NumberFormatter id="nf" precision="2"/>
+
+	</fx:Declarations>
+	
+	<s:Panel title="Watch List" top="20" left="20" bottom="20" right="20">
+		<mx:DataGrid id="dg" dataProvider="{items}" width="100%" height="100%" borderVisible="false">
+			<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>
+		<s:controlBarLayout>
+			<s:VerticalLayout paddingTop="8" paddingLeft="8" paddingBottom="8" paddingRight="8"/>
+		</s:controlBarLayout>
+		<s:controlBarContent>
+			<s:RichText width="100%">
+				<s:text>The stocks available in the sample feed are: XOM, WMT, GM, CVX, COP, GE, C, AIG, GOOG, ADBE, JBLU, COKE, GENZ, YHOO, IBM, BA, SAP, MOT, VZ, MCD.</s:text>
+			</s:RichText>
+			<s:HGroup width="100%">
+				<s:TextInput id="symbol" enter="addSymbol(symbol.text);symbol.text='';" width="50"/>
+				<s:Button label="Add Symbol" click="addSymbol(symbol.text);symbol.text='';"/>
+				<mx:Spacer width="100%"/>
+				<s:Button label="Delete Symbol" click="deleteSymbol()" enabled="{dg.selectedItem}"/>
+			</s:HGroup>
+		</s:controlBarContent>
+	</s:Panel>
+
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex/messaging-config.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex/messaging-config.xml b/apps/samples-spring/WEB-INF/flex/messaging-config.xml
new file mode 100755
index 0000000..34f4d3f
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex/messaging-config.xml
@@ -0,0 +1,32 @@
+<?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-polling-amf"/>
+    </default-channels>
+
+</service>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex/proxy-config.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex/proxy-config.xml b/apps/samples-spring/WEB-INF/flex/proxy-config.xml
new file mode 100755
index 0000000..9335e6c
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex/proxy-config.xml
@@ -0,0 +1,43 @@
+<?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>
+
+    <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>
+
+    <default-channels>
+        <channel ref="my-amf"/>
+    </default-channels>
+
+    <destination id="DefaultHTTP">
+    </destination>
+
+</service>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex/remoting-config.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex/remoting-config.xml b/apps/samples-spring/WEB-INF/flex/remoting-config.xml
new file mode 100755
index 0000000..0c55cf8
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex/remoting-config.xml
@@ -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.
+
+-->
+<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>
+
+</service>


[43/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/history/history.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/history/history.js b/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/history/history.js
new file mode 100755
index 0000000..0f82450
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/history/history.js
@@ -0,0 +1,722 @@
+/*
+ * 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.
+ */
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        ie8: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+        if (browser.version == 8)
+        {
+            browser.ie = false;
+            browser.ie8 = true;
+        }
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    function hashChangeHandler()
+    {
+        currentHref = document.location.href;
+        var flexAppUrl = getHash();
+        //ADR: to fix multiple
+        if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+            var pl = getPlayers();
+            for (var i = 0; i < pl.length; i++) {
+                pl[i].browserURLChange(flexAppUrl);
+            }
+        } else {
+            getPlayer().browserURLChange(flexAppUrl);
+        }
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+        var i;
+
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+                for (i = 0; i < o.length; i++) {
+                    if (typeof o[i].browserURLChange != "undefined")
+                        return o[i];
+                }
+                for (i = 0; i < e.length; i++) {
+                    if (typeof e[i].browserURLChange != "undefined")
+                        return e[i];
+                }
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+            for (i = 0; i < e.length; i++) {
+                if (typeof e[i].browserURLChange != "undefined")
+                {
+                    return e[i];
+                }
+            }
+            for (i = 0; i < o.length; i++) {
+                if (typeof o[i].browserURLChange != "undefined")
+                {
+                    return o[i];
+                }
+            }
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var i;
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            for (i = 0; i < tmp.length; i++)
+            {
+                if (typeof tmp[i].browserURLChange != "undefined")
+                    players.push(tmp[i]);
+            }
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+                        currentHref = document.location.href;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                var flexAppUrl = getHash();
+                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
+                {    
+                    // If it did change and we're running Safari 3.x or earlier, 
+                    // then we have to look the old state up in our hand-maintained 
+                    // array since document.location.hash won't have changed, 
+                    // then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                    flexAppUrl = historyHash[currentHistoryLength];
+                }
+
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            iframe.src = 'javascript:false;'; 
+
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox || browser.ie8)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+
+        if (browser.ie8)        
+            document.body.onhashchange = hashChangeHandler;
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        },
+        getUserAgent: function() {
+            return navigator.userAgent;
+        },
+        getPlatform: function() {
+            return navigator.platform;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/history/historyFrame.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/history/historyFrame.html b/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/history/historyFrame.html
new file mode 100755
index 0000000..63bdd3e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/history/historyFrame.html
@@ -0,0 +1,45 @@
+<!--
+  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>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/index.template.html
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/index.template.html b/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/index.template.html
new file mode 100755
index 0000000..e3e9c81
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/index.template.html
@@ -0,0 +1,121 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
+    <!-- 
+    Smart developers always View Source. 
+    
+    This application was built using Adobe Flex, an open source framework
+    for building rich Internet applications that get delivered via the
+    Flash Player or to desktops via Adobe AIR. 
+    
+    Learn more about Flex at http://flex.org 
+    // -->
+    <head>
+        <title>${title}</title>         
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and 
+		     the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as 
+			 the percentage of the height of its parent container, which has to be set explicitly.  Initially, 
+			 don't display flashContent div so it won't show if JavaScript disabled.
+		-->
+        <style type="text/css" media="screen"> 
+			html, body	{ height:100%; }
+			body { margin:0; padding:0; overflow:auto; text-align:center; 
+			       background-color: ${bgcolor}; }   
+			#flashContent { display:none; }
+        </style>
+		
+		<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+        <!-- BEGIN Browser History required section ${useBrowserHistory}>
+        <link rel="stylesheet" type="text/css" href="history/history.css" />
+        <script type="text/javascript" src="history/history.js"></script>
+        <!${useBrowserHistory} END Browser History required section -->  
+		    
+        <script type="text/javascript" src="swfobject.js"></script>
+        <script type="text/javascript">
+            <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
+            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
+            <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+            var xiSwfUrlStr = "${expressInstallSwf}";
+            var flashvars = {};
+            var params = {};
+            params.quality = "high";
+            params.bgcolor = "${bgcolor}";
+            params.allowscriptaccess = "sameDomain";
+            params.allowfullscreen = "true";
+            var attributes = {};
+            attributes.id = "${application}";
+            attributes.name = "${application}";
+            attributes.align = "middle";
+            swfobject.embedSWF(
+                "${swf}.swf", "flashContent", 
+                "${width}", "${height}", 
+                swfVersionStr, xiSwfUrlStr, 
+                flashvars, params, attributes);
+			<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+			swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+        </script>
+    </head>
+    <body>
+        <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough 
+			 JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+			 when JavaScript is disabled.
+		-->
+        <div id="flashContent">
+        	<p>
+	        	To view this page ensure that Adobe Flash Player version 
+				${version_major}.${version_minor}.${version_revision} or greater is installed. 
+			</p>
+			<script type="text/javascript"> 
+				var pageHost = ((document.location.protocol == "https:") ? "https://" :	"http://"); 
+				document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" 
+								+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); 
+			</script> 
+        </div>
+	   	
+       	<noscript>
+            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
+                <param name="movie" value="${swf}.swf" />
+                <param name="quality" value="high" />
+                <param name="bgcolor" value="${bgcolor}" />
+                <param name="allowScriptAccess" value="sameDomain" />
+                <param name="allowFullScreen" value="true" />
+                <!--[if !IE]>-->
+                <object type="application/x-shockwave-flash" data="${swf}.swf" width="${width}" height="${height}">
+                    <param name="quality" value="high" />
+                    <param name="bgcolor" value="${bgcolor}" />
+                    <param name="allowScriptAccess" value="sameDomain" />
+                    <param name="allowFullScreen" value="true" />
+                <!--<![endif]-->
+                <!--[if gte IE 6]>-->
+                	<p> 
+                		Either scripts and active content are not permitted to run or Adobe Flash Player version
+                		${version_major}.${version_minor}.${version_revision} or greater is not installed.
+                	</p>
+                <!--<![endif]-->
+                    <a href="http://www.adobe.com/go/getflashplayer">
+                        <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+                    </a>
+                <!--[if !IE]>-->
+                </object>
+                <!--<![endif]-->
+            </object>
+	    </noscript>		
+   </body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/swfobject.js
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/swfobject.js b/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/swfobject.js
new file mode 100755
index 0000000..07730fa
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync01/html-template/swfobject.js
@@ -0,0 +1,793 @@
+/*
+ * 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.
+ */
+/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
+	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
+*/
+
+var swfobject = function() {
+	
+	var UNDEF = "undefined",
+		OBJECT = "object",
+		SHOCKWAVE_FLASH = "Shockwave Flash",
+		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
+		FLASH_MIME_TYPE = "application/x-shockwave-flash",
+		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
+		ON_READY_STATE_CHANGE = "onreadystatechange",
+		
+		win = window,
+		doc = document,
+		nav = navigator,
+		
+		plugin = false,
+		domLoadFnArr = [main],
+		regObjArr = [],
+		objIdArr = [],
+		listenersArr = [],
+		storedAltContent,
+		storedAltContentId,
+		storedCallbackFn,
+		storedCallbackObj,
+		isDomLoaded = false,
+		isExpressInstallActive = false,
+		dynamicStylesheet,
+		dynamicStylesheetMedia,
+		autoHideShow = true,
+	
+	/* Centralized function for browser feature detection
+		- User agent string detection is only used when no good alternative is possible
+		- Is executed directly for optimal performance
+	*/	
+	ua = function() {
+		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
+			u = nav.userAgent.toLowerCase(),
+			p = nav.platform.toLowerCase(),
+			windows = p ? /win/.test(p) : /win/.test(u),
+			mac = p ? /mac/.test(p) : /mac/.test(u),
+			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
+			ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
+			playerVersion = [0,0,0],
+			d = null;
+		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
+			d = nav.plugins[SHOCKWAVE_FLASH].description;
+			if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
+				plugin = true;
+				ie = false; // cascaded feature detection for Internet Explorer
+				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
+				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
+				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
+				playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
+			}
+		}
+		else if (typeof win.ActiveXObject != UNDEF) {
+			try {
+				var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
+				if (a) { // a will return null when ActiveX is disabled
+					d = a.GetVariable("$version");
+					if (d) {
+						ie = true; // cascaded feature detection for Internet Explorer
+						d = d.split(" ")[1].split(",");
+						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+			}
+			catch(e) {}
+		}
+		return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
+	}(),
+	
+	/* Cross-browser onDomLoad
+		- Will fire an event as soon as the DOM of a web page is loaded
+		- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
+		- Regular onload serves as fallback
+	*/ 
+	onDomLoad = function() {
+		if (!ua.w3) { return; }
+		if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically 
+			callDomLoadFunctions();
+		}
+		if (!isDomLoaded) {
+			if (typeof doc.addEventListener != UNDEF) {
+				doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
+			}		
+			if (ua.ie && ua.win) {
+				doc.attachEvent(ON_READY_STATE_CHANGE, function() {
+					if (doc.readyState == "complete") {
+						doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
+						callDomLoadFunctions();
+					}
+				});
+				if (win == top) { // if not inside an iframe
+					(function(){
+						if (isDomLoaded) { return; }
+						try {
+							doc.documentElement.doScroll("left");
+						}
+						catch(e) {
+							setTimeout(arguments.callee, 0);
+							return;
+						}
+						callDomLoadFunctions();
+					})();
+				}
+			}
+			if (ua.wk) {
+				(function(){
+					if (isDomLoaded) { return; }
+					if (!/loaded|complete/.test(doc.readyState)) {
+						setTimeout(arguments.callee, 0);
+						return;
+					}
+					callDomLoadFunctions();
+				})();
+			}
+			addLoadEvent(callDomLoadFunctions);
+		}
+	}();
+	
+	function callDomLoadFunctions() {
+		if (isDomLoaded) { return; }
+		try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
+			var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
+			t.parentNode.removeChild(t);
+		}
+		catch (e) { return; }
+		isDomLoaded = true;
+		var dl = domLoadFnArr.length;
+		for (var i = 0; i < dl; i++) {
+			domLoadFnArr[i]();
+		}
+	}
+	
+	function addDomLoadEvent(fn) {
+		if (isDomLoaded) {
+			fn();
+		}
+		else { 
+			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
+		}
+	}
+	
+	/* Cross-browser onload
+		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
+		- Will fire an event as soon as a web page including all of its assets are loaded 
+	 */
+	function addLoadEvent(fn) {
+		if (typeof win.addEventListener != UNDEF) {
+			win.addEventListener("load", fn, false);
+		}
+		else if (typeof doc.addEventListener != UNDEF) {
+			doc.addEventListener("load", fn, false);
+		}
+		else if (typeof win.attachEvent != UNDEF) {
+			addListener(win, "onload", fn);
+		}
+		else if (typeof win.onload == "function") {
+			var fnOld = win.onload;
+			win.onload = function() {
+				fnOld();
+				fn();
+			};
+		}
+		else {
+			win.onload = fn;
+		}
+	}
+	
+	/* Main function
+		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
+	*/
+	function main() { 
+		if (plugin) {
+			testPlayerVersion();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Detect the Flash Player version for non-Internet Explorer browsers
+		- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
+		  a. Both release and build numbers can be detected
+		  b. Avoid wrong descriptions by corrupt installers provided by Adobe
+		  c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
+		- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
+	*/
+	function testPlayerVersion() {
+		var b = doc.getElementsByTagName("body")[0];
+		var o = createElement(OBJECT);
+		o.setAttribute("type", FLASH_MIME_TYPE);
+		var t = b.appendChild(o);
+		if (t) {
+			var counter = 0;
+			(function(){
+				if (typeof t.GetVariable != UNDEF) {
+					var d = t.GetVariable("$version");
+					if (d) {
+						d = d.split(" ")[1].split(",");
+						ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
+					}
+				}
+				else if (counter < 10) {
+					counter++;
+					setTimeout(arguments.callee, 10);
+					return;
+				}
+				b.removeChild(o);
+				t = null;
+				matchVersions();
+			})();
+		}
+		else {
+			matchVersions();
+		}
+	}
+	
+	/* Perform Flash Player and SWF version matching; static publishing only
+	*/
+	function matchVersions() {
+		var rl = regObjArr.length;
+		if (rl > 0) {
+			for (var i = 0; i < rl; i++) { // for each registered object element
+				var id = regObjArr[i].id;
+				var cb = regObjArr[i].callbackFn;
+				var cbObj = {success:false, id:id};
+				if (ua.pv[0] > 0) {
+					var obj = getElementById(id);
+					if (obj) {
+						if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
+							setVisibility(id, true);
+							if (cb) {
+								cbObj.success = true;
+								cbObj.ref = getObjectById(id);
+								cb(cbObj);
+							}
+						}
+						else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
+							var att = {};
+							att.data = regObjArr[i].expressInstall;
+							att.width = obj.getAttribute("width") || "0";
+							att.height = obj.getAttribute("height") || "0";
+							if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
+							if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
+							// parse HTML object param element's name-value pairs
+							var par = {};
+							var p = obj.getElementsByTagName("param");
+							var pl = p.length;
+							for (var j = 0; j < pl; j++) {
+								if (p[j].getAttribute("name").toLowerCase() != "movie") {
+									par[p[j].getAttribute("name")] = p[j].getAttribute("value");
+								}
+							}
+							showExpressInstall(att, par, id, cb);
+						}
+						else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
+							displayAltContent(obj);
+							if (cb) { cb(cbObj); }
+						}
+					}
+				}
+				else {	// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
+					setVisibility(id, true);
+					if (cb) {
+						var o = getObjectById(id); // test whether there is an HTML object element or not
+						if (o && typeof o.SetVariable != UNDEF) { 
+							cbObj.success = true;
+							cbObj.ref = o;
+						}
+						cb(cbObj);
+					}
+				}
+			}
+		}
+	}
+	
+	function getObjectById(objectIdStr) {
+		var r = null;
+		var o = getElementById(objectIdStr);
+		if (o && o.nodeName == "OBJECT") {
+			if (typeof o.SetVariable != UNDEF) {
+				r = o;
+			}
+			else {
+				var n = o.getElementsByTagName(OBJECT)[0];
+				if (n) {
+					r = n;
+				}
+			}
+		}
+		return r;
+	}
+	
+	/* Requirements for Adobe Express Install
+		- only one instance can be active at a time
+		- fp 6.0.65 or higher
+		- Win/Mac OS only
+		- no Webkit engines older than version 312
+	*/
+	function canExpressInstall() {
+		return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
+	}
+	
+	/* Show the Adobe Express Install dialog
+		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
+	*/
+	function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
+		isExpressInstallActive = true;
+		storedCallbackFn = callbackFn || null;
+		storedCallbackObj = {success:false, id:replaceElemIdStr};
+		var obj = getElementById(replaceElemIdStr);
+		if (obj) {
+			if (obj.nodeName == "OBJECT") { // static publishing
+				storedAltContent = abstractAltContent(obj);
+				storedAltContentId = null;
+			}
+			else { // dynamic publishing
+				storedAltContent = obj;
+				storedAltContentId = replaceElemIdStr;
+			}
+			att.id = EXPRESS_INSTALL_ID;
+			if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
+			if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
+			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
+			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
+				fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
+			if (typeof par.flashvars != UNDEF) {
+				par.flashvars += "&" + fv;
+			}
+			else {
+				par.flashvars = fv;
+			}
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			if (ua.ie && ua.win && obj.readyState != 4) {
+				var newObj = createElement("div");
+				replaceElemIdStr += "SWFObjectNew";
+				newObj.setAttribute("id", replaceElemIdStr);
+				obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						obj.parentNode.removeChild(obj);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			createSWF(att, par, replaceElemIdStr);
+		}
+	}
+	
+	/* Functions to abstract and display alternative content
+	*/
+	function displayAltContent(obj) {
+		if (ua.ie && ua.win && obj.readyState != 4) {
+			// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
+			// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
+			var el = createElement("div");
+			obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
+			el.parentNode.replaceChild(abstractAltContent(obj), el);
+			obj.style.display = "none";
+			(function(){
+				if (obj.readyState == 4) {
+					obj.parentNode.removeChild(obj);
+				}
+				else {
+					setTimeout(arguments.callee, 10);
+				}
+			})();
+		}
+		else {
+			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
+		}
+	} 
+
+	function abstractAltContent(obj) {
+		var ac = createElement("div");
+		if (ua.win && ua.ie) {
+			ac.innerHTML = obj.innerHTML;
+		}
+		else {
+			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
+			if (nestedObj) {
+				var c = nestedObj.childNodes;
+				if (c) {
+					var cl = c.length;
+					for (var i = 0; i < cl; i++) {
+						if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
+							ac.appendChild(c[i].cloneNode(true));
+						}
+					}
+				}
+			}
+		}
+		return ac;
+	}
+	
+	/* Cross-browser dynamic SWF creation
+	*/
+	function createSWF(attObj, parObj, id) {
+		var r, el = getElementById(id);
+		if (ua.wk && ua.wk < 312) { return r; }
+		if (el) {
+			if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
+				attObj.id = id;
+			}
+			if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
+				var att = "";
+				for (var i in attObj) {
+					if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
+						if (i.toLowerCase() == "data") {
+							parObj.movie = attObj[i];
+						}
+						else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							att += ' class="' + attObj[i] + '"';
+						}
+						else if (i.toLowerCase() != "classid") {
+							att += ' ' + i + '="' + attObj[i] + '"';
+						}
+					}
+				}
+				var par = "";
+				for (var j in parObj) {
+					if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
+						par += '<param name="' + j + '" value="' + parObj[j] + '" />';
+					}
+				}
+				el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
+				objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
+				r = getElementById(attObj.id);	
+			}
+			else { // well-behaving browsers
+				var o = createElement(OBJECT);
+				o.setAttribute("type", FLASH_MIME_TYPE);
+				for (var m in attObj) {
+					if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
+						if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
+							o.setAttribute("class", attObj[m]);
+						}
+						else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
+							o.setAttribute(m, attObj[m]);
+						}
+					}
+				}
+				for (var n in parObj) {
+					if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
+						createObjParam(o, n, parObj[n]);
+					}
+				}
+				el.parentNode.replaceChild(o, el);
+				r = o;
+			}
+		}
+		return r;
+	}
+	
+	function createObjParam(el, pName, pValue) {
+		var p = createElement("param");
+		p.setAttribute("name", pName);	
+		p.setAttribute("value", pValue);
+		el.appendChild(p);
+	}
+	
+	/* Cross-browser SWF removal
+		- Especially needed to safely and completely remove a SWF in Internet Explorer
+	*/
+	function removeSWF(id) {
+		var obj = getElementById(id);
+		if (obj && obj.nodeName == "OBJECT") {
+			if (ua.ie && ua.win) {
+				obj.style.display = "none";
+				(function(){
+					if (obj.readyState == 4) {
+						removeObjectInIE(id);
+					}
+					else {
+						setTimeout(arguments.callee, 10);
+					}
+				})();
+			}
+			else {
+				obj.parentNode.removeChild(obj);
+			}
+		}
+	}
+	
+	function removeObjectInIE(id) {
+		var obj = getElementById(id);
+		if (obj) {
+			for (var i in obj) {
+				if (typeof obj[i] == "function") {
+					obj[i] = null;
+				}
+			}
+			obj.parentNode.removeChild(obj);
+		}
+	}
+	
+	/* Functions to optimize JavaScript compression
+	*/
+	function getElementById(id) {
+		var el = null;
+		try {
+			el = doc.getElementById(id);
+		}
+		catch (e) {}
+		return el;
+	}
+	
+	function createElement(el) {
+		return doc.createElement(el);
+	}
+	
+	/* Updated attachEvent function for Internet Explorer
+		- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
+	*/	
+	function addListener(target, eventType, fn) {
+		target.attachEvent(eventType, fn);
+		listenersArr[listenersArr.length] = [target, eventType, fn];
+	}
+	
+	/* Flash Player and SWF content version matching
+	*/
+	function hasPlayerVersion(rv) {
+		var pv = ua.pv, v = rv.split(".");
+		v[0] = parseInt(v[0], 10);
+		v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
+		v[2] = parseInt(v[2], 10) || 0;
+		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
+	}
+	
+	/* Cross-browser dynamic CSS creation
+		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
+	*/	
+	function createCSS(sel, decl, media, newStyle) {
+		if (ua.ie && ua.mac) { return; }
+		var h = doc.getElementsByTagName("head")[0];
+		if (!h) { return; } // to also support badly authored HTML pages that lack a head element
+		var m = (media && typeof media == "string") ? media : "screen";
+		if (newStyle) {
+			dynamicStylesheet = null;
+			dynamicStylesheetMedia = null;
+		}
+		if (!dynamicStylesheet || dynamicStylesheetMedia != m) { 
+			// create dynamic stylesheet + get a global reference to it
+			var s = createElement("style");
+			s.setAttribute("type", "text/css");
+			s.setAttribute("media", m);
+			dynamicStylesheet = h.appendChild(s);
+			if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
+				dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
+			}
+			dynamicStylesheetMedia = m;
+		}
+		// add style rule
+		if (ua.ie && ua.win) {
+			if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
+				dynamicStylesheet.addRule(sel, decl);
+			}
+		}
+		else {
+			if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
+				dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
+			}
+		}
+	}
+	
+	function setVisibility(id, isVisible) {
+		if (!autoHideShow) { return; }
+		var v = isVisible ? "visible" : "hidden";
+		if (isDomLoaded && getElementById(id)) {
+			getElementById(id).style.visibility = v;
+		}
+		else {
+			createCSS("#" + id, "visibility:" + v);
+		}
+	}
+
+	/* Filter to avoid XSS attacks
+	*/
+	function urlEncodeIfNecessary(s) {
+		var regex = /[\\\"<>\.;]/;
+		var hasBadChars = regex.exec(s) != null;
+		return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
+	}
+	
+	/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
+	*/
+	var cleanup = function() {
+		if (ua.ie && ua.win) {
+			window.attachEvent("onunload", function() {
+				// remove listeners to avoid memory leaks
+				var ll = listenersArr.length;
+				for (var i = 0; i < ll; i++) {
+					listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
+				}
+				// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
+				var il = objIdArr.length;
+				for (var j = 0; j < il; j++) {
+					removeSWF(objIdArr[j]);
+				}
+				// cleanup library's main closures to avoid memory leaks
+				for (var k in ua) {
+					ua[k] = null;
+				}
+				ua = null;
+				for (var l in swfobject) {
+					swfobject[l] = null;
+				}
+				swfobject = null;
+			});
+		}
+	}();
+	
+	return {
+		/* Public API
+			- Reference: http://code.google.com/p/swfobject/wiki/documentation
+		*/ 
+		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
+			if (ua.w3 && objectIdStr && swfVersionStr) {
+				var regObj = {};
+				regObj.id = objectIdStr;
+				regObj.swfVersion = swfVersionStr;
+				regObj.expressInstall = xiSwfUrlStr;
+				regObj.callbackFn = callbackFn;
+				regObjArr[regObjArr.length] = regObj;
+				setVisibility(objectIdStr, false);
+			}
+			else if (callbackFn) {
+				callbackFn({success:false, id:objectIdStr});
+			}
+		},
+		
+		getObjectById: function(objectIdStr) {
+			if (ua.w3) {
+				return getObjectById(objectIdStr);
+			}
+		},
+		
+		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
+			var callbackObj = {success:false, id:replaceElemIdStr};
+			if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
+				setVisibility(replaceElemIdStr, false);
+				addDomLoadEvent(function() {
+					widthStr += ""; // auto-convert to string
+					heightStr += "";
+					var att = {};
+					if (attObj && typeof attObj === OBJECT) {
+						for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
+							att[i] = attObj[i];
+						}
+					}
+					att.data = swfUrlStr;
+					att.width = widthStr;
+					att.height = heightStr;
+					var par = {}; 
+					if (parObj && typeof parObj === OBJECT) {
+						for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
+							par[j] = parObj[j];
+						}
+					}
+					if (flashvarsObj && typeof flashvarsObj === OBJECT) {
+						for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
+							if (typeof par.flashvars != UNDEF) {
+								par.flashvars += "&" + k + "=" + flashvarsObj[k];
+							}
+							else {
+								par.flashvars = k + "=" + flashvarsObj[k];
+							}
+						}
+					}
+					if (hasPlayerVersion(swfVersionStr)) { // create SWF
+						var obj = createSWF(att, par, replaceElemIdStr);
+						if (att.id == replaceElemIdStr) {
+							setVisibility(replaceElemIdStr, true);
+						}
+						callbackObj.success = true;
+						callbackObj.ref = obj;
+					}
+					else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
+						att.data = xiSwfUrlStr;
+						showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+						return;
+					}
+					else { // show alternative content
+						setVisibility(replaceElemIdStr, true);
+					}
+					if (callbackFn) { callbackFn(callbackObj); }
+				});
+			}
+			else if (callbackFn) { callbackFn(callbackObj);	}
+		},
+		
+		switchOffAutoHideShow: function() {
+			autoHideShow = false;
+		},
+		
+		ua: ua,
+		
+		getFlashPlayerVersion: function() {
+			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
+		},
+		
+		hasFlashPlayerVersion: hasPlayerVersion,
+		
+		createSWF: function(attObj, parObj, replaceElemIdStr) {
+			if (ua.w3) {
+				return createSWF(attObj, parObj, replaceElemIdStr);
+			}
+			else {
+				return undefined;
+			}
+		},
+		
+		showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
+			if (ua.w3 && canExpressInstall()) {
+				showExpressInstall(att, par, replaceElemIdStr, callbackFn);
+			}
+		},
+		
+		removeSWF: function(objElemIdStr) {
+			if (ua.w3) {
+				removeSWF(objElemIdStr);
+			}
+		},
+		
+		createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
+			if (ua.w3) {
+				createCSS(selStr, declStr, mediaStr, newStyleBoolean);
+			}
+		},
+		
+		addDomLoadEvent: addDomLoadEvent,
+		
+		addLoadEvent: addLoadEvent,
+		
+		getQueryParamValue: function(param) {
+			var q = doc.location.search || doc.location.hash;
+			if (q) {
+				if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
+				if (param == null) {
+					return urlEncodeIfNecessary(q);
+				}
+				var pairs = q.split("&");
+				for (var i = 0; i < pairs.length; i++) {
+					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
+						return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
+					}
+				}
+			}
+			return "";
+		},
+		
+		// For internal usage only
+		expressInstallCallback: function() {
+			if (isExpressInstallActive) {
+				var obj = getElementById(EXPRESS_INSTALL_ID);
+				if (obj && storedAltContent) {
+					obj.parentNode.replaceChild(storedAltContent, obj);
+					if (storedAltContentId) {
+						setVisibility(storedAltContentId, true);
+						if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
+					}
+					if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
+				}
+				isExpressInstallActive = false;
+			} 
+		}
+	};
+}();

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync01/src/insync01.mxml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync01/src/insync01.mxml b/apps/samples-spring/WEB-INF/flex-src/insync01/src/insync01.mxml
new file mode 100755
index 0000000..f1058dd
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync01/src/insync01.mxml
@@ -0,0 +1,35 @@
+<?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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%">
+
+	<fx:Declarations>
+		<s:RemoteObject id="ro" destination="contactService" endpoint="{&apos;http://{server.name}:{server.port}/samples-spring/messagebroker/amf&apos;}"/>
+	</fx:Declarations>
+	
+	<s:controlBarContent>
+		<s:TextInput id="searchStr"/>
+		<s:Button label="Search" click="ro.findByName(searchStr.text)"/>
+	</s:controlBarContent>
+
+	<mx:DataGrid id="dg" dataProvider="{ro.findByName.lastResult}" top="8" left="8" right="8" bottom="8"/>
+	
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync02/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync02/.actionScriptProperties b/apps/samples-spring/WEB-INF/flex-src/insync02/.actionScriptProperties
new file mode 100755
index 0000000..70165f6
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync02/.actionScriptProperties
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<actionScriptProperties mainApplicationPath="insync02.mxml" projectUUID="f975ff1e-3bc6-433b-a8f8-43e3a6349ba6" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="insync02.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync02/.flexProperties
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync02/.flexProperties b/apps/samples-spring/WEB-INF/flex-src/insync02/.flexProperties
new file mode 100755
index 0000000..1d99468
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync02/.flexProperties
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+  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.
+
+-->
+<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync02/.project
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync02/.project b/apps/samples-spring/WEB-INF/flex-src/insync02/.project
new file mode 100755
index 0000000..832af5e
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync02/.project
@@ -0,0 +1,36 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>insync02</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/apps/samples-spring/WEB-INF/flex-src/insync02/build.xml
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync02/build.xml b/apps/samples-spring/WEB-INF/flex-src/insync02/build.xml
new file mode 100755
index 0000000..bf2bedc
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync02/build.xml
@@ -0,0 +1,76 @@
+<?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-spring.war/build.xml" default="main" basedir="../../../../../">
+    
+    <property environment="env" />
+    <property file="${basedir}/build.properties"/>
+    <property name="samples-spring.war" value="${basedir}/apps/samples-spring"/>
+    <property name="context.root" value="samples-spring" />
+    <property name="application.name" value="insync02" />
+    <property name="application.file" value="insync02" />
+    <property name="application.bin.dir" value="${samples-spring.war}/insync02" />
+    <property name="application.src.dir" value="${samples-spring.war}/WEB-INF/flex-src/insync02/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-spring.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"
+            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-spring/WEB-INF/flex-src/insync02/html-template/history/history.css
----------------------------------------------------------------------
diff --git a/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/history/history.css b/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/history/history.css
new file mode 100755
index 0000000..4a7f791
--- /dev/null
+++ b/apps/samples-spring/WEB-INF/flex-src/insync02/html-template/history/history.css
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }


[20/51] [partial] BlazeDS Donation from Adobe Systems Inc

Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/blazeds-core/.project
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/blazeds-core/.project b/development/eclipse/projects/java/blazeds-core/.project
new file mode 100755
index 0000000..b75ff96
--- /dev/null
+++ b/development/eclipse/projects/java/blazeds-core/.project
@@ -0,0 +1,52 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>blazeds-core</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+	<linkedResources>
+		<link>
+			<name>classes</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/core/classes</locationURI>
+		</link>
+		<link>
+			<name>java</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/core/src</locationURI>
+		</link>
+		<link>
+			<name>test</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/core/test/src</locationURI>
+		</link>
+	</linkedResources>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/blazeds-opt/.classpath
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/blazeds-opt/.classpath b/development/eclipse/projects/java/blazeds-opt/.classpath
new file mode 100755
index 0000000..73a0082
--- /dev/null
+++ b/development/eclipse/projects/java/blazeds-opt/.classpath
@@ -0,0 +1,41 @@
+<?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.
+
+-->
+<classpath>
+	<classpathentry including="flex/messaging/security/TomcatLogin.java|flex/messaging/security/TomcatLoginCommand.java|flex/messaging/security/TomcatLoginHolder.java|flex/messaging/security/TomcatValve.java|flex/messaging/security/tomcat-descriptor.xml" kind="src" path="tomcat"/>
+	<classpathentry kind="src" path="weblogic"/>
+	<classpathentry kind="src" path="oracle"/>
+	<classpathentry kind="src" path="jrun"/>
+	<classpathentry kind="src" path="websphere"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/blazeds-common"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/blazeds-core"/>
+	<classpathentry kind="lib" path="lib/asynchbeans.jar"/>
+	<classpathentry kind="lib" path="lib/catalina.jar"/>
+	<classpathentry kind="lib" path="lib/jazncore.jar"/>
+	<classpathentry kind="lib" path="lib/jrun.jar"/>
+	<classpathentry kind="lib" path="lib/mx4j-jmx.jar"/>
+	<classpathentry kind="lib" path="lib/oc4j-api.jar"/>
+	<classpathentry kind="lib" path="lib/sas.jar"/>
+	<classpathentry kind="lib" path="lib/servlet.jar"/>
+	<classpathentry kind="lib" path="lib/weblogic.jar"/>
+	<classpathentry kind="lib" path="lib/wsexception.jar"/>
+	<classpathentry kind="var" path="BLAZEDS_HOME/lib/servlet.jar"/>
+	<classpathentry kind="output" path="classes"/>
+</classpath>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/blazeds-opt/.project
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/blazeds-opt/.project b/development/eclipse/projects/java/blazeds-opt/.project
new file mode 100755
index 0000000..19f7aec
--- /dev/null
+++ b/development/eclipse/projects/java/blazeds-opt/.project
@@ -0,0 +1,129 @@
+<<<<<<< .mine
+<?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.
+
+-->
+<projectDescription>
+	<name>blazeds-opt</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+	<linkedResources>
+		<link>
+			<name>classes</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/opt/classes</locationURI>
+		</link>
+		<link>
+			<name>jrun</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/opt/src/jrun</locationURI>
+		</link>
+		<link>
+			<name>lib</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/opt/lib</locationURI>
+		</link>
+		<link>
+			<name>oracle</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/opt/src/oracle</locationURI>
+		</link>
+		<link>
+			<name>tomcat</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/opt/src/tomcat</locationURI>
+		</link>
+		<link>
+			<name>weblogic</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/opt/src/weblogic</locationURI>
+		</link>
+		<link>
+			<name>websphere</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/opt/src/websphere</locationURI>
+		</link>
+	</linkedResources>
+</projectDescription>
+=======
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>blazeds-opt</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+	<linkedResources>
+		<link>
+			<name>classes</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/opt/classes</locationURI>
+		</link>
+		<link>
+			<name>jrun</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/opt/src/jrun</locationURI>
+		</link>
+		<link>
+			<name>lib</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/opt/lib</locationURI>
+		</link>
+		<link>
+			<name>oracle</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/opt/src/oracle</locationURI>
+		</link>
+		<link>
+			<name>tomcat</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/opt/src/tomcat</locationURI>
+		</link>
+		<link>
+			<name>weblogic</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/opt/src/weblogic</locationURI>
+		</link>
+		<link>
+			<name>websphere</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/opt/src/websphere</locationURI>
+		</link>
+	</linkedResources>
+</projectDescription>
+>>>>>>> .r22994

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/blazeds-proxy/.classpath
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/blazeds-proxy/.classpath b/development/eclipse/projects/java/blazeds-proxy/.classpath
new file mode 100755
index 0000000..cab4dbd
--- /dev/null
+++ b/development/eclipse/projects/java/blazeds-proxy/.classpath
@@ -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.
+
+-->
+<classpath>
+	<classpathentry kind="src" path="java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/blazeds-common"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/blazeds-core"/>
+	<classpathentry kind="var" path="BLAZEDS_HOME/lib/servlet.jar"/>
+	<classpathentry kind="var" path="BLAZEDS_HOME/lib/commons-httpclient-3.1.jar"/>
+	<classpathentry kind="output" path="classes"/>
+</classpath>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/blazeds-proxy/.project
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/blazeds-proxy/.project b/development/eclipse/projects/java/blazeds-proxy/.project
new file mode 100755
index 0000000..b2b2071
--- /dev/null
+++ b/development/eclipse/projects/java/blazeds-proxy/.project
@@ -0,0 +1,47 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>blazeds-proxy</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+	<linkedResources>
+		<link>
+			<name>classes</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/proxy/classes</locationURI>
+		</link>
+		<link>
+			<name>java</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/proxy/src</locationURI>
+		</link>
+	</linkedResources>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/blazeds-remoting/.classpath
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/blazeds-remoting/.classpath b/development/eclipse/projects/java/blazeds-remoting/.classpath
new file mode 100755
index 0000000..24e90f7
--- /dev/null
+++ b/development/eclipse/projects/java/blazeds-remoting/.classpath
@@ -0,0 +1,26 @@
+<?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.
+
+-->
+<classpath>
+	<classpathentry kind="src" path="java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/blazeds-common"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/blazeds-core"/>
+	<classpathentry kind="output" path="classes"/>
+</classpath>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/blazeds-remoting/.project
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/blazeds-remoting/.project b/development/eclipse/projects/java/blazeds-remoting/.project
new file mode 100755
index 0000000..fa7e08f
--- /dev/null
+++ b/development/eclipse/projects/java/blazeds-remoting/.project
@@ -0,0 +1,47 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>blazeds-remoting</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+	<linkedResources>
+		<link>
+			<name>classes</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/remoting/classes</locationURI>
+		</link>
+		<link>
+			<name>java</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/modules/remoting/src</locationURI>
+		</link>
+	</linkedResources>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/blazeds-team.war/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/blazeds-team.war/.actionScriptProperties b/development/eclipse/projects/java/blazeds-team.war/.actionScriptProperties
new file mode 100755
index 0000000..cad784e
--- /dev/null
+++ b/development/eclipse/projects/java/blazeds-team.war/.actionScriptProperties
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+<actionScriptProperties mainApplicationPath="main.mxml" projectUUID="c2adec1e-f2cd-48db-a739-09b2100ced5f" version="6">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="true" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path=""/>
+      <libraryPathEntry kind="1" linkType="1" path="libs"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications/>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/blazeds-team.war/.classpath
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/blazeds-team.war/.classpath b/development/eclipse/projects/java/blazeds-team.war/.classpath
new file mode 100755
index 0000000..ed64f32
--- /dev/null
+++ b/development/eclipse/projects/java/blazeds-team.war/.classpath
@@ -0,0 +1,30 @@
+<?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.
+
+-->
+<classpath>
+	<classpathentry kind="src" output="webroot/WEB-INF/classes" path="webroot/WEB-INF/src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="var" path="BLAZEDS_HOME/lib/commons-httpclient-3.1.jar"/>
+	<classpathentry kind="var" path="BLAZEDS_HOME/lib/servlet.jar"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/blazeds-common"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/blazeds-core"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/blazeds-proxy"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/blazeds-remoting"/>
+	<classpathentry kind="output" path="webroot/WEB-INF/classes"/>
+</classpath>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/blazeds-team.war/.flexProperties
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/blazeds-team.war/.flexProperties b/development/eclipse/projects/java/blazeds-team.war/.flexProperties
new file mode 100755
index 0000000..b7deab0
--- /dev/null
+++ b/development/eclipse/projects/java/blazeds-team.war/.flexProperties
@@ -0,0 +1,20 @@
+<?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.
+
+-->
+<flexProperties flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/blazeds-team.war/.project
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/blazeds-team.war/.project b/development/eclipse/projects/java/blazeds-team.war/.project
new file mode 100755
index 0000000..5018bc6
--- /dev/null
+++ b/development/eclipse/projects/java/blazeds-team.war/.project
@@ -0,0 +1,49 @@
+<?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.
+
+-->
+<projectDescription>
+	<name>blazeds-team.war</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+	<linkedResources>
+		<link>
+			<name>webroot</name>
+			<type>2</type>
+			<locationURI>BLAZEDS_HOME/apps/team</locationURI>
+		</link>
+	</linkedResources>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/java/formatter.xml
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/java/formatter.xml b/development/eclipse/projects/java/formatter.xml
new file mode 100755
index 0000000..903918e
--- /dev/null
+++ b/development/eclipse/projects/java/formatter.xml
@@ -0,0 +1,269 @@
+<?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.
+
+-->
+<profiles version="10">
+<profile name="Enterprise" version="10">
+<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_comments" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
+<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
+<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
+</profile>
+</profiles>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/development/eclipse/projects/readme.txt
----------------------------------------------------------------------
diff --git a/development/eclipse/projects/readme.txt b/development/eclipse/projects/readme.txt
new file mode 100755
index 0000000..daca09d
--- /dev/null
+++ b/development/eclipse/projects/readme.txt
@@ -0,0 +1,116 @@
+INTRODUCTION
+
+This directory contains Eclipse 3.4 and Flash Builder 4.0 projects that make up your
+workspace for the BlazeDS development environment. You can import these projects into
+your Eclipse workspace, however you should follow all of these directions before actually
+importing any of them.
+
+GETTING STARTED
+
+* IMPORTANT - before you import any projects you should read and complete the
+following steps!
+
+1. Install the necessary requirements:
+  - installed at least JDK 1.5.0 (or later) (although it is useful to have  JDK 1.4.2 in addition to JDK 1.5.0)
+  - established your JAVA_HOME environment variable pointing to this JDK installation
+  - download and install Apache Ant 1.6.2 or later (http://ant.apache.org/) along with ant-contrib-1.0b2.
+  - established an ANT_HOME environment variable.
+  - added %JAVA_HOME%\bin and %ANT_HOME%\bin to your PATH environment variable
+    (or equivalent syntax for your operating system)
+  - closed and restarted the command line since making any environment variable changes.
+  - installed at least Eclipse 3.4.
+  - (Optional) install a Subversion (aka SVN) client (http://subversion.tigris.org/)
+
+2. Download a copy of the BlazeDS source code from opensource.adobe.com
+   or check out a version of the BlazeDS source tree from Subversion
+   i.e.  svn checkout http://opensource.adobe.com/svn/opensource/blazeds/trunk c:\dev
+
+3. Also download a copy of the Flex SDK source code from opensource.adobe.com
+   or check out a version of the Flex SDK source tree from Subversion
+   i.e. svn checkout http://opensource.adobe.com/svn/opensource/flex/sdk/trunk c:\dev
+
+4. Run "ant clean main" from the BlazeDS home directory.
+
+5. Install Flash Builder 4 plugin for Eclipse.
+
+6. Open Eclipse/Flash Builder, start a new workspace in the location of your choice.
+
+7. Define a "Linked Resource Path Variables" through the following menu
+sequence:
+
+  Window > Preferences... > General > Workspace > Linked Resources
+
+BLAZEDS_HOME = the root of the BlazeDS source tree
+               For instance: C:\dev\blazeds\trunk
+
+FLEX_SDK        = your sync of the relevant sdk branch, e.g
+                      c:\dev\flex\sdk\trunk
+
+Apply your changes.
+
+8. Define a "Java Build Classpath Variables" through the following menu
+sequnce:
+
+  Window > Preferences... > Java > Build Path > Classpath Variables
+
+BLAZEDS_HOME = the root of the BlazeDS source tree
+               For instance: C:\dev\blazeds\trunk
+
+FLEX_SDK        = your sync of the relevant sdk branch, e.g
+                      c:\dev\flex\sdk\trunk
+
+Apply your changes.
+
+9. Ensure that you have the correct JRE configured in Eclipse through the
+following menu sequence:
+
+  Window > Preferences... > Java > Installed JREs
+
+At the very least a valid JRE should be pointed to your JDK 1.5.0 installation
+(on selecting a location Eclipse should fill in the rest of the information)
+and then as a best practice be sure to edit the name so that the particular
+update of the JDK isn't considered, e.g.
+
+  Name = jdk1.5.0
+  Location = C:\dev\java\jdk1.5.0_07
+
+Ensure that the compile compliance level is 1.4 (we support 1.4 except for selected projects that are compiled with 1.5):
+
+  Window > Preferences... > Java > Compiler:  select 1.4 on the first 3 fields.
+
+Apply your changes.
+
+10. Change all file types to insert 4 spaces for an indent instead of tab
+characters. These changes have to be made in several locations depending on
+which plug-ins you have installed. At a minimum, check the following locations
+by navigating through these menu sequence, all under Window > Preferences ...
+
+Ant > Editor > Formatter
+  - ensure Tab size is 4
+  - uncheck use tab character instead of spaces
+  - apply your changes
+
+Flex > Editors
+  - select the Indent using spaces radio button
+  - ensure the indent and tab sizes are set to 4 spaces
+  - apply your changes
+
+Java > Code Style > Formatter
+  - import the formatting settings from the source tree:
+        blazeds/trunk/development/eclipse/java/formatter.xml
+  - After importing the enterprise formatting rules, double check that in the
+    Indentation tab, select the Tab policy to "Spaces only"
+  - ensure the tab and indentation sizes sare set to 4 spaces
+  - apply your changes
+
+11. Import existing eclipse projects from your enteprise workspace by navigating
+to the following menu sequence:
+
+  File > Import... > General > Existing Projects into Workspace
+
+Select the root directory as your sync of the blazeds\trunk\development\eclipse\projects directory
+and then select the projects you want to add to your workspace.
+
+(Note that you don't need to select "Copy projects into workspace" if you wish
+to work off your sync of the projects... though be prepared to handle any
+changes that get checked in for these project definitions).

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/downloads.xml
----------------------------------------------------------------------
diff --git a/downloads.xml b/downloads.xml
new file mode 100644
index 0000000..bfc93dd
--- /dev/null
+++ b/downloads.xml
@@ -0,0 +1,641 @@
+<?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="downloads" default="main" basedir=".">
+
+	<!-- properties -->
+	<property file="${basedir}/build.properties"/>
+
+	<property name="download.dir" value="${basedir}/in"/>
+	<property name="lib.dir" value="${basedir}/lib"/>
+	<property name="qa.lib.dir" value="${basedir}/qa/lib"/>
+	<property name="modules.core.dir" value="${basedir}/modules/core"/>
+	<property name="modules.core.lib.dir" value="${basedir}/modules/core/lib"/>
+	<property name="modules.opt.lib.dir" value="${basedir}/modules/opt/lib"/>
+	<property name="tomcat.dir" value="${basedir}/servers/apache-tomcat-6.0.29"/>
+	<property name="tomcat.zip.file" value="${basedir}/in/apache-tomcat-6.0.29.zip"/>
+	<property name="activemq.dir" value="${tomcat.dir}/lib/activemq-5.3.1"/>
+	<property name="activemq.zip.file" value="${basedir}/in/apache-activemq-5.3.1-bin.zip"/>
+	<property name="codec.zip.file" value="${basedir}/in/apache-codec-3.1-bin.zip"/>
+	<property name="collection.zip.file" value="${basedir}/in/apache-collections-3.1.zip"/>
+	<property name="fileupload.zip.file" value="${basedir}/in/apache-fileupload-1.1.zip"/>
+	<property name="httpclient.zip.file" value="${basedir}/in/apache-httpclient-3.1.zip"/>
+	<property name="logging.zip.file" value="${basedir}/in/apache-logging-1.1.1-bin.zip"/>
+	<property name="hsqldb.zip.file" value="${basedir}/in/hsqldb_1_8_0_10.zip"/>
+	<property name="jms.zip.file" value="${basedir}/in/openjms-0.7.6.1.zip"/>
+	<property name="log4j.zip.file" value="${basedir}/in/logging-log4j-1.2.14.zip"/>
+	<property name="spring.zip.file" value="${basedir}/in/spring-framework-3.0.3.RELEASE.zip"/>
+	<property name="springsecurity.zip.file" value="${basedir}/in/spring-security-3.0.3.RELEASE.zip"/>
+	<property name="springflex.jar.file" value="${basedir}/lib/spring/spring-flex-core-1.5.2.RELEASE.jar"/>
+	<property name="taglibs.zip.file" value="${basedir}/in/jakarta-taglibs-standard-1.1.2.zip"/>
+	<property name="aopalliance.zip.file" value="${basedir}/in/aopalliance.zip"/>
+	<property name="backport.zip.file" value="${basedir}/in/backport-util-concurrent.zip"/>
+	<property name="cglib.jar.file" value="${basedir}/lib/spring/cglib-nodep-2.1_3.jar"/>
+	<property name="jackson.jar.file" value="${basedir}/lib/spring/jackson-core-asl-1.0.0.jar"/>
+	<property name="xalan.zip.file" value="${basedir}/in/xalan-j_2_6_0-bin-2jars.zip"/>
+	<property name="cat4150.zip.file" value="${basedir}/in/jakarta-tomcat-4150.zip"/>
+	<property name="axis.zip.file" value="${basedir}/in/axis.zip"/>
+	        
+    <!-- 
+       To clean these you must call thirdparty-clean or super-clean to clean everything.  
+       clean does not remove these since they don't change often and the downloads take time.
+    -->
+    <target name="main" 
+        depends="tomcat-download,activemq-download,codec-download,collection-download,fileupload-download,httpclient-download,logging-download,hsqldb-download,jms-download,log4j-download,spring-download,xalan-download,doclet-download,mx4j-download,cat708-download,cat4150-download,cat-download,axis-download,testng-download" 
+        description="Copies third-party software into place for build">
+        <echo message="Use thirdparty-clean or super-clean to remove these."/> 
+    </target>
+    
+    <target name="clean"
+        description="Cleans thirdparty downloaded files.">
+        <delete failonerror="false">
+            <fileset dir="${lib.dir}">
+                <include name="**/*"/>
+            </fileset>
+        </delete>
+        <delete failonerror="false">
+            <fileset dir="${modules.core.lib.dir}">
+                <include name="**/*"/>
+            </fileset>
+        </delete>
+        <delete failonerror="false">
+            <fileset dir="${modules.opt.lib.dir}">
+                <include name="**/*"/>
+            </fileset>
+        </delete>
+        <delete failonerror="false">
+            <fileset dir="${qa.lib.dir}">
+                <include name="**/*"/>
+            </fileset>
+        </delete>
+        <delete failonerror="false">
+            <fileset dir="${tomcat.dir}">
+                <include name="**/*"/>
+            </fileset>
+        </delete>
+        <delete failonerror="false" dir="${tomcat.dir}/bin" />
+        <delete failonerror="false" dir="${tomcat.dir}/conf" />
+        <delete failonerror="false" dir="${tomcat.dir}/lib/activemq-5.3.1" />
+        <delete failonerror="false" dir="${tomcat.dir}/logs" />
+        <delete failonerror="false" dir="${tomcat.dir}/temp" />
+        <delete failonerror="false" dir="${tomcat.dir}/webapps" />
+        <delete failonerror="false" dir="${tomcat.dir}/work" />
+        <delete includeEmptyDirs="true" failonerror="false">
+            <fileset dir="${download.dir}">
+                <include name="${tomcat.zip.file}"/>
+            </fileset>
+        </delete>
+        <delete failonerror="false">
+            <fileset dir="${basedir}/apps/samples/WEB-INF/lib/">
+                <include name="**/*"/>
+            </fileset>
+        </delete>
+        <delete failonerror="false" dir="${lib.dir}/hsqldb" />
+        <delete failonerror="false" dir="${lib.dir}/spring" />
+        <delete failonerror="false" file="${modules.core.dir}/src/ExcludeDoclet.java" />
+     </target>
+           
+	<!--
+        apache-tomcat-6.0.29-bin.zip 
+    -->
+    <target name="tomcat-check" description="Checks if the Tomcat server has been downloaded.">
+        <available file="${tomcat.dir}/bin/catalina.bat" property="tomcat.present"/>
+    </target>
+   
+    <target name="tomcat-download" depends="tomcat-check" unless="tomcat.present">
+        <available file="${tomcat.zip.file}" type="file" property="tomcat.zip.exists"/>
+        <antcall target="download-tomcat-zip" />
+        
+        <unzip src="${tomcat.zip.file}" dest="${tomcat.dir}/..">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+    </target>
+
+    <target name="download-tomcat-zip" unless="tomcat.zip.exists">
+        <mkdir dir="${download.dir}"/>
+        <get src="http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.29/bin/apache-tomcat-6.0.29.zip" 
+            dest="${tomcat.zip.file}" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        activemq-5.3.1.zip 
+    -->
+    <target name="activemq-check" description="Checks if the ActiveMQ jars have been downloaded.">
+        <available file="${tomcat.dir}/lib/activemq-5.3.1/activemq-core-5.3.1.jar" property="activemq.present"/>
+    </target>
+   
+    <target name="activemq-download" depends="activemq-check" unless="activemq.present">
+        <available file="${activemq.zip.file}" type="file" property="activemq.zip.exists"/>
+        <antcall target="download-activemq-zip" />
+        
+        <unzip src="${activemq.zip.file}" dest="${download.dir}/activemq">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy toDir="${activemq.dir}">
+            <fileset dir="${download.dir}/activemq/apache-activemq-5.3.1/lib" />
+        </copy>
+    </target>
+
+    <target name="download-activemq-zip" unless="activemq.zip.exists">
+        <mkdir dir="${download.dir}"/>
+        <get src="http://archive.apache.org/dist/activemq/apache-activemq/5.3.1/apache-activemq-5.3.1-bin.zip" 
+            dest="${activemq.zip.file}" 
+            verbose="false"/>
+    </target>
+
+	<!--
+        commons-codec-1.5.jar 
+    -->
+    <target name="codec-check" description="Checks if the commons-codec jar have been downloaded.">
+        <available file="${lib.dir}/commons-codec-1.5.jar" property="codec.present"/>
+    </target>
+   
+    <target name="codec-download" depends="codec-check" unless="codec.present">
+        <available file="${codec.zip.file}" type="file" property="codec.zip.exists"/>
+        <antcall target="download-codec-zip" />
+        
+        <unzip src="${codec.zip.file}" dest="${download.dir}/commons-codec">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy toDir="${lib.dir}"
+            file="${download.dir}/commons-codec/commons-codec-1.5/commons-codec-1.5.jar" />
+    </target>
+
+    <target name="download-codec-zip" unless="codec.zip.exists">
+        <mkdir dir="${download.dir}"/>
+        <get src="http://archive.apache.org/dist/commons/codec/binaries/commons-codec-1.5-bin.zip" 
+            dest="${codec.zip.file}" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        commons-collection-3.1.jar 
+    -->
+    <target name="collection-check" description="Checks if the commons-collection jar have been downloaded.">
+        <available file="${lib.dir}/commons-collections-3.1.jar" property="collection.present"/>
+    </target>
+   
+    <target name="collection-download" depends="collection-check" unless="collection.present">
+        <available file="${collection.zip.file}" type="file" property="collection.zip.exists"/>
+        <antcall target="download-collection-zip" />
+        
+        <unzip src="${collection.zip.file}" dest="${download.dir}/commons-collections">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy toDir="${lib.dir}"
+            file="${download.dir}/commons-collections/commons-collections-3.1/commons-collections-3.1.jar" />
+    </target>
+
+    <target name="download-collection-zip" unless="collection.zip.exists">
+        <mkdir dir="${download.dir}"/>
+        <get src="http://archive.apache.org/dist/commons/collections/binaries/commons-collections-3.1.zip" 
+            dest="${collection.zip.file}" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        commons-fileupload-1.1.jar 
+    -->
+    <target name="fileupload-check" description="Checks if the commons-fileupload jar have been downloaded.">
+        <available file="${lib.dir}/commons-fileupload-1.1.jar" property="fileupload.present"/>
+    </target>
+   
+    <target name="fileupload-download" depends="fileupload-check" unless="fileupload.present">
+        <available file="${fileupload.zip.file}" type="file" property="fileupload.zip.exists"/>
+        <antcall target="download-fileupload-zip" />
+        
+        <unzip src="${fileupload.zip.file}" dest="${download.dir}/commons-fileupload">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy toDir="${lib.dir}"
+            file="${download.dir}/commons-fileupload/commons-fileupload-1.1/commons-fileupload-1.1.jar" />
+    </target>
+
+    <target name="download-fileupload-zip" unless="fileupload.zip.exists">
+        <mkdir dir="${download.dir}"/>
+        <get src="http://archive.apache.org/dist/commons/fileupload/binaries/commons-fileupload-1.1.zip" 
+            dest="${fileupload.zip.file}" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        commons-httpclient-3.1.jar 
+    -->
+    <target name="httpclient-check" description="Checks if the commons-httpclient jar have been downloaded.">
+        <available file="${lib.dir}/commons-httpclient-3.1.jar" property="httpclient.present"/>
+    </target>
+   
+    <target name="httpclient-download" depends="httpclient-check" unless="httpclient.present">
+        <available file="${httpclient.zip.file}" type="file" property="httpclient.zip.exists"/>
+        <antcall target="download-httpclient-zip" />
+        
+        <unzip src="${httpclient.zip.file}" dest="${download.dir}/commons-httpclient">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy toDir="${lib.dir}"
+            file="${download.dir}/commons-httpclient/commons-httpclient-3.1/commons-httpclient-3.1.jar" />
+    </target>
+
+    <target name="download-httpclient-zip" unless="httpclient.zip.exists">
+        <mkdir dir="${download.dir}"/>
+        <get src="http://archive.apache.org/dist/httpcomponents/commons-httpclient/binary/commons-httpclient-3.1.zip" 
+            dest="${httpclient.zip.file}" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        commons-logging-1.1.1.jar 
+    -->
+    <target name="logging-check" description="Checks if the commons-logging jar have been downloaded.">
+        <available file="${lib.dir}/commons-logging-1.1.1.jar" property="logging.present"/>
+    </target>
+   
+    <target name="logging-download" depends="logging-check" unless="logging.present">
+        <available file="${logging.zip.file}" type="file" property="logging.zip.exists"/>
+        <antcall target="download-logging-zip" />
+        
+        <unzip src="${logging.zip.file}" dest="${download.dir}/commons-logging">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy toDir="${lib.dir}"
+            file="${download.dir}/commons-logging/commons-logging-1.1.1/commons-logging-1.1.1.jar" />
+    </target>
+
+    <target name="download-logging-zip" unless="logging.zip.exists">
+        <mkdir dir="${download.dir}"/>
+        <get src="http://archive.apache.org/dist/commons/logging/binaries/commons-logging-1.1.1-bin.zip" 
+            dest="${logging.zip.file}" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        hsqldb.jar 
+    -->
+    <target name="hsqldb-check" description="Checks if the hsqldb jar have been downloaded.">
+        <available file="${lib.dir}/hsqldb/hsqldb.jar" property="hsqldb.present"/>
+    </target>
+   
+    <target name="hsqldb-download" depends="hsqldb-check" unless="hsqldb.present">
+        <available file="${hsqldb.zip.file}" type="file" property="hsqldb.zip.exists"/>
+        <antcall target="download-hsqldb-zip" />
+        
+        <unzip src="${hsqldb.zip.file}" dest="${download.dir}/hsqldb">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy toDir="${lib.dir}/hsqldb">
+            <fileset dir="${download.dir}/hsqldb/hsqldb/lib" includes="hsqldb.jar"/>
+        </copy>
+        <copy toDir="${lib.dir}/hsqldb">
+            <fileset dir="${download.dir}/hsqldb/hsqldb/doc" includes="hsqldb_lic.txt"/>
+        </copy>
+    </target>
+
+    <target name="download-hsqldb-zip" unless="hsqldb.zip.exists">
+        <mkdir dir="${download.dir}"/>
+        <get src="http://downloads.sourceforge.net/project/hsqldb/hsqldb/hsqldb_1_8_0/hsqldb_1_8_0_10.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fhsqldb%2Ffiles%2Fhsqldb%2Fhsqldb_1_8_0%2F&amp;ts=1378509998&amp;use_mirror=softlayer-dal" 
+            dest="${hsqldb.zip.file}" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        jms.jar 
+    -->
+    <target name="jms-check" description="Checks if the jms jar have been downloaded.">
+        <available file="${lib.dir}/jms.jar" property="jms.present"/>
+    </target>
+   
+    <target name="jms-download" depends="jms-check" unless="jms.present">
+        <available file="${jms.zip.file}" type="file" property="jms.zip.exists"/>
+        <antcall target="download-jms-zip" />
+        
+        <unzip src="${jms.zip.file}" dest="${download.dir}/jms">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy file="${download.dir}/jms/openjms-0.7.6.1/lib/jms-1.0.2a.jar" toFile="${lib.dir}/jms.jar"/>
+        <copy file="${download.dir}/jms/openjms-0.7.6.1/LICENSE.txt" toFile="${lib.dir}/jms-LICENSE.txt"/>
+    </target>
+
+    <target name="download-jms-zip" unless="jms.zip.exists">
+        <mkdir dir="${download.dir}"/>
+        <get src="http://downloads.sourceforge.net/project/openjms/openjms/openjms-0.7.6.1/openjms-0.7.6.1.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fopenjms%2Ffiles%2Fopenjms%2Fopenjms-0.7.6.1%2F&amp;ts=1378512874&amp;use_mirror=hivelocity" 
+            dest="${jms.zip.file}" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        log4j.jar 
+    -->
+    <target name="log4j-check" description="Checks if the log4j jar have been downloaded.">
+        <available file="${lib.dir}/log4j.jar" property="log4j.present"/>
+    </target>
+   
+    <target name="log4j-download" depends="log4j-check" unless="log4j.present">
+        <available file="${log4j.zip.file}" type="file" property="log4j.zip.exists"/>
+        <antcall target="download-log4j-zip" />
+        
+        <unzip src="${log4j.zip.file}" dest="${download.dir}/log4j">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy file="${download.dir}/log4j/logging-log4j-1.2.14/dist/lib/log4j-1.2.14.jar" toFile="${lib.dir}/log4j.jar"/>
+    </target>
+
+    <target name="download-log4j-zip" unless="log4j.zip.exists">
+        <mkdir dir="${download.dir}"/>
+        <get src="http://archive.apache.org/dist/logging/log4j/1.2.14/logging-log4j-1.2.14.zip" 
+            dest="${log4j.zip.file}" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        spring 
+    -->
+    <target name="spring-check" description="Checks if the spring jars have been downloaded.">
+        <available file="${lib.dir}/spring/spring-security-core-3.0.3.RELEASE.jar" property="spring.present"/>
+    </target>
+   
+    <target name="spring-download" depends="spring-check" unless="spring.present">
+        <available file="${spring.zip.file}" type="file" property="spring.zip.exists"/>
+        <antcall target="download-spring-zip" />
+        
+        <unzip src="${spring.zip.file}" dest="${download.dir}/spring">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy toDir="${lib.dir}/spring">
+            <fileset dir="${download.dir}/spring/spring-framework-3.0.3.RELEASE/dist" />
+        </copy>
+        <unzip src="${springsecurity.zip.file}" dest="${download.dir}/springsecurity">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy file="${download.dir}/springsecurity/spring-security-3.0.3.RELEASE/dist/spring-security-config-3.0.3.RELEASE.jar" toDir="${lib.dir}/spring"/>
+        <copy file="${download.dir}/springsecurity/spring-security-3.0.3.RELEASE/dist/spring-security-core-3.0.3.RELEASE.jar" toDir="${lib.dir}/spring"/>
+        <copy file="${download.dir}/springsecurity/spring-security-3.0.3.RELEASE/dist/spring-security-web-3.0.3.RELEASE.jar" toDir="${lib.dir}/spring"/>
+        <unzip src="${taglibs.zip.file}" dest="${download.dir}/taglibs">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy file="${download.dir}/taglibs/jakarta-taglibs-standard-1.1.2/lib/jstl.jar" toFile="${lib.dir}/spring/jstl-1.1.2.jar"/>
+        <copy file="${download.dir}/taglibs/jakarta-taglibs-standard-1.1.2/lib/standard.jar" toFile="${lib.dir}/spring/standard-1.1.2.jar"/>
+        <unzip src="${aopalliance.zip.file}" dest="${download.dir}/aopalliance">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy file="${download.dir}/aopalliance/aopalliance.jar" toFile="${lib.dir}/spring/aopalliance-1.0.jar"/>
+        <unzip src="${backport.zip.file}" dest="${download.dir}/backport">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy file="${download.dir}/backport/backport-util-concurrent-2.2/backport-util-concurrent.jar" toFile="${lib.dir}/spring/backport-util-concurrent-2.2.jar"/>
+    </target>
+
+    <target name="download-spring-zip" unless="spring.zip.exists">
+        <mkdir dir="${lib.dir}/spring"/>
+        <mkdir dir="${download.dir}"/>
+        <get src="http://s3.amazonaws.com/dist.springframework.org/release/SPR/spring-framework-3.0.3.RELEASE.zip" 
+            dest="${spring.zip.file}" 
+            verbose="false"/>
+        <get src="http://s3.amazonaws.com/dist.springframework.org/release/SEC/spring-security-3.0.3.RELEASE.zip" 
+            dest="${springsecurity.zip.file}" 
+            verbose="false"/>
+        <get src="http://repo1.maven.org/maven2/org/springframework/flex/spring-flex-core/1.5.2.RELEASE/spring-flex-core-1.5.2.RELEASE.jar" 
+            dest="${springflex.jar.file}" 
+            verbose="false"/>
+        <get src="http://archive.apache.org/dist/jakarta/taglibs/standard/binaries/jakarta-taglibs-standard-1.1.2.zip" 
+            dest="${taglibs.zip.file}" 
+            verbose="false"/>
+        <get src="http://downloads.sourceforge.net/project/aopalliance/aopalliance/1.0/aopalliance.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Faopalliance%2Ffiles%2Faopalliance%2F1.0%2F&amp;ts=1378515484&amp;use_mirror=softlayer-dal" 
+            dest="${aopalliance.zip.file}" 
+            verbose="false"/>
+        <get src="http://downloads.sourceforge.net/project/backport-jsr166/backport-jsr166/2.2/backport-util-concurrent-2.2.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fbackport-jsr166%2Ffiles%2Fbackport-jsr166%2F2.2%2F&amp;ts=1378515970&amp;use_mirror=heanet" 
+            dest="${backport.zip.file}" 
+            verbose="false"/>
+        <get src="http://downloads.sourceforge.net/project/cglib/cglib2/cglib%202.1_03/cglib-nodep-2.1_3.jar?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fcglib%2Ffiles%2Fcglib2%2Fcglib%25202.1_03%2F&amp;ts=1378516297&amp;use_mirror=hivelocity" 
+            dest="${cglib.jar.file}" 
+            verbose="false"/>
+        <get src="http://repository.codehaus.org/org/codehaus/jackson/jackson-core-asl/1.0.0/jackson-core-asl-1.0.0.jar" 
+            dest="${jackson.jar.file}" 
+            verbose="false"/>
+    </target>
+
+	<!--
+        xalan.jar 
+    -->
+    <target name="xalan-check" description="Checks if the xalan jar have been downloaded.">
+        <available file="${lib.dir}/xalan.jar" property="xalan.present"/>
+    </target>
+   
+    <target name="xalan-download" depends="xalan-check" unless="xalan.present">
+        <available file="${xalan.zip.file}" type="file" property="xalan.zip.exists"/>
+        <antcall target="download-xalan-zip" />
+        
+        <unzip src="${xalan.zip.file}" dest="${download.dir}/xalan">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy file="${download.dir}/xalan/xalan-j_2_6_0/bin/xalan.jar" toFile="${lib.dir}/xalan.jar"/>
+    </target>
+    
+    <target name="download-xalan-zip" unless="xalan.zip.exists">
+        <mkdir dir="${download.dir}"/>
+        <get src="http://archive.apache.org/dist/xml/xalan-j/xalan-j_2_6_0-bin-2jars.zip" 
+            dest="${xalan.zip.file}" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        ExcludeDoclet.java 
+    -->
+    <target name="doclet-check" description="Checks if the excludedoclet.java has been downloaded.">
+        <available file="${modules.core.dir}/src/ExcludeDoclet.java" property="doclet.present"/>
+    </target>
+   
+    <target name="doclet-download" depends="doclet-check" unless="doclet.present">
+        <available file="${doclet.zip.file}" type="file" property="doclet.zip.exists"/>
+        <antcall target="download-doclet-java" />
+        
+    </target>
+    
+    <target name="download-doclet-java" unless="doclet.zip.exists">
+        <get src="http://sixlegs.com/misc/ExcludeDoclet.java" 
+            dest="${modules.core.dir}/src/ExcludeDoclet.java" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        mx4j-jmx.jar 
+    -->
+    <target name="mx4j-check" description="Checks if the mx4j jar has been downloaded.">
+        <available file="${modules.opt.lib.dir}/mx4j-jmx.jar" property="mx4j.present"/>
+    </target>
+   
+    <target name="mx4j-download" depends="mx4j-check" unless="mx4j.present">
+        <available file="${mx4j.zip.file}" type="file" property="mx4j.zip.exists"/>
+        <antcall target="download-mx4j-java" />
+        
+    </target>
+    
+    <target name="download-mx4j-java" unless="mx4j.zip.exists">
+        <get src="http://repo1.maven.org/maven2/mx4j/mx4j-jmx/1.1.1/mx4j-jmx-1.1.1.jar" 
+            dest="${modules.opt.lib.dir}/mx4j-jmx.jar" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        catalina-708.jar 
+    -->
+    <target name="cat708-check" description="Checks if the catalina-708 jar has been downloaded.">
+        <available file="${modules.opt.lib.dir}/catalina-708.jar" property="cat708.present"/>
+    </target>
+   
+    <target name="cat708-download" depends="cat708-check" unless="cat708.present">
+        <available file="${cat708.zip.file}" type="file" property="cat708.zip.exists"/>
+        <antcall target="download-cat708-java" />
+        
+    </target>
+    
+    <target name="download-cat708-java" unless="cat708.zip.exists">
+        <get src="http://repo1.maven.org/maven2/org/apache/tomcat/tomcat-catalina/7.0.8/tomcat-catalina-7.0.8.jar" 
+            dest="${modules.opt.lib.dir}/catalina-708.jar" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        catalina-4150.jar 
+    -->
+    <target name="cat4150-check" description="Checks if the catalina-4150 jar have been downloaded.">
+        <available file="${modules.opt.lib.dir}/catalina-4150.jar" property="cat4150.present"/>
+    </target>
+   
+    <target name="cat4150-download" depends="cat4150-check" unless="cat4150.present">
+        <available file="${cat4150.zip.file}" type="file" property="cat4150.zip.exists"/>
+        <antcall target="download-cat4150-zip" />
+        
+        <unzip src="${cat4150.zip.file}" dest="${download.dir}/cat4150">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy file="${download.dir}/cat4150/jakarta-tomcat-4.0.6/server/lib/catalina.jar" toFile="${modules.opt.lib.dir}/catalina-4150.jar"/>
+    </target>
+    
+    <target name="download-cat4150-zip" unless="cat4150.zip.exists">
+        <mkdir dir="${download.dir}"/>
+        <get src="http://archive.apache.org/dist/tomcat/tomcat-4/archive/v4.0.6/bin/jakarta-tomcat-4.0.6.zip" 
+            dest="${cat4150.zip.file}" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        catalina.jar 
+    -->
+    <target name="cat-check" description="Checks if the catalina jar has been downloaded.">
+        <available file="${modules.opt.lib.dir}/catalina.jar" property="cat.present"/>
+    </target>
+   
+    <target name="cat-download" depends="cat-check" unless="cat.present">
+        <available file="${cat.zip.file}" type="file" property="cat.zip.exists"/>
+        <antcall target="download-cat-java" />
+        
+    </target>
+    
+    <target name="download-cat-java" unless="cat.zip.exists">
+        <get src="http://repo1.maven.org/maven2/org/apache/tomcat/catalina/6.0.26/catalina-6.0.26.jar" 
+            dest="${modules.opt.lib.dir}/catalina.jar" 
+            verbose="false"/>
+    </target>
+    
+	<!--
+        axis.jar 
+    -->
+    <target name="axis-check" description="Checks if the axis jar have been downloaded.">
+        <available file="${qa.lib.dir}/axis.jar" property="axis.present"/>
+    </target>
+   
+    <target name="axis-download" depends="axis-check" unless="axis.present">
+        <available file="${axis.zip.file}" type="file" property="axis.zip.exists"/>
+        <antcall target="download-axis-zip" />
+        <unzip src="${axis.zip.file}" dest="${download.dir}/axis">
+            <patternset>
+                <include name="**/*"/>
+            </patternset>
+        </unzip>
+        <copy file="${download.dir}/axis/axis-1_4/lib/axis.jar" toFile="${qa.lib.dir}/axis.jar"/>
+        <copy file="${download.dir}/axis/axis-1_4/lib/jaxrpc.jar" toFile="${qa.lib.dir}/jaxrpc.jar"/>
+        <copy file="${download.dir}/axis/axis-1_4/lib/saaj.jar" toFile="${qa.lib.dir}/saaj.jar"/>
+        <copy file="${download.dir}/axis/axis-1_4/lib/commons-discovery-0.2.jar" toFile="${qa.lib.dir}/commons-discovery-0.2.jar"/>
+        <copy file="${download.dir}/axis/axis-1_4/lib/wsdl4j-1.5.1.jar" toFile="${qa.lib.dir}/wsdl4j-1.5.1.jar"/>
+    </target>
+    
+    <target name="download-axis-zip" unless="axis.zip.exists">
+        <mkdir dir="${download.dir}"/>
+        <get src="http://archive.apache.org/dist/axis/axis/java/1.4/axis-bin-1_4.zip" 
+            dest="${axis.zip.file}" 
+            verbose="false"/>
+    </target>
+    
+
+	<!--
+        testng.jar 
+    -->
+    <target name="testng-check" description="Checks if the testng jar has been downloaded.">
+        <available file="${qa.lib.dir}/testng-5.8-jdk15.jar" property="testng.present"/>
+    </target>
+   
+    <target name="testng-download" depends="testng-check" unless="testng.present">
+        <available file="${testng.zip.file}" type="file" property="testng.zip.exists"/>
+        <antcall target="download-testng-java" />
+        
+    </target>
+    
+    <target name="download-testng-java" unless="testng.zip.exists">
+        <get src="http://mirrors.ibiblio.org/pub/mirrors/maven2/org/testng/testng/5.8/testng-5.8-jdk15.jar" 
+            dest="${qa.lib.dir}/testng-5.8-jdk15.jar" 
+            verbose="false"/>
+    </target>
+    
+</project>

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/frameworks/local-swcs/FlexSDK3/empty.txt
----------------------------------------------------------------------
diff --git a/frameworks/local-swcs/FlexSDK3/empty.txt b/frameworks/local-swcs/FlexSDK3/empty.txt
new file mode 100755
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/7a58369c/frameworks/local-swcs/FlexSDK4/empty.txt
----------------------------------------------------------------------
diff --git a/frameworks/local-swcs/FlexSDK4/empty.txt b/frameworks/local-swcs/FlexSDK4/empty.txt
new file mode 100755
index 0000000..e69de29