Codota Logo
TextMessage.setBooleanProperty
Code IndexAdd Codota to your IDE (free)

How to use
setBooleanProperty
method
in
javax.jms.TextMessage

Best Java code snippets using javax.jms.TextMessage.setBooleanProperty (Showing top 20 results out of 315)

  • Common ways to obtain TextMessage
private void myMethod () {
TextMessage t =
  • Codota IconSession session;String text;session.createTextMessage(text)
  • Codota IconSession session;session.createTextMessage()
  • Codota IconQueueSession senderSession;senderSession.createTextMessage()
  • Smart code suggestions by Codota
}
origin: uk.org.mygrid.resources/boca-notification-servlet

TextMessage textMessage = session.createTextMessage();
textMessage.setStringProperty(BocaSerializationConstants.operation, BocaSerializationConstants.updateResults);
textMessage.setBooleanProperty(BocaSerializationConstants.method, addition);
textMessage.setObjectProperty(BocaSerializationConstants.type, BocaSerializationConstants.aci);
textMessage.setObjectProperty(BocaSerializationConstants.namedGraphUri, Constants.defaultSystemGraph);
textMessage.setObjectProperty(BocaSerializationConstants.role, role.toString());
if (canRead != null)
  textMessage.setBooleanProperty(BocaSerializationConstants.canRead, canRead);
if (canUpdate != null)
  textMessage.setBooleanProperty(BocaSerializationConstants.canUpdate, canUpdate);
if (canDelete != null)
  textMessage.setBooleanProperty(BocaSerializationConstants.canDelete, canDelete);
if (canInsert != null)
  textMessage.setBooleanProperty(BocaSerializationConstants.canInsert, canInsert);
if (canRemove != null)
  textMessage.setBooleanProperty(BocaSerializationConstants.canRemove, canRemove);
if (canChangeAcl != null)
  textMessage.setBooleanProperty(BocaSerializationConstants.canChangeAcl, canChangeAcl);
aclUserAccess.remove(acl);
Set<URI> users = null;
origin: SolaceSamples/solace-samples-jms

  @Override
  public void onMessage(Message request) {
    try {
      Destination replyDestination = request.getJMSReplyTo();
      if (replyDestination != null) {
        System.out.println("Received request, responding...");
        TextMessage reply = session.createTextMessage();
        String text = "Sample response";
        reply.setText(text);
        // Copy the correlation ID from the request to the reply
        reply.setJMSCorrelationID(request.getJMSCorrelationID());
        // For direct messaging only, this flag is needed to interoperate with
        // Solace Java, C, and C# request reply APIs.
        reply.setBooleanProperty(SupportedProperty.SOLACE_JMS_PROP_IS_REPLY_MESSAGE, Boolean.TRUE);
        // Sent the reply
        replyProducer.send(replyDestination, reply, DeliveryMode.NON_PERSISTENT,
            Message.DEFAULT_PRIORITY,
            Message.DEFAULT_TIME_TO_LIVE);
        System.out.println("Responded successfully. Exiting...");
        latch.countDown(); // unblock the main thread
      } else {
        System.out.println("Received message without reply-to field.");
      }
    } catch (JMSException ex) {
      System.out.println("Error processing incoming message.");
      ex.printStackTrace();
    }
  }
});
origin: org.apache.geronimo.daytrader/daytrader-ejb

