public NestableTransaction.Created create(long leaseTime) throws UnknownTransactionException, CannotJoinException, LeaseDeniedException, RemoteException { return create((NestableTransactionManager)mgr, leaseTime); }
/** * Return true if the specified transaction is an ancestor of this transaction. * * @param enclosing transaction to test for being an ancestor * @return true if the specified transaction is an ancestor of this transaction. */ public boolean enclosedBy(NestableTransaction enclosing) { for (NestableServerTransaction ancestor = this.parent; ancestor != null; ancestor = ancestor.parent) { if (ancestor.equals(enclosing)) return true; } return false; }
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); }
public NestableServerTransaction(GetArg arg) throws IOException, ClassNotFoundException{ super(check(arg)); this.parent = arg.get("parent", null, NestableServerTransaction.class); }
/** * 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); }
public NestableTransaction.Created create(long leaseTime) throws UnknownTransactionException, CannotJoinException, LeaseDeniedException, RemoteException { return create((NestableTransactionManager) mgr, leaseTime); }
/** * Return true if the specified transaction is an ancestor of * this transaction. * * @param enclosing transaction to test for being an ancestor * @return true if the specified transaction is an ancestor of * this transaction. */ public boolean enclosedBy(NestableTransaction enclosing) { for (NestableServerTransaction ancestor = this.parent; ancestor != null; ancestor = ancestor.parent) { if (ancestor.equals(enclosing)) return true; } return false; }
/** * 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); }