Trait

com.twitter.inject.app

App

Related Doc: package app

Permalink

trait App extends app.App with Logging

A com.twitter.app.App that supports injection and com.twitter.inject.TwitterModule modules.

It is not expected that you override @Lifecycle methods. If you do, take care to ensure that you call the super implementation, otherwise critical lifecycle set-up may not occur causing your application to either function improperly or outright fail.

Typically, you will only need to interact with the following methods: run -- callback executed after the injector is created and all @Lifecycle methods have completed.

Linear Supertypes
Logging, util.logging.Logging, app.App, CloseAwaitably, CloseAwaitably0[Unit], Awaitable[Unit], Closable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. App
  2. Logging
  3. Logging
  4. App
  5. CloseAwaitably
  6. CloseAwaitably0
  7. Awaitable
  8. Closable
  9. AnyRef
  10. 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 addFrameworkModule(module: Module): Unit

    Permalink

    ONLY INTENDED FOR USE BY THE FRAMEWORK.

    ONLY INTENDED FOR USE BY THE FRAMEWORK.

    Default modules can be overridden in production by overriding methods in your App or Server.

    We take special care to make sure the module is not null, since a common bug is overriding the default methods using a val instead of a def

    Attributes
    protected[com.twitter]
  6. def addFrameworkModules(modules: Module*): Unit

    Permalink

    ONLY INTENDED FOR USE BY THE FRAMEWORK.

    ONLY INTENDED FOR USE BY THE FRAMEWORK.

    Attributes
    protected[com.twitter]
  7. def addFrameworkOverrideModules(modules: Module*): Unit

    Permalink

    ONLY INTENDED FOR USE BY THE FRAMEWORK.

    ONLY INTENDED FOR USE BY THE FRAMEWORK.

    Attributes
    protected[com.twitter.inject]
  8. def afterPostWarmup(): Unit

    Permalink

    Method to be be called after port warmup

    Method to be be called after port warmup

    Attributes
    protected
    Annotations
    @Lifecycle()
  9. def allowUndefinedFlags: Boolean

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

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

    Permalink
    Definition Classes
    Any
  12. def beforePostWarmup(): Unit

    Permalink

    Method to be called after successful warmup but before application initialization

    Method to be called after successful warmup but before application initialization

    Attributes
    protected
    Annotations
    @Lifecycle()
  13. def clone(): AnyRef

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

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

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

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

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

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

    Permalink
    Definition Classes
    App
  20. def debug(marker: Marker, message: ⇒ Any, cause: Throwable): Unit

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

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

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

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

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

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  26. def defaultCloseGracePeriod: Duration

    Permalink
    Definition Classes
    App
  27. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  41. def hashCode(): Int

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

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

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

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

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

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

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

    Permalink
  49. def isDebugEnabled(marker: Marker): Boolean

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

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

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

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

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

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

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

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

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

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

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

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

    Permalink

    Production modules from Java.

    Production modules from Java.

    Attributes
    protected
  62. def javaOverrideModules: Collection[Module]

    Permalink

    ONLY INTENDED FOR USE IN TESTING.

    ONLY INTENDED FOR USE IN TESTING.

    Override modules from Java which redefine production bindings (only use overrideModules during testing) If you think you need this in your main server you are most likely doing something incorrectly.

    Attributes
    protected
  63. def loadModules(): InstalledModules

    Permalink

    ONLY INTENDED FOR USE BY THE FRAMEWORK.

    ONLY INTENDED FOR USE BY THE FRAMEWORK.

    Attributes
    protected[com.twitter.inject]
  64. def loadServiceBindings: Seq[Binding[_]]

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

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

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging
  67. def main(): Unit

    Permalink

    DO NOT BLOCK

  68. final def main(args: Array[String]): Unit

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

    Permalink

    Production modules.

    Production modules.

    Attributes
    protected
    Note

    Java users should prefer javaModules.

  70. val name: String

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

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

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

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

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

    Permalink
    Attributes
    protected
    Definition Classes
    App
  76. def overrideModules: Seq[Module]

    Permalink

    ONLY INTENDED FOR USE IN TESTING.

    ONLY INTENDED FOR USE IN TESTING.

    Override modules which redefine production bindings (only use overrideModules during testing) If you think you need this in your main server you are most likely doing something incorrectly.

    Attributes
    protected
  77. def parseArgs(args: Array[String]): Unit

    Permalink
    Attributes
    protected[this]
    Definition Classes
    App
  78. def postInjectorStartup(): Unit

    Permalink

    Method to be called after injector creation

    Method to be called after injector creation

    Attributes
    protected
    Annotations
    @Lifecycle()
  79. def postWarmup(): Unit

    Permalink

    Method to be called after successful warmup

    Method to be called after successful warmup

    Attributes
    protected
    Annotations
    @Lifecycle()
  80. final def postmain(f: ⇒ Unit): Unit

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

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

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

    Permalink
    Definition Classes
    CloseAwaitably0 → Awaitable
  84. def run(): 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.

    The app is signaled as STARTED prior to the execution of this callback as all lifecycle methods have successfully completed.

    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 app exiting.

    Attributes
    protected
  85. lazy val shutdownTimer: Timer

    Permalink
    Attributes
    protected
    Definition Classes
    App
  86. def suppressGracefulShutdownErrors: Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    App
  87. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

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

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

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

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

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

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

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

    Permalink

    Callback method run before postWarmup

    Callback method run before postWarmup

    Attributes
    protected
  99. def warn(marker: Marker, message: ⇒ Any, cause: Throwable): Unit

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

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

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

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

    Permalink
    Attributes
    protected[this]
    Definition Classes
    Logging

Inherited from Logging

Inherited from util.logging.Logging

Inherited from app.App

Inherited from CloseAwaitably

Inherited from CloseAwaitably0[Unit]

Inherited from Awaitable[Unit]

Inherited from Closable

Inherited from AnyRef

Inherited from Any

Ungrouped