/// <summary> Extract a IDictionary from the given MapMessage.</summary>
        /// <param name="message">the message to convert
        /// </param>
        /// <returns> the resulting Map
        /// </returns>
        /// <throws>EMSException if thrown by EMS methods </throws>
        protected virtual IDictionary ExtractMapFromMessage(MapMessage message)
        {
            IDictionary dictionary = new Hashtable();
            IEnumerator e          = message.MapNames;

            while (e.MoveNext())
            {
                String key = (String)e.Current;
                dictionary.Add(key, message.GetObject(key));
            }

            return(dictionary);
        }
Exemplo n.º 2
0
        //UPGRADE_TODO: Interface 'javax.jms.Message' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
        private static System.Object getValue(Message msg, Identifier identifier)
        {
            if (identifier.JMSHeader)
            {
                return(getHeaderValue(msg, identifier));
            }

            System.String fldName = identifier.getIdentifier();

            // Leading '.' is there to indicate that this identifier references a nested
            // message field (not a property)
            int ind = fldName.IndexOf((System.Char) '.');

            if (ind >= 0)
            {
                // Skip over leading '.' if any
                if (ind == 0)
                {
                    fldName = fldName.Substring(1);
                }

                //UPGRADE_ISSUE: Constructor 'java.util.StringTokenizer.StringTokenizer' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javautilStringTokenizerStringTokenizer_javalangString_javalangString_boolean"'
                for (SupportClass.Tokenizer strTok = new SupportClass.Tokenizer(identifier.getIdentifier(), "."); strTok.HasMoreTokens();)
                {
                    //UPGRADE_TODO: Interface 'javax.jms.MapMessage' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                    if (!(msg is MapMessage))
                    {
                        return(null);
                    }

                    //UPGRADE_TODO: Interface 'javax.jms.MapMessage' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                    MapMessage mapMsg = (MapMessage)msg;

                    fldName = strTok.NextToken();
                    //UPGRADE_TODO: Method 'javax.jms.MapMessage.getObject' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                    System.Object nestedMsg = mapMsg.GetObject(fldName);
                    if (strTok.HasMoreTokens())
                    {
                        //UPGRADE_TODO: Interface 'javax.jms.MapMessage' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                        if (!(nestedMsg is MapMessage))
                        {
                            return(null);
                        }

                        //UPGRADE_TODO: Interface 'javax.jms.Message' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                        msg = (Message)nestedMsg;
                    }
                    else
                    {
                        return(nestedMsg);
                    }
                }
            }

            // Must be a property
            //UPGRADE_TODO: Method 'javax.jms.Message.propertyExists' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
            if (msg.PropertyExists(fldName))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getObjectProperty' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return(msg.GetObjectProperty(fldName));
            }
            return(null);
        }