Package org.apache.qpid.protonj2.codec
Class CodecFactory
- java.lang.Object
-
- org.apache.qpid.protonj2.codec.CodecFactory
-
public final class CodecFactory extends java.lang.ObjectFactory 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 DecodergetDecoder()static DecodergetDefaultDecoder()static EncodergetDefaultEncoder()static DecodergetDefaultSaslDecoder()static EncodergetDefaultSaslEncoder()static EncodergetEncoder()static DecodergetSaslDecoder()static EncodergetSaslEncoder()static voidsetDecoder(Decoder decoder)Sets anDecoderinstance that will be returned from all calls to thegetDecoder().static voidsetEncoder(Encoder encoder)Sets anEncoderinstance that will be returned from all calls to thegetEncoder().static voidsetSaslDecoder(Decoder decoder)Sets anDecoderinstance that will be returned from all calls to thegetSaslDecoder().static voidsetSaslEncoder(Encoder encoder)Sets anEncoderinstance that will be returned from all calls to thegetSaslEncoder().
-
-
-
Method Detail
-
setEncoder
public static void setEncoder(Encoder encoder)
Sets anEncoderinstance that will be returned from all calls to thegetEncoder(). If noEncoderis 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 anDecoderinstance that will be returned from all calls to thegetDecoder(). If noDecoderis 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 anEncoderinstance that will be returned from all calls to thegetSaslEncoder(). If noEncoderis 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 anDecoderinstance that will be returned from all calls to thegetSaslDecoder(). If noDecoderis 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
Encoderinstance that resulted from a call togetDefaultEncoder()if not set externally.
-
getDecoder
public static Decoder getDecoder()
- Returns:
- a cached
Decoderinstance that resulted from a call togetDefaultDecoder()if not set externally.
-
getSaslEncoder
public static Encoder getSaslEncoder()
- Returns:
- a cached
Encoderinstance that resulted from a call togetDefaultSaslEncoder()if not set externally.
-
getSaslDecoder
public static Decoder getSaslDecoder()
- Returns:
- a cached
Decoderinstance that resulted from a call togetSaslDecoder()if not set externally.
-
getDefaultEncoder
public static Encoder getDefaultEncoder()
- Returns:
- a new instance of the Proton default
Encoderimplementation.
-
getDefaultDecoder
public static Decoder getDefaultDecoder()
- Returns:
- a new instance of the Proton default
Decoderimplementation.
-
getDefaultSaslEncoder
public static Encoder getDefaultSaslEncoder()
- Returns:
- a new instance of the Proton default SASL only
Encoderimplementation.
-
-