Trait

com.twitter.inject.server

TwitterServer

Related Doc: package server

Permalink

trait TwitterServer extends App with server.TwitterServer with Ports with Warmup with Logging

A com.twitter.server.TwitterServer that supports injection and com.twitter.inject.TwitterModule modules.

To use, override the appropriate @Lifecycle and callback method(s). Make sure when overriding @Lifecycle methods to call the super implementation, otherwise critical lifecycle set-up may not occur causing your server to either function improperly or outright fail.

Typically, you will only need to interact with the following methods:

postWarmup -- create and bind any external interface(s). See com.twitter.inject.app.App#postWarmup start -- callback executed after the injector is created and all @Lifecycle methods have completed.

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TwitterServer
  2. Warmup
  3. Ports
  4. TwitterServer
  5. Stats
  6. Lifecycle
  7. Admin
  8. AdminHttpServer
  9. Hooks
  10. LogFormat
  11. EventSink
  12. Logging
  13. Linters
  14. App
  15. Logging
  16. Logging
  17. App
  18. CloseAwaitably
  19. CloseAwaitably0
  20. Awaitable
  21. Closable
  22. AnyRef
  23. 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
    Definition Classes
    AdminHttpServer
  6. def addAdminRoutes(newRoutes: Seq[Route]): Unit

    Permalink
    Definition Classes
    AdminHttpServer
  7. def addFrameworkModule(module: Module): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    App
  8. def addFrameworkModules(modules: Module*): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    App
  9. def addFrameworkOverrideModules(modules: Module*): Unit

    Permalink
    Attributes
    protected[com.twitter.inject]
    Definition Classes
    App
  10. def adminBoundAddress: InetSocketAddress

    Permalink
    Definition Classes
    AdminHttpServer
  11. var adminHttpServer: ListeningServer

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

    Permalink
    Definition Classes
    AdminHttpServer
  13. def afterPostWarmup(): Unit

    Permalink

    After postWarmup, all external servers have been started, and we can now enable our health endpoint.

    After postWarmup, all external servers have been started, and we can now enable our health endpoint.

    Attributes
    protected
    Definition Classes
    TwitterServer → App
    Annotations
    @Lifecycle()
    See also

    com.twitter.inject.app.App#afterPostwarmup

    com.twitter.server.Lifecycle.Warmup#warmupComplete

  14. def allowUndefinedFlags: Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    App
  15. val appendFlag: Flag[Boolean]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  16. def args: Array[String]

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

    Permalink
    Definition Classes
    Any
  18. val asyncFlag: Flag[Boolean]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  19. val asyncMaxSizeFlag: Flag[Int]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  20. def await(awaitables: Awaitable[_]*): Unit

    Permalink
    Attributes
    protected
  21. def await[T <: Awaitable[_]](awaitable: T): Unit

    Permalink
    Attributes
    protected
  22. def beforePostWarmup(): Unit

    Permalink

    After warmup but before accepting traffic promote to old gen (which triggers gc).

    After warmup but before accepting traffic promote to old gen (which triggers gc).

    Attributes
    protected
    Definition Classes
    TwitterServer → App
    Annotations
    @Lifecycle()
    See also

    com.twitter.inject.app.App#beforePostWarmup

    com.twitter.server.Lifecycle.Warmup#prebindWarmup

  23. def clone(): AnyRef

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

    Permalink
    Definition Classes
    App → Closable
  25. def close(after: Duration): Future[Unit]

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

    Permalink
    Definition Classes
    Closable
  27. def closeAwaitably(f: ⇒ Future[Unit]): Future[Unit]

    Permalink
    Attributes
    protected
    Definition Classes
    CloseAwaitably0
  28. final def closeOnExit(closable: Closable): Unit

    Permalink
    Definition Classes
    App
  29. def configureLoggerFactories(): Unit

    Permalink
    Definition Classes
    TwitterServer → Logging
  30. def debug(marker: Marker, message: ⇒ Any, cause: Throwable): Unit

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

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

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

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  34. def debugFutureResult[T](msg: String)(func: ⇒ Future[T]): Future[T]

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

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  36. def defaultAppend: Boolean

    Permalink
    Definition Classes
    Logging
  37. def defaultCloseGracePeriod: Duration

    Permalink
    Definition Classes
    App
  38. def defaultFormatter: Formatter

    Permalink
    Definition Classes
    Logging
  39. def defaultHttpPort: Int

    Permalink
    Definition Classes
    AdminHttpServer
  40. def defaultLogLevel: Level

    Permalink
    Definition Classes
    Logging
  41. def defaultOutput: String

    Permalink
    Definition Classes
    Logging
  42. def defaultRollPolicy: Policy

    Permalink
    Definition Classes
    Logging
  43. def defaultRotateCount: Int

    Permalink
    Definition Classes
    Logging
  44. 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
  45. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

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

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  52. def exitOnError(reason: String): Unit

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

    Permalink
    Attributes
    protected
    Definition Classes
    TwitterServer → App
  54. def finalize(): Unit

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

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

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

    Permalink
    Definition Classes
    Lifecycle
  58. def handle[T <: Handler]()(implicit arg0: Manifest[T]): Unit

    Permalink

    Utility to run a com.twitter.inject.utils.Handler.

    Utility to run a com.twitter.inject.utils.Handler. This is generally used for running a warmup handler in #warmup.

    T

    - type parameter with upper-bound of com.twitter.inject.utils.Handler

    Attributes
    protected
    See also

    com.twitter.inject.utils.Handler

  59. def handlers: List[() ⇒ Handler]

    Permalink
    Definition Classes
    Logging
  60. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  61. def httpExternalPort: Option[Int]

    Permalink
    Definition Classes
    Ports
  62. def httpsExternalPort: Option[Int]

    Permalink
    Definition Classes
    Ports
  63. val inferClassNamesFlag: Flag[Boolean]

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

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

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

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

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

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

    Permalink
    Attributes
    protected
    Definition Classes
    App
  70. def injector: Injector

    Permalink
    Definition Classes
    App
  71. def isDebugEnabled(marker: Marker): Boolean

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    CloseAwaitably0 → Awaitable
  79. def isTraceEnabled(marker: Marker): Boolean

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

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

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

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  83. def javaModules: Collection[Module]

    Permalink
    Attributes
    protected
    Definition Classes
    App
  84. def javaOverrideModules: Collection[Module]

    Permalink
    Attributes
    protected
    Definition Classes
    App
  85. val levelFlag: Flag[Level]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  86. val 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
    TwitterServer → AdminHttpServer
  87. def linterRules: Seq[Rule]

    Permalink
    Definition Classes
    Linters
  88. def loadModules(): InstalledModules

    Permalink
    Attributes
    protected[com.twitter.inject]
    Definition Classes
    App
  89. lazy val log: Logger

    Permalink
    Definition Classes
    Logging
  90. def logger: Logger

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  91. def loggerFactories: List[LoggerFactory]

    Permalink
    Definition Classes
    Logging
  92. def loggerName: String

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  93. final def main(): Unit

    Permalink
    Definition Classes
    TwitterServer → App
  94. final def main(args: Array[String]): Unit

    Permalink
    Definition Classes
    App
  95. def modules: Seq[Module]

    Permalink
    Attributes
    protected
    Definition Classes
    App
  96. val name: String

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  101. final def onExit(f: ⇒ Unit): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    App
  102. val outputFlag: Flag[String]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  103. def overrideModules: Seq[Module]

    Permalink
    Attributes
    protected
    Definition Classes
    App
  104. def postInjectorStartup(): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    TwitterServer → App
    Annotations
    @Lifecycle()
  105. def postWarmup(): Unit

    Permalink

    If you override this method to create and bind any external interface or to instantiate any awaitable it is expected that you add the Awaitable (or com.twitter.finagle.ListeningServer) to the list of Awaitables using the <: Awaitable[_(awaitable: T): Unit]] function.

    If you override this method to create and bind any external interface or to instantiate any awaitable it is expected that you add the Awaitable (or com.twitter.finagle.ListeningServer) to the list of Awaitables using the <: Awaitable[_(awaitable: T): Unit]] function.

    It is NOT expected that you block in this method as you will prevent completion of the server lifecycle.

    Attributes
    protected
    Definition Classes
    TwitterServer → App
    Annotations
    @Lifecycle()
  106. final def postmain(f: ⇒ Unit): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    App
  107. def prebindWarmup(): Unit

    Permalink
    Definition Classes
    Warmup
  108. final def premain(f: ⇒ Unit): Unit

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

    Permalink
    Definition Classes
    CloseAwaitably0 → Awaitable
  110. def resolveFinagleClientsOnStartup: Boolean

    Permalink

    Resolve all Finagle clients before warmup method called

    Resolve all Finagle clients before warmup method called

    Attributes
    protected
  111. def result(timeout: Duration)(implicit permit: CanAwait): Unit

    Permalink
    Definition Classes
    CloseAwaitably0 → Awaitable
  112. val rollPolicyFlag: Flag[Policy]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  113. val rotateCountFlag: Flag[Int]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  114. def routes: Seq[Route]

    Permalink
    Attributes
    protected
    Definition Classes
    Admin
  115. final def run(): Unit

    Permalink

    Attributes
    protected
    Definition Classes
    TwitterServer → App
    See also

    com.twitter.inject.server.TwitterServer#start

  116. def start(): Unit

    Permalink

    Callback method executed after the injector is created and all lifecycle methods have fully completed.

    Callback method executed after the injector is created and all lifecycle methods have fully completed. It is NOT expected that you block in this method as you will prevent completion of the server lifecycle.

    The server is signaled as STARTED prior to the execution of this callback as all lifecycle methods have successfully completed and the admin and any external interfaces have started.

    This method can be used to start long-lived processes that run in separate threads from the main() thread. It is expected that you manage these threads manually, e.g., by using a com.twitter.util.FuturePool.

    Any exceptions thrown in this method will result in the server exiting.

    Attributes
    protected
  117. val statsReceiver: StatsReceiver

    Permalink
    Definition Classes
    Stats
  118. def statsReceiverModule: Module

    Permalink

    Default com.twitter.inject.TwitterModule for providing a com.twitter.finagle.stats.StatsReceiver.

    Default com.twitter.inject.TwitterModule for providing a com.twitter.finagle.stats.StatsReceiver.

    returns

    a com.twitter.inject.TwitterModule which provides a com.twitter.finagle.stats.StatsReceiver implementation.

    Attributes
    protected
  119. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  120. def thriftPort: Option[Int]

    Permalink
    Definition Classes
    Ports
  121. def time[T](formatStr: String)(func: ⇒ T): T

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  122. def toString(): String

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  131. def warmup(): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    App
    Annotations
    @Lifecycle()
  132. def warmupComplete(): Unit

    Permalink
    Definition Classes
    Warmup
  133. def warn(marker: Marker, message: ⇒ Any, cause: Throwable): Unit

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

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

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

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

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging

Inherited from Warmup

Inherited from Ports

Inherited from server.TwitterServer

Inherited from Stats

Inherited from Lifecycle

Inherited from Admin

Inherited from AdminHttpServer

Inherited from Hooks

Inherited from LogFormat

Inherited from EventSink

Inherited from logging.Logging

Inherited from Linters

Inherited from App

Inherited from Logging

Inherited from util.logging.Logging

Inherited from App

Inherited from CloseAwaitably

Inherited from CloseAwaitably0[Unit]

Inherited from Awaitable[Unit]

Inherited from Closable

Inherited from AnyRef

Inherited from Any

Ungrouped