@Override public V put(K key, V value) { return node.put(key, value); }
@Override @SuppressWarnings("unchecked") public boolean add(K arg0) { return node.put(arg0, VALUE) == null; }
@Override @SuppressWarnings("unchecked") public V put(K arg0, V arg1) { return (V) node.addChild(Fqn.fromElements(arg0)).put(KEY, arg1); }
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); } }
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); } }
clientTransactionNode.put(clientTransaction.getTransactionId(), clientTransaction); if (tx != null) {