//UPGRADE_TODO: Interface 'javax.jms.Message' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
        private static System.Object getHeaderValue(Message msg, Identifier identifier)
        {
            System.String prop = identifier.getIdentifier();
            if (prop.Equals("JMSMessageID"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSMessageID' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return(msg.MessageID);
            }
            else if (prop.Equals("JMSPriority"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSPriority' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return(msg.Priority);
            }
            else if (prop.Equals("JMSTimestamp"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSTimestamp' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return(msg.Timestamp);
            }
            else if (prop.Equals("JMSCorrelationID"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSCorrelationID' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return(msg.CorrelationID);
            }
            else if (prop.Equals("JMSDeliveryMode"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSDeliveryMode' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return(msg.DeliveryMode);
            }
            else if (prop.Equals("JMSRedelivered"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSRedelivered' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return(msg.Redelivered);
            }
            else if (prop.Equals("JMSType"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSType' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return(msg.MsgType);
            }
            else if (prop.Equals("JMSExpiration"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSExpiration' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return(msg.Expiration);
            }

            throw new System.SystemException("Invalid JMS property referenced: " + prop);
        }
        /// <summary> Get the value of the specified identifier.</summary>
        /// <param name="identifier">Field identifier.
        /// </param>
        /// <param name="correlation">Application correlation data. May be <tt>null</tt>.
        /// </param>
        /// <returns> Value of the specified identifier. Returns <tt>null</tt> if value
        /// of the specified identifier is not found.
        /// </returns>
        public virtual System.Object getValue(Identifier identifier, System.Object correlation)
        {
            try
            {
                /// <summary> Wrap numeric values in NumericValue instance</summary>
                System.Object value_Renamed = getValue(msg_, identifier);
                if ((value_Renamed is System.Int32))
                {
                    return(new NumericValue((System.Int32)value_Renamed));
                }

                if ((value_Renamed is System.Single))
                {
                    return(new NumericValue((System.Single)value_Renamed));
                }

                if ((value_Renamed is System.Double))
                {
                    return(new NumericValue((System.Double)value_Renamed));
                }

                if ((value_Renamed is System.Int64))
                {
                    return(new NumericValue((System.Int64)value_Renamed));
                }

                if ((value_Renamed is System.Int16))
                {
                    return(new NumericValue((System.Int16)value_Renamed));
                }

                if ((value_Renamed is System.Byte))
                {
                    return(new NumericValue((System.Byte)value_Renamed));
                }

                return(value_Renamed);
            }
            //UPGRADE_TODO: Class 'javax.jms.JMSException' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
            catch (Exception ex)
            {
                //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.toString' may return a different value. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1043"'
                throw new System.ArgumentException(ex.ToString());
            }
        }
Example #3
0
        /// <summary> Get the value of the specified identifier.</summary>
        /// <param name="identifier">Field identifier.
        /// </param>
        /// <param name="correlation">Application correlation data. May be <tt>null</tt>.
        /// </param>
        /// <returns> Value of the specified identifier. Returns <tt>null</tt> if value
        /// of the specified identifier is not found.
        /// </returns>
        public virtual System.Object getValue(Identifier identifier, System.Object correlation)
        {
            try
            {
                /// <summary> Wrap numeric values in NumericValue instance</summary>
                System.Object value_Renamed = getValue(msg_, identifier);
                if ((value_Renamed is System.Int32))
                    return new NumericValue((System.Int32) value_Renamed);

                if ((value_Renamed is System.Single))
                    return new NumericValue((System.Single) value_Renamed);

                if ((value_Renamed is System.Double))
                    return new NumericValue((System.Double) value_Renamed);

                if ((value_Renamed is System.Int64))
                    return new NumericValue((System.Int64) value_Renamed);

                if ((value_Renamed is System.Int16))
                    return new NumericValue((System.Int16) value_Renamed);

                if ((value_Renamed is System.Byte))
                    return new NumericValue((System.Byte) value_Renamed);

                return value_Renamed;
            }
            //UPGRADE_TODO: Class 'javax.jms.JMSException' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
            catch (Exception ex)
            {
                //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.toString' may return a different value. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1043"'
                throw new System.ArgumentException(ex.ToString());
            }
        }
Example #4
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;
        }
Example #5
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 getHeaderValue(Message msg, Identifier identifier)
        {
            System.String prop = identifier.getIdentifier();
            if (prop.Equals("JMSMessageID"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSMessageID' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return msg.MessageID;
            }
            else if (prop.Equals("JMSPriority"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSPriority' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return msg.Priority;
            }
            else if (prop.Equals("JMSTimestamp"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSTimestamp' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return msg.Timestamp;
            }
            else if (prop.Equals("JMSCorrelationID"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSCorrelationID' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return msg.CorrelationID;
            }
            else if (prop.Equals("JMSDeliveryMode"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSDeliveryMode' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return msg.DeliveryMode;
            }
            else if (prop.Equals("JMSRedelivered"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSRedelivered' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return msg.Redelivered;
            }
            else if (prop.Equals("JMSType"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSType' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return msg.MsgType;
            }
            else if (prop.Equals("JMSExpiration"))
            {
                //UPGRADE_TODO: Method 'javax.jms.Message.getJMSExpiration' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1095"'
                return msg.Expiration;
            }

            throw new System.SystemException("Invalid JMS property referenced: " + prop);
        }
        //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);
        }