org.switchyard.Property.hasLabel()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(90)

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

Property.hasLabel介绍

[英]If the property has the specified label.
[中]如果属性具有指定的标签。

代码示例

代码示例来源:origin: jboss-switchyard/core

@Override
public Set<Property> getProperties(String label) {
  Set<Property> properties = new HashSet<Property>();
  for (Property property : getProperties()) {
    if (property.hasLabel(label)) {
      properties.add(property);
    }
  }
  return properties;
}

代码示例来源:origin: org.switchyard/switchyard-bus-camel

@Override
public Set<Property> getProperties(String label) {
  Set<Property> properties = new HashSet<Property>();
  for (Property property : getProperties()) {
    if (property.hasLabel(label)) {
      properties.add(property);
    }
  }
  return properties;
}

代码示例来源:origin: jboss-switchyard/core

@Override
public Set<Property> getProperties(String label) {
  Set<Property> props = new HashSet<Property>();
  for (Property p : getProperties()) {
    if (p.hasLabel(label)) {
      props.add(p);
    }
  }
  return props;
}

代码示例来源:origin: org.switchyard/switchyard-runtime

@Override
public Set<Property> getProperties(String label) {
  Set<Property> props = new HashSet<Property>();
  for (Property p : getProperties()) {
    if (p.hasLabel(label)) {
      props.add(p);
    }
  }
  return props;
}

代码示例来源:origin: org.switchyard/switchyard-bus-camel

@Override
public void removeProperties(String label) {
  for (Property property : getProperties()) {
    if (property.hasLabel(label)) {
      removeProperty(property);
    }
  }
}

代码示例来源:origin: jboss-switchyard/core

@Override
public void removeProperties(String label) {
  for (Property p : getProperties()) {
    if (p.hasLabel(label)) {
      removeProperty(p);
    }
  }
}

代码示例来源:origin: org.switchyard/switchyard-runtime

@Override
public void removeProperties(String label) {
  for (Property p : getProperties()) {
    if (p.hasLabel(label)) {
      removeProperty(p);
    }
  }
}

代码示例来源:origin: jboss-switchyard/core

@Override
public void removeProperties(String label) {
  for (Property property : getProperties()) {
    if (property.hasLabel(label)) {
      removeProperty(property);
    }
  }
}

代码示例来源:origin: jboss-switchyard/components

