Use to propagate session/connection properties to a JMS message.

@param msg
182247
private void setMessageProperties(JmsMessageImpl msg) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setMessageProperties", msg.getClass() + "@" + System.identityHashCode(msg));

        // Get properties from the pass through properties
        String prodProp = (String) passThruProps.get(JmsraConstants.PRODUCER_DOES_NOT_MODIFY_PAYLOAD_AFTER_SET);
        String consProp = (String) passThruProps.get(JmsraConstants.CONSUMER_DOES_NOT_MODIFY_PAYLOAD_AFTER_GET);

        // Check property values & assign message attributes accordingly
        msg.producerWontModifyPayloadAfterSet = prodProp.equalsIgnoreCase(ApiJmsConstants.WILL_NOT_MODIFY_PAYLOAD);
        msg.consumerWontModifyPayloadAfterGet = consProp.equalsIgnoreCase(ApiJmsConstants.WILL_NOT_MODIFY_PAYLOAD);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setMessageProperties");
    }
639399
public void send(final Command msg) throws HandlerSocketException {
		Session session = this.selectSession();
		session.write(msg);
	}
63703
protected void connectToJMS(String clientId) throws MessagingException {
        // Check to see if already connected
        //
        if (connected == true) return;

        try {
            // Get a JMS Connection
            //
            connection = getConnection();
            if(clientId != null) {
                connection.setClientID(clientId);
            }
            connection.start();
            connected = true;
            logger.debug("connectToJMS - connected");
        } catch (JMSException e) {
            connected = false;
            logger.error("JMSManager.connectToJMS - Exception occurred:");
            throw new MessagingException(e.getMessage(), e);
        }
    }
1178840
public void sendBasicMessageAsync(Session session, BasicMessage msg) {
        String text = ApiDeserializer.toHawkularFormat(msg);
        sendTextAsync(session, text);
    }
951506
public boolean addMessage(SIMPMessage msgItem) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "addMessage", new Object[] { msgItem });
  
    // Get the JsMessage as we need to update the Guaranteed fields
    JsMessage jsMsg = msgItem.getMessage();
  
    StreamSet streamSet = getStreamSet();
  
    // Stamp the message with the stream ID
    msgItem.setGuaranteedStreamUuid(streamSet.getStreamID());
  
    //  NOTE: no synchronization with flush necessary here since startFlush
    // is not supposed to be called until all competing producer threads have
    // exited.
    Reliability reliability = msgItem.getReliability();
  
    if(reliability == Reliability.BEST_EFFORT_NONPERSISTENT)
    {
      addBestEffortMessage(msgItem);
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "addMessage", false);
      return false;
    }
    else
    {
      SourceStream sourceStream = null;
      int priority = msgItem.getPriority();
      synchronized(streamSet)
      {        
        sourceStream = (SourceStream) streamSet.getStream(priority, reliability);
    
        if(sourceStream == null)
        {
          sourceStream = createStream(streamSet,
                                      priority,
                                      reliability,
                                      streamSet.getPersistentData(priority, reliability),
                                      false );
        }
      }
    
      synchronized(sourceStream)
      {    
        long tick = this.messageProcessor.nextTick();
    
        //Set a unique id in the message if explicitly told to or
        //if one has not already been set
        if(msgItem.getRequiresNewId()  ||  jsMsg.getSystemMessageId()==null)
        {
          jsMsg.setSystemMessageSourceUuid(this.messageProcessor.getMessagingEngineUuid());
          jsMsg.setSystemMessageValue(tick);
          msgItem.setRequiresNewId(false);
        }
    
        jsMsg.setGuaranteedValueEndTick(tick);
        jsMsg.setGuaranteedValueValueTick(tick);
        jsMsg.setGuaranteedValueRequestedOnly(false);
    
        jsMsg.setGuaranteedValueStartTick(sourceStream.getLastMsgAdded() + 1);
        jsMsg.setGuaranteedValueCompletedPrefix(sourceStream.getCompletedPrefix());
    
        sourceStream.writeUncommitted(msgItem);
      } // end sync
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "addMessage", true);
    
      return true;
    }    
  }
182275
@OnMessage
	public void onMessage(Dto msg, Session session) {
		try {
			messageBus.fire(session);
			messagePayloadBus.fire(msg);
		} catch (Exception e) {

			log.log(Level.SEVERE, e.getMessage(), e);
		}

	}
949509
@Override
    public void sendMsg(Message message) {
        try {
            message.setSender(this.getID());
            ShanksAgent receiver = this.simulation.getAgent(message
                    .getReceiver());
            receiver.putMessegaInInbox(message);
            logger.finer("Sent message from Agent: " + this.getID()
                    + " to Agent: " + message.getReceiver());
        } catch (UnkownAgentException e) {
            logger.severe("UnkownAgentException: " + e.getMessage());
            e.printStackTrace();
        } catch (ShanksException e) {
            e.printStackTrace();
        }
    }
