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
    Attributes
    protected
    Definition Classes
    App
  29. def configureLoggerFactories(): Unit

    Permalink
    Definition Classes
    TwitterServer → Logging
  30. def debug(mkr: Marker, msg: ⇒ Any, t: ⇒ Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  31. def debug(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  32. def debug(msg: ⇒ Any): Unit

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

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

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  35. def defaultAppend: Boolean

    Permalink
    Definition Classes
    Logging
  36. def defaultCloseGracePeriod: Duration

    Permalink
    Definition Classes
    App
  37. def defaultFormatter: Formatter

    Permalink
    Definition Classes
    Logging
  38. def defaultHttpPort: Int

    Permalink
    Definition Classes
    AdminHttpServer
  39. def defaultLogLevel: Level

    Permalink
    Definition Classes
    Logging
  40. def defaultOutput: String

    Permalink
    Definition Classes
    Logging
  41. def defaultRollPolicy: Policy

    Permalink
    Definition Classes
    Logging
  42. def defaultRotateCount: Int

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  46. def error(mkr: Marker, msg: ⇒ Any, t: ⇒ Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  47. def error(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  48. def error(msg: ⇒ Any): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  49. def errorResult[T](msg: String)(func: ⇒ T): T

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  50. def exitOnError(reason: String): Unit

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

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

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

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

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

    Permalink
    Definition Classes
    Lifecycle
  56. 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

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

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

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

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

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

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  62. def info(mkr: Marker, msg: ⇒ Any, t: ⇒ Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  63. def info(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  64. def info(msg: ⇒ Any): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  65. def infoResult[T](msg: String)(func: ⇒ T): T

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  66. final def init(f: ⇒ Unit): Unit

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

    Permalink
    Definition Classes
    App
  68. def isDebugEnabled: Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  69. def isErrorEnabled: Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  70. def isInfoEnabled: Boolean

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

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

    Permalink
    Definition Classes
    CloseAwaitably0 → Awaitable
  73. def isTraceEnabled: Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  74. def isWarnEnabled: Boolean

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

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

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

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  78. 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
  79. def linterRules: Seq[Rule]

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

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

    Permalink
    Definition Classes
    Logging
  82. def logger: grizzled.slf4j.Logger

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

    Permalink
    Definition Classes
    Logging
  84. def loggerName: String

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

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

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

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

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

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

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

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

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

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

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

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

    Permalink
    Attributes
    protected
    Definition Classes
    TwitterServer → App
    Annotations
    @Lifecycle()
  97. 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()
  98. final def postmain(f: ⇒ Unit): Unit

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

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

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

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

    Permalink

    Resolve all Finagle clients before warmup method called

    Resolve all Finagle clients before warmup method called

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

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

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

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

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

    Permalink

    Attributes
    protected
    Definition Classes
    TwitterServer → App
    See also

    com.twitter.inject.server.TwitterServer#start

  108. 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
  109. val statsReceiver: StatsReceiver

    Permalink
    Definition Classes
    Stats
  110. 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
  111. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  115. def trace(mkr: Marker, msg: ⇒ Any, t: ⇒ Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  116. def trace(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  117. def trace(msg: ⇒ Any): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  118. final def wait(): Unit

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

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

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

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

    Permalink
    Definition Classes
    Warmup
  123. def warn(mkr: Marker, msg: ⇒ Any, t: ⇒ Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  124. def warn(msg: ⇒ Any, t: ⇒ Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  125. def warn(msg: ⇒ Any): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  126. def warnResult[T](msg: String)(func: ⇒ T): T

    Permalink
    Attributes
    protected
    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 grizzled.slf4j.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