Checks to see if the producer has promised not to modify the payload after it's been set.
If they have, then throw a JMS exception based on the parameters

@throws JMSException
432401
private void checkProducerPromise(String jmsMethod, String ffdcProbeID) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "checkProducerPromise", new Object[] { jmsMethod, ffdcProbeID });

        // Only proceed if the producer hasn't promised not to modify the payload
        // after setting it.
        if (producerWontModifyPayloadAfterSet) {
            throw (JMSException) JmsErrorUtils.newThrowable(
                                                            IllegalStateException.class, // JMS illegal state exception
                                                            "PROMISE_BROKEN_EXCEPTION_CWSIA0510", // promise broken
                                                            new Object[] { jmsMethod }, // insert = jms method name
                                                            null, // no cause, original exception
                                                            ffdcProbeID, // Probe ID
                                                            this, // caller (?)
                                                            tc); // Trace component
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "checkProducerPromise");
    }
625945
protected void checkPropertiesWriteable(String callingMethodName) throws JMSException {
        if (propertiesReadOnly) {
            throw (javax.jms.MessageNotWriteableException) JmsErrorUtils.newThrowable(javax.jms.MessageNotWriteableException.class,
                                                                                      "READ_ONLY_MESSAGE_PROPERTY_CWSIA0108",
                                                                                      new Object[] { callingMethodName },
                                                                                      tc
                            );
        }
    }
880302
@Override
	public void check() throws JMSException
    {
        Iterator<User> users = userMap.values().iterator();
        while (users.hasNext())
        {
            User user = users.next();
            user.check();
        }
    }
871296
@Override
	public void check() throws JMSException
    {
	    if (StringTools.isEmpty(name))
	        throw new InvalidDescriptorException("Missing user name in security descriptor");
	    if (password == null)
	        throw new InvalidDescriptorException("Missing password definition for user "+name);
    }
94284
@Override
    public void clearBody() throws javax.jms.JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "clearBody");

        // Set the message into write-only mode, handle generic actions
        super.clearBody();

        // Clear the locally stored reference to body of the message, and ensure the
        // 'read' stream is set to null
        dataBuffer = null;
        dataStart = 0; // @P2A
        readStream = null;

        // remove the encoding and character set properties as these pertain to the
        // body which is being cleared.
        // SIB0121: also clear the underlying MFP payload
        if (jsBytesMsg != null) {
            jsBytesMsg.setBytes(null);
            jsBytesMsg.setObjectProperty(ApiJmsConstants.ENCODING_PROPERTY, null);
            jsBytesMsg.setObjectProperty(ApiJmsConstants.CHARSET_PROPERTY, null);
        }

        integerEncoding = ApiJmsConstants.ENC_INTEGER_NORMAL; // reset to standard Java encoding
        floatEncoding = ApiJmsConstants.ENC_FLOAT_IEEE_NORMAL; // reset to standard Java encoding

        // Invalidate the cached toString object.
        cachedBytesToString = null;

        // This class has different behaviour depending on the whether the
        // producer might modify the payload after it's been set or not
        if (!producerWontModifyPayloadAfterSet) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "Producer might modify the payload after set - encoding is required, so reinitialise encoding relating variables");

            // Prepare a new stream for the client to write to
            _writeBytes = new ByteArrayOutputStream();
            writeStream = new DataOutputStream(_writeBytes);

            // Initialise the arrays used to record the position of numeric items
            integer_count = 0;
            // number of integer items recorded in the current arrays
            integer_offsets = new int[ARRAY_SIZE];
            // offset of start of each numeric item
            integer_sizes = new int[ARRAY_SIZE];
            // length in byte of the item in question
            if (integers != null)
                integers.removeAllElements();
            // arrays which we filled up are stored in this vector - remove them all

            if (float_offsets != null)
                float_offsets.removeAllElements();
            if (float_values != null)
                float_values.removeAllElements();

            // Ensure that the new data gets exported when the time comes.
            bodySetInJsMsg = false;
        }

        else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "Producer has promised not to modify payload - ensure write streams used for encoding are null");

            // Ensure the write stream variables are null - they are never used when the
            // producer has promised not to modify the payload after it's been set
            _writeBytes = null;
            writeStream = null;

            // Ensure the producer promise flag is checked correctly in the writeBytes method
            writeByteArrayCalled = false;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "clearBody");
    }
38508
@Override
    public void setProviderEndpoints(String newProviderEndpoints) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setProviderEndpoints", newProviderEndpoints);
        jcaManagedConnectionFactory.setRemoteServerAddress(newProviderEndpoints);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setProviderEndpoints");
    }
889141
@Override
	public final void setJMSPriority(int priority) throws JMSException
    {
        if (priority < 0 || priority > 9)
            throw new FFMQException("Invalid priority value : "+priority,"INVALID_PRIORITY");
            
        assertDeserializationLevel(MessageSerializationLevel.FULL);
        this.priority = priority;
    }
