Minimum duration to allow for exits to be processed.
Whether or not to accept undefined flags
Whether or not to accept undefined flags
The remaining, unparsed arguments
Notify the application that it may stop running.
Notify the application that it may stop running. Returns a Future that is satisfied when the App has been torn down or errors at the deadline.
Close closable
when shutdown is requested.
Close closable
when shutdown is requested. Closables are closed in parallel.
Default amount of time to wait for shutdown.
Default amount of time to wait for shutdown.
This value is not used as a default if close()
is called without parameters. It simply
provides a default value to be passed as close(grace)
.
The com.twitter.app.Flags instance associated with this application
Invoke f
before anything else (including flag parsing).
Invoke f
before anything else (including flag parsing).
The name of the application, based on the classname
Invoke f
when shutdown is requested.
Invoke f
when shutdown is requested. Exit hooks run in parallel and are
executed after all postmains complete. The thread resumes when all exit
hooks complete or closeDeadline
expires.
Invoke f
after the user's main has exited.
Invoke f
after the user's main has exited.
Invoke f
right before the user's main is invoked.
Invoke f
right before the user's main is invoked.
A composable application trait that includes flag parsing as well as basic application lifecycle (pre- and post- main). Flag parsing is done via com.twitter.app.Flags, an instance of which is defined in the member
flag
. Applications should be constructed with modularity in mind, and common functionality should be extracted into mixins.Flags should only be constructed in the constructor, and should only be read in the premain or later, after they have been parsed.
Note that a missing
main
is OK: mixins may provide behavior that does not require defining a custommain
method.