psUpdate.setLong( 3, now ); long expireTime = now + ce.getElementAttributes().getMaxLife(); psUpdate.setLong( 4, expireTime );
psUpdate.setLong( 3, now ); long expireTime = now + ce.getElementAttributes().getMaxLife(); psUpdate.setLong( 4, expireTime );
attributes.getIsEternal(), format.format(new Date(attributes.getCreateTime())), attributes.getMaxLife(), (now - attributes.getCreateTime() - attributes.getMaxLife() * 1000 ) / -1000);
attributes.getIsEternal(), format.format(new Date(attributes.getCreateTime())), attributes.getMaxLife(), (now - attributes.getCreateTime() - attributes.getMaxLife() * 1000 ) / -1000);
psInsert.setString( 2, this.getCacheName() ); psInsert.setBytes( 3, element ); psInsert.setLong( 4, ce.getElementAttributes().getMaxLife() ); if ( ce.getElementAttributes().getIsEternal() ) psInsert.setLong( 7, now ); long expireTime = now + ce.getElementAttributes().getMaxLife(); psInsert.setLong( 8, expireTime );
psInsert.setString( 2, this.getCacheName() ); psInsert.setBytes( 3, element ); psInsert.setLong( 4, ce.getElementAttributes().getMaxLife() ); if ( ce.getElementAttributes().getIsEternal() ) psInsert.setLong( 7, now ); long expireTime = now + ce.getElementAttributes().getMaxLife(); psInsert.setLong( 8, expireTime );
long maxLifeSeconds = attributes.getMaxLife(); long createTime = attributes.getCreateTime();
long maxLifeSeconds = attributes.getMaxLife(); long createTime = attributes.getCreateTime();
/** * Verify that elements that go in the region after this call take the new attributes. * @throws Exception */ public void testSetDefaultElementAttributes() throws Exception { CacheAccess<String, String> access = JCS.getInstance( "test" ); assertNotNull( "We should have an access class", access ); long maxLife = 9876; IElementAttributes attr = new ElementAttributes(); attr.setMaxLife(maxLife); access.setDefaultElementAttributes( attr ); assertEquals( "Wrong element attributes.", attr.getMaxLife(), access.getDefaultElementAttributes() .getMaxLife() ); String key = "mykey"; String value = "myvalue"; access.put( key, value ); ICacheElement<String, String> element = access.getCacheElement( key ); assertEquals( "Wrong max life. Should have the new value.", maxLife, element.getElementAttributes() .getMaxLife() ); }
/** * Verify that elements that go in the region after this call take the new attributes. * @throws Exception */ public void testSetDefaultElementAttributes() throws Exception { CacheAccess<String, String> access = JCS.getInstance( "test" ); assertNotNull( "We should have an access class", access ); long maxLife = 9876; IElementAttributes attr = new ElementAttributes(); attr.setMaxLife(maxLife); access.setDefaultElementAttributes( attr ); assertEquals( "Wrong element attributes.", attr.getMaxLife(), access.getDefaultElementAttributes() .getMaxLife() ); String key = "mykey"; String value = "myvalue"; access.put( key, value ); ICacheElement<String, String> element = access.getCacheElement( key ); assertEquals( "Wrong max life. Should have the new value.", maxLife, element.getElementAttributes() .getMaxLife() ); }
assertEquals( "Attributes should be the same.", before.getElementAttributes().getMaxLife(), after .getElementAttributes().getMaxLife() ); assertEquals( "Keys should be the same.", before.getKey(), after.getKey() ); assertEquals( "Cache name should be the same.", before.getCacheName(), after.getCacheName() );
assertEquals( "Attributes should be the same.", attr.getMaxLife(), after .getElementAttributes().getMaxLife() ); assertEquals( "Keys should be the same.", key, after.getKey() ); assertEquals( "Cache name should be the same.", cacheName, after.getCacheName() );
assertEquals( "Attributes should be the same.", before.getElementAttributes().getMaxLife(), after .getElementAttributes().getMaxLife() ); assertEquals( "Keys should be the same.", before.getKey(), after.getKey() ); assertEquals( "Cache name should be the same.", before.getCacheName(), after.getCacheName() );
assertEquals( "Attributes should be the same.", before.getElementAttributes().getMaxLife(), after .getElementAttributes().getMaxLife() ); assertEquals( "Keys should be the same.", before.getKey(), after.getKey() ); assertEquals( "Cache name should be the same.", before.getCacheName(), after.getCacheName() );
assertEquals( "Attributes should be the same.", before.getElementAttributes().getMaxLife(), after .getElementAttributes().getMaxLife() ); assertEquals( "Keys should be the same.", before.getKey(), after.getKey() ); assertEquals( "Cache name should be the same.", before.getCacheName(), after.getCacheName() );
assertEquals( "Attributes should be the same.", attr.getMaxLife(), after .getElementAttributes().getMaxLife() ); assertEquals( "Keys should be the same.", key, after.getKey() ); assertEquals( "Cache name should be the same.", cacheName, after.getCacheName() );