Class ObjectSerializationCodecFactory

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(java.lang.String... patterns)
      Accept the wildcard specified classes for deserialization, unless they are otherwise rejected.
      void accept​(java.util.regex.Pattern pattern)
      Accept class names that match the supplied pattern for deserialization, unless they are otherwise rejected.
      void accept​(ClassNameMatcher classNameMatcher)
      Accept class names where the supplied ClassNameMatcher matches for deserialization, unless they are otherwise rejected.
      ProtocolDecoder getDecoder​(IoSession session)
      Returns a new (or reusable) instance of ProtocolDecoder which decodes binary or protocol-specific data into message objects.
      int getDecoderMaxObjectSize()  
      ProtocolEncoder getEncoder​(IoSession session)
      Returns a new (or reusable) instance of ProtocolEncoder which encodes message objects into binary or protocol-specific data.
      int getEncoderMaxObjectSize()  
      void setDecoderMaxObjectSize​(int maxObjectSize)
      Sets the allowed maximum size of the object to be decoded.
      void setEncoderMaxObjectSize​(int maxObjectSize)
      Sets the allowed maximum size of the encoded object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ObjectSerializationCodecFactory

        public ObjectSerializationCodecFactory()
        Creates a new instance with the ClassLoader of the current thread.
      • ObjectSerializationCodecFactory

        public ObjectSerializationCodecFactory​(java.lang.ClassLoader classLoader)
        Creates a new instance with the specified ClassLoader.
        Parameters:
        classLoader - The class loader to use
    • Method Detail

      • getEncoderMaxObjectSize

        public int getEncoderMaxObjectSize()
        Returns:
        the allowed maximum size of the encoded object. If the size of the encoded object exceeds this value, the encoder will throw a IllegalArgumentException. The default value is Integer.MAX_VALUE.

        This method does the same job with ObjectSerializationEncoder.getMaxObjectSize().

      • setEncoderMaxObjectSize

        public void setEncoderMaxObjectSize​(int maxObjectSize)
        Sets the allowed maximum size of the encoded object. If the size of the encoded object exceeds this value, the encoder will throw a IllegalArgumentException. The default value is Integer.MAX_VALUE.

        This method does the same job with ObjectSerializationEncoder.setMaxObjectSize(int).

        Parameters:
        maxObjectSize - The maximum size of the encoded object
      • getDecoderMaxObjectSize

        public int getDecoderMaxObjectSize()
        Returns:
        the allowed maximum size of the object to be decoded. If the size of the object to be decoded exceeds this value, the decoder will throw a BufferDataException. The default value is 1048576 (1MB).

        This method does the same job with ObjectSerializationDecoder.getMaxObjectSize().

      • setDecoderMaxObjectSize

        public void setDecoderMaxObjectSize​(int maxObjectSize)
        Sets the allowed maximum size of the object to be decoded. If the size of the object to be decoded exceeds this value, the decoder will throw a BufferDataException. The default value is 1048576 (1MB).

        This method does the same job with ObjectSerializationDecoder.setMaxObjectSize(int).

        Parameters:
        maxObjectSize - The maximum size of the decoded object
      • accept

        public void accept​(ClassNameMatcher classNameMatcher)
        Accept class names where the supplied ClassNameMatcher matches for deserialization, unless they are otherwise rejected.
        Parameters:
        classNameMatcher - the matcher to use
      • accept

        public void accept​(java.util.regex.Pattern pattern)
        Accept class names that match the supplied pattern for deserialization, unless they are otherwise rejected.
        Parameters:
        pattern - standard Java regexp
      • accept

        public void accept​(java.lang.String... patterns)
        Accept the wildcard specified classes for deserialization, unless they are otherwise rejected.
        Parameters:
        patterns - Wildcard file name patterns as defined by FilenameUtils.wildcardMatch