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

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

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

Message.setDoubleProperty介绍

[英]Sets a double property value with the specified name into the message.
[中]在消息中设置具有指定名称的双属性值。

代码示例

代码示例来源:origin: apache/nifi

message.setByteProperty(jmsPropName, Byte.parseByte(value));
} else if (type.equalsIgnoreCase(PROP_TYPE_DOUBLE)) {
  message.setDoubleProperty(jmsPropName, Double.parseDouble(value));
} else if (type.equalsIgnoreCase(PROP_TYPE_FLOAT)) {
  message.setFloatProperty(jmsPropName, Float.parseFloat(value));

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

@Override
public void setDoubleProperty(final String name, final double value) throws JMSException {
  message.setDoubleProperty(name, value);
}

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

public void setDoubleProperty(String name, double value) throws JMSException {
  message.setDoubleProperty(name, value);
}

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

public void setDoubleProperty(String name, double value) throws JMSException
{
 message.setDoubleProperty(name, value);
}

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

/**
* Set property
* @param name The name
* @param value The value
* @exception JMSException Thrown if an error occurs
*/
public void setDoubleProperty(final String name, final double value) throws JMSException
{
 if (_log.isTraceEnabled())
 {
   _log.trace("setDoubleProperty(" + name + ", " + value + ")");
 }
 _message.setDoubleProperty(name, value);
}

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

/**
* Set property
*
* @param name  The name
* @param value The value
* @throws JMSException Thrown if an error occurs
*/
@Override
public void setDoubleProperty(final String name, final double value) throws JMSException {
 if (ActiveMQRALogger.LOGGER.isTraceEnabled()) {
   ActiveMQRALogger.LOGGER.trace("setDoubleProperty(" + name + ", " + value + ")");
 }
 message.setDoubleProperty(name, value);
}

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

/**
* Set property
*
* @param name  The name
* @param value The value
* @throws JMSException Thrown if an error occurs
*/
@Override
public void setDoubleProperty(final String name, final double value) throws JMSException {
 if (ActiveMQRALogger.LOGGER.isTraceEnabled()) {
   ActiveMQRALogger.LOGGER.trace("setDoubleProperty(" + name + ", " + value + ")");
 }
 message.setDoubleProperty(name, value);
}

代码示例来源:origin: objectweb-joramtests/joramtests

/**
* if a property is set as a <code>double</code>, 
* it can also be read as a <code>java.lang.String</code>.
*/
public void testDouble2String()
{
 try
 {
   Message message = senderSession.createMessage();
   message.setDoubleProperty("prop", 127.0);
   assertEquals("127.0", message.getStringProperty("prop"));
 }
 catch (JMSException e)
 {
   fail(e);
 }
}

代码示例来源:origin: objectweb-joramtests/joramtests

/**
* if a property is set as a <code>double</code>, 
* it can also be read as a <code>double</code>.
*/
public void testDouble2Double()
{
 try
 {
   Message message = senderSession.createMessage();
   message.setDoubleProperty("prop", 127.0);
   assertEquals(127.0, message.getDoubleProperty("prop"), 0);
 }
 catch (JMSException e)
 {
   fail(e);
 }
}

代码示例来源:origin: objectweb-joramtests/joramtests

/**
* if a property is set as a <code>double</code>, 
* to get is as a <code>boolean</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
public void testDouble2Boolean()
{
 try
 {
   Message message = senderSession.createMessage();
   // store a value that can be converted to boolean
   message.setDoubleProperty("prop", 127.0);
   message.getBooleanProperty("prop");
   fail("3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
 }
 catch (MessageFormatException e)
 {
 }
 catch (JMSException e)
 {
   fail(e);
 }
}

代码示例来源:origin: objectweb-joramtests/joramtests

/**
* if a property is set as a <code>double</code>, 
* to get is as an <code>int</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
public void testDouble2Int()
{
 try
 {
   Message message = senderSession.createMessage();
   message.setDoubleProperty("prop", 127.0);
   message.getIntProperty("prop");
   fail("3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
 }
 catch (MessageFormatException e)
 {
 }
 catch (JMSException e)
 {
   fail(e);
 }
}

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

/**
* if a property is set as a <code>double</code>,
* it can also be read as a <code>java.lang.String</code>.
*/
@Test
public void testDouble2String() {
 try {
   Message message = senderSession.createMessage();
   message.setDoubleProperty("prop", 127.0);
   Assert.assertEquals("127.0", message.getStringProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}

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

/**
* if a property is set as a <code>double</code>,
* it can also be read as a <code>double</code>.
*/
@Test
public void testDouble2Double() {
 try {
   Message message = senderSession.createMessage();
   message.setDoubleProperty("prop", 127.0);
   Assert.assertEquals(127.0, message.getDoubleProperty("prop"), 0);
 } catch (JMSException e) {
   fail(e);
 }
}

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

/**
* if a property is set as a <code>double</code>,
* to get is as a <code>short</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testDouble2Short() {
 try {
   Message message = senderSession.createMessage();
   // store a value that can't be converted to short
   message.setDoubleProperty("prop", 127.0);
   message.getShortProperty("prop");
   Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
 } catch (MessageFormatException e) {
 } catch (JMSException e) {
   fail(e);
 }
}

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

/**
* if a property is set as a <code>double</code>,
* to get is as a <code>long</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testDouble2Long() {
 try {
   Message message = senderSession.createMessage();
   message.setDoubleProperty("prop", 127.0);
   message.getLongProperty("prop");
   Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
 } catch (MessageFormatException e) {
 } catch (JMSException e) {
   fail(e);
 }
}

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

/**
* if a property is set as a <code>double</code>,
* to get is as an <code>int</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testDouble2Int() {
 try {
   Message message = senderSession.createMessage();
   message.setDoubleProperty("prop", 127.0);
   message.getIntProperty("prop");
   Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
 } catch (MessageFormatException e) {
 } catch (JMSException e) {
   fail(e);
 }
}

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

/**
* if a property is set as a <code>double</code>,
* to get is as a <code>float</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testDouble2Float() {
 try {
   Message message = senderSession.createMessage();
   message.setDoubleProperty("prop", 127.0);
   message.getFloatProperty("prop");
   Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
 } catch (MessageFormatException e) {
 } catch (JMSException e) {
   fail(e);
 }
}

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

/**
* if a property is set as a <code>double</code>,
* to get is as a <code>byte</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testDouble2Byte() {
 try {
   Message message = senderSession.createMessage();
   // store a value that can't be converted to byte
   message.setDoubleProperty("prop", 127.0);
   message.getByteProperty("prop");
   Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
 } catch (MessageFormatException e) {
 } catch (JMSException e) {
   fail(e);
 }
}

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

/**
* if a property is set as a <code>double</code>,
* to get is as a <code>boolean</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testDouble2Boolean() {
 try {
   Message message = senderSession.createMessage();
   // store a value that can be converted to boolean
   message.setDoubleProperty("prop", 127.0);
   message.getBooleanProperty("prop");
   Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
 } catch (MessageFormatException e) {
 } catch (JMSException e) {
   fail(e);
 }
}

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

protected void prepareMessage(final Message m) throws JMSException {
 m.setBooleanProperty("booleanProperty", true);
 m.setByteProperty("byteProperty", (byte) 3);
 m.setDoubleProperty("doubleProperty", 4.0);
 m.setFloatProperty("floatProperty", 5.0f);
 m.setIntProperty("intProperty", 6);
 m.setLongProperty("longProperty", 7);
 m.setShortProperty("shortProperty", (short) 8);
 m.setStringProperty("stringProperty", "this is a String property");
 m.setJMSCorrelationID("this is the correlation ID");
 m.setJMSReplyTo(ActiveMQServerTestCase.topic1);
 m.setJMSType("someArbitraryType");
}

相关文章