Packages

class NetworkClient extends AutoCloseable

A NetworkClient connects to a running sbt instance or starts a new instance if there isn't already one running. Once connected, it can send commands for sbt to run, it can send completions to sbt and print the completions to stdout so that a shell can consume the completions or it can enter an interactive sbt shell session in which it relays io bytes between sbt and the terminal.

Self Type
NetworkClient
Linear Supertypes
AutoCloseable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NetworkClient
  2. AutoCloseable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new NetworkClient(configuration: AppConfiguration, args: List[String])
  2. new NetworkClient(configuration: AppConfiguration, arguments: Arguments)
  3. new NetworkClient(arguments: Arguments, console: ConsoleInterface, inputStream: InputStream, errorStream: PrintStream, printStream: PrintStream, useJNI: Boolean)

    arguments

    the arguments for the forked sbt server if the client needs to start it. It also contains the sbt command arguments to send to the server if any are present.

    console

    a logging instance. This can use a ConsoleAppender or just simply print to a PrintStream.

    inputStream

    the InputStream from which the client reads bytes. It is not hardcoded to System.in so that a NetworkClient can be remotely controlled by a java process, which is useful in testing.

    errorStream

    the sink for messages that we always want to be printed. It is usually System.err but could be overridden in tests or set to a null OutputStream if the NetworkClient needs to be silent.

    printStream

    the sink for standard out messages. It is typically System.out but in the case of completions, the bytes written to System.out are usually treated as completion results so we need to reroute standard out messages to System.err. It's also useful to override this in testing.

    useJNI

    toggles whether or not to use the jni based implementations in org.scalasbt.ipcsocket. These are only available on 64 bit linux, mac and windows. Any other platform will need to fall back on jna.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def batchExecute(userCommands: List[String]): Int
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  7. def close(): Unit
    Definition Classes
    NetworkClient → AutoCloseable
  8. def connect(log: Boolean, promptCompleteUsers: Boolean): Boolean
  9. def connection: ServerConnection
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def getCompletions(query: String): Seq[String]
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def init(promptCompleteUsers: Boolean, retry: Boolean): ServerConnection
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def messageTypeToLevel(severity: Long): util.Level.Value
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. def onNotification(msg: JsonRpcNotificationMessage): Unit
  23. def onRequest(msg: JsonRpcRequestMessage): Unit
  24. def onResponse(msg: JsonRpcResponseMessage): Unit
  25. def onReturningReponse(msg: JsonRpcResponseMessage): Unit

    Called on the response for a returning message.

  26. def run(): Int
  27. def sendCancelAllCommand(): LinkedBlockingQueue[Boolean]
  28. def sendCommand(command: CommandMessage): Unit
  29. def sendCommandResponse(method: String, command: EventMessage, id: String): Unit
  30. def sendExecCommand(commandLine: String): LinkedBlockingQueue[Integer]
  31. def sendJson(method: String, params: String, uuid: String): Unit
  32. def sendJson(method: String, params: String): String
  33. def sendNotification(method: String, params: String): Unit
  34. def splitDiagnostics(params: PublishDiagnosticsParams): Vector[(util.Level.Value, String)]
  35. def splitLogMessage(params: LogMessageParams): Vector[(util.Level.Value, String)]
  36. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  37. def toString(): String
    Definition Classes
    AnyRef → Any
  38. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  41. def waitForServer(portfile: File, log: Boolean, startServer: Boolean): Unit

    Forks another instance of sbt in the background.

    Forks another instance of sbt in the background. This instance must be shutdown explicitly via sbt -client shutdown

Inherited from AutoCloseable

Inherited from AnyRef

Inherited from Any

Ungrouped