Package com.oracle.coherence.cdi
Class SerializerProducer
- java.lang.Object
-
- com.oracle.coherence.cdi.SerializerProducer
-
- All Implemented Interfaces:
NamedSerializerFactory
@ApplicationScoped public class SerializerProducer extends Object implements NamedSerializerFactory
A CDI producer ofSerializer
instances.- Since:
- 20.06
- Author:
- Jonathan Knight 2019.11.20
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SerializerProducer.Builder
A builder that buildsSerializerProducer
instances.
-
Field Summary
-
Fields inherited from interface com.tangosol.io.NamedSerializerFactory
DEFAULT
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SerializerProducer.Builder
builder()
Create an instance of aSerializerProducer.Builder
.static SerializerProducer
create()
Create an instance ofSerializerProducer
.Serializer
getDefaultSerializer(javax.enterprise.inject.spi.InjectionPoint ip)
Produces an instance of the defaultSerializer
.Serializer
getNamedSerializer(String sName, ClassLoader loader)
Produces instances of a namedSerializer
.Serializer
getNamedSerializer(javax.enterprise.inject.spi.InjectionPoint ip)
Produces instances of a namedSerializer
.
-
-
-
Method Detail
-
create
public static SerializerProducer create()
Create an instance ofSerializerProducer
.- Returns:
- an instance of
SerializerProducer
-
builder
public static SerializerProducer.Builder builder()
Create an instance of aSerializerProducer.Builder
.- Returns:
- an instance of
SerializerProducer.Builder
-
getDefaultSerializer
@Produces public Serializer getDefaultSerializer(javax.enterprise.inject.spi.InjectionPoint ip)
Produces an instance of the defaultSerializer
.- Parameters:
ip
- theInjectionPoint
that theSerializer
will be injected into- Returns:
- an instance of the default
Serializer
-
getNamedSerializer
@Produces @Name("") @ConfigUri("") public Serializer getNamedSerializer(javax.enterprise.inject.spi.InjectionPoint ip)
Produces instances of a namedSerializer
.Named Serializers are first looked up in the Coherence operational configuration and if not found there they will be looked up in as a
Named
CDI bean of typeSerializer
.- Parameters:
ip
- theInjectionPoint
that theSerializer
will be injected into- Returns:
- an instance of a named
Serializer
-
getNamedSerializer
public Serializer getNamedSerializer(String sName, ClassLoader loader)
Produces instances of a namedSerializer
.- Specified by:
getNamedSerializer
in interfaceNamedSerializerFactory
- Parameters:
sName
- the name of the serializerloader
- theClassLoader
to use to create aSerializer
- Returns:
- an instance of a named
Serializer
- Throws:
NullPointerException
- if the name parameter is nullIllegalArgumentException
- if no serializer is discoverable with the specified name
-
-