Collects functions over a com.twitter.util.Closables.
Collects functions over a com.twitter.util.Closables. These functions will be passed to
the application onExit
function to be executed on graceful shutdown of the application.
A Function0 which returns Unit. It is expected that this function encapsulates awaiting on a com.twitter.util.Closable that the application would like to ensure is closed upon graceful shutdown.
closeOnExit {
val closable = ...
Await.result(
closable.close(after: Duration), timeout: Duration)
}
It is expected that the passed function is a function over a com.twitter.util.Closable.
com.twitter.util.Closable
com.twitter.util.Awaitable
=> Unit)
Configures a com.google.inject.Binder via the exposed methods.
Configures a com.google.inject.Binder
via the exposed methods. A default implementation is provided such that extensions using
only @Provider
-annotated methods do not need to implement an empty
TwitterModule.configure() method.
com.google.inject.PrivateModule#configure
A Java-friendly method for creating a named Flag.
A Java-friendly method for creating a named Flag.
the name of the Flag.
a default value for the Flag when no value is given as an application argument.
the help text explaining the purpose of the Flag.
the created Flag.
A Java-friendly way to create a "mandatory" Flag.
A Java-friendly way to create a "mandatory" Flag. "Mandatory" flags MUST have a value provided as an application argument (as they have no default value to be used).
the name of the Flag.
the help text explaining the purpose of the Flag.
a string describing the type of the Flag, i.e.: Integer.
the created Flag.
This is akin to the c.t.inject.app.App#failfastOnFlagsNotParsed
and serves
a similar purpose but for new com.twitter.app.Flag instances created in this
TwitterModule.
This is akin to the c.t.inject.app.App#failfastOnFlagsNotParsed
and serves
a similar purpose but for new com.twitter.app.Flag instances created in this
TwitterModule. The value is 'true' by default. This is to ensure that the value of
a com.twitter.app.Flag instance created in this TwitterModule cannot be incorrectly
accessed before the application has parsed any passed command line input. This mirrors the
framework default for com.twitter.inject.app.App#failfastOnFlagsNotParsed
for Flag
instances created within the application container.
a Boolean indicating if com.twitter.app.Flag instances created in this TwitterModule should be set with com.twitter.app.Flag.failFastUntilParsed set to 'true' or 'false'. Default: 'true'.
This value SHOULD NOT be changed to 'false' without a very good reason.
Create a "mandatory" flag and add it to this Module's flags list."Mandatory" flags MUST have a value provided as an application argument (as they have no default value to be used).
Create a "mandatory" flag and add it to this Module's flags list."Mandatory" flags MUST have a value provided as an application argument (as they have no default value to be used).
must be a Flaggable type.
the name of the Flag.
the help text explaining the purpose of the Flag.
the created Flag.
Java users: see the more Java-friendly createFlag or createMandatoryFlag.
Create a Flag and add it to this Module's flags list.
Create a Flag and add it to this Module's flags list.
must be a Flaggable type.
the name of the Flag.
a default value for the Flag when no value is given as an application argument.
the help text explaining the purpose of the Flag.
the created Flag.
Java users: see the more Java-friendly createFlag or createMandatoryFlag.
Additional framework modules to be composed into this module.
Additional framework modules to be composed into this module.
Additional modules to be composed into this module from Java
Additional modules to be composed into this module from Java
Additional modules to be composed into this module.
Additional modules to be composed into this module. This list of modules is generally used instead of the TwitterModule.install method to properly support the TwitterModuleLifecycle for TwitterModule instances.
Java users should prefer javaModules.
,Module) can still be used for non-TwitterModule 1
instances, and is sometimes preferred due to install
being deferred until after flag parsing occurs.
Invoke after external ports are bound and any clients are resolved
Invoke after external ports are bound and any clients are resolved
This method should only get singleton instances from the injector.
Invoked on graceful shutdown of the application.
Invoked on graceful shutdown of the application.
This method should only get singleton instances from the injector.
Invoked after the injector is started.
Invoked after the injector is started.
This method should only get singleton instances from the injector.
A module whose configuration information is hidden from its environment by default. Only bindings that are explicitly exposed will be available to other modules and to the users of the injector. This module may expose the bindings it creates and the bindings of the modules it installs.
Calling com.google.inject.PrivateModule#install in the configure() method is not supported. Please set TwitterBaseModule.modules (or TwitterBaseModule.javaModules) to a non-empty list instead.
Writing Modules in Finatra
com.google.inject.PrivateModule