Package org.ehcache.spi.serialization
Interface StatefulSerializer<T>
-
- Type Parameters:
T- the type of the instances to serialize
- All Superinterfaces:
Serializer<T>
public interface StatefulSerializer<T> extends Serializer<T>
Implementations of this interface can have their state maintained in aStateRepository. The state will be maintained by the authoritative tier of the cache for which this is configured.Implementations must be thread-safe.
When used within the default serialization provider, there is an additional constructor requirement. The implementations must define a constructor that takes in a
ClassLoader. Post instantiation, the state repository will be injected with theinitmethod invocation. This is guaranteed to happen before any serialization/deserialization interaction.- See Also:
Serializer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidinit(StateRepository stateRepository)This method is used to inject aStateRepositoryto the serializer by the authoritative tier of a cache during the cache initialization.-
Methods inherited from interface org.ehcache.spi.serialization.Serializer
equals, read, serialize
-
-
-
-
Method Detail
-
init
void init(StateRepository stateRepository)
This method is used to inject aStateRepositoryto the serializer by the authoritative tier of a cache during the cache initialization. The passed in state repository will have the persistent properties of the injecting tier.- Parameters:
stateRepository- the state repository
-
-