1367052
public void warn(final String msg) {
        if (proxy.isWarnEnabled()) {
            if (proxy instanceof LocationAwareLogger) {
                ((LocationAwareLogger) proxy).log(null, FQCN, LocationAwareLogger.WARN_INT, msg, null, null);
            } else {
                proxy.warn(msg);
            }
        }
    }
222213
public void onMessage(Message msg) {
	        try {
                    LOG.debug("Queuing msg [" + msg.getJMSMessageID() + "]");
                } catch (JMSException e) {
                }
		this.queue.offer(msg);
	}
807944
@Override
  public void update(final GroupCommunicationMessage msg) {
    if (msg.hasSrcVersion()) {
      final String srcId = msg.getSrcid();
      final int srcVersion = msg.getSrcVersion();
      LOG.finest(getQualifiedName() + "Updating " + msg.getType() + " msg from " + srcId);
      LOG.finest(getQualifiedName() + "Before update: parent=" + ((parent != null) ? parent.getId() : "NULL"));
      LOG.finest(getQualifiedName() + "Before update: children=" + children);
      switch (msg.getType()) {
      case ParentAdd:
        updateParentAdd(srcId, srcVersion);
        break;
      case ParentDead:
        updateParentDead(srcId, srcVersion);
        break;
      case ChildAdd:
        updateChildAdd(srcId, srcVersion);
        break;
      case ChildDead:
        updateChildDead(srcId, srcVersion);
        break;
      default:
        throw new RuntimeException("Received a non control message in update");
      }
      LOG.finest(getQualifiedName() + "After update: parent=" + ((parent != null) ? parent.getId() : "NULL"));
      LOG.finest(getQualifiedName() + "After update: children=" + children);
    } else {
      throw new RuntimeException(getQualifiedName() + "can only deal with msgs that have src version set");
    }
  }
1321249
public void sendMessage(final String message) {
        try {
            session.sendMessage(new TextMessage(message));
        }
        catch (IOException e) {
            logger.error("[sendTextMessage]", e);
        }
    }
1368887
@Override
	public void setMessageListener(MessageListener messageListener) throws JMSException
    {
    	externalAccessLock.readLock().lock();
    	try
		{
    		checkNotClosed();
    		this.messageListener = messageListener;
		}
    	finally
    	{
    		externalAccessLock.readLock().unlock();
    	}
    }
150089
public void debug(Object format, Object... msg) {
		if (logger.isDebugEnabled()) {
			// check if the first message contains variables variables
			if (format.toString().contains("{")) {
				logger.debug(format.toString(), msg);
			} else {
				logger.debug(format.toString().concat(" ").concat(JKStringUtil.concat(msg)));
			}
		}
	}
203244
protected void setMessage(byte[] msg) {
        try {
            readData(new DataInputStream(new ByteArrayInputStream(msg)));
        }
        catch (IOException ex) {
            logger.error("Problem setting response message - {}", ex.getMessage());
        }
    }
432650
private void createDestinations() throws MessagingException {
        try {
            // Create Destinations based on properties
            Enumeration<?> propertyNames = m_connectionProperties.keys();
            while (propertyNames.hasMoreElements()) {
                String propertyName = (String) propertyNames.nextElement();
                if (propertyName.startsWith("topic.")) {
                    String destinationName =
                            m_connectionProperties.getProperty(propertyName);
                    m_jmsManager.createDestination(destinationName,
                                                   DestinationType.Topic);
                } else if (propertyName.startsWith("queue.")) {
                    String destinationName =
                            m_connectionProperties.getProperty(propertyName);
                    m_jmsManager.createDestination(destinationName,
                                                   DestinationType.Queue);
                }
            }

            // Get destination list
            List<Destination> destinations = m_jmsManager.getDestinations();

            // If there are no Destinations, throw an exception
            if (destinations.size() == 0) {
                throw new MessagingException("No destinations available for "
                        + "subscription, make sure that there is at least one topic "
                        + "or queue specified in the connection properties.");
            }

            // Subscribe
            for (Destination destination : destinations) {
                if (m_durable && (destination instanceof Topic)) {
                    m_jmsManager.listenDurable((Topic) destination,
                                               m_messageSelector,
                                               this,
                                               null);
                } else {
                    m_jmsManager.listen(destination, m_messageSelector, this);
                }
            }
        } catch (MessagingException me) {
            logger.error("MessagingException encountered attempting to start "
                    + "Messaging Client: " + m_clientId
                    + ". Exception message: " + me.getMessage(), me);
            throw me;
        }
    }
50657
private void proxy(final SipResponse msg) {
        final ViaHeader via = msg.getViaHeader();
        final Connection connection = this.stack.connect(via.getHost(), via.getPort());
        connection.send(msg);
    }
440123
@Override
    public void send(Message msg) throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "send", msg);

        //Defer straight through to the version with completion listner (which will do all the locking and checking).
        send_internal(msg, null);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "send");
    }