Package org.apache.qpid.protonj2.codec
Class CodecFactory
- java.lang.Object
-
- org.apache.qpid.protonj2.codec.CodecFactory
-
public final class CodecFactory extends Object
Factory Class used to create new instances of AMQP type Encoder and Decoder instances registered in the factory.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Decoder
getDecoder()
static Decoder
getDefaultDecoder()
static Encoder
getDefaultEncoder()
static Decoder
getDefaultSaslDecoder()
static Encoder
getDefaultSaslEncoder()
static Encoder
getEncoder()
static Decoder
getSaslDecoder()
static Encoder
getSaslEncoder()
static void
setDecoder(Decoder decoder)
Sets anDecoder
instance that will be returned from all calls to thegetDecoder()
.static void
setEncoder(Encoder encoder)
Sets anEncoder
instance that will be returned from all calls to thegetEncoder()
.static void
setSaslDecoder(Decoder decoder)
Sets anDecoder
instance that will be returned from all calls to thegetSaslDecoder()
.static void
setSaslEncoder(Encoder encoder)
Sets anEncoder
instance that will be returned from all calls to thegetSaslEncoder()
.
-
-
-
Method Detail
-
setEncoder
public static void setEncoder(Encoder encoder)
Sets anEncoder
instance that will be returned from all calls to thegetEncoder()
. If noEncoder
is configured then the calls to get an Encoder instance will return the default Encoder from the library.- Parameters:
encoder
- The encoder to return from all calls to thegetEncoder()
method/
-
setDecoder
public static void setDecoder(Decoder decoder)
Sets anDecoder
instance that will be returned from all calls to thegetDecoder()
. If noDecoder
is configured then the calls to get an Decoder instance will return the default Decoder from the library.- Parameters:
decoder
- The decoder to return from all calls to thegetDecoder()
method/
-
setSaslEncoder
public static void setSaslEncoder(Encoder encoder)
Sets anEncoder
instance that will be returned from all calls to thegetSaslEncoder()
. If noEncoder
is configured then the calls to get an Encoder instance will return the default Encoder from the library. The Encoder configured should only accept encodes of the SASL AMQP types.- Parameters:
encoder
- The encoder to return from all calls to thegetSaslEncoder()
method/
-
setSaslDecoder
public static void setSaslDecoder(Decoder decoder)
Sets anDecoder
instance that will be returned from all calls to thegetSaslDecoder()
. If noDecoder
is configured then the calls to get an Decoder instance will return the default Decoder from the library. The Decoder configured should only decode the SASL AMQP types.- Parameters:
decoder
- The decoder to return from all calls to thegetSaslDecoder()
method/
-
getEncoder
public static Encoder getEncoder()
- Returns:
- a cached
Encoder
instance that resulted from a call togetDefaultEncoder()
if not set externally.
-
getDecoder
public static Decoder getDecoder()
- Returns:
- a cached
Decoder
instance that resulted from a call togetDefaultDecoder()
if not set externally.
-
getSaslEncoder
public static Encoder getSaslEncoder()
- Returns:
- a cached
Encoder
instance that resulted from a call togetDefaultSaslEncoder()
if not set externally.
-
getSaslDecoder
public static Decoder getSaslDecoder()
- Returns:
- a cached
Decoder
instance that resulted from a call togetSaslDecoder()
if not set externally.
-
getDefaultEncoder
public static Encoder getDefaultEncoder()
- Returns:
- a new instance of the Proton default
Encoder
implementation.
-
getDefaultDecoder
public static Decoder getDefaultDecoder()
- Returns:
- a new instance of the Proton default
Decoder
implementation.
-
getDefaultSaslEncoder
public static Encoder getDefaultSaslEncoder()
- Returns:
- a new instance of the Proton default SASL only
Encoder
implementation.
-
-