List of usage examples for javax.jms ObjectMessage setBooleanProperty
void setBooleanProperty(String name, boolean value) throws JMSException;
From source file:eu.learnpad.simulator.mon.manager.ResponseDispatcher.java
public static void sendScoresEvaluation(HashMap<ScoreType, Float> scores, String destination, String channel, String userid, String simulationSessionID) { try {//from w w w. ja v a 2s.com publicSession = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); connectionTopic = publishSession.createTopic(channel); tPub = publishSession.createPublisher(connectionTopic); ObjectMessage sendMessage = publishSession.createObjectMessage(); sendMessage.setObject((Serializable) scores); sendMessage.setStringProperty("DESTINATION", destination); sendMessage.setStringProperty("USERID", userid); sendMessage.setBooleanProperty("ISASCORE", true); sendMessage.setStringProperty("SIMSESSIONID", simulationSessionID); tPub.publish(sendMessage); } catch (JMSException e) { DebugMessages.println(TimeStamp.getCurrentTime(), ResponseDispatcher.class.getSimpleName(), "Exception during sendScoresEvaluation method execution"); } }
From source file:com.alliander.osgp.adapter.protocol.iec61850.infra.messaging.DeviceResponseMessageSender.java
private void sendMessage(final ProtocolResponseMessage responseMessage) { this.iec61850ResponsesJmsTemplate.send(new MessageCreator() { @Override//w w w. j a v a 2 s.com public Message createMessage(final Session session) throws JMSException { final ObjectMessage objectMessage = session.createObjectMessage(responseMessage); objectMessage.setJMSCorrelationID(responseMessage.getCorrelationUid()); objectMessage.setStringProperty(Constants.DOMAIN, responseMessage.getDomain()); objectMessage.setStringProperty(Constants.DOMAIN_VERSION, responseMessage.getDomainVersion()); objectMessage.setJMSType(responseMessage.getMessageType()); objectMessage.setStringProperty(Constants.ORGANISATION_IDENTIFICATION, responseMessage.getOrganisationIdentification()); objectMessage.setStringProperty(Constants.DEVICE_IDENTIFICATION, responseMessage.getDeviceIdentification()); objectMessage.setStringProperty(Constants.RESULT, responseMessage.getResult().toString()); if (responseMessage.getOsgpException() != null) { objectMessage.setStringProperty(Constants.DESCRIPTION, responseMessage.getOsgpException().getMessage()); } objectMessage.setBooleanProperty(Constants.IS_SCHEDULED, responseMessage.isScheduled()); objectMessage.setIntProperty(Constants.RETRY_COUNT, responseMessage.getRetryCount()); return objectMessage; } }); }
From source file:com.alliander.osgp.adapter.protocol.oslp.elster.infra.messaging.DeviceResponseMessageSender.java
private void sendMessage(final ProtocolResponseMessage responseMessage) { this.oslpResponsesJmsTemplate.send(new MessageCreator() { @Override//from w w w. ja va 2 s .c o m public Message createMessage(final Session session) throws JMSException { final ObjectMessage objectMessage = session.createObjectMessage(responseMessage); objectMessage.setJMSCorrelationID(responseMessage.getCorrelationUid()); objectMessage.setStringProperty(Constants.DOMAIN, responseMessage.getDomain()); objectMessage.setStringProperty(Constants.DOMAIN_VERSION, responseMessage.getDomainVersion()); objectMessage.setJMSType(responseMessage.getMessageType()); objectMessage.setStringProperty(Constants.ORGANISATION_IDENTIFICATION, responseMessage.getOrganisationIdentification()); objectMessage.setStringProperty(Constants.DEVICE_IDENTIFICATION, responseMessage.getDeviceIdentification()); objectMessage.setStringProperty(Constants.RESULT, responseMessage.getResult().toString()); if (responseMessage.getOsgpException() != null) { objectMessage.setStringProperty(Constants.DESCRIPTION, responseMessage.getOsgpException().getMessage()); } objectMessage.setBooleanProperty(Constants.IS_SCHEDULED, responseMessage.isScheduled()); objectMessage.setIntProperty(Constants.RETRY_COUNT, responseMessage.getRetryCount()); return objectMessage; } }); }
From source file:org.osgp.adapter.protocol.dlms.infra.messaging.DeviceResponseMessageSender.java
private void sendMessage(final ProtocolResponseMessage responseMessage) { this.dlmsResponsesJmsTemplate.setPriority(responseMessage.getMessagePriority()); this.dlmsResponsesJmsTemplate.send(new MessageCreator() { @Override/*from w w w.j ava2 s. c o m*/ public Message createMessage(final Session session) throws JMSException { final ObjectMessage objectMessage = session.createObjectMessage(responseMessage); objectMessage.setJMSCorrelationID(responseMessage.getCorrelationUid()); objectMessage.setStringProperty(Constants.DOMAIN, responseMessage.getDomain()); objectMessage.setStringProperty(Constants.DOMAIN_VERSION, responseMessage.getDomainVersion()); objectMessage.setJMSType(responseMessage.getMessageType()); objectMessage.setStringProperty(Constants.ORGANISATION_IDENTIFICATION, responseMessage.getOrganisationIdentification()); objectMessage.setStringProperty(Constants.DEVICE_IDENTIFICATION, responseMessage.getDeviceIdentification()); objectMessage.setStringProperty(Constants.RESULT, responseMessage.getResult().toString()); if (responseMessage.getOsgpException() != null) { objectMessage.setStringProperty(Constants.DESCRIPTION, responseMessage.getOsgpException().getMessage()); } objectMessage.setBooleanProperty(Constants.IS_SCHEDULED, responseMessage.isScheduled()); objectMessage.setIntProperty(Constants.RETRY_COUNT, responseMessage.getRetryCount()); return objectMessage; } }); }