Trait

com.twitter.server

TwitterServer

Related Doc: package server

Permalink

trait TwitterServer extends App with Slf4jBridge with Logging with Stats with Linters with DtabFlags with Hooks with AdminHttpServer with Lifecycle

Twitter Server defines a template from which servers at Twitter are built. It provides common application components such as an administrative HTTP server, tracing, stats, etc. These features are wired in correctly for use in production at Twitter.

For DI (Dependency Injection) Twitter Server uses self-typed Scala traits that might be mixed in the TwitterServer trait. The common practice is to define self-typed traits against the App trait as shown below.

import com.twitter.app.App
import com.twitter.server.TwitterServer

trait MyModule { self: App =>
  // module logic
}

object MyApp extends TwitterServer with MyModule {
  // app logic
}

Note: the Slf4jBridge trait MUST be defined first to properly bridge legacy logging APIs.

Linear Supertypes
Lifecycle, AdminHttpServer, Hooks, DtabFlags, Linters, Stats, Logging, Slf4jBridge, App, app.Lifecycle, CloseOnceAwaitably, CloseOnceAwaitably0[Unit], Awaitable[Unit], ClosableOnce, CloseOnce, Closable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TwitterServer
  2. Lifecycle
  3. AdminHttpServer
  4. Hooks
  5. DtabFlags
  6. Linters
  7. Stats
  8. Logging
  9. Slf4jBridge
  10. App
  11. Lifecycle
  12. CloseOnceAwaitably
  13. CloseOnceAwaitably0
  14. Awaitable
  15. ClosableOnce
  16. CloseOnce
  17. Closable
  18. AnyRef
  19. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final val MinGrace: Duration

    Permalink
    Definition Classes
    App
  5. def addAdminRoute(route: Route): Unit

    Permalink

    Add a Route into admin http server.

    Add a Route into admin http server.

    Definition Classes
    AdminHttpServer
  6. def addAdminRoutes(newRoutes: Seq[Route]): Unit

    Permalink

    Add a collection of Routes into admin http server.

    Add a collection of Routes into admin http server.

    Definition Classes
    AdminHttpServer
  7. def addDtabs(): Unit

    Permalink
    Definition Classes
    DtabFlags
  8. def adminBoundAddress: InetSocketAddress

    Permalink

    The address to which the Admin HTTP server is bound.

    The address to which the Admin HTTP server is bound.

    Definition Classes
    AdminHttpServer
  9. var adminHttpServer: ListeningServer

    Permalink
    Attributes
    protected
    Definition Classes
    AdminHttpServer
  10. val adminPort: Flag[InetSocketAddress]

    Permalink
    Definition Classes
    AdminHttpServer
  11. def allowUndefinedFlags: Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    App
  12. def args: Array[String]

    Permalink
    Definition Classes
    App
  13. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. final def close(deadline: Time): Future[Unit]

    Permalink
    Definition Classes
    CloseOnce
  16. def close(after: Duration): Future[Unit]

    Permalink
    Definition Classes
    Closable
  17. final def close(): Future[Unit]

    Permalink
    Definition Classes
    Closable
  18. final def closeFuture: Future[Unit]

    Permalink
    Attributes
    protected
    Definition Classes
    CloseOnce
  19. final def closeOnExit(closable: Closable): Unit

    Permalink
    Definition Classes
    App
  20. final def closeOnExitLast(closable: Closable): Unit

    Permalink
    Definition Classes
    App
  21. def closeOnce(deadline: Time): Future[Unit]

    Permalink
    Attributes
    protected
    Definition Classes
    App → CloseOnce
  22. def configureAdminHttpServer(server: Server): Server

    Permalink

    This method allows for further configuration of the http server for parameters not exposed by this trait or for overriding defaults provided herein, e.g.,

    This method allows for further configuration of the http server for parameters not exposed by this trait or for overriding defaults provided herein, e.g.,

    override def configureAdminHttpServer(server: Http.Server): Http.Server =
     server.withMonitor(myMonitor)
    server

    - the com.twitter.finagle.Http.Server to configure.

    returns

    a configured Http.Server.

    Attributes
    protected
    Definition Classes
    AdminHttpServer
  23. def debug(marker: Marker, message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  24. def debug(message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  25. def debug(marker: Marker, message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  26. def debug(message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  27. def debugResult[T](message: ⇒ String)(fn: ⇒ T): T

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  28. def defaultAdminPort: Int

    Permalink
    Definition Classes
    AdminHttpServer
  29. def defaultCloseGracePeriod: Duration

    Permalink
    Definition Classes
    App
  30. def disableAdminHttpServer: Boolean

    Permalink

    If true, the Twitter-Server admin server will be disabled.

    If true, the Twitter-Server admin server will be disabled. Note: Disabling the admin server allows services to be deployed into environments where only a single port is allowed

    Attributes
    protected
    Definition Classes
    AdminHttpServer
  31. val dtabAddBaseFlag: Flag[Dtab]

    Permalink
    Definition Classes
    DtabFlags
  32. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  33. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  34. def error(marker: Marker, message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  35. def error(message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  36. def error(marker: Marker, message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  37. def error(message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  38. def errorResult[T](message: ⇒ String)(fn: ⇒ T): T

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  39. def exitOnError(reason: String, details: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    App
  40. def exitOnError(reason: String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    App
  41. def exitOnError(throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    App
  42. def failfastOnFlagsNotParsed: Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    App
  43. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  44. val flag: Flags

    Permalink
    Definition Classes
    App
  45. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  46. val group: String

    Permalink
    Definition Classes
    Lifecycle
  47. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  48. def info(marker: Marker, message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  49. def info(message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  50. def info(marker: Marker, message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  51. def info(message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  52. def infoResult[T](message: ⇒ String)(fn: ⇒ T): T

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  53. final def init(f: ⇒ Unit): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    App
  54. final def isClosed: Boolean

    Permalink
    Definition Classes
    CloseOnce
  55. def isDebugEnabled(marker: Marker): Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  56. def isDebugEnabled: Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  57. def isErrorEnabled(marker: Marker): Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  58. def isErrorEnabled: Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  59. def isInfoEnabled(marker: Marker): Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  60. def isInfoEnabled: Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  61. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  62. def isReady(implicit permit: CanAwait): Boolean

    Permalink
    Definition Classes
    CloseOnceAwaitably0 → Awaitable
  63. def isTraceEnabled(marker: Marker): Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  64. def isTraceEnabled: Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  65. def isWarnEnabled(marker: Marker): Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  66. def isWarnEnabled: Boolean

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  67. def libraryName: String

    Permalink

    Name used for registration in the com.twitter.util.registry.Library

    Name used for registration in the com.twitter.util.registry.Library

    returns

    library name to register in the Library registry.

    Attributes
    protected
    Definition Classes
    AdminHttpServer
  68. def linterRules: Seq[Rule]

    Permalink

    Exposed for testing

    Exposed for testing

    Definition Classes
    Linters
  69. def loadServiceBindings: Seq[Binding[_]]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    App
  70. final def logger: Logger

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  71. final def loggerName: String

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  72. final def main(args: Array[String]): Unit

    Permalink
    Definition Classes
    App
  73. val name: String

    Permalink
    Definition Classes
    App
  74. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  75. final def nonExitingMain(args: Array[String]): Unit

    Permalink
    Definition Classes
    App
  76. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  77. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  78. final def observe(event: Event)(f: ⇒ Unit): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Lifecycle
  79. final def observeFuture(event: Event)(f: Future[Unit]): Future[Unit]

    Permalink
    Attributes
    protected
    Definition Classes
    Lifecycle
  80. final def onExit(f: ⇒ Unit): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    App
  81. final def onExitLast(f: ⇒ Unit): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    App
  82. def parseArgs(args: Array[String]): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    App
  83. final def postmain(f: ⇒ Unit): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    App
  84. final def premain(f: ⇒ Unit): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    App
  85. def ready(timeout: Duration)(implicit permit: CanAwait): TwitterServer.this.type

    Permalink
    Definition Classes
    CloseOnceAwaitably0 → Awaitable
  86. def result(timeout: Duration)(implicit permit: CanAwait): Unit

    Permalink
    Definition Classes
    CloseOnceAwaitably0 → Awaitable
  87. def routes: Seq[Route]

    Permalink

    Get all Routes of admin http server.

    Get all Routes of admin http server.

    Definition Classes
    AdminHttpServer
  88. lazy val shutdownTimer: Timer

    Permalink

    Use the Finagle DefaultTimer

    Use the Finagle DefaultTimer

    Attributes
    protected
    Definition Classes
    TwitterServer → App
  89. def startupCompletionEvent: Event

    Permalink
    Attributes
    protected[com.twitter]
  90. def statsReceiver: StatsReceiver

    Permalink

    This returns the global LoadedStatsReceiver instance.

    This returns the global LoadedStatsReceiver instance.

    returns

    a StatsReceiver instance.

    Definition Classes
    Stats
    See also

    com.twitter.finagle.stats.LoadedStatsReceiver

  91. final val suppressGracefulShutdownErrors: Boolean

    Permalink

    Don't let applications opt-out

    Don't let applications opt-out

    Definition Classes
    TwitterServer → App
  92. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  93. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  94. def trace(marker: Marker, message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  95. def trace(message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  96. def trace(marker: Marker, message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  97. def trace(message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  98. def traceResult[T](message: ⇒ String)(fn: ⇒ T): T

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  99. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  100. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  101. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  102. def warn(marker: Marker, message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  103. def warn(message: ⇒ Any, cause: Throwable): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  104. def warn(marker: Marker, message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  105. def warn(message: ⇒ Any): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  106. def warnResult[T](message: ⇒ String)(fn: ⇒ T): T

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging

Inherited from Lifecycle

Inherited from AdminHttpServer

Inherited from Hooks

Inherited from DtabFlags

Inherited from Linters

Inherited from Stats

Inherited from Logging

Inherited from Slf4jBridge

Inherited from App

Inherited from app.Lifecycle

Inherited from CloseOnceAwaitably

Inherited from CloseOnceAwaitably0[Unit]

Inherited from Awaitable[Unit]

Inherited from ClosableOnce

Inherited from CloseOnce

Inherited from Closable

Inherited from AnyRef

Inherited from Any

Ungrouped