Package org.apache.qpid.protonj2.codec
Class CodecFactory
java.lang.Object
org.apache.qpid.protonj2.codec.CodecFactory
Factory Class used to create new instances of AMQP type
Encoder and Decoder instances registered in the factory.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Decoder
static Decoder
static Encoder
static Decoder
static Encoder
static Encoder
static Decoder
static Encoder
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 Details
-
setEncoder
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
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
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
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
- Returns:
- a cached
Encoder
instance that resulted from a call togetDefaultEncoder()
if not set externally.
-
getDecoder
- Returns:
- a cached
Decoder
instance that resulted from a call togetDefaultDecoder()
if not set externally.
-
getSaslEncoder
- Returns:
- a cached
Encoder
instance that resulted from a call togetDefaultSaslEncoder()
if not set externally.
-
getSaslDecoder
- Returns:
- a cached
Decoder
instance that resulted from a call togetSaslDecoder()
if not set externally.
-
getDefaultEncoder
- Returns:
- a new instance of the Proton default
Encoder
implementation.
-
getDefaultDecoder
- Returns:
- a new instance of the Proton default
Decoder
implementation.
-
getDefaultSaslEncoder
- Returns:
- a new instance of the Proton default SASL only
Encoder
implementation.
-
getDefaultSaslDecoder
- Returns:
- a new instance of the Proton default SASL only
Decoder
implementation.
-