Class CommandDecoder

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class CommandDecoder
    extends org.apache.maven.surefire.api.stream.AbstractStreamDecoder<org.apache.maven.surefire.api.booter.Command,​org.apache.maven.surefire.api.booter.MasterProcessCommand,​org.apache.maven.surefire.api.stream.SegmentType>
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.maven.surefire.api.stream.AbstractStreamDecoder

        org.apache.maven.surefire.api.stream.AbstractStreamDecoder.BufferedStream, org.apache.maven.surefire.api.stream.AbstractStreamDecoder.MalformedFrameException, org.apache.maven.surefire.api.stream.AbstractStreamDecoder.Memento, org.apache.maven.surefire.api.stream.AbstractStreamDecoder.Segment, org.apache.maven.surefire.api.stream.AbstractStreamDecoder.StreamReadStatus
    • Field Summary

      • Fields inherited from class org.apache.maven.surefire.api.stream.AbstractStreamDecoder

        BUFFER_SIZE
    • Constructor Summary

      Constructors 
      Constructor Description
      CommandDecoder​(java.nio.channels.ReadableByteChannel channel, org.apache.maven.surefire.api.fork.ForkNodeArguments arguments)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      protected void debugStream​(byte[] array, int position, int remaining)  
      org.apache.maven.surefire.api.booter.Command decode​(org.apache.maven.surefire.api.stream.AbstractStreamDecoder.Memento memento)  
      protected byte[] getEncodedMagicNumber()  
      protected org.apache.maven.surefire.api.stream.SegmentType[] nextSegmentType​(org.apache.maven.surefire.api.booter.MasterProcessCommand commandType)  
      protected org.apache.maven.surefire.api.booter.Command toMessage​(org.apache.maven.surefire.api.booter.MasterProcessCommand commandType, org.apache.maven.surefire.api.stream.AbstractStreamDecoder.Memento memento)  
      • Methods inherited from class org.apache.maven.surefire.api.stream.AbstractStreamDecoder

        checkArguments, checkDelimiter, checkHeader, getArguments, printRemainingStream, read, readByte, readCharset, readInt, readInteger, readLong, readLongPrivate, readMessageType, readSegment, readString
      • Methods inherited from class java.lang.Object

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

      • CommandDecoder

        public CommandDecoder​(@Nonnull
                              java.nio.channels.ReadableByteChannel channel,
                              @Nonnull
                              org.apache.maven.surefire.api.fork.ForkNodeArguments arguments)
    • Method Detail

      • decode

        public org.apache.maven.surefire.api.booter.Command decode​(@Nonnull
                                                                   org.apache.maven.surefire.api.stream.AbstractStreamDecoder.Memento memento)
                                                            throws java.io.IOException,
                                                                   org.apache.maven.surefire.api.stream.MalformedChannelException
        Specified by:
        decode in class org.apache.maven.surefire.api.stream.AbstractStreamDecoder<org.apache.maven.surefire.api.booter.Command,​org.apache.maven.surefire.api.booter.MasterProcessCommand,​org.apache.maven.surefire.api.stream.SegmentType>
        Throws:
        java.io.IOException
        org.apache.maven.surefire.api.stream.MalformedChannelException
      • getEncodedMagicNumber

        @Nonnull
        protected final byte[] getEncodedMagicNumber()
        Specified by:
        getEncodedMagicNumber in class org.apache.maven.surefire.api.stream.AbstractStreamDecoder<org.apache.maven.surefire.api.booter.Command,​org.apache.maven.surefire.api.booter.MasterProcessCommand,​org.apache.maven.surefire.api.stream.SegmentType>
      • nextSegmentType

        @Nonnull
        protected org.apache.maven.surefire.api.stream.SegmentType[] nextSegmentType​(@Nonnull
                                                                                     org.apache.maven.surefire.api.booter.MasterProcessCommand commandType)
        Specified by:
        nextSegmentType in class org.apache.maven.surefire.api.stream.AbstractStreamDecoder<org.apache.maven.surefire.api.booter.Command,​org.apache.maven.surefire.api.booter.MasterProcessCommand,​org.apache.maven.surefire.api.stream.SegmentType>
      • toMessage

        @Nonnull
        protected org.apache.maven.surefire.api.booter.Command toMessage​(@Nonnull
                                                                         org.apache.maven.surefire.api.booter.MasterProcessCommand commandType,
                                                                         @Nonnull
                                                                         org.apache.maven.surefire.api.stream.AbstractStreamDecoder.Memento memento)
                                                                  throws org.apache.maven.surefire.api.stream.AbstractStreamDecoder.MalformedFrameException
        Specified by:
        toMessage in class org.apache.maven.surefire.api.stream.AbstractStreamDecoder<org.apache.maven.surefire.api.booter.Command,​org.apache.maven.surefire.api.booter.MasterProcessCommand,​org.apache.maven.surefire.api.stream.SegmentType>
        Throws:
        org.apache.maven.surefire.api.stream.AbstractStreamDecoder.MalformedFrameException
      • debugStream

        protected void debugStream​(byte[] array,
                                   int position,
                                   int remaining)
        Overrides:
        debugStream in class org.apache.maven.surefire.api.stream.AbstractStreamDecoder<org.apache.maven.surefire.api.booter.Command,​org.apache.maven.surefire.api.booter.MasterProcessCommand,​org.apache.maven.surefire.api.stream.SegmentType>
      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException