use of org.jboss.cache.Node in project jain-sip.ha by RestComm.
the class JBossSipCache method putClientTransaction.
public void putClientTransaction(SIPClientTransaction clientTransaction) 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 clientTransactionNode = clientTxRootNode.addChild(Fqn.fromString(clientTransaction.getTransactionId()));
clientTransactionNode.put(clientTransaction.getTransactionId(), clientTransaction);
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 client transaction " + clientTransaction.getTransactionId() + " into JBoss Cache", e);
}
}
Aggregations