org.jboss.cache.Node.put()方法的使用及代码示例

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

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

Node.put介绍

[英]Associates the specified value with the specified key for this node. If this node previously contained a mapping for this key, the old value is replaced by the specified value.
[中]将指定的值与此节点的指定键相关联。如果此节点以前包含此键的映射,则旧值将替换为指定值。

代码示例

代码示例来源:origin: org.jboss.cache/jbosscache-core

@Override
public V put(K key, V value)
{
  return node.put(key, value);
}

代码示例来源:origin: org.jboss.cache/jbosscache-core

@Override
@SuppressWarnings("unchecked")
public boolean add(K arg0)
{
  return node.put(arg0, VALUE) == null;
}

代码示例来源:origin: org.jboss.cache/jbosscache-core

@Override
@SuppressWarnings("unchecked")
public V put(K arg0, V arg1)
{
  return (V) node.addChild(Fqn.fromElements(arg0)).put(KEY, arg1);
}

代码示例来源:origin: org.mobicents.ha.javax.sip/restcomm-jain-sip-jboss5

public void putDialog(SIPDialog dialog) throws SipCacheException {
  UserTransaction tx = null;
  try {
    Properties prop = new Properties();
    prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
    tx = (UserTransaction) new InitialContext(prop).lookup("UserTransaction");
    if(tx != null) {
      tx.begin();
    }
    Node dialogNode = dialogRootNode.addChild(Fqn.fromString(dialog.getDialogId()));
    dialogNode.put(dialog.getDialogId(), dialog);
    if(tx != null) {
      tx.commit();
    }
  } catch (Exception e) {
    if(tx != null) {
      try { tx.rollback(); } catch(Throwable t) {}
    }
    throw new SipCacheException("A problem occured while putting the following dialog " + dialog.getDialogId() + "  into JBoss Cache", e);
  } 
}

代码示例来源:origin: org.mobicents.ha.javax.sip/restcomm-jain-sip-jboss5

public void putServerTransaction(SIPServerTransaction serverTransaction)
    throws SipCacheException {
  UserTransaction tx = null;
  try {
    Properties prop = new Properties();
    prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
    tx = (UserTransaction) new InitialContext(prop).lookup("UserTransaction");
    if(tx != null) {
      tx.begin();
    }
    Node serverTransactionNode = serverTxRootNode.addChild(Fqn.fromString(serverTransaction.getTransactionId()));
    serverTransactionNode.put(serverTransaction.getTransactionId(), serverTransaction);
    if(tx != null) {
      tx.commit();
    }
  } catch (Exception e) {
    if(tx != null) {
      try { tx.rollback(); } catch(Throwable t) {}
    }
    throw new SipCacheException("A problem occured while putting the following server transaction " + serverTransaction.getTransactionId() + "  into JBoss Cache", e);
  } 
}

代码示例来源:origin: org.mobicents.ha.javax.sip/restcomm-jain-sip-jboss5

clientTransactionNode.put(clientTransaction.getTransactionId(),
    clientTransaction);
if (tx != null) {

相关文章