org.ehcache.spi.serialization
Class DefaultSerializationProvider

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

public class DefaultSerializationProvider
extends java.lang.Object
implements SerializationProvider


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 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
 

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

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