Package io.aeron.driver
Class MediaDriver
java.lang.Object
io.aeron.driver.MediaDriver
- All Implemented Interfaces:
AutoCloseable
Main class for JVM-based media driver.
Usage:
$ java -jar aeron-driver.jar
$ java -Doption=value -jar aeron-driver.jar
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Context for theMediaDriver
that can be used to provide overrides forConfiguration
. -
Method Summary
Modifier and TypeMethodDescriptionUsed to access the configured aeronDirectoryName for this MediaDriver, typically used after thelaunchEmbedded()
method is used.void
close()
Shutdown the media driver by stopping all threads and freeing resources.context()
Get theMediaDriver.Context
that is used by thisMediaDriver
.static MediaDriver
launch()
Launch a MediaDriver embedded in the current process with default configuration.static MediaDriver
Launch a MediaDriver embedded in the current process and provided a configuration ctx.static MediaDriver
Launch an isolated MediaDriver embedded in the current process with a generated aeronDirectoryName that can be retrieved by calling aeronDirectoryName.static MediaDriver
Launch an isolated MediaDriver embedded in the current process with a provided configuration ctx and a generated aeronDirectoryName (overwrites configuredCommonContext.aeronDirectoryName()
) that can be retrieved by calling aeronDirectoryName.static void
Main method for launching the process.Get theAgentInvoker
for the shared agents when running without threads.toString()
-
Method Details
-
main
Main method for launching the process.- Parameters:
args
- passed to the process.
-
launchEmbedded
Launch an isolated MediaDriver embedded in the current process with a generated aeronDirectoryName that can be retrieved by calling aeronDirectoryName.If the aeronDirectoryName is set as a system property to something different from
CommonContext.AERON_DIR_PROP_DEFAULT
then this set value will be used.- Returns:
- the newly started MediaDriver.
-
launchEmbedded
Launch an isolated MediaDriver embedded in the current process with a provided configuration ctx and a generated aeronDirectoryName (overwrites configuredCommonContext.aeronDirectoryName()
) that can be retrieved by calling aeronDirectoryName.If the aeronDirectoryName is set as a system property, or via context, to something different from
CommonContext.AERON_DIR_PROP_DEFAULT
then this set value will be used.- Parameters:
ctx
- containing the configuration options.- Returns:
- the newly started MediaDriver.
-
launch
Launch a MediaDriver embedded in the current process with default configuration.- Returns:
- the newly started MediaDriver.
-
launch
Launch a MediaDriver embedded in the current process and provided a configuration ctx.- Parameters:
ctx
- containing the configuration options.- Returns:
- the newly created MediaDriver.
-
context
Get theMediaDriver.Context
that is used by thisMediaDriver
.- Returns:
- the
MediaDriver.Context
that is used by thisMediaDriver
.
-
close
public void close()Shutdown the media driver by stopping all threads and freeing resources.- Specified by:
close
in interfaceAutoCloseable
-
aeronDirectoryName
Used to access the configured aeronDirectoryName for this MediaDriver, typically used after thelaunchEmbedded()
method is used.- Returns:
- the context aeronDirectoryName
-
toString
-