abstract class AbstractTwitterServer extends AbstractApp with TwitterServer
AbstractTwitterServer for usage from Java
- Alphabetic
- By Inheritance
- AbstractTwitterServer
- TwitterServer
- Warmup
- Ports
- DeprecatedLogging
- Logging
- TwitterServer
- Lifecycle
- AdminHttpServer
- Hooks
- DtabFlags
- Linters
- Stats
- Slf4jBridge
- AbstractApp
- App
- Logging
- Logging
- App
- Lifecycle
- CloseOnceAwaitably
- CloseOnceAwaitably0
- Awaitable
- ClosableOnce
- CloseOnce
- Closable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new AbstractTwitterServer()
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final val MinGrace: Duration
- Definition Classes
- App
- def addAdminRoute(route: Route): Unit
- Definition Classes
- AdminHttpServer
- def addAdminRoutes(newRoutes: Seq[Route]): Unit
- Definition Classes
- AdminHttpServer
- def addDtabs(): Unit
- Definition Classes
- DtabFlags
- def addFrameworkModule(module: Module): Unit
- Attributes
- protected[twitter]
- Definition Classes
- App
- def addFrameworkModules(modules: Module*): Unit
- Attributes
- protected[twitter]
- Definition Classes
- App
- def addFrameworkOverrideModules(modules: Module*): Unit
- Attributes
- protected[inject]
- Definition Classes
- App
- def adminBoundAddress: InetSocketAddress
- Definition Classes
- AdminHttpServer
- val adminHttpServer: ListeningServer
- Attributes
- protected
- Definition Classes
- AdminHttpServer
- Annotations
- @volatile()
- val adminPort: Flag[InetSocketAddress]
- Definition Classes
- AdminHttpServer
- def afterPostWarmup(): Unit
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()
- Note
You MUST call
,super.afterPostWarmup()in any overridden definition of this method. Failure to do so may cause your server to not completely startup.It is NOT expected that you block in this method as you will prevent completion of the server lifecycle.
- See also
com.twitter.inject.app.App#afterPostwarmup
- def allowUndefinedFlags: Boolean
- Attributes
- protected
- Definition Classes
- App
- val appendFlag: Flag[Boolean]
- Attributes
- protected[this]
- Definition Classes
- Logging
- def args: Array[String]
- Definition Classes
- App
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val asyncFlag: Flag[Boolean]
- Attributes
- protected[this]
- Definition Classes
- Logging
- val asyncMaxSizeFlag: Flag[Int]
- Attributes
- protected[this]
- Definition Classes
- Logging
- def await(awaitables: Awaitable[_]*): Unit
Callback to register multiple Awaitable instances for the server to await (block) on.
Callback to register multiple Awaitable instances for the server to await (block) on.
- awaitables
vararg list of Awaitable instances to register.
- Attributes
- protected
- Definition Classes
- TwitterServer
- See also
Awaitable)
- def await[T <: Awaitable[_]](awaitable: T): Unit
Callback to register an Awaitable instance for the server to await (block) on.
Callback to register an Awaitable instance for the server to await (block) on.
All registered Awaitable instances are entangled by the server such that if any registered Awaitable exits it will trigger all registered Awaitable instances to exit.
- awaitable
an Awaitable instance to register.
- Attributes
- protected
- Definition Classes
- TwitterServer
- See also
- def beforePostWarmup(): Unit
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()
- Note
You MUST call
,super.beforePostWarmup()in any overridden definition of this method. Failure to do so may cause your server to not completely startup.It is NOT expected that you block in this method as you will prevent completion of the server lifecycle.
- See also
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def close(deadline: Time): Future[Unit]
- Definition Classes
- CloseOnce → Closable
- def close(after: Duration): Future[Unit]
- Definition Classes
- Closable
- final def close(): Future[Unit]
- Definition Classes
- Closable
- final def closeFuture: Future[Unit]
- Attributes
- protected
- Definition Classes
- CloseOnce
- final def closeOnExit(closable: Closable): Unit
- Definition Classes
- App
- final def closeOnExitLast(closable: Closable): Unit
- Definition Classes
- App
- def closeOnce(deadline: Time): Future[Unit]
- Attributes
- protected
- Definition Classes
- App → CloseOnce
- def configureAdminHttpServer(server: Server): Server
- Attributes
- protected
- Definition Classes
- AdminHttpServer
- def configureLoggerFactories(): Unit
com.twitter.logging.Logging.configureLoggerFactories() removes all added JUL handlers and adds only handlers defined by com.twitter.logging.Logging.loggerFactories.
com.twitter.logging.Logging.configureLoggerFactories() removes all added JUL handlers and adds only handlers defined by com.twitter.logging.Logging.loggerFactories.
Logging.configureLoggerFactorieswould thus remove the installed SLF4J BridgeHandler from com.twitter.server.TwitterServer. Therefore, we override with a no-op to prevent the SLF4J BridgeHandler from being removed.- Attributes
- protected
- Definition Classes
- DeprecatedLogging → Logging
- Note
Subclasses MUST override this method with an implementation that configures the
com.twitter.logging.Loggerif they want to use their configured logger factories via the util-logging style of configuration.- See also
- final def createFlag[T](name: String, default: T, help: String, flaggable: Flaggable[T]): Flag[T]
- Definition Classes
- AbstractApp
- final def createMandatoryFlag[T](name: String, help: String, usage: String, flaggable: Flaggable[T]): Flag[T]
- Definition Classes
- AbstractApp
- def debug(marker: Marker, message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def debug(message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def debug(marker: Marker, message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def debug(message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def debugFutureResult[T](msg: String)(func: => Future[T]): Future[T]
- Attributes
- protected
- Definition Classes
- Logging
- def debugResult[T](message: => String)(fn: => T): T
- Attributes
- protected[this]
- Definition Classes
- Logging
- def defaultAdminPort: Int
- Definition Classes
- AdminHttpServer
- def defaultAppend: Boolean
- Definition Classes
- Logging
- def defaultCloseGracePeriod: Duration
- Definition Classes
- App
- def defaultFormatter: Formatter
- Definition Classes
- Logging
- def defaultLogLevel: Level
- Definition Classes
- Logging
- def defaultOutput: String
- Definition Classes
- Logging
- def defaultRollPolicy: Policy
- Definition Classes
- Logging
- def defaultRotateCount: Int
- Definition Classes
- Logging
- def disableAdminHttpServer: Boolean
- Attributes
- protected
- Definition Classes
- AdminHttpServer
- val dtabAddBaseFlag: Flag[Dtab]
- Definition Classes
- DtabFlags
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def error(marker: Marker, message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def error(message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def error(marker: Marker, message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def error(message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def errorResult[T](message: => String)(fn: => T): T
- Attributes
- protected[this]
- Definition Classes
- Logging
- def exitOnError(reason: String, details: => String): Unit
- Attributes
- protected
- Definition Classes
- App
- def exitOnError(reason: String): Unit
- Attributes
- protected
- Definition Classes
- App
- def exitOnError(throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- App
- def failfastOnFlagsNotParsed: Boolean
- Attributes
- protected
- Definition Classes
- App → App
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def flag: app.Flags
- Definition Classes
- App
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val group: String
- Definition Classes
- Lifecycle
- def handle(clazz: Class[_ <: Handler]): Unit
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 TwitterServer.warmup.
- Attributes
- protected
- Definition Classes
- TwitterServer
- See also
- def handle[T <: Handler]()(implicit arg0: Manifest[T]): Unit
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 TwitterServer.warmup.
- T
- type parameter with upper-bound of com.twitter.inject.utils.Handler
- Attributes
- protected
- Definition Classes
- TwitterServer
- See also
- def handlers: List[() => Handler]
- Definition Classes
- Logging
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def httpExternalPort: Option[Int]
- Definition Classes
- Ports
- def httpsExternalPort: Option[Int]
- Definition Classes
- Ports
- def includeGlobalFlags: Boolean
- Attributes
- protected
- Definition Classes
- App
- val inferClassNamesFlag: Flag[Boolean]
- Attributes
- protected[this]
- Definition Classes
- Logging
- def info(marker: Marker, message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def info(message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def info(marker: Marker, message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def info(message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def infoResult[T](message: => String)(fn: => T): T
- Attributes
- protected[this]
- Definition Classes
- Logging
- final def init(f: => Unit): Unit
- Attributes
- protected
- Definition Classes
- App
- def injector: Injector
- Definition Classes
- App
- final def isClosed: Boolean
- Definition Classes
- CloseOnce
- def isDebugEnabled(marker: Marker): Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isDebugEnabled: Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isErrorEnabled(marker: Marker): Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isErrorEnabled: Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isInfoEnabled(marker: Marker): Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isInfoEnabled: Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isReady(implicit permit: CanAwait): Boolean
- Definition Classes
- CloseOnceAwaitably0 → Awaitable
- def isTraceEnabled(marker: Marker): Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isTraceEnabled: Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isWarnEnabled(marker: Marker): Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def isWarnEnabled: Boolean
- Attributes
- protected[this]
- Definition Classes
- Logging
- def javaModules: Collection[Module]
- Attributes
- protected
- Definition Classes
- App
- def javaOverrideModules: Collection[Module]
- Attributes
- protected
- Definition Classes
- App
- val levelFlag: Flag[Level]
- Attributes
- protected[this]
- Definition Classes
- Logging
- def libraryName: String
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
- def linterRules: Seq[Rule]
- Definition Classes
- Linters
- def loadModules(): InstalledModules
- Attributes
- protected[inject]
- Definition Classes
- App
- def loadServiceBindings: Seq[Binding[_]]
- Attributes
- protected[this]
- Definition Classes
- App
- final def logger: Logger
- Attributes
- protected[this]
- Definition Classes
- Logging
- def loggerFactories: List[LoggerFactory]
- Definition Classes
- Logging
- final def loggerName: String
- Attributes
- protected[this]
- Definition Classes
- Logging
- final def main(): Unit
- Definition Classes
- TwitterServer → App
- final def main(args: Array[String]): Unit
- Definition Classes
- App
- def modules: Seq[Module]
- Attributes
- protected
- Definition Classes
- App
- def name: String
- Definition Classes
- App
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def nonExitingMain(args: Array[String]): Unit
- Definition Classes
- App
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def observe(event: Event)(f: => Unit): Unit
- Attributes
- protected
- Definition Classes
- Lifecycle
- final def observeFuture(event: Event)(f: Future[Unit]): Future[Unit]
- Attributes
- protected
- Definition Classes
- Lifecycle
- def onExit(): Unit
- Definition Classes
- AbstractApp
- final def onExit(f: => Unit): Unit
- Attributes
- protected
- Definition Classes
- App
- def onExitLast(): Unit
- Definition Classes
- AbstractApp
- final def onExitLast(f: => Unit): Unit
- Attributes
- protected
- Definition Classes
- App
- def onInit(): Unit
- Definition Classes
- AbstractApp
- val outputFlag: Flag[String]
- Attributes
- protected[this]
- Definition Classes
- Logging
- def overrideModules: Seq[Module]
- Attributes
- protected
- Definition Classes
- App
- def parseArgs(args: Array[String]): Unit
- Attributes
- protected[this]
- Definition Classes
- App
- def postInjectorStartup(): Unit
After creation of the Injector.
After creation of the Injector. Before any other lifecycle methods.
- Attributes
- protected
- Definition Classes
- TwitterServer → App
- Annotations
- @Lifecycle()
- Note
You MUST call
,super.postInjectorStartup()in any overridden definition of this method. Failure to do so may cause your server to not completely startup.It is NOT expected that you block in this method as you will prevent completion of the server lifecycle.
- def postMain(): Unit
- Definition Classes
- AbstractApp
- def postWarmup(): Unit
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
await[T <: Awaitable[_(awaitable: T): Unitfunction.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
await[T <: Awaitable[_(awaitable: T): Unitfunction.- Attributes
- protected
- Definition Classes
- TwitterServer → App
- Annotations
- @Lifecycle()
- Note
You MUST call
,super.postWarmup()in any overridden definition of this method. Failure to do so may cause your server to not completely startup.It is NOT expected that you block in this method as you will prevent completion of the server lifecycle.
- final def postmain(f: => Unit): Unit
- Attributes
- protected
- Definition Classes
- App
- def preMain(): Unit
- Definition Classes
- AbstractApp
- def prebindWarmup(): Unit
- Definition Classes
- Warmup
- final def premain(f: => Unit): Unit
- Attributes
- protected
- Definition Classes
- App
- def ready(timeout: Duration)(implicit permit: CanAwait): AbstractTwitterServer.this.type
- Definition Classes
- CloseOnceAwaitably0 → Awaitable
- def resolveFinagleClientsOnStartup: Boolean
Resolve all Finagle clients before warmup method called
Resolve all Finagle clients before warmup method called
- Attributes
- protected
- Definition Classes
- TwitterServer
- def result(timeout: Duration)(implicit permit: CanAwait): Unit
- Definition Classes
- CloseOnceAwaitably0 → Awaitable
- val rollPolicyFlag: Flag[Policy]
- Attributes
- protected[this]
- Definition Classes
- Logging
- val rotateCountFlag: Flag[Int]
- Attributes
- protected[this]
- Definition Classes
- Logging
- def routes: Seq[Route]
- Definition Classes
- AdminHttpServer
- final def run(): Unit
- Attributes
- protected
- Definition Classes
- TwitterServer → App
- See also
- final def runOnExit(runnable: Runnable): Unit
- Attributes
- protected
- Definition Classes
- App
- final def runOnExitLast(runnable: Runnable): Unit
- Attributes
- protected
- Definition Classes
- App
- def setup(): Unit
Callback method which is executed specifically in the
postInjectorStartuplifecycle phase of this server.Callback method which is executed specifically in the
postInjectorStartuplifecycle phase of this server.This is AFTER the injector is created but BEFORE server warmup has been performed.
This method is thus suitable for starting and awaiting on PubSub publishers or subscribers.
The server is NOT signaled to be started until AFTER this method has executed thus it is imperative that this method is NOT BLOCKED as it will cause the server to not complete startup.
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.
If you override this method to instantiate any com.twitter.util.Awaitable it is expected that you add the com.twitter.util.Awaitable to the list of
Awaitablesusing theawait[T <: Awaitable[_]](awaitable: T): Unitfunction if you want the server to exit when the com.twitter.util.Awaitable exits.Any exceptions thrown in this method will result in the server exiting.
- Attributes
- protected
- Definition Classes
- TwitterServer
- lazy val shutdownTimer: Timer
- Attributes
- protected
- Definition Classes
- TwitterServer → App
- def start(): Unit
Callback method which is executed after the injector is created and all lifecycle methods have fully completed but before awaiting on any Awaitables.
Callback method which is executed after the injector is created and all lifecycle methods have fully completed but before awaiting on any Awaitables. 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
- Definition Classes
- TwitterServer
- final def startupCompletionEvent: Event
- Attributes
- protected[twitter]
- Definition Classes
- TwitterServer → Warmup → TwitterServer
- def statsReceiver: StatsReceiver
- Definition Classes
- Stats
- def statsReceiverModule: Module
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
- Definition Classes
- TwitterServer
- final val suppressGracefulShutdownErrors: Boolean
- Definition Classes
- TwitterServer → App
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def thriftPort: Option[Int]
- Definition Classes
- Ports
- def time[T](formatStr: String)(func: => T): T
- Attributes
- protected
- Definition Classes
- Logging
- def toString(): String
- Definition Classes
- AnyRef → Any
- def trace(marker: Marker, message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def trace(message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def trace(marker: Marker, message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def trace(message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def traceResult[T](message: => String)(fn: => T): T
- Attributes
- protected[this]
- Definition Classes
- Logging
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def warmup(): Unit
Callback method run before TwitterServer.postWarmup, used for performing warm up of this server.
Callback method run before TwitterServer.postWarmup, used for performing warm up of this server. Override, but do not call
super.warmup()as you will trigger a lint rule violation.Any exceptions thrown in this method will result in the app exiting.
- Attributes
- protected
- Definition Classes
- TwitterServer → App
- See also
- def warmupComplete(): Unit
- Definition Classes
- Warmup
- def warn(marker: Marker, message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def warn(message: => Any, cause: Throwable): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def warn(marker: Marker, message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def warn(message: => Any): Unit
- Attributes
- protected[this]
- Definition Classes
- Logging
- def warnResult[T](message: => String)(fn: => T): T
- Attributes
- protected[this]
- Definition Classes
- Logging