public static class Aeron.Context extends CommonContext
Aeron class via the Aeron.connect(Aeron.Context)
method and its overloads. It gives applications some control over the interactions with the Aeron Media Driver.
It can also set up error handling as well as application callbacks for image information from the
Media Driver.AERON_DIR_PROP_DEFAULT, AERON_DIR_PROP_NAME, DEFAULT_DRIVER_TIMEOUT_MS, IPC_CHANNEL, SPY_PREFIX, TERM_LENGTH_PARAM_NAME| Constructor and Description |
|---|
Context() |
| Modifier and Type | Method and Description |
|---|---|
Aeron.Context |
aeronDirectoryName(java.lang.String dirName)
Set the top level Aeron directory used for communication between the client and Media Driver, and the location
of the data buffers.
|
Aeron.Context |
availableImageHandler(AvailableImageHandler handler)
Set up a callback for when an
Image is available. |
Aeron.Context |
bufferManager(io.aeron.LogBuffersFactory logBuffersFactory)
This method is used for testing and debugging.
|
void |
close()
Clean up all resources that the client uses to communicate with the Media Driver.
|
Aeron.Context |
conclude()
This is called automatically by
Aeron.connect(Aeron.Context) and its overloads. |
Aeron.Context |
driverTimeoutMs(long value)
Set the amount of time, in milliseconds, that this client will wait until it determines the
Media Driver is unavailable.
|
Aeron.Context |
epochClock(org.agrona.concurrent.EpochClock clock)
Set the
EpochClock to be used for tracking wall clock time when interacting with the driver. |
Aeron.Context |
errorHandler(org.agrona.ErrorHandler errorHandler)
Handle Aeron exceptions in a callback method.
|
Aeron.Context |
idleStrategy(org.agrona.concurrent.IdleStrategy idleStrategy)
Provides an IdleStrategy for the thread responsible for communicating with the Aeron Media Driver.
|
Aeron.Context |
imageMapMode(java.nio.channels.FileChannel.MapMode imageMapMode)
The file memory mapping mode for
Images. |
long |
interServiceTimeout()
Return the timeout between service calls for the client.
|
long |
keepAliveInterval()
Get the interval in nanoseconds for which the client will perform keep-alive operations.
|
Aeron.Context |
keepAliveInterval(long value)
Set the interval in nanoseconds for which the client will perform keep-alive operations.
|
Aeron.Context |
nanoClock(org.agrona.concurrent.NanoClock clock)
Set the
NanoClock to be used for tracking high resolution time. |
long |
publicationConnectionTimeout()
Return the timeout, in milliseconds, that this client will use to determine if a
Publication
has active subscribers or not. |
Aeron.Context |
publicationConnectionTimeout(long value)
Set the amount of time, in milliseconds, that this client will use to determine if a
Publication
has active subscribers or not. |
java.util.concurrent.ThreadFactory |
threadFactory()
The thread factory to be use to construct the conductor thread
|
Aeron.Context |
threadFactory(java.util.concurrent.ThreadFactory threadFactory)
Specify the thread factory to use when starting the conductor thread.
|
Aeron.Context |
toClientBuffer(org.agrona.concurrent.broadcast.CopyBroadcastReceiver toClientBuffer)
This method is used for testing and debugging.
|
Aeron.Context |
toDriverBuffer(org.agrona.concurrent.ringbuffer.RingBuffer toDriverBuffer)
This method is used for testing and debugging.
|
Aeron.Context |
unavailableImageHandler(UnavailableImageHandler handler)
Set up a callback for when an
Image is unavailable. |
aeronDirectoryName, cncFile, countersMetaDataBuffer, countersMetaDataBuffer, countersValuesBuffer, countersValuesBuffer, deleteAeronDirectory, driverTimeoutMs, generateRandomDirName, isDriverActive, newDefaultCncFile, saveErrorLogpublic Aeron.Context conclude()
Aeron.connect(Aeron.Context) and its overloads.
There is no need to call it from a client application. It is responsible for providing default
values for options that are not individually changed through field setters.conclude in class CommonContextpublic Aeron.Context epochClock(org.agrona.concurrent.EpochClock clock)
EpochClock to be used for tracking wall clock time when interacting with the driver.clock - EpochClock to be used for tracking wall clock time when interacting with the driver.public Aeron.Context nanoClock(org.agrona.concurrent.NanoClock clock)
NanoClock to be used for tracking high resolution time.clock - NanoClock to be used for tracking high resolution time.public Aeron.Context idleStrategy(org.agrona.concurrent.IdleStrategy idleStrategy)
idleStrategy - Thread idle strategy for communication with the Media Driver.public Aeron.Context toClientBuffer(org.agrona.concurrent.broadcast.CopyBroadcastReceiver toClientBuffer)
toClientBuffer - Injected CopyBroadcastReceiverpublic Aeron.Context toDriverBuffer(org.agrona.concurrent.ringbuffer.RingBuffer toDriverBuffer)
toDriverBuffer - Injected RingBuffer.public Aeron.Context bufferManager(io.aeron.LogBuffersFactory logBuffersFactory)
logBuffersFactory - Injected LogBuffersFactorypublic Aeron.Context errorHandler(org.agrona.ErrorHandler errorHandler)
Aeron.DEFAULT_ERROR_HANDLER.errorHandler - Method to handle objects of type Throwable.DriverTimeoutException,
RegistrationExceptionpublic Aeron.Context availableImageHandler(AvailableImageHandler handler)
Image is available.handler - Callback method for handling available image notifications.public Aeron.Context unavailableImageHandler(UnavailableImageHandler handler)
Image is unavailable.handler - Callback method for handling unavailable image notifications.public Aeron.Context keepAliveInterval(long value)
value - the interval in nanoseconds for which the client will perform keep-alive operations.public long keepAliveInterval()
public Aeron.Context driverTimeoutMs(long value)
DriverTimeoutException will be generated for the error handler.driverTimeoutMs in class CommonContextvalue - Number of milliseconds.errorHandler(ErrorHandler)public long interServiceTimeout()
errorHandler will be called and the active Publications and Images
closed.
This value is controlled by the driver and included in the CnC file.public Aeron.Context aeronDirectoryName(java.lang.String dirName)
CommonContextaeronDirectoryName in class CommonContextdirName - New top level Aeron directory.CommonContext.aeronDirectoryName(String)public Aeron.Context publicationConnectionTimeout(long value)
Publication
has active subscribers or not.value - number of milliseconds.public long publicationConnectionTimeout()
Publication
has active subscribers or not.public Aeron.Context imageMapMode(java.nio.channels.FileChannel.MapMode imageMapMode)
Images.imageMapMode - file memory mapping mode for Images.public Aeron.Context threadFactory(java.util.concurrent.ThreadFactory threadFactory)
threadFactory - thread factory to construct the thread.public java.util.concurrent.ThreadFactory threadFactory()
Thread.Thread(Runnable) if none is providedpublic void close()
close in interface java.lang.AutoCloseableclose in class CommonContextCopyright © 2014 - 2016 Real Logic Ltd. All Rights Reserved.