message.setStringProperty("command", command);
message.setIntProperty("orderID", orderID.intValue());
message.setBooleanProperty("twoPhase", twoPhase);
message.setBooleanProperty("direct", true);
message.setLongProperty("publishTime", System.currentTimeMillis());
message.setText("neworder: orderID=" + orderID
origin: org.apache.tuscany.sca/tuscany-binding-jms-runtime

public Message createFaultJMSTextMessage(Session session, Throwable o) {
  if (session == null) {
    logger.fine("no response session to create fault message: " + String.valueOf(o));
    return null;
  }
  if (o instanceof FaultException) {
    try {
      TextMessage message = session.createTextMessage();
      message.setText(xmlHelper.saveAsString(((FaultException)o).getFaultInfo()));
      message.setBooleanProperty(JMSBindingConstants.FAULT_PROPERTY, true);
      return message;
    } catch (JMSException e) {
      throw new JMSBindingException(e);
    }
  } else {
    // handle the non XML fault case
    return super.createFaultMessage(session, o);
  }
}
origin: org.apache.tuscany.sca/tuscany-binding-jms-runtime

@Override
public Message createFaultMessage(Session session, Throwable o) {
  if (session == null) {
    logger.fine("no response session to create fault message: " + String.valueOf(o));
    return null;
  }
  if (o instanceof FaultException) {
    try {
      TextMessage message = session.createTextMessage();
      message.setText(xmlHelper.saveAsString(((FaultException)o).getFaultInfo()));
      message.setBooleanProperty(JMSBindingConstants.FAULT_PROPERTY, true);
      return message;
    } catch (JMSException e) {
      throw new JMSBindingException(e);
    }
  } else {
    return super.createFaultMessage(session, o);
  }
}
origin: org.apache.geronimo.daytrader/daytrader-ejb

message.setBooleanProperty("twoPhase", twoPhase);
message.setText("neworder: orderID=" + orderID + " runtimeMode=EJB twoPhase=" + twoPhase);
message.setLongProperty("publishTime", System.currentTimeMillis());
origin: uk.org.mygrid.resources/boca-notification-servlet

TextMessage textMessage = session.createTextMessage();
textMessage.setStringProperty(BocaSerializationConstants.operation, BocaSerializationConstants.updateResults);
textMessage.setBooleanProperty(BocaSerializationConstants.method, additions);
textMessage.setObjectProperty(BocaSerializationConstants.type, BocaSerializationConstants.namedGraph);
textMessage.setLongProperty(BocaSerializationConstants.revision, revision);
origin: uk.org.mygrid.resources/boca-notification-servlet

public boolean handleUserInRole(boolean addition, URI user, URI role) throws BocaException {
  if (userDestinations.size() == 0)
    return false;
  try {
    TextMessage textMessage = session.createTextMessage();
    textMessage.setStringProperty(BocaSerializationConstants.operation, BocaSerializationConstants.updateResults);
    textMessage.setBooleanProperty(BocaSerializationConstants.method, addition);
    textMessage.setObjectProperty(BocaSerializationConstants.type, BocaSerializationConstants.userInRole);
    textMessage.setObjectProperty(BocaSerializationConstants.namedGraphUri, Constants.defaultSystemGraph);
    textMessage.setObjectProperty(BocaSerializationConstants.metaUri, Constants.defaultSystemMetaGraph);
    textMessage.setObjectProperty(BocaSerializationConstants.user, user.toString());
    textMessage.setObjectProperty(BocaSerializationConstants.role, role.toString());
    Set<URI> users = aclUserAccess.get(Constants.defaultSystemMetaGraphURI);
    if (users == null) {
      users = authenticationService.getUsersForGraph(Constants.defaultSystemMetaGraphURI);
      aclUserAccess.put(Constants.defaultSystemMetaGraphURI, users);
    }
    return sendMessage(textMessage, users);
  } catch (JMSException jmse) {
    throw BocaException.createException(CODES.PROCESS_UPDATE_ERROR, ExceptionConstants.NOTIFICATION.SUBCODES.PROCESS_UPDATE_FAILED, jmse, jmse.getMessage());
  }
}
origin: uk.org.mygrid.resources/boca-notification-servlet

public boolean handleRole(boolean addition, URI role) throws BocaException {
  if (userDestinations.size() == 0)
    return false;
  try {
    TextMessage textMessage = session.createTextMessage();
    textMessage.setStringProperty(BocaSerializationConstants.operation, BocaSerializationConstants.updateResults);
    textMessage.setBooleanProperty(BocaSerializationConstants.method, addition);
    textMessage.setObjectProperty(BocaSerializationConstants.type, BocaSerializationConstants.role);
    textMessage.setObjectProperty(BocaSerializationConstants.namedGraphUri, Constants.defaultSystemGraph);
    textMessage.setObjectProperty(BocaSerializationConstants.metaUri, Constants.defaultSystemMetaGraph);
    textMessage.setObjectProperty(BocaSerializationConstants.role, role.toString());
    Set<URI> users = aclUserAccess.get(Constants.defaultSystemMetaGraphURI);
    if (users == null) {
      users = authenticationService.getUsersForGraph(Constants.defaultSystemMetaGraphURI);
      aclUserAccess.put(Constants.defaultSystemMetaGraphURI, users);
    }
    return sendMessage(textMessage, users);
  } catch (JMSException jmse) {
    throw BocaException.createException(CODES.PROCESS_UPDATE_ERROR, ExceptionConstants.NOTIFICATION.SUBCODES.PROCESS_UPDATE_FAILED, jmse, jmse.getMessage());
  }
}
origin: uk.org.mygrid.resources/boca-notification-servlet

public boolean handleSubRoleOf(boolean addition, URI role, URI parentRole) throws BocaException {
  if (userDestinations.size() == 0)
    return false;
  try {
    TextMessage textMessage = session.createTextMessage();
    textMessage.setStringProperty(BocaSerializationConstants.operation, BocaSerializationConstants.updateResults);
    textMessage.setBooleanProperty(BocaSerializationConstants.method, addition);
    textMessage.setObjectProperty(BocaSerializationConstants.type, BocaSerializationConstants.subRole);
    textMessage.setObjectProperty(BocaSerializationConstants.namedGraphUri, Constants.defaultSystemGraph);
    textMessage.setObjectProperty(BocaSerializationConstants.metaUri, Constants.defaultSystemMetaGraph);
    textMessage.setObjectProperty(BocaSerializationConstants.role, role.toString());
    textMessage.setObjectProperty(BocaSerializationConstants.parentRole, parentRole.toString());
    Set<URI> users = aclUserAccess.get(Constants.defaultSystemMetaGraphURI);
    if (users == null) {
      users = authenticationService.getUsersForGraph(Constants.defaultSystemMetaGraphURI);
      aclUserAccess.put(Constants.defaultSystemMetaGraphURI, users);
    }
    return sendMessage(textMessage, users);
  } catch (JMSException jmse) {
    throw BocaException.createException(CODES.PROCESS_UPDATE_ERROR, ExceptionConstants.NOTIFICATION.SUBCODES.PROCESS_UPDATE_FAILED, jmse, jmse.getMessage());
  }
}
origin: uk.org.mygrid.resources/boca-notification-servlet

public boolean handleAcl(boolean addition, URI acl, boolean isTemplate) throws BocaException {
  if (userDestinations.size() == 0)
    return false;
  try {
    if (isTemplate) {
      TextMessage textMessage = session.createTextMessage();
      textMessage.setStringProperty(BocaSerializationConstants.operation, BocaSerializationConstants.updateResults);
      textMessage.setBooleanProperty(BocaSerializationConstants.method, addition);
      textMessage.setObjectProperty(BocaSerializationConstants.type, BocaSerializationConstants.acl);
      textMessage.setObjectProperty(BocaSerializationConstants.namedGraphUri, Constants.defaultSystemGraph);
      textMessage.setObjectProperty(BocaSerializationConstants.metaUri, Constants.defaultSystemMetaGraph);
      textMessage.setObjectProperty(BocaSerializationConstants.acl, acl.toString());
      Set<URI> users = aclUserAccess.get(Constants.defaultSystemMetaGraphURI);
      if (users == null) {
        users = authenticationService.getUsersForGraph(Constants.defaultSystemMetaGraphURI);
        aclUserAccess.put(Constants.defaultSystemMetaGraphURI, users);
      }
      return sendMessage(textMessage, users);
    }
  } catch (JMSException jmse) {
    throw BocaException.createException(CODES.PROCESS_UPDATE_ERROR, ExceptionConstants.NOTIFICATION.SUBCODES.PROCESS_UPDATE_FAILED, jmse, jmse.getMessage());
  }
  return false;
}
origin: uk.org.mygrid.resources/boca-notification-servlet

public boolean handleUser(boolean additions, URI user, URI defaultRole, URI defaultAclTemplate, String userId, String password) throws BocaException {
  if (userDestinations.size() == 0)
    return false;
  try {
    TextMessage textMessage = session.createTextMessage();
    textMessage.setStringProperty(BocaSerializationConstants.operation, BocaSerializationConstants.updateResults);
    textMessage.setBooleanProperty(BocaSerializationConstants.method, additions);
    textMessage.setObjectProperty(BocaSerializationConstants.type, BocaSerializationConstants.userType);
    textMessage.setObjectProperty(BocaSerializationConstants.user, user.toString());
    textMessage.setObjectProperty(BocaSerializationConstants.namedGraphUri, Constants.defaultSystemGraph);
    textMessage.setObjectProperty(BocaSerializationConstants.metaUri, Constants.defaultSystemMetaGraph);
    if (defaultRole != null)
      textMessage.setObjectProperty(BocaSerializationConstants.defaultRole, defaultRole.toString());
    if (defaultAclTemplate != null)
      textMessage.setObjectProperty(BocaSerializationConstants.defaultAclTemplate, defaultAclTemplate.toString());
    if (password != null)
      textMessage.setObjectProperty(BocaSerializationConstants.password, password);
    if (userId != null)
      textMessage.setObjectProperty(BocaSerializationConstants.userId, userId);
    Set<URI> users = aclUserAccess.get(Constants.defaultSystemMetaGraphURI);
    if (users == null) {
      users = authenticationService.getUsersForGraph(Constants.defaultSystemMetaGraphURI);
      aclUserAccess.put(Constants.defaultSystemMetaGraphURI, users);
    }
    return sendMessage(textMessage, users);
  } catch (JMSException jmse) {
    throw BocaException.createException(CODES.PROCESS_UPDATE_ERROR, ExceptionConstants.NOTIFICATION.SUBCODES.PROCESS_UPDATE_FAILED, jmse, jmse.getMessage());
  }
}
origin: com.betfair.cougar/jms-transport

@Override
public TextMessage marshallEvent(EventServiceBindingDescriptor bindingDescriptor, Event event, Object session) throws CougarException {
  try {
    TextMessage message = ((Session)session).createTextMessage(marshallEventBody(event));
    //Sets the routing string
    message.setStringProperty(JMSPropertyConstants.MESSAGE_ROUTING_FIELD_NAME, getHostString(event));
    //Sets the message id guid.  If there isn't one, make one up
    String messageId = event.getMessageId();
    if (messageId == null) {
      messageId = new RequestUUIDImpl().toString();
    }
    message.setStringProperty(JMSPropertyConstants.MESSAGE_ID_FIELD_NAME, messageId);
    //Sets the version header
    message.setStringProperty(JMSPropertyConstants.EVENT_VERSION_FIELD_NAME, bindingDescriptor.getServiceVersion().toString());
    //Sets the event name header
    message.setStringProperty(JMSPropertyConstants.EVENT_NAME_FIELD_NAME, event.getClass().getSimpleName());
    message.setBooleanProperty("JMS_SonicMQ_preserveUndelivered", true);
    message.setBooleanProperty("JMS_SonicMQ_notifyUndelivered",   true);
    message.setJMSDeliveryMode(deliveryMode);
    message.setJMSExpiration(expirationTime);
    message.setJMSPriority(priority);
    return message;
  } catch (JMSException jmsex) {
    throw new CougarFrameworkException("Error marshalling Event", jmsex);
  } catch (UnknownHostException e) {
    throw new CougarFrameworkException("Error looking up local host name", e);
  }
}
origin: apache/activemq-artemis

message.setStringProperty("stringProperty", "a");
message.setLongProperty("longProperty", 1);
message.setBooleanProperty("booleanProperty", true);
producer.send(message);
message.setStringProperty("stringProperty", "a");
message.setLongProperty("longProperty", 1);
message.setBooleanProperty("booleanProperty", false);
producer.send(message);
message.setStringProperty("stringProperty", "a");
message.setLongProperty("longProperty", 1);
message.setBooleanProperty("booleanProperty", true);
producer.send(message);
message.setStringProperty("stringProperty", "b");
message.setLongProperty("longProperty", 2);
message.setBooleanProperty("booleanProperty", false);
producer.send(message);
message.setStringProperty("stringProperty", "c");
message.setLongProperty("longProperty", 3);
message.setBooleanProperty("booleanProperty", true);
producer.send(message);
origin: hazelcast/hazelcast-jet-code-samples

private static Pipeline buildPipeline() {
  Pipeline p = Pipeline.create();
  p.drawFrom(Sources.jmsTopic(() -> new ActiveMQConnectionFactory(ActiveMQBroker.BROKER_URL), INPUT_TOPIC))
   .filter(message -> message.getJMSPriority() > 3)
   .map(message -> (TextMessage) message)
   // print the message text to the log
   .peek(TextMessage::getText)
   .drainTo(Sinks.<TextMessage>jmsTopicBuilder(() -> new ActiveMQConnectionFactory(ActiveMQBroker.BROKER_URL))
       .destinationName(OUTPUT_TOPIC)
       .messageFn((session, message) -> {
         TextMessage textMessage = session.createTextMessage(message.getText());
         textMessage.setBooleanProperty("isActive", true);
         textMessage.setJMSPriority(8);
         return textMessage;
       })
       .build());
  return p;
}
origin: hazelcast/hazelcast-jet-code-samples

private static Pipeline buildPipeline() {
  Pipeline p = Pipeline.create();
  p.drawFrom(Sources.jmsQueue(() -> new ActiveMQConnectionFactory(ActiveMQBroker.BROKER_URL), INPUT_QUEUE))
   .filter(message -> message.getJMSPriority() > 3)
   .map(message -> (TextMessage) message)
   // print the message text to the log
   .peek(TextMessage::getText)
   .drainTo(Sinks.<TextMessage>jmsQueueBuilder(() -> new ActiveMQConnectionFactory(ActiveMQBroker.BROKER_URL))
       .destinationName(OUTPUT_QUEUE)
       .messageFn((session, message) -> {
           // create new text message with the same text and few additional properties
           TextMessage textMessage = session.createTextMessage(message.getText());
           textMessage.setBooleanProperty("isActive", true);
           textMessage.setJMSPriority(8);
           return textMessage;
         }
       )
       .build());
  return p;
}
origin: org.apache.servicemix/servicemix-jms

public Message createFault(MessageExchange exchange, Fault fault, Session session, JmsContext context) throws Exception {
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  PhaseInterceptorChain chain = new PhaseInterceptorChain();
  chain.add(new AttachmentsOutInterceptor());
  chain.add(new StaxOutInterceptor());
  chain.add(new BodyOutInterceptor());
  org.apache.servicemix.soap.api.Message msg = new MessageImpl();
  msg.setContent(Source.class, fault.getContent());
  msg.setContent(OutputStream.class, baos);
  for (String attId : (Set<String>) fault.getAttachmentNames()) {
    msg. getAttachments().put(attId, fault.getAttachment(attId));
  }
  chain.doIntercept(msg);
  TextMessage text = session.createTextMessage(baos.toString());
  if (msg.get(org.apache.servicemix.soap.api.Message.CONTENT_TYPE) != null) {
    text.setStringProperty(CONTENT_TYPE_PROPERTY,
                (String) msg.get(org.apache.servicemix.soap.api.Message.CONTENT_TYPE));
  }
  text.setBooleanProperty(FAULT_JMS_PROPERTY, true);
  if (isCopyProperties()) {
    copyPropertiesFromNM(fault, text);
  }
  return text;
}
origin: apache/activemq-artemis

TextMessage message = session.createTextMessage();
message.setText("msg:0");
message.setBooleanProperty("true", true);
message.setBooleanProperty("false", false);
message.setStringProperty("foo", "bar");
message.setDoubleProperty("double", 66.6);
origin: apache/activemq-artemis

sendMessage.setBooleanProperty("ActiveMQ.Retain", true);
origin: apache/activemq-artemis

m.setBooleanProperty("targetMessage", false);
m.setBooleanProperty("targetMessage", true);
javax.jmsTextMessagesetBooleanProperty

Popular methods of TextMessage

  • getText
    Gets the string containing this message's data. The default value is null.
  • setText
    Sets the string containing this message's data.
  • setStringProperty
  • setJMSCorrelationID
  • setIntProperty
  • setLongProperty
  • getStringProperty
  • setJMSReplyTo
  • getJMSCorrelationID
  • getJMSMessageID
  • getJMSReplyTo
  • setDoubleProperty
  • getJMSReplyTo,
  • setDoubleProperty,
  • acknowledge,
  • setJMSType,
  • getJMSDeliveryMode,
  • setObjectProperty,
  • getIntProperty,
  • getJMSPriority,
  • clearBody

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onCreateOptionsMenu (Activity)
  • findViewById (Activity)
  • setContentView (Activity)
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • JOptionPane (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now