You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2017/04/16 22:32:32 UTC

[41/72] [abbrv] [partial] flex-blazeds git commit: - Major code scrub

http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/8315f8fa/common/src/main/java/flex/messaging/util/PropertyStringResourceLoader.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/flex/messaging/util/PropertyStringResourceLoader.java b/common/src/main/java/flex/messaging/util/PropertyStringResourceLoader.java
new file mode 100644
index 0000000..21c2f59
--- /dev/null
+++ b/common/src/main/java/flex/messaging/util/PropertyStringResourceLoader.java
@@ -0,0 +1,378 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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>
+ *
+ * @see MessageFormat
+ *
+ */
+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/8315f8fa/common/src/main/java/flex/messaging/util/ResourceLoader.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/flex/messaging/util/ResourceLoader.java b/common/src/main/java/flex/messaging/util/ResourceLoader.java
new file mode 100644
index 0000000..e980f4b
--- /dev/null
+++ b/common/src/main/java/flex/messaging/util/ResourceLoader.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.messaging.util;
+
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * The root interface for classes that provide access to localized resources.
+ *
+ *
+ */
+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/8315f8fa/common/src/main/java/flex/messaging/util/StringUtils.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/flex/messaging/util/StringUtils.java b/common/src/main/java/flex/messaging/util/StringUtils.java
new file mode 100644
index 0000000..5a33f2e
--- /dev/null
+++ b/common/src/main/java/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;
+
+/**
+ *
+ */
+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/8315f8fa/common/src/main/java/flex/messaging/util/UUIDUtils.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/flex/messaging/util/UUIDUtils.java b/common/src/main/java/flex/messaging/util/UUIDUtils.java
new file mode 100644
index 0000000..9fd3c57
--- /dev/null
+++ b/common/src/main/java/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/8315f8fa/common/src/main/resources/flex/messaging/errors.properties
----------------------------------------------------------------------
diff --git a/common/src/main/resources/flex/messaging/errors.properties b/common/src/main/resources/flex/messaging/errors.properties
new file mode 100644
index 0000000..6ff59b0
--- /dev/null
+++ b/common/src/main/resources/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/8315f8fa/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index 0293d62..5a642bf 100755
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -16,79 +16,68 @@ 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>
+<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>org.apache.flex.blazeds</groupId>
-		<artifactId>blazeds</artifactId>
-		<version>4.7.3-SNAPSHOT</version>
-		<relativePath>../pom.xml</relativePath>
-	</parent>
+  <parent>
+    <groupId>org.apache.flex.blazeds</groupId>
+    <artifactId>blazeds</artifactId>
+    <version>4.7.3-SNAPSHOT</version>
+  </parent>
 
-	<artifactId>flex-messaging-core</artifactId>
+  <artifactId>flex-messaging-core</artifactId>
 
-	<dependencies>
-		<dependency>
-            <groupId>org.apache.flex.blazeds</groupId>
-			<artifactId>flex-messaging-common</artifactId>
-			<version>${project.version}</version>
-		</dependency>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.flex.blazeds</groupId>
+      <artifactId>flex-messaging-common</artifactId>
+      <version>${project.version}</version>
+    </dependency>
 
-        <dependency>
-            <groupId>org.apache.activemq</groupId>
-            <artifactId>activemq-core</artifactId>
-            <version>5.7.0</version>
-            <scope>provided</scope>
-        </dependency>
+    <dependency>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>activemq-core</artifactId>
+      <optional>true</optional>
+    </dependency>
 
-		<dependency>
-			<groupId>jgroups</groupId>
-			<artifactId>jgroups</artifactId>
-			<version>2.9.0.GA</version>
-			<scope>provided</scope>
-		</dependency>
+    <dependency>
+      <groupId>jgroups</groupId>
+      <artifactId>jgroups</artifactId>
+      <optional>true</optional>
+    </dependency>
 
-		<dependency>
-			<groupId>javax.servlet</groupId>
-			<artifactId>servlet-api</artifactId>
-			<version>2.5</version>
-			<scope>provided</scope>
-		</dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <scope>provided</scope>
+    </dependency>
 
-		<dependency>
-			<groupId>javax.jms</groupId>
-			<artifactId>jms-api</artifactId>
-			<version>1.1-rev-1</version>
-			<scope>provided</scope>
-		</dependency>
-	</dependencies>
+    <dependency>
+      <groupId>javax.jms</groupId>
+      <artifactId>javax.jms-api</artifactId>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-server</artifactId>
+      <version>9.1.0.v20131115</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-servlet</artifactId>
+      <version>9.1.0.v20131115</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
 
-	<build>
-		<sourceDirectory>src</sourceDirectory>
-		<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>