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

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

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

Message.setJMSDeliveryTime介绍

[英]Sets the message's delivery time value.

This method is for use by JMS providers only to set this field when a message is sent. This message cannot be used by clients to configure the delivery time of the message. This method is public to allow a JMS provider to set this field when sending a message whose implementation is not its own.
[中]设置邮件的传递时间值。
此方法仅供JMS提供程序在发送消息时用于设置此字段。客户端无法使用此邮件来配置邮件的传递时间。此方法是公共的,允许JMS提供程序在发送非其自身实现的消息时设置此字段。

代码示例

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

@Override
public void setJMSDeliveryTime(long deliveryTime) throws JMSException {
  message.setJMSDeliveryTime(deliveryTime);
}

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

private static Message wrap(final Message message) {
  if (message == null) {
    return null;
  }
  final Message wrapped = JMS2.wrap(message);
  try {
    wrapped.setJMSDeliveryTime(System.currentTimeMillis());
  } catch (final JMSException e) {
    // no-op: TODO: investigate if an issue or not in this context
  }
  return wrapped;
}

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

private void setForeignMessageDeliveryTime(Message foreignMessage, long deliveryTime) throws JMSException {
  // Verify if the setJMSDeliveryTime method exists, i.e the foreign provider isn't only JMS 1.1.
  Method deliveryTimeMethod = null;
  try {
    Class<?> clazz = foreignMessage.getClass();
    Method method = clazz.getMethod("setJMSDeliveryTime", new Class[] { long.class });
    if (!Modifier.isAbstract(method.getModifiers())) {
      deliveryTimeMethod = method;
    }
  } catch (NoSuchMethodException e) {
    // Assume its a JMS 1.1 Message, we will no-op.
  }
  if (deliveryTimeMethod != null) {
    // Method exists, isn't abstract, so use it.
    foreignMessage.setJMSDeliveryTime(deliveryTime);
  }
}

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

private void setForeignMessageDeliveryTime(Message foreignMessage, long deliveryTime) throws JMSException {
  // Verify if the setJMSDeliveryTime method exists, i.e the foreign provider isn't only JMS 1.1.
  Method deliveryTimeMethod = null;
  try {
    Class<?> clazz = foreignMessage.getClass();
    Method method = clazz.getMethod("setJMSDeliveryTime", new Class[] { long.class });
    if (!Modifier.isAbstract(method.getModifiers())) {
      deliveryTimeMethod = method;
    }
  } catch (NoSuchMethodException e) {
    // Assume its a JMS 1.1 Message, we will no-op.
  }
  if (deliveryTimeMethod != null) {
    // Method exists, isn't abstract, so use it.
    foreignMessage.setJMSDeliveryTime(deliveryTime);
  }
}

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

@Override
public void setJMSDeliveryTime(long deliveryTime) throws JMSException {
 if (ActiveMQRALogger.LOGGER.isTraceEnabled()) {
   ActiveMQRALogger.LOGGER.trace("setJMSDeliveryTime(" + deliveryTime + ")");
 }
 message.setJMSDeliveryTime(deliveryTime);
}

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

@Override
public void setJMSDeliveryTime(long deliveryTime) throws JMSException {
 if (ActiveMQRALogger.LOGGER.isTraceEnabled()) {
   ActiveMQRALogger.LOGGER.trace("setJMSDeliveryTime(" + deliveryTime + ")");
 }
 message.setJMSDeliveryTime(deliveryTime);
}

代码示例来源:origin: org.ow2.joram/joram-client-jms

msg.setJMSDeliveryTime(deliveryTime);
} else {
 msg.setJMSDeliveryTime(0L);

代码示例来源:origin: com.github.jbricks.soap2jms/s2j_common

message.setJMSMessageID(wsMessage.getJmsMessageId());
message.setJMSDeliveryTime(wsMessage.getJmsDeliveryTime());
message.setJMSExpiration(wsMessage.getJmsExpiration());
message.setJMSPriority(wsMessage.getJmsPriority());

相关文章