org.granite.util.XMap.put()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(10.5k)|赞(0)|评价(0)|浏览(153)

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

XMap.put介绍

[英]Creates or updates the text value of the element (or text or attribute) matched by the supplied XPath expression. If the matched element (or text or attribute) does not exist, it is created with the last segment of the XPath expression (but its parent must already exist).
[中]创建或更新与提供的XPath表达式匹配的元素(或文本或属性)的文本值。如果匹配的元素(或文本或属性)不存在,则使用XPath表达式的最后一段创建它(但其父元素必须已经存在)。

代码示例

代码示例来源:origin: org.graniteds/granite-client

/**
 * Creates or updates the text value of the element (or text or attribute) matched by
 * the supplied XPath expression. If the matched element (or text or attribute) does not exist,
 * it is created with the last segment of the XPath expression (but its parent must already exist).
 * 
 * @param key an XPath expression.
 * @param value the value to set (may be null).
 * @return the previous value of the matched element (may be null).
 * @throws RuntimeException if the root element of this XMap is null, if the XPath expression is not valid,
 *         or (creation case) if the parent node does not exist or is not an element instance. 
 */
public String put(String key, String value) {
  return put(key, value, false);
}

代码示例来源:origin: org.graniteds/granite-client-javafx

/**
 * Creates or updates the text value of the element (or text or attribute) matched by
 * the supplied XPath expression. If the matched element (or text or attribute) does not exist,
 * it is created with the last segment of the XPath expression (but its parent must already exist).
 * 
 * @param key an XPath expression.
 * @param value the value to set (may be null).
 * @return the previous value of the matched element (may be null).
 * @throws RuntimeException if the root element of this XMap is null, if the XPath expression is not valid,
 *         or (creation case) if the parent node does not exist or is not an element instance. 
 */
public String put(String key, String value) {
  return put(key, value, false);
}

代码示例来源:origin: org.graniteds/granite-client-java

/**
 * Creates or updates the text value of the element (or text or attribute) matched by
 * the supplied XPath expression. If the matched element (or text or attribute) does not exist,
 * it is created with the last segment of the XPath expression (but its parent must already exist).
 * 
 * @param key an XPath expression.
 * @param value the value to set (may be null).
 * @return the previous value of the matched element (may be null).
 * @throws RuntimeException if the root element of this XMap is null, if the XPath expression is not valid,
 *         or (creation case) if the parent node does not exist or is not an element instance. 
 */
public String put(String key, String value) {
  return put(key, value, false);
}

代码示例来源:origin: org.graniteds/granite-server

/**
 * Creates or updates the text value of the element (or text or attribute) matched by
 * the supplied XPath expression. If the matched element (or text or attribute) does not exist,
 * it is created with the last segment of the XPath expression (but its parent must already exist).
 * 
 * @param key an XPath expression.
 * @param value the value to set (may be null).
 * @return the previous value of the matched element (may be null).
 * @throws RuntimeException if the root element of this XMap is null, if the XPath expression is not valid,
 *         or (creation case) if the parent node does not exist or is not an element instance. 
 */
public String put(String key, String value) {
  return put(key, value, false);
}

代码示例来源:origin: org.ow2.kerneos.graniteds-osgi/granite-core

@Property(name = "scope", mandatory = false)
private void setScope(String scope) {
  this.properties.put("scope", scope);
}

代码示例来源:origin: org.graniteds/granite-server

@Override
  protected Destination buildDestination(Adapter adapter) {
    Destination destination = super.buildDestination(adapter);
    destination.getProperties().put("server", null);
    destination.getProperties().put("server/broker-url", brokerUrl);
    destination.getProperties().put("server/create-broker", String.valueOf(createBroker));
    if (createBroker) {
      destination.getProperties().put("server/wait-for-start", String.valueOf(waitForStart));
      destination.getProperties().put("server/durable", String.valueOf(durable));
      if (durable)
        destination.getProperties().put("server/file-store-root", fileStoreRoot);
    }
    return destination;
  }
}

代码示例来源:origin: org.graniteds/granite-server

@Override
  protected Destination buildDestination(Adapter adapter) {
    Destination destination = super.buildDestination(adapter);
    destination.getProperties().put("jms", null);
    destination.getProperties().put("jms/destination-type", "Topic");
    destination.getProperties().put("jms/destination-name", name);
    destination.getProperties().put("jms/destination-jndi-name", destinationJndiName);
    destination.getProperties().put("jms/connection-factory", connectionFactoryJndiName);
    if (textMessages)
      destination.getProperties().put("jms/message-type", "javax.jms.TextMessage");
    destination.getProperties().put("jms/acknowledge-mode", acknowledgeMode);
    destination.getProperties().put("jms/transacted-sessions", String.valueOf(transactedSessions));
    destination.getProperties().put("jms/no-local", String.valueOf(isNoLocal()));
    return destination;
  }
}

代码示例来源:origin: org.graniteds/granite-server

protected Destination buildDestination(Adapter adapter) {
    List<String> channelIds = new ArrayList<String>();
    channelIds.add("gravityamf");
    Destination destination = new Destination(id, channelIds, new XMap(), roles, adapter, null);
    destination.getProperties().put("no-local", String.valueOf(noLocal));
    destination.getProperties().put("session-selector", String.valueOf(sessionSelector));
    if (getSecurizerClassName() != null)
      destination.getProperties().put("securizer", securizerClassName);
    if (getSecurizer() != null)
      destination.setSecurizer(getSecurizer());
    return destination;
  }
}

