本文整理了Java中javax.jms.Message.setFloatProperty()
方法的一些代码示例,展示了Message.setFloatProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.setFloatProperty()
方法的具体详情如下:
包路径:javax.jms.Message
类名称:Message
方法名:setFloatProperty
[英]Sets a float property value with the specified name into the message.
[中]在消息中设置具有指定名称的浮点属性值。
代码示例来源:origin: apache/nifi
message.setDoubleProperty(jmsPropName, Double.parseDouble(value));
} else if (type.equalsIgnoreCase(PROP_TYPE_FLOAT)) {
message.setFloatProperty(jmsPropName, Float.parseFloat(value));
} else if (type.equalsIgnoreCase(PROP_TYPE_OBJECT)) {
message.setObjectProperty(jmsPropName, value);
代码示例来源:origin: org.jboss.jbossas/jboss-as-connector
public void setFloatProperty(String name, float value) throws JMSException
{
message.setFloatProperty(name, value);
}
代码示例来源:origin: org.apache.tomee/openejb-core
@Override
public void setFloatProperty(final String name, final float value) throws JMSException {
message.setFloatProperty(name, value);
}
代码示例来源:origin: org.jboss.genericjms/generic-jms-ra-jar
public void setFloatProperty(String name, float value) throws JMSException {
message.setFloatProperty(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 setFloatProperty(final String name, final float value) throws JMSException
{
if (_log.isTraceEnabled())
{
_log.trace("setFloatProperty(" + name + ", " + value + ")");
}
_message.setFloatProperty(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 setFloatProperty(final String name, final float value) throws JMSException {
if (ActiveMQRALogger.LOGGER.isTraceEnabled()) {
ActiveMQRALogger.LOGGER.trace("setFloatProperty(" + name + ", " + value + ")");
}
message.setFloatProperty(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 setFloatProperty(final String name, final float value) throws JMSException {
if (ActiveMQRALogger.LOGGER.isTraceEnabled()) {
ActiveMQRALogger.LOGGER.trace("setFloatProperty(" + name + ", " + value + ")");
}
message.setFloatProperty(name, value);
}
代码示例来源:origin: objectweb-joramtests/joramtests
/**
* if a property is set as a <code>float</code>,
* it can also be read as a <code>double</code>.
*/
public void testFloat2Double()
{
try
{
Message message = senderSession.createMessage();
message.setFloatProperty("prop", 127.0F);
assertEquals(127.0, message.getDoubleProperty("prop"), 0);
}
catch (JMSException e)
{
fail(e);
}
}
代码示例来源:origin: objectweb-joramtests/joramtests
/**
* if a property is set as a <code>float</code>,
* it can also be read as a <code>String</code>.
*/
public void testFloat2String()
{
try
{
Message message = senderSession.createMessage();
message.setFloatProperty("prop", 127.0F);
assertEquals("127.0", message.getStringProperty("prop"));
}
catch (JMSException e)
{
fail(e);
}
}
代码示例来源:origin: objectweb-joramtests/joramtests
/**
* if a property is set as a <code>float</code>,
* it can also be read as a <code>float</code>.
*/
public void testFloat2Float()
{
try
{
Message message = senderSession.createMessage();
message.setFloatProperty("prop", 127.0F);
assertEquals(127.0F, message.getFloatProperty("prop"), 0);
}
catch (JMSException e)
{
fail(e);
}
}
代码示例来源:origin: org.ballerinalang/ballerina-jms
@Override
public void execute(Context context, CallableUnitCallback callableUnitCallback) {
Struct messageStruct = BallerinaAdapter.getReceiverObject(context);
Message message = BallerinaAdapter.getNativeObject(messageStruct,
Constants.JMS_MESSAGE_OBJECT,
Message.class,
context);
String key = context.getStringArgument(0);
double value = context.getFloatArgument(0);
try {
message.setFloatProperty(key, (float) value);
} catch (JMSException e) {
BallerinaAdapter.returnError("Error when setting float property", context, e);
}
}
}
代码示例来源:origin: apache/activemq-artemis
/**
* if a property is set as a <code>float</code>,
* it can also be read as a <code>double</code>.
*/
@Test
public void testFloat2Double() {
try {
Message message = senderSession.createMessage();
message.setFloatProperty("prop", 127.0F);
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>float</code>,
* it can also be read as a <code>String</code>.
*/
@Test
public void testFloat2String() {
try {
Message message = senderSession.createMessage();
message.setFloatProperty("prop", 127.0F);
Assert.assertEquals("127.0", message.getStringProperty("prop"));
} catch (JMSException e) {
fail(e);
}
}
代码示例来源:origin: apache/activemq-artemis
/**
* if a property is set as a <code>float</code>,
* it can also be read as a <code>float</code>.
*/
@Test
public void testFloat2Float() {
try {
Message message = senderSession.createMessage();
message.setFloatProperty("prop", 127.0F);
Assert.assertEquals(127.0F, message.getFloatProperty("prop"), 0);
} catch (JMSException e) {
fail(e);
}
}
代码示例来源:origin: apache/activemq-artemis
/**
* if a property is set as a <code>float</code>,
* to get is as a <code>int</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testFloat2Int() {
try {
Message message = senderSession.createMessage();
message.setFloatProperty("prop", 127.0F);
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>float</code>,
* to get is as a <code>short</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testFloat2Short() {
try {
Message message = senderSession.createMessage();
// store a value that can't be converted to short
message.setFloatProperty("prop", 127.0F);
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>float</code>,
* to get is as a <code>byte</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testFloat2Byte() {
try {
Message message = senderSession.createMessage();
// store a value that can't be converted to byte
message.setFloatProperty("prop", 127.0F);
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>float</code>,
* to get is as a <code>long</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testFloat2Long() {
try {
Message message = senderSession.createMessage();
message.setFloatProperty("prop", 127.0F);
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>float</code>,
* to get is as a <code>boolean</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testFloat2Boolean() {
try {
Message message = senderSession.createMessage();
// store a value that can be converted to boolean
message.setFloatProperty("prop", 127.0F);
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");
}
内容来源于网络,如有侵权,请联系作者删除!