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

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

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

Node.get介绍

[英]Returns the value to which this node maps the specified key. Returns null if the node contains no mapping for this key.
[中]返回此节点将指定键映射到的值。如果节点不包含此键的映射,则返回null

代码示例

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

  1. @Override
  2. @SuppressWarnings("unchecked")
  3. public V get(Object key)
  4. {
  5. return node.get((K) key);
  6. }

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

  1. @Override
  2. @SuppressWarnings("unchecked")
  3. public V get(Object arg0)
  4. {
  5. Node child = node.getChild(arg0);
  6. if (child == null)
  7. return null;
  8. return (V) child.get(KEY);
  9. }

代码示例来源:origin: Verigreen/verigreen

  1. private void populateValues(Node<String, Object> cache, ArrayList<V> list) {
  2. Set<Node<String, Object>> children = cache.getChildren();
  3. for (Node<String, Object> node : children) {
  4. Iterator<String> iterator = node.getKeys().iterator();
  5. if (iterator.hasNext()) {
  6. String key = iterator.next();
  7. V value = RuntimeUtils.<V> cast(node.get(key));
  8. list.add(getClonedValue(value));
  9. }
  10. }
  11. }

代码示例来源:origin: org.jasig.cas/cas-server-integration-jboss

  1. @Override
  2. public Collection<Ticket> getTickets() {
  3. try {
  4. final Node<String, Ticket> node = this.cache.getNode(FQN_TICKET);
  5. if (node == null) {
  6. return Collections.emptyList();
  7. }
  8. final Set<String> keys = node.getKeys();
  9. final List<Ticket> list = new ArrayList<>();
  10. for (final String key : keys) {
  11. /** Returns null if the node contains no mapping for this key. **/
  12. final Ticket ticket = node.get(key);
  13. if (ticket != null) {
  14. list.add(node.get(key));
  15. }
  16. }
  17. return list;
  18. } catch (final CacheException e) {
  19. return Collections.emptyList();
  20. }
  21. }

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

  1. public SIPDialog getDialog(String dialogId) throws SipCacheException {
  2. try {
  3. Node dialogNode = ((Node) dialogRootNode.getChild(Fqn.fromString(dialogId)));
  4. if(dialogNode != null) {
  5. return (SIPDialog) dialogNode.get(dialogId);
  6. } else {
  7. return null;
  8. }
  9. } catch (CacheException e) {
  10. throw new SipCacheException("A problem occured while retrieving the following dialog " + dialogId + " from JBoss Cache", e);
  11. }
  12. }

代码示例来源:origin: org.jboss.seam/jboss-seam

  1. @Override
  2. public Object get(String region, String key) {
  3. try {
  4. Node node = cache.get(getFqn(region));
  5. if (node != null) {
  6. return node.get(key);
  7. } else {
  8. return null;
  9. }
  10. } catch (CacheException e) {
  11. throw new IllegalStateException(String.format("Cache throw exception when trying to get %s from region %s.", key, region), e);
  12. }
  13. }

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

  1. public SIPServerTransaction getServerTransaction(String transactionId)
  2. throws SipCacheException {
  3. try {
  4. Node serverTransactionNode = ((Node) serverTxRootNode.getChild(Fqn.fromString(transactionId)));
  5. if(serverTransactionNode != null) {
  6. return (SIPServerTransaction) serverTransactionNode.get(transactionId);
  7. } else {
  8. return null;
  9. }
  10. } catch (CacheException e) {
  11. throw new SipCacheException("A problem occured while retrieving the following server transaction " + transactionId + " from JBoss Cache", e);
  12. }
  13. }

代码示例来源:origin: org.jboss.seam/jboss-seam

  1. @Override
  2. public Object get(String region, String key)
  3. {
  4. try
  5. {
  6. Node node = cache.get(getFqn(region));
  7. if (node != null)
  8. {
  9. return node.get(key);
  10. }
  11. else
  12. {
  13. return null;
  14. }
  15. }
  16. catch (CacheException e)
  17. {
  18. throw new IllegalStateException(String.format("Cache throw exception when trying to get %s from region %s.", key, region), e);
  19. }
  20. }

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

  1. public SIPClientTransaction getClientTransaction(String transactionId)
  2. throws SipCacheException {
  3. try {
  4. Node clientTransactionNode = ((Node) clientTxRootNode.getChild(Fqn
  5. .fromString(transactionId)));
  6. if (clientTransactionNode != null) {
  7. return (SIPClientTransaction) clientTransactionNode
  8. .get(transactionId);
  9. } else {
  10. return null;
  11. }
  12. } catch (CacheException e) {
  13. throw new SipCacheException(
  14. "A problem occured while retrieving the following client transaction "
  15. + transactionId + " from JBoss Cache", e);
  16. }
  17. }

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

  1. public void updateDialog(SIPDialog sipDialog) throws SipCacheException {
  2. Node dialogNode = ((Node) dialogRootNode.getChild(Fqn.fromString(sipDialog.getDialogId())));
  3. if(dialogNode != null) {
  4. if(dialogNode != null) {
  5. sipDialog = (SIPDialog) dialogNode.get(sipDialog.getDialogId());
  6. }
  7. }
  8. }

相关文章