String name = property.getName();
Object value = property.getValue();
if ((value != null) && (matches(name) || property.hasLabel(EndpointLabel.HTTP.label()))) {
  if (HTTP_RESPONSE_STATUS.equalsIgnoreCase(name) && (target instanceof HttpResponseBindingData)) {
    HttpResponseBindingData response = (HttpResponseBindingData)target;

代码示例来源:origin: jboss-switchyard/components

String name = property.getName();
Object value = property.getValue();
if ((value != null) && (matches(name) || property.hasLabel(EndpointLabel.HTTP.label()))) {
  if (HTTP_RESPONSE_STATUS.equals(name)) {
    target.setStatusCode((Integer)property.getValue());

代码示例来源:origin: org.switchyard.components/switchyard-component-resteasy

String name = property.getName();
Object value = property.getValue();
if ((value != null) && (matches(name) || property.hasLabel(EndpointLabel.HTTP.label()))) {
  if (HTTP_RESPONSE_STATUS.equals(name)) {
    target.setStatusCode((Integer)property.getValue());

代码示例来源:origin: jboss-switchyard/release

@Override
public void onMessage(String name) {
  if (!name.equals("onMessagetest")) {
    throw new RuntimeException("expected content is 'onMessagetest' but was '" + name + "'");
  }
  final String val = _context.getProperty("testProp").getValue().toString();
  if (!val.equals("testVal")) {
    throw new RuntimeException("'testProp' property is '" + val + "' while it should be 'testVal'");
  };
  Property jmsMessageId = _context.getProperty(JMSContextMapper.HEADER_JMS_MESSAGE_ID);
  if (jmsMessageId == null) {
    throw new RuntimeException("Couldn't find javax.jms.JMSMessageID context property");
  }
  if (!jmsMessageId.hasLabel(PropertyLabel.HEADER.label())) {
    throw new RuntimeException("javax.jmsJMSMessageID context property doesn't have HEADER label");
  }
  if (jmsMessageId.getValue().toString() == null) {
    throw new RuntimeException("javax.jmsJMSMessageID context property has null value");
  };
  _storeResult.onMessage(name);
}

代码示例来源:origin: org.switchyard/switchyard-transform

private void copyProperties(Context context, Exchange exchange) {
  for (Property property : context.getProperties()) {
    if (property.hasLabel(BehaviorLabel.TRANSIENT.label()) 
        || ContextPropertyUtil.isReservedProperty(property.getName(), property.getScope())) {
      continue;
    }
    if (Scope.EXCHANGE.equals(property.getScope())) {
      exchange.setProperty(property.getName(), property.getValue());
    } else {
      exchange.getIn().setHeader(property.getName(), property.getValue());
    }
  }
}

代码示例来源:origin: org.switchyard/switchyard-runtime

/**
 * Copy properties from source context to destination context. Properties with
 * TRANSIENT label will be skipped.
 * 
 * @param source Source context.
 * @param destination Destination context.
 * @return Destination context.
 */
public static Context copy(Context source, Context destination) {
  for (Property property : source.getProperties()) {
    if (!property.hasLabel(BehaviorLabel.TRANSIENT.label())) {
      destination.setProperty(property.getName(), property.getValue())
        .addLabels(property.getLabels());
    }
  }
  return destination;
}

代码示例来源:origin: jboss-switchyard/core

/**
 * Copy properties from source context to destination context. Properties with
 * TRANSIENT label will be skipped.
 * 
 * @param source Source context.
 * @param destination Destination context.
 * @return Destination context.
 */
public static Context copy(Context source, Context destination) {
  for (Property property : source.getProperties()) {
    if (!property.hasLabel(BehaviorLabel.TRANSIENT.label())) {
      destination.setProperty(property.getName(), property.getValue())
        .addLabels(property.getLabels());
    }
  }
  return destination;
}

代码示例来源:origin: org.switchyard/switchyard-bus-camel

@Override
public void mergeInto(Context context) {
  for (Property property : getProperties()) {
    if (ContextPropertyUtil.isReservedProperty(property.getName(), property.getScope())
        || property.hasLabel(BehaviorLabel.TRANSIENT.label())) {
      continue;
    }
    context.setProperty(property.getName(), property.getValue(), property.getScope())
      .addLabels(property.getLabels());
  }
}

代码示例来源:origin: jboss-switchyard/core

@Override
public void mergeInto(Context context) {
  for (Property property : getProperties()) {
    if (ContextPropertyUtil.isReservedProperty(property.getName(), property.getScope())
        || property.hasLabel(BehaviorLabel.TRANSIENT.label())) {
      continue;
    }
    context.setProperty(property.getName(), property.getValue(), property.getScope())
      .addLabels(property.getLabels());
  }
}

代码示例来源:origin: org.switchyard.components/switchyard-component-camel-switchyard

/**
   * Map from SwitchYard context property to camel exchange property or camel message header.
   * @param syContext switchyard context
   * @param camelExchange camel exchange
   * @param camelMessage camel message
   */
  public static void mapSwitchYardPropertiesToCamel(
      org.switchyard.Context syContext,
      org.apache.camel.Exchange camelExchange,
      org.apache.camel.Message camelMessage) {
    
    for (Property property : syContext.getProperties()) {
      if (property.hasLabel(BehaviorLabel.TRANSIENT.label()) 
          || ContextPropertyUtil.isReservedProperty(property.getName(), property.getScope())) {
        continue;
      }
      
      if (Scope.EXCHANGE.equals(property.getScope())) {
        camelExchange.setProperty(property.getName(), property.getValue());
      } else if (camelMessage != null) {
        camelMessage.setHeader(property.getName(), property.getValue());
      }
    }
  }
}

代码示例来源:origin: jboss-switchyard/components

if (property.hasLabel(BehaviorLabel.TRANSIENT.label()) 
    || ContextPropertyUtil.isReservedProperty(property.getName(), property.getScope())) {
  continue;

代码示例来源:origin: jboss-switchyard/components

if (target instanceof HttpResponseBindingData) {
  Property responseCode = exchange.getContext().getProperty(HttpContextMapper.HTTP_RESPONSE_STATUS);
  if (!((responseCode != null) && responseCode.hasLabel(EndpointLabel.HTTP.label()))) {
    int status = HttpServletResponse.SC_ACCEPTED;
    if (exchange.getState() == ExchangeState.FAULT) {

相关文章