Class AbstractInputStreamLookup

java.lang.Object
com.comphenix.protocol.injector.server.AbstractInputStreamLookup

public abstract class AbstractInputStreamLookup extends Object
  • Field Details

    • reporter

      protected final ErrorReporter reporter
    • server

      protected final org.bukkit.Server server
  • Constructor Details

    • AbstractInputStreamLookup

      protected AbstractInputStreamLookup(ErrorReporter reporter, org.bukkit.Server server)
  • Method Details

    • inject

      public abstract void inject(Object container)
      Inject the given server thread or dedicated connection.
      Parameters:
      container - - class that contains a ServerSocket field.
    • waitSocketInjector

      public abstract SocketInjector waitSocketInjector(InputStream input)
      Retrieve the associated socket injector for a player.
      Parameters:
      input - - the indentifying filtered input stream.
      Returns:
      The socket injector we have associated with this player.
    • waitSocketInjector

      public abstract SocketInjector waitSocketInjector(Socket socket)
      Retrieve an injector by its socket.
      Parameters:
      socket - - the socket.
      Returns:
      The socket injector.
    • waitSocketInjector

      public abstract SocketInjector waitSocketInjector(SocketAddress address)
      Retrieve a injector by its address.
      Parameters:
      address - - the address of the socket.
      Returns:
      The socket injector, or NULL if not found.
    • peekSocketInjector

      public abstract SocketInjector peekSocketInjector(SocketAddress address)
      Attempt to get a socket injector without blocking the thread.
      Parameters:
      address - - the address to lookup.
      Returns:
      The socket injector, or NULL if not found.
    • setSocketInjector

      public abstract void setSocketInjector(SocketAddress address, SocketInjector injector)
      Associate a given socket address to the provided socket injector.
      Parameters:
      address - - the socket address to associate.
      injector - - the injector.
    • onPreviousSocketOverwritten

      protected void onPreviousSocketOverwritten(SocketInjector previous, SocketInjector current)
      If a player can hold a reference to its parent injector, this method will update that reference.
      Parameters:
      previous - - the previous injector.
      current - - the new injector.
    • cleanupAll

      public abstract void cleanupAll()
      Invoked when the injection should be undone.