Class MarshalledEntryFactoryImpl
java.lang.Object
org.infinispan.marshall.persistence.impl.MarshalledEntryFactoryImpl
- All Implemented Interfaces:
MarshallableEntryFactory
- Since:
- 10.0
- Author:
- Ryan Emerson
-
Constructor Summary
ConstructorsConstructorDescriptionMarshalledEntryFactoryImpl(org.infinispan.commons.marshall.Marshaller marshaller) -
Method Summary
Modifier and TypeMethodDescriptioncloneWithExpiration(MarshallableEntry me, long creationTime, long lifespan) Clone the provided MarshallableEntry if needed to apply lifespan expiration.valuedefaults to nullmetadatadefaults to nullcreateddefaults to -1lastUseddefaults to -1create(Object key, Object value, Metadata metadata, PrivateMetadata internalMetadata, long created, long lastUsed) Creates aMarshallableEntryusing non-marshalled POJOs as argumentscreate(Object key, org.infinispan.commons.io.ByteBuffer valueBytes, org.infinispan.commons.io.ByteBuffer metadataBytes, org.infinispan.commons.io.ByteBuffer internalMetadataBytes, long created, long lastUsed) Creates aMarshallableEntryusing a object key and already marshalled value/metadata as argumentscreate(Object key, MarshalledValue value) Creates aMarshallableEntryusing a KeyMarshalledValue.create(org.infinispan.commons.io.ByteBuffer key, org.infinispan.commons.io.ByteBuffer valueBytes) metadataBytesdefaults to nullcreateddefaults to -1lastUseddefaults to -1create(org.infinispan.commons.io.ByteBuffer key, org.infinispan.commons.io.ByteBuffer valueBytes, org.infinispan.commons.io.ByteBuffer metadataBytes, org.infinispan.commons.io.ByteBuffer internalMetadataBytes, long created, long lastUsed) Creates aMarshallableEntryusing already marshalled objects as argumentsgetEmpty()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.persistence.spi.MarshallableEntryFactory
create, create
-
Constructor Details
-
MarshalledEntryFactoryImpl
public MarshalledEntryFactoryImpl() -
MarshalledEntryFactoryImpl
public MarshalledEntryFactoryImpl(org.infinispan.commons.marshall.Marshaller marshaller)
-
-
Method Details
-
create
public MarshallableEntry create(org.infinispan.commons.io.ByteBuffer key, org.infinispan.commons.io.ByteBuffer valueBytes) Description copied from interface:MarshallableEntryFactorymetadataBytesdefaults to nullcreateddefaults to -1lastUseddefaults to -1- Specified by:
createin interfaceMarshallableEntryFactory- See Also:
-
create
public MarshallableEntry create(org.infinispan.commons.io.ByteBuffer key, org.infinispan.commons.io.ByteBuffer valueBytes, org.infinispan.commons.io.ByteBuffer metadataBytes, org.infinispan.commons.io.ByteBuffer internalMetadataBytes, long created, long lastUsed) Description copied from interface:MarshallableEntryFactoryCreates aMarshallableEntryusing already marshalled objects as arguments- Specified by:
createin interfaceMarshallableEntryFactory- Parameters:
key-ByteBufferof serialized key objectvalueBytes-ByteBufferof serialized value objectmetadataBytes-ByteBufferof serialized metadata objectinternalMetadataBytes-ByteBufferof serialized internal metadata objectcreated- timestamp of when the entry was created, -1 means this value is ignoredlastUsed- timestamp of last time entry was accessed in memory- Returns:
MarshallableEntryinstance that lazily handles unmarshalling of keys, values and metadata via theMarshallableEntry.getKey(),MarshallableEntry.getValue()andMarshallableEntry.getMetadata()methods.
-
create
public MarshallableEntry create(Object key, org.infinispan.commons.io.ByteBuffer valueBytes, org.infinispan.commons.io.ByteBuffer metadataBytes, org.infinispan.commons.io.ByteBuffer internalMetadataBytes, long created, long lastUsed) Description copied from interface:MarshallableEntryFactoryCreates aMarshallableEntryusing a object key and already marshalled value/metadata as arguments- Specified by:
createin interfaceMarshallableEntryFactory- Parameters:
key- entry keyvalueBytes-ByteBufferof serialized value objectmetadataBytes-ByteBufferof serialized metadata objectinternalMetadataBytes-ByteBufferof serialized internal metadata objectcreated- timestamp of when the entry was created, -1 means this value is ignoredlastUsed- timestamp of last time entry was accessed in memory- Returns:
MarshallableEntryinstance that lazily handles unmarshalling of values and metadata via theMarshallableEntry.getKey(),MarshallableEntry.getValue()andMarshallableEntry.getMetadata()methods.
-
create
Description copied from interface:MarshallableEntryFactoryvaluedefaults to null- Specified by:
createin interfaceMarshallableEntryFactory- See Also:
-
create
Description copied from interface:MarshallableEntryFactorymetadatadefaults to nullcreateddefaults to -1lastUseddefaults to -1- Specified by:
createin interfaceMarshallableEntryFactory- See Also:
-
create
public MarshallableEntry create(Object key, Object value, Metadata metadata, PrivateMetadata internalMetadata, long created, long lastUsed) Description copied from interface:MarshallableEntryFactoryCreates aMarshallableEntryusing non-marshalled POJOs as arguments- Specified by:
createin interfaceMarshallableEntryFactory- Parameters:
key- entry keyvalue- entry valuemetadata- entry metadatainternalMetadata- entry internal metadatacreated- timestamp of when the entry was created, -1 means this value is ignoredlastUsed- timestamp of last time entry was accessed in memory- Returns:
MarshallableEntryinstance that lazily handles serialization of keys, values and metadata via theMarshallableEntry.getKeyBytes(),MarshallableEntry.getValueBytes()andMarshallableEntry.getMetadataBytes()methods.
-
create
Description copied from interface:MarshallableEntryFactoryCreates aMarshallableEntryusing a KeyMarshalledValue.- Specified by:
createin interfaceMarshallableEntryFactory- Parameters:
key- entry keyvalue- aMarshalledValuewhose values are used to populateMarshallableEntry.getValueBytes(),MarshallableEntry.getMetadataBytes(),MarshallableEntry.created()andMarshallableEntry.lastUsed()fields.- Returns:
MarshallableEntryinstance that lazily handles unmarshalling of keys, values and metadata via theMarshallableEntry.getKey(),MarshallableEntry.getValue()andMarshallableEntry.getMetadata()methods.
-
cloneWithExpiration
public MarshallableEntry cloneWithExpiration(MarshallableEntry me, long creationTime, long lifespan) Description copied from interface:MarshallableEntryFactoryClone the provided MarshallableEntry if needed to apply lifespan expiration. If the entry already has lifespan applied this method will do nothing, returning the same MarshallableEntry back.- Specified by:
cloneWithExpirationin interfaceMarshallableEntryFactory- Parameters:
me- the entry to clone if applicablecreationTime- the creation time to apply for lifespanlifespan- the duration for which the entry will expire after the creationTime- Returns:
- a new entry if lifespan was applied otherwise the same entry provided
-
getEmpty
- Specified by:
getEmptyin interfaceMarshallableEntryFactory- Returns:
- a cached empty
MarshallableEntryinstance.
-