代码示例来源:origin: org.graniteds/granite-client

factoryId = anno.factory();
else if (this.factories.isEmpty()) {
  props.put("scope", anno.scope());
  props.put("source", clazz.getName());
  log.info("Default POJO factory selected for destination in class: " + clazz.getName() + " with scope: " + anno.scope());
  props.put("factory", factoryId);
if (!(anno.source().equals("")))
  props.put("source", anno.source());
  props.put("securizer", anno.securizer().getName());

代码示例来源:origin: org.graniteds/granite-server

factoryId = anno.factory();
else if (this.factories.isEmpty()) {
  props.put("scope", anno.scope());
  props.put("source", clazz.getName());
  log.info("Default POJO factory selected for destination in class: " + clazz.getName() + " with scope: " + anno.scope());
  props.put("factory", factoryId);
if (!(anno.source().equals("")))
  props.put("source", anno.source());
  props.put("securizer", anno.securizer().getName());

代码示例来源:origin: org.graniteds/granite-server-cdi

@Override
  public ServiceInvoker<?> getServiceInstance(RemotingMessage request) throws ServiceException {
    String messageType = request.getClass().getName();
    String destinationId = request.getDestination();

    ServicesConfig servicesConfig = GraniteContext.getCurrentInstance().getServicesConfig();
    Destination destination = servicesConfig.findDestinationById(messageType, destinationId);
    if (destination == null)
      throw new ServiceException("No matching destination: " + destinationId);
    
    if (!destination.getProperties().containsKey(TideServiceInvoker.VALIDATOR_CLASS_NAME))
      destination.getProperties().put(TideServiceInvoker.VALIDATOR_CLASS_NAME, "org.granite.tide.validation.BeanValidation");
    
    @SuppressWarnings("unchecked")
    Bean<PersistenceConfiguration> pcBean = (Bean<PersistenceConfiguration>)manager.getBeans(PersistenceConfiguration.class).iterator().next();
    PersistenceConfiguration persistenceConfiguration = (PersistenceConfiguration)manager.getReference(pcBean, PersistenceConfiguration.class, manager.createCreationalContext(pcBean));
    if (destination.getProperties().containsKey(ENTITY_MANAGER_FACTORY_JNDI_NAME))
      persistenceConfiguration.setEntityManagerFactoryJndiName(destination.getProperties().get(ENTITY_MANAGER_FACTORY_JNDI_NAME));
    else if (destination.getProperties().containsKey(ENTITY_MANAGER_JNDI_NAME))
      persistenceConfiguration.setEntityManagerJndiName(destination.getProperties().get(ENTITY_MANAGER_JNDI_NAME));
    
    // Create an instance of the component
    CDIServiceInvoker invoker = new CDIServiceInvoker(destination, this);
    return invoker;
  }
}

代码示例来源:origin: org.ow2.kerneos.graniteds-osgi/granite-core

@Validate
public void start() {
  log.debug("Start OSGiDestinationFactory: " + toString());
  if (service.findDestinationById(id) == null) {
    this.properties.put("factory", factory.getId());
    service.addDestination(this);
    started = true;
  } else {
    log.error("Destination \"" + id + "\" already registered");
  }
}

代码示例来源:origin: org.graniteds/granite-server-ejb

@Override
public void configure(XMap properties) throws ServiceException {
  String sServiceExceptionHandler = properties.get("service-exception-handler");
  if (sServiceExceptionHandler == null) {
    XMap props = new XMap(properties);
    props.put("service-exception-handler", ExtendedServiceExceptionHandler.class.getName());
    super.configure(props);
  }
  else
    super.configure(properties);
  
  GraniteConfig config = GraniteContext.getCurrentInstance().getGraniteConfig();
  config.registerExceptionConverter(PersistenceExceptionConverter.class);
  config.registerExceptionConverter(EJBAccessExceptionConverter.class);
  
  this.lookup = properties.get("lookup");
}

代码示例来源:origin: org.graniteds/granite-server-cdi

if (sServiceExceptionHandler == null) {
  XMap props = new XMap(properties);
  props.put("service-exception-handler", "org.granite.messaging.service.ExtendedServiceExceptionHandler");
  super.configure(props);

代码示例来源:origin: org.graniteds/granite-server

factoryProperties.put("lookup", lookup);
factoryProperties.put("enable-exception-logging", String.valueOf(serverFilter.enableExceptionLogging()));
    List<String> tideRoles = serverFilter.tideRoles().length == 0 ? null : Arrays.asList(serverFilter.tideRoles());
    Destination destination = new Destination(type, channelIds, new XMap(), tideRoles, null, null);
    destination.getProperties().put("factory", "tide-" + type + "-factory");
    if (!("".equals(serverFilter.entityManagerFactoryJndiName())))
      destination.getProperties().put("entity-manager-factory-jndi-name", serverFilter.entityManagerFactoryJndiName());
    else if (!("".equals(serverFilter.entityManagerJndiName())))
      destination.getProperties().put("entity-manager-jndi-name", serverFilter.entityManagerJndiName());
    if (!("".equals(serverFilter.validatorClassName())))
      destination.getProperties().put("validator-class-name", serverFilter.validatorClassName());
    service.getDestinations().put(type, destination);

相关文章