org.ehcache.impl.internal.spi.serialization
Class DefaultSerializationProvider

java.lang.Object
  extended by org.ehcache.impl.internal.spi.serialization.DefaultSerializationProvider
All Implemented Interfaces:
SerializationProvider, Service
Direct Known Subclasses:
DefaultJsr107SerializationProvider

public class DefaultSerializationProvider
extends java.lang.Object
implements SerializationProvider


Field Summary
protected  ConcurrentWeakIdentityHashMap<Serializer<?>,java.util.concurrent.atomic.AtomicInteger> providedVsCount
           
 
Constructor Summary
DefaultSerializationProvider(DefaultSerializationProviderConfiguration configuration)
           
 
Method Summary
<T> Serializer<T>
createKeySerializer(java.lang.Class<T> clazz, java.lang.ClassLoader classLoader, ServiceConfiguration<?>... configs)
          Creates a key Serializer with the given parameters.
<T> Serializer<T>
createValueSerializer(java.lang.Class<T> clazz, java.lang.ClassLoader classLoader, ServiceConfiguration<?>... configs)
          Creates a value Serializer with the given parameters.
 void releaseSerializer(Serializer<?> serializer)
          Releases the given Serializer instance
 void start(ServiceProvider serviceProvider)
          Start this service using the provided configuration and ServiceProvider.
 void stop()
          Stops this service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

providedVsCount

protected final ConcurrentWeakIdentityHashMap<Serializer<?>,java.util.concurrent.atomic.AtomicInteger> providedVsCount
Constructor Detail

DefaultSerializationProvider

public DefaultSerializationProvider(DefaultSerializationProviderConfiguration configuration)
Method Detail

createKeySerializer

public <T> Serializer<T> createKeySerializer(java.lang.Class<T> clazz,
                                             java.lang.ClassLoader classLoader,
                                             ServiceConfiguration<?>... configs)
                                  throws UnsupportedTypeException
Description copied from interface: SerializationProvider
Creates a key Serializer with the given parameters.

Specified by:
createKeySerializer in interface SerializationProvider
Type Parameters:
T - the type serialized to serialize to/from
Parameters:
clazz - the class of the type to serialize to/from
classLoader - the classloader to use
configs - specific configuration
Returns:
a Serializer instance
Throws:
UnsupportedTypeException - if a serializer cannot be created for the given type

createValueSerializer

public <T> Serializer<T> createValueSerializer(java.lang.Class<T> clazz,
                                               java.lang.ClassLoader classLoader,
                                               ServiceConfiguration<?>... configs)
                                    throws UnsupportedTypeException
Description copied from interface: SerializationProvider
Creates a value Serializer with the given parameters.

Specified by:
createValueSerializer in interface SerializationProvider
Type Parameters:
T - the type serialized to serialize to/from
Parameters:
clazz - the class of the type to serialize to/from
classLoader - the classloader to use
configs - specific configuration
Returns:
a Serializer instance
Throws:
UnsupportedTypeException - if a serializer cannot be created for the given type

releaseSerializer

public void releaseSerializer(Serializer<?> serializer)
                       throws java.io.IOException
Description copied from interface: SerializationProvider
Releases the given Serializer instance

Specified by:
releaseSerializer in interface SerializationProvider
Parameters:
serializer - the serializer to be released
Throws:
java.io.IOException

start

public void start(ServiceProvider serviceProvider)
Description copied from interface: Service
Start this service using the provided configuration and ServiceProvider.

The goal of the service provider is to allow a service to use other services.

Specified by:
start in interface Service
Parameters:
serviceProvider - the service provider.

stop

public void stop()
Description copied from interface: Service
Stops this service.

Specified by:
stop in interface Service