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 Details

    • setEncoder

      public static void setEncoder(Encoder encoder)
      Sets an Encoder instance that will be returned from all calls to the getEncoder(). If no Encoder 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 the getEncoder() method/
    • setDecoder

      public static void setDecoder(Decoder decoder)
      Sets an Decoder instance that will be returned from all calls to the getDecoder(). If no Decoder 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 the getDecoder() method/
    • setSaslEncoder

      public static void setSaslEncoder(Encoder encoder)
      Sets an Encoder instance that will be returned from all calls to the getSaslEncoder(). If no Encoder 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 the getSaslEncoder() method/
    • setSaslDecoder

      public static void setSaslDecoder(Decoder decoder)
      Sets an Decoder instance that will be returned from all calls to the getSaslDecoder(). If no Decoder 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 the getSaslDecoder() method/
    • getEncoder

      public static Encoder getEncoder()
      Returns:
      a cached Encoder instance that resulted from a call to getDefaultEncoder() if not set externally.
    • getDecoder

      public static Decoder getDecoder()
      Returns:
      a cached Decoder instance that resulted from a call to getDefaultDecoder() if not set externally.
    • getSaslEncoder

      public static Encoder getSaslEncoder()
      Returns:
      a cached Encoder instance that resulted from a call to getDefaultSaslEncoder() if not set externally.
    • getSaslDecoder

      public static Decoder getSaslDecoder()
      Returns:
      a cached Decoder instance that resulted from a call to getSaslDecoder() 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.
    • getDefaultSaslDecoder

      public static Decoder getDefaultSaslDecoder()
      Returns:
      a new instance of the Proton default SASL only Decoder implementation.