javax.jms.Message.getBooleanProperty()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(202)

本文整理了Java中javax.jms.Message.getBooleanProperty()方法的一些代码示例,展示了Message.getBooleanProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getBooleanProperty()方法的具体详情如下:
包路径:javax.jms.Message
类名称:Message
方法名:getBooleanProperty

Message.getBooleanProperty介绍

[英]Returns the value of the boolean property with the specified name.
[中]返回具有指定名称的布尔属性的值。

代码示例

代码示例来源:origin: org.apache.activemq.rest/artemis-rest

public static boolean isHttpMessage(Message message) {
 try {
   return message.getBooleanProperty(HttpMessageHelper.POSTED_AS_HTTP_MESSAGE);
 } catch (JMSException e) {
   return false;
 }
}

代码示例来源:origin: apache/activemq-artemis

public static boolean isHttpMessage(Message message) {
 try {
   return message.getBooleanProperty(HttpMessageHelper.POSTED_AS_HTTP_MESSAGE);
 } catch (JMSException e) {
   return false;
 }
}

代码示例来源:origin: org.jboss.jbossas/jboss-as-connector

public boolean getBooleanProperty(String name) throws JMSException
{
 return message.getBooleanProperty(name);
}

代码示例来源:origin: org.apache.tomee/openejb-core

@Override
public boolean getBooleanProperty(final String name) throws JMSException {
  return message.getBooleanProperty(name);
}

代码示例来源:origin: org.ihtsdo.otf.common/otf-common

public static boolean isError(Message message) throws JMSException {
  return message.getBooleanProperty(ERROR_FLAG);
}

代码示例来源:origin: org.jboss.genericjms/generic-jms-ra-jar

public boolean getBooleanProperty(String name) throws JMSException {
  return message.getBooleanProperty(name);
}

代码示例来源:origin: org.hornetq.rest/hornetq-rest

public static boolean isHttpMessage(Message message)
{
 try
 {
   Boolean aBoolean = message.getBooleanProperty(HttpMessageHelper.POSTED_AS_HTTP_MESSAGE);
   return aBoolean != null && aBoolean.booleanValue() == true;
 }
 catch (JMSException e)
 {
   return false;
 }
}

代码示例来源:origin: org.apache.qpid/qpid-jca

/**
* Get property
* @param name The name
* @return The value
* @exception JMSException Thrown if an error occurs
*/
public boolean getBooleanProperty(final String name) throws JMSException
{
 if (_log.isTraceEnabled())
 {
   _log.trace("getBooleanProperty(" + name + ")");
 }
 return _message.getBooleanProperty(name);
}

代码示例来源:origin: org.apache.uima/uimaj-as-jms

public boolean getMessageBooleanProperty(String aMessagePropertyName) throws AsynchAEException {
 try {
  return message.getBooleanProperty(aMessagePropertyName);
 } catch (Exception e) {
  throw new AsynchAEException(e);
 }
}

代码示例来源:origin: be.fedict.eid-trust-service/eid-trust-service-model

public DownloadMessage(Message message) throws JMSException {
  this.caName = message.getStringProperty(CA_NAME_PROPERTY);
  this.update = message.getBooleanProperty(UPDATE_PROPERTY);
}

代码示例来源:origin: com.github.albfernandez.richfaces/richfaces-core

private Object getMessageData(Message message) throws JMSException {
    Object messageData = null;
    if (message instanceof ObjectMessage) {
      messageData = ((ObjectMessage) message).getObject();
    } else if (message instanceof TextMessage) {
      TextMessage textMessage = (TextMessage) message;
      if (message.getBooleanProperty(SERIALIZED_DATA_INDICATOR)) {
        messageData = new JSLiteral(textMessage.getText());
      } else {
        messageData = textMessage.getText();
      }
    }
    return messageData;
  }
}

代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-itests-beans

public void onMessage(Message msg) {
  try {
    classLevelBusinessMethodInterception = msg.getBooleanProperty("ClassLevelBusinessMethodInterception");
    methodLevelBusinessMethodInterception = msg.getBooleanProperty("MethodLevelBusinessMethodInterception");
    try {
      msg.acknowledge();
    } catch (JMSException e) {
     e.printStackTrace();
    }
    mdbInvoker.onMessage(msg);
  } catch (Throwable e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: org.apache.openejb/openejb-itests-beans

@Override
public void onMessage(final Message msg) {
  try {
    classLevelBusinessMethodInterception = msg.getBooleanProperty("ClassLevelBusinessMethodInterception");
    methodLevelBusinessMethodInterception = msg.getBooleanProperty("MethodLevelBusinessMethodInterception");
    try {
      msg.acknowledge();
    } catch (final JMSException e) {
      e.printStackTrace();
    }
    mdbInvoker.onMessage(msg);
  } catch (final Throwable e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: be.fedict.eid-trust-service/eid-trust-service-model

public HarvestMessage(Message message) throws JMSException {
  this.caName = message.getStringProperty(CA_NAME_PROPERTY);
  this.crlFile = message.getStringProperty(CRL_FILE_PROPERTY);
  this.update = message.getBooleanProperty(UPDATE_PROPERTY);
}

代码示例来源:origin: apache/activemq-artemis

/**
* Get property
*
* @param name The name
* @return The value
* @throws JMSException Thrown if an error occurs
*/
@Override
public boolean getBooleanProperty(final String name) throws JMSException {
 if (ActiveMQRALogger.LOGGER.isTraceEnabled()) {
   ActiveMQRALogger.LOGGER.trace("getBooleanProperty(" + name + ")");
 }
 return message.getBooleanProperty(name);
}

代码示例来源:origin: org.apache.qpid/proton-jms

@Override
public EncodedMessage transform(Message msg) throws Exception {
  if( msg == null )
    return null;
  if( msg.getBooleanProperty(prefixVendor + "NATIVE") ) {
    if( msg instanceof BytesMessage ) {
      return AMQPNativeOutboundTransformer.transform(this, (BytesMessage)msg);
    } else {
      return null;
    }
  } else {
    return transformer.transform(msg);
  }
}

代码示例来源:origin: org.apache.activemq/artemis-ra

/**
* Get property
*
* @param name The name
* @return The value
* @throws JMSException Thrown if an error occurs
*/
@Override
public boolean getBooleanProperty(final String name) throws JMSException {
 if (ActiveMQRALogger.LOGGER.isTraceEnabled()) {
   ActiveMQRALogger.LOGGER.trace("getBooleanProperty(" + name + ")");
 }
 return message.getBooleanProperty(name);
}

代码示例来源:origin: apache/activemq-artemis

/**
* Test that an attempt to get a <code>boolean</code> property which does not exist
* returns <code>false</code>
*/
@Test
public void testGetBooleanProperty() {
 try {
   Message message = senderSession.createMessage();
   Assert.assertEquals(false, message.getBooleanProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
  * if a property is set as a <code>boolean</code>,
  * it can also be read as a <code>boolean</code>.
  */
  @Test
  public void testBoolean2Boolean() {
   try {
     Message message = senderSession.createMessage();
     message.setBooleanProperty("prop", true);
     Assert.assertEquals(true, message.getBooleanProperty("prop"));
   } catch (JMSException e) {
     fail(e);
   }
  }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>java.lang.String</code>,
* it can also be read as a <code>boolean</code> if the <code>String</code>
* is a correct representation of a <code>boolean</code> (e.g. <code>"true"</code>).
*/
@Test
public void testString2Boolean_1() {
 try {
   Message message = senderSession.createMessage();
   message.setStringProperty("prop", "true");
   Assert.assertEquals(true, message.getBooleanProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}

相关文章