Class StreamFeeder

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Runnable, Stoppable

    public class StreamFeeder
    extends CloseableDaemonThread
    Commands which are sent from plugin to the forked jvm.

    magic number : opcode [: opcode specific data]*
    or data encoded with Base64
    magic number : opcode [: Base64(opcode specific data)]*
    Since:
    3.0.0-M5
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Constructor Summary

      Constructors 
      Constructor Description
      StreamFeeder​(java.lang.String threadName, java.nio.channels.WritableByteChannel channel, CommandReader commandReader, ConsoleLogger logger)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void disable()  
      java.lang.Throwable getException()  
      void run()  
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • channel

        private final java.nio.channels.WritableByteChannel channel
      • disabled

        private volatile boolean disabled
      • exception

        private volatile java.lang.Throwable exception
    • Constructor Detail

      • StreamFeeder

        public StreamFeeder​(@Nonnull
                            java.lang.String threadName,
                            @Nonnull
                            java.nio.channels.WritableByteChannel channel,
                            @Nonnull
                            CommandReader commandReader,
                            @Nonnull
                            ConsoleLogger logger)
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • disable

        public void disable()
      • getException

        public java.lang.Throwable getException()
      • close

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