@Test(expected = IllegalArgumentException.class) public void testStore_token_isNull() throws Exception { try { store = new HttpSessionTransactionTokenStore(5); store.store(null); } catch (Exception e) { assertThat(e.getMessage(), is("token must not be null")); throw e; } }
@Override public void store(TransactionToken token) { String sessionAttributeKey = createSessionAttributeName(token); HttpSession session = getSession(); Object mutex = getMutex(session); synchronized (mutex) { session.setAttribute(sessionAttributeKey, new TokenHolder(token .getTokenValue(), System.currentTimeMillis())); } }
HttpSessionTransactionTokenStore implements TransactionTokenStore { @Override public void store(TransactionToken token) { String sessionAttributeKey = createSessionAttributeName(token); HttpSession session = getSession(); Object mutex = getMutex(session); synchronized (mutex) { session.setAttribute(sessionAttributeKey, new TokenHolder(token .getTokenValue(), System.currentTimeMillis())); } } }
HttpSessionTransactionTokenStore implements TransactionTokenStore { @Override public void store(TransactionToken token) { String sessionAttributeKey = createSessionAttributeName(token); HttpSession session = getSession(); Object mutex = getMutex(session); synchronized (mutex) { session.setAttribute(sessionAttributeKey, new TokenHolder(token .getTokenValue(), System.currentTimeMillis())); } } HttpSessionTransactionTokenStore();  HttpSessionTransactionTokenStore(
            int transactionTokenSizePerTokenName);  HttpSessionTransactionTokenStore(
            int transactionTokenSizePerTokenName, int retryCreateTokenName);  HttpSessionTransactionTokenStore(
            final TokenStringGenerator generator,
            final int transactionTokenSizePerTokenName,
            final int retryCreateTokenName); }
HttpSessionTransactionTokenStore implements TransactionTokenStore { @Override public void store(TransactionToken token) { String sessionAttributeKey = createSessionAttributeName(token); HttpSession session = getSession(); Object mutex = getMutex(session); synchronized (mutex) { session.setAttribute(sessionAttributeKey, new TokenHolder(token .getTokenValue(), System.currentTimeMillis())); } } HttpSessionTransactionTokenStore();  HttpSessionTransactionTokenStore(
            int transactionTokenSizePerTokenName);  HttpSessionTransactionTokenStore(
            int transactionTokenSizePerTokenName, int retryCreateTokenName);  HttpSessionTransactionTokenStore(
            final TokenStringGenerator generator,
            final int transactionTokenSizePerTokenName,
            final int retryCreateTokenName); @Override String getAndClear(TransactionToken token); @Override void remove(TransactionToken token); @Override String createAndReserveTokenKey(String tokenName); @Override void store(TransactionToken token); }
HttpSessionTransactionTokenStore implements TransactionTokenStore { @Override public void store(TransactionToken token) { String sessionAttributeKey = createSessionAttributeName(token); HttpSession session = getSession(); Object mutex = getMutex(session); synchronized (mutex) { session.setAttribute(sessionAttributeKey, new TokenHolder(token .getTokenValue(), System.currentTimeMillis())); } } HttpSessionTransactionTokenStore();  HttpSessionTransactionTokenStore(
            int transactionTokenSizePerTokenName);  HttpSessionTransactionTokenStore(
            int transactionTokenSizePerTokenName, int retryCreateTokenName);  HttpSessionTransactionTokenStore(
            final TokenStringGenerator generator,
            final int transactionTokenSizePerTokenName,
            final int retryCreateTokenName); @Override String getAndClear(TransactionToken token); @Override void remove(TransactionToken token); @Override String createAndReserveTokenKey(String tokenName); @Override void store(TransactionToken token); static final String TOKEN_HOLDER_SESSION_ATTRIBUTE_PREFIX; static final int NO_OF_TOKENS_PER_TOKEN_NAME; static final int DEFAULT_RETRY_CREATE_TOKEN_NAME; }