org.infinispan.container
Interface InternalEntryFactory

All Known Implementing Classes:
InternalEntryFactoryImpl, VersionedInternalEntryFactoryImpl

public interface InternalEntryFactory

A factory for InternalCacheEntry and InternalCacheValue instances.

Since:
5.1
Author:
Manik Surtani

Method Summary
 InternalCacheEntry create(CacheEntry cacheEntry)
          Creates a new InternalCacheEntry instance based on the key, value, version and timestamp/lifespan information reflected in the CacheEntry instance passed in.
 InternalCacheEntry create(Object key, Object value, EntryVersion version)
          Creates a new InternalCacheEntry instance
 InternalCacheEntry create(Object key, Object value, EntryVersion version, long lifespan, long maxIdle)
          Creates a new InternalCacheEntry instance
 InternalCacheEntry create(Object key, Object value, EntryVersion version, long created, long lifespan, long lastUsed, long maxIdle)
          Creates a new InternalCacheEntry instance
 InternalCacheEntry create(Object key, Object value, InternalCacheEntry cacheEntry)
          Creates a new InternalCacheEntry instance based on the version and timestamp/lifespan information reflected in the CacheEntry instance passed in.
 InternalCacheValue createValue(CacheEntry cacheEntry)
          Creates an InternalCacheValue based on the InternalCacheEntry passed in.
 InternalCacheEntry update(InternalCacheEntry cacheEntry, long lifespan, long maxIdle)
          Updates an existing InternalCacheEntry with new lifespan and maxIdle values.
 

Method Detail

create

InternalCacheEntry create(CacheEntry cacheEntry)
Creates a new InternalCacheEntry instance based on the key, value, version and timestamp/lifespan information reflected in the CacheEntry instance passed in.

Parameters:
cacheEntry - cache entry to copy
Returns:
a new InternalCacheEntry

create

InternalCacheEntry create(Object key,
                          Object value,
                          InternalCacheEntry cacheEntry)
Creates a new InternalCacheEntry instance based on the version and timestamp/lifespan information reflected in the CacheEntry instance passed in. Key and value are both passed in explicitly.

Parameters:
key - key to use
value - value to use
cacheEntry - cache entry to retrieve version and timestamp/lifespan information from
Returns:
a new InternalCacheEntry

create

InternalCacheEntry create(Object key,
                          Object value,
                          EntryVersion version)
Creates a new InternalCacheEntry instance

Parameters:
key - key to use
value - value to use
version - version to use
Returns:
a new InternalCacheEntry

create

InternalCacheEntry create(Object key,
                          Object value,
                          EntryVersion version,
                          long lifespan,
                          long maxIdle)
Creates a new InternalCacheEntry instance

Parameters:
key - key to use
value - value to use
version - version to use
lifespan - lifespan to use
maxIdle - maxIdle to use
Returns:
a new InternalCacheEntry

create

InternalCacheEntry create(Object key,
                          Object value,
                          EntryVersion version,
                          long created,
                          long lifespan,
                          long lastUsed,
                          long maxIdle)
Creates a new InternalCacheEntry instance

Parameters:
key - key to use
value - value to use
version - version to use
created - creation timestamp to use
lifespan - lifespan to use
lastUsed - lastUsed timestamp to use
maxIdle - maxIdle to use
Returns:
a new InternalCacheEntry

update

InternalCacheEntry update(InternalCacheEntry cacheEntry,
                          long lifespan,
                          long maxIdle)
Updates an existing InternalCacheEntry with new lifespan and maxIdle values. This may result in a new InternalCacheEntry instance being created, as a different InternalCacheEntry implementation may be more appropriate to suit the new lifespan and maxIdle values. As such, one should consider the InternalCacheEntry passed in as a parameter as passed by value and not by reference.

Parameters:
cacheEntry - original internal cache entry
lifespan - new lifespan to use
maxIdle - new maxIdle to use
Returns:
a new InternalCacheEntry instance

createValue

InternalCacheValue createValue(CacheEntry cacheEntry)
Creates an InternalCacheValue based on the InternalCacheEntry passed in.

Parameters:
cacheEntry - to use to generate a InternalCacheValue
Returns:
an InternalCacheValue

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.