public NestableTransaction.Created create(NestableTransactionManager mgr, long leaseTime) throws UnknownTransactionException, CannotJoinException, LeaseDeniedException, RemoteException { TransactionManager.Created rawTxn = mgr.create((NestableTransactionManager)this.mgr, id, leaseTime); return new NestableTransaction.Created( new NestableServerTransaction(mgr, rawTxn.id, this), rawTxn.lease); }
/** * Create a new top-level transaction, under which nested transactions * can be created. * * @param mgr the transaction manager to use for this transaction * @param leaseTime the requested lease time for the transaction * @return the created transaction and the lease granted * * @throws LeaseDeniedException if this manager is unwilling to * grant the requested lease time * @throws RemoteException if a communication error occurs. */ public static NestableTransaction.Created create(NestableTransactionManager mgr, long leaseTime) throws LeaseDeniedException, RemoteException { TransactionManager.Created rawTxn = mgr.create(leaseTime); return new NestableTransaction.Created( new NestableServerTransaction(mgr, rawTxn.id, null), rawTxn.lease); } }
public NestableTransaction.Created create(NestableTransactionManager mgr, long leaseTime) throws UnknownTransactionException, CannotJoinException, LeaseDeniedException, RemoteException { TransactionManager.Created rawTxn = mgr.create((NestableTransactionManager) this.mgr, id, leaseTime); NestableServerTransaction tx = new NestableServerTransaction(mgr, rawTxn.id, this, leaseTime); return new NestableTransaction.Created(tx, rawTxn.lease); }
/** * Create a new top-level transaction, under which nested transactions can be created. * * @param mgr the transaction manager to use for this transaction * @param leaseTime the requested lease time for the transaction * @return the created transaction and the lease granted * @throws LeaseDeniedException if this manager is unwilling to grant the requested lease time * @throws RemoteException if a communication error occurs. */ public static NestableTransaction.Created create(NestableTransactionManager mgr, long leaseTime) throws LeaseDeniedException, RemoteException { TransactionManager.Created rawTxn = mgr.create(leaseTime); NestableServerTransaction tx = new NestableServerTransaction(mgr, rawTxn.id, null, leaseTime); return new NestableTransaction.Created(tx, rawTxn.lease); } }
/** * Create a new top-level transaction. If the specified transaction manager supports nested * transactions, then the returned transaction can be cast to a <code>NestableTransaction</code>. * * @param mgr the transaction manager to use for this transaction * @param leaseTime the requested lease time for the transaction * @return the created transaction and the lease granted * @throws LeaseDeniedException if this manager is unwilling to grant the requested lease time * @throws RemoteException if a communication error occurs. */ public static Transaction.Created create(TransactionManager mgr, long leaseTime) throws LeaseDeniedException, RemoteException { TransactionManager.Created rawTxn = mgr.create(leaseTime); Transaction transaction; if (mgr instanceof NestableTransactionManager) transaction = new NestableServerTransaction((NestableTransactionManager) mgr, rawTxn.id, null, leaseTime); else transaction = ServerTransaction.create(mgr, rawTxn.id, leaseTime); return new Transaction.Created(transaction, rawTxn.lease); }
/** * Create a new top-level transaction. If the specified transaction * manager supports nested transactions, then the returned transaction * can be cast to a <code>NestableTransaction</code>. * * @param mgr the transaction manager to use for this transaction * @param leaseTime the requested lease time for the transaction * @return the created transaction and the lease granted * * @throws LeaseDeniedException if this manager is unwilling to * grant the requested lease time * @throws RemoteException if a communication error occurs. */ public static Transaction.Created create(TransactionManager mgr, long leaseTime) throws LeaseDeniedException, RemoteException { TransactionManager.Created rawTxn = mgr.create(leaseTime); Transaction transaction; if (mgr instanceof NestableTransactionManager) transaction = new NestableServerTransaction( (NestableTransactionManager)mgr, rawTxn.id, null); else transaction = new ServerTransaction(mgr, rawTxn.id); return new Transaction.Created(transaction, rawTxn.lease); }