当前位置: 首页>>代码示例>>Java>>正文


Java ApplicationProperties.getValue方法代码示例

本文整理汇总了Java中org.apache.qpid.proton.amqp.messaging.ApplicationProperties.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationProperties.getValue方法的具体用法?Java ApplicationProperties.getValue怎么用?Java ApplicationProperties.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.qpid.proton.amqp.messaging.ApplicationProperties的用法示例。


在下文中一共展示了ApplicationProperties.getValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getApplicationPropertiesMap

import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private Map<String, Object> getApplicationPropertiesMap() {
   ApplicationProperties appMap = getApplicationProperties();
   Map<String, Object> map = null;

   if (appMap != null) {
      map = appMap.getValue();
   }

   if (map == null) {
      map = new HashMap<>();
      this.applicationProperties = new ApplicationProperties(map);
   }

   return map;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:17,代码来源:AMQPMessage.java

示例2: testJSON_to_AMQP_VerifyMessageApplicationProperties

import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; //导入方法依赖的package包/类
@Test
public void testJSON_to_AMQP_VerifyMessageApplicationProperties() {

  String testPropKeyA = "testPropKeyA";
  String testPropValueA = "testPropValueA";
  String testPropKeyB = "testPropKeyB";
  String testPropValueB = "testPropValueB";

  JsonObject jsonAppProps = new JsonObject();

  jsonAppProps.put(testPropKeyA, testPropValueA);
  jsonAppProps.put(testPropKeyB, testPropValueB);

  JsonObject jsonObject = new JsonObject();
  jsonObject.put(AmqpConstants.APPLICATION_PROPERTIES, jsonAppProps);

  Message protonMsg = translator.convertToAmqpMessage(jsonObject);
  assertNotNull("Expected converted msg", protonMsg);

  ApplicationProperties appProps = protonMsg.getApplicationProperties();
  assertNotNull("Application properties section not present", appProps);

  @SuppressWarnings("unchecked")
  Map<String, Object> props = appProps.getValue();
  assertNotNull("Application properties map not present", appProps);

  assertTrue("expected key to be present", props.containsKey(testPropKeyA));
  assertEquals("expected value to be equal", testPropValueA, props.get(testPropKeyA));

  assertTrue("expected key to be present", props.containsKey(testPropKeyB));
  assertEquals("expected value to be equal", testPropValueB, props.get(testPropKeyB));

  assertEquals("unexpected number of props", 2, props.size());
}
 
开发者ID:vert-x3,项目名称:vertx-amqp-bridge,代码行数:35,代码来源:MessageTranslatorImplTest.java

示例3: wrap

import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; //导入方法依赖的package包/类
@Override
protected Map wrap(ApplicationProperties val)
{
    return val.getValue();
}
 
开发者ID:apache,项目名称:qpid-proton-j,代码行数:6,代码来源:ApplicationPropertiesType.java

示例4: convertToJsonObject

import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; //导入方法依赖的package包/类
public JsonObject convertToJsonObject(Message protonMessage) throws IllegalArgumentException {
  JsonObject jsonObject = new JsonObject();

  Section body = protonMessage.getBody();
  if (body instanceof AmqpValue) {
    Object value = translateToJsonCompatible(((AmqpValue) body).getValue());
    jsonObject.put(AmqpConstants.BODY, value);
    jsonObject.put(AmqpConstants.BODY_TYPE, AmqpConstants.BODY_TYPE_VALUE);
  } else if (body instanceof Data) {
    Binary bin = ((Data) body).getValue();
    byte[] bytes = new byte[bin.getLength()];
    System.arraycopy(bin.getArray(), bin.getArrayOffset(), bytes, 0, bin.getLength());

    jsonObject.put(AmqpConstants.BODY, bytes);
    jsonObject.put(AmqpConstants.BODY_TYPE, AmqpConstants.BODY_TYPE_DATA);
  } else if (body instanceof AmqpSequence) {
    JsonArray jsonSequence = (JsonArray) translateToJsonCompatible(((AmqpSequence) body).getValue());

    jsonObject.put(AmqpConstants.BODY, jsonSequence);
    jsonObject.put(AmqpConstants.BODY_TYPE, AmqpConstants.BODY_TYPE_SEQUENCE);
  }

  Properties props = protonMessage.getProperties();
  if (props != null) {
    JsonObject jsonProps = createJsonProperties(props);
    jsonObject.put(AmqpConstants.PROPERTIES, jsonProps);
  }

  Header header = protonMessage.getHeader();
  if (header != null) {
    JsonObject jsonHeader = createJsonHeader(header);
    jsonObject.put(AmqpConstants.HEADER, jsonHeader);
  }

  ApplicationProperties appProps = protonMessage.getApplicationProperties();
  if (appProps != null && appProps.getValue() != null) {
    @SuppressWarnings("unchecked")
    JsonObject jsonAppProps = createJsonApplicationProperties(appProps.getValue());
    jsonObject.put(AmqpConstants.APPLICATION_PROPERTIES, jsonAppProps);
  }

  MessageAnnotations msgAnn = protonMessage.getMessageAnnotations();
  if (msgAnn != null && msgAnn.getValue() != null) {
    JsonObject jsonMsgAnn = createJsonMessageAnnotations(msgAnn.getValue());
    jsonObject.put(AmqpConstants.MESSAGE_ANNOTATIONS, jsonMsgAnn);
  }

  return jsonObject;
}
 
开发者ID:vert-x3,项目名称:vertx-amqp-bridge,代码行数:50,代码来源:MessageTranslatorImpl.java

示例5: setApplicationProperties

import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
void setApplicationProperties(ApplicationProperties applicationProperties) {
    if (applicationProperties != null) {
        this.applicationPropertiesMap = applicationProperties.getValue();
    }
}
 
开发者ID:apache,项目名称:qpid-jms,代码行数:7,代码来源:AmqpJmsMessageFacade.java


注:本文中的org.apache.qpid.proton.amqp.messaging.ApplicationProperties.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。