1211492
@Override
    public void setGatherMessages(String gatherMessages) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setGatherMessages", gatherMessages);

        // Make sure null and empty are treated equally.
        if ((gatherMessages == null) || ("".equals(gatherMessages.trim())))
            gatherMessages = null;

        if ((gatherMessages == null) ||
            (ApiJmsConstants.GATHER_MESSAGES_OFF.equals(gatherMessages) ||
            (ApiJmsConstants.GATHER_MESSAGES_ON.equals(gatherMessages)))) {

            updateProperty(GATHER_MESSAGES, gatherMessages);
        }
        else {
            // bad value, throw exception
            String key = "INVALID_VALUE_CWSIA0281";
            Object[] inserts = new Object[] { GATHER_MESSAGES, gatherMessages };
            throw (JMSException) JmsErrorUtils.newThrowable(JMSException.class, key, inserts, tc);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setGatherMessages");
    }
467298
@Override
    public void reset() throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "reset");

        // After reset has been called, the message body is immutable (the only way of changing it is to
        // call clearBody and start again). If we're in Write Mode, we need to convert the writeStream
        // to a byte array and switch into read mode. If we're in Read Mode, we must have already done this,
        // so we don't want to do it again
        if (!isBodyReadOnly()) {

            // If the producer won't modify the payload after set,skip the
            // encoding of the write stream because encoding is not needed
            if (!producerWontModifyPayloadAfterSet) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "Body is writeable & producer might modify the payload, so encode the write stream");

                // Convert the stream in which the message was being assembled to a byte array
                dataBuffer = _writeBytes.toByteArray();

                // store the content in the JS msg
                lastEncoding = integerEncoding | floatEncoding;
                jsBytesMsg.setBytes(_exportBody(lastEncoding));
                bodySetInJsMsg = true;

                // Throw away the write stream
                writeStream = null;
                _writeBytes = null;
            }

            dataStart = 0; // start from the first byte in the buffer

            // The message is now read only
            setBodyReadOnly();
        }

        // For some odd reason, after receiving an 'empty' message the dataBuffer
        // is null rather than pointing to an empty array. This will compensate
        // hopefully without any side effects - SXA #58832
        if (dataBuffer == null)
            dataBuffer = new byte[0];

        // Create a Byte array input stream for the readxxx methods to operate on. We have to create a new
        // stream each time (rather than call the stream's read method), as the stream may have a position
        // marked in it that isn't at the start.
        _readBytes = new ByteArrayInputStream(dataBuffer);
        readStream = new DataInputStream(_readBytes);

        // Jump over any header that might be present in the dataBuffer
        // JBK - I don't think we will ever have dataStart!=0 in JS, but I'm
        // leaving the capability here until I understand better.
        try {
            readStream.skip(dataStart);
        } catch (IOException e) {
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "reset");
    }
1349472
@Override
    public void reportException(JMSException e) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "reportException", e);
        if (elRef.get() != null) {
            asyncExceptionTask.handleException(e);
        }
        else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "No exception listener is currently set for this connection.");
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "reportException");
    }
228381
@Override
    public final void setReportException(Byte value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setReportException", value);
        if (value != null) {
            getApi().setField(JsApiAccess.REPORTEXCEPTION_VALUE, value);
        }
        else {
            getApi().setChoiceField(JsApiAccess.REPORTEXCEPTION, JsApiAccess.IS_REPORTEXCEPTION_UNSET);
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setReportException");
    }
945729
@Override
    protected JsJmsMessage getMsgReference() throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getMsgReference");

        // If the body is read only, the contents should already be in the
        // JS message, so only do the copy over if we are in write mode.
        // SIB0121: ... and if the producer might modify the payload after it's been set
        if (!isBodyReadOnly() && !producerWontModifyPayloadAfterSet) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "Body is writeable & producer hasn't promised not to modify the payload - attempt encoding");

            try {
                int encoding = integerEncoding | floatEncoding; // NB bitwise or (|), not logical or (||)
                // check if JMS_IBM_Encoding has been set
                if (propertyExists(ApiJmsConstants.ENCODING_PROPERTY)) {
                    encoding = getIntProperty(ApiJmsConstants.ENCODING_PROPERTY);
                }

                if (bodySetInJsMsg && (encoding == lastEncoding)) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        SibTr.debug(this, tc, "Body cached - encoding not necessary");
                }
                else {
                    // flatten and encode the data streams
                    byte[] encodedBody = _exportBody(encoding);
                    // and set it into the Jetstream message
                    jsBytesMsg.setBytes(encodedBody);
                    lastEncoding = encoding;
                    bodySetInJsMsg = true;
                }
            }

            catch (JMSException e) {
                // No FFDC code needed

                // d222942 review JMSException could be thrown by _exportBody if passed an unknown
                // value for encoding, or if there was an IO error handling the streams. These already
                // have good nls messages, so we should simply pass on, not wrap with a generic message.
                // Similarly, getIntProperty can throw a JMSException which can also be passed on.
                throw e;
            }

        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getMsgReference", jsBytesMsg);
        return jsBytesMsg;
    }
83619
public void delete() throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "delete");

    //check to see if this has already been deleted.
    //If it has return with out doing anything
    if(!deleted) {
      session.deleteTemporaryDestination(getConsumerSIDestinationAddress());
      deleted = true;
      ((JmsConnectionImpl)session.getConnection()).removeTemporaryDestination(this);
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "delete");
  }
666534
@Override
	public final void send(Message message) throws JMSException
    {
    	if (this.destination == null)
    		throw new UnsupportedOperationException("Destination was not set at creation time");
    	
    	// Setup message fields
    	setupMessage(destination,message,defaultDeliveryMode,defaultPriority,defaultTimeToLive);
    	
    	// Handle foreign message implementations
        message = MessageTools.normalize(message);

        sendToDestination(destination,false,message,defaultDeliveryMode,defaultPriority,defaultTimeToLive);
    }
1032006
@Override
    public void setReadAhead(String value) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setReadAhead", value);

        // Check for null then ensure that the value is one of the permitted constants.
        if ((value != null)
            && ((ApiJmsConstants.READ_AHEAD_DEFAULT.equals(value))
                || (ApiJmsConstants.READ_AHEAD_ON.equals(value))
                || (ApiJmsConstants.READ_AHEAD_OFF.equals(value))
            )) {
            jcaManagedConnectionFactory.setReadAhead(value);
        }
        else {
            throw (JMSException) JmsErrorUtils.newThrowable(
                                                            JMSException.class,
                                                            "INVALID_VALUE_CWSIA0261",
                                                            new Object[] { "readAhead", value },
                                                            tc
                            );
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setReadAhead");
    }
794897
void rollbackTransaction() throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "rollbackTransaction");

        try {
            if (rolledBackDueToConnectionFailure) { //PK60857
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    SibTr.debug(tc, "rolledBackDueToConnectionFailure = true");
                }
                // No-op'ing the rollback because it has already happened during the commit.
                // This means rollback should never have been called, but some components insist on calling rollback after getting a TransactionRolledBackException.
                return; // exit trace handled by the finally block
            }

            jcaSession.rollbackLocalTransaction();
            uncommittedReceiveCount = 0;
        } catch (javax.resource.spi.IllegalStateException ise) {
            // No FFDC code needed
            // d238447 FFDC review. IllegalState is thrown if the jcaSession is closed, which
            //   might occur in a badly coded app due to concurrent race. No FFDC.
            throw (javax.jms.IllegalStateException) JmsErrorUtils.newThrowable(javax.jms.IllegalStateException.class,
                                                                               "EXCEPTION_RECEIVED_CWSIA0053",
                                                                               new Object[] { ise, "JmsSessionImpl.rollbackTransaction (#1)" },
                                                                               ise,
                                                                               null, // null probeId = no FFDC
                                                                               this,
                                                                               tc
                            );
        } catch (javax.resource.spi.LocalTransactionException lte) {
            // No FFDC code needed
            // d222942 review - ok
            // d238447 FFDC review. LTE thrown when no transaction is in progress. JMS layer shouldn't
            //   get this, so generate FFDC to indicate something has gone wrong.
            throw (javax.jms.IllegalStateException) JmsErrorUtils.newThrowable(javax.jms.IllegalStateException.class,
                                                                               "EXCEPTION_RECEIVED_CWSIA0053",
                                                                               new Object[] { lte, "JmsSessionImpl.rollbackTransaction (#2)" },
                                                                               lte,
                                                                               "JmsSessionImpl.rollbackTransaction#2",
                                                                               this,
                                                                               tc
                            );
        } catch (Exception e) {
            // No FFDC code needed
            // d238447 FFDC review - generate FFDC.
            throw (JMSException) JmsErrorUtils.newThrowable(JMSException.class,
                                                            "EXCEPTION_RECEIVED_CWSIA0053",
                                                            new Object[] { e, "JmsSessionImpl.rollbackTransaction (#3)" },
                                                            e,
                                                            "JmsSessionImpl.rollbackTransaction#3",
                                                            this,
                                                            tc
                            );
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "commitTransaction");
        }
    }
1062294
@Override
    public final void setJmsReplyTo(byte[] value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setJmsReplyTo", value);
        /* There is no need to take a copy because the JMS API layer will never */
        /* change the byte array passed in. */
        getHdr2().setField(JsHdr2Access.JMSREPLYTO_DATA, value);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setJmsReplyTo");
    }