/** * Sets the value of this TransactionLocal variable associtated with the * specified transaction. This is only used to change the value from * the one assigned by the initialValue method, and many applications will * have no need for this functionality. * * @param transaction the transaction for which the value will be set * @param value the value to be associated with the thread context * transactions's TransactionLocal */ public void set(Transaction transaction, Object value) { if (transaction == null) throw new IllegalStateException("there is no transaction"); // If this transaction is unknown, register for synchroniztion callback, // and call initialValue to give subclasses a chance to do some // initialization. if(!containsValue(transaction)) { initialValue(); } // if value is null replace it with the null value standin if(value == null) { value = NULL_VALUE; } // finally store the value storeValue(transaction, value); }
/** * Sets the value of this TransactionLocal variable associtated with the * specified transaction. This is only used to change the value from * the one assigned by the initialValue method, and many applications will * have no need for this functionality. * * @param transaction the transaction for which the value will be set * @param value the value to be associated with the thread context * transactions's TransactionLocal */ public void set(Transaction transaction, Object value) { if (transaction == null) throw new IllegalStateException("there is no transaction"); // If this transaction is unknown, register for synchroniztion callback, // and call initialValue to give subclasses a chance to do some // initialization. if(!containsValue(transaction)) { initialValue(); } // if value is null replace it with the null value standin if(value == null) { value = NULL_VALUE; } // finally store the value storeValue(transaction, value); }