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.
A number of the properties are for testing and should not be set by end users.AERON_DIR_PROP_DEFAULT, AERON_DIR_PROP_NAME, DEFAULT_DRIVER_TIMEOUT_MS, INITIAL_TERM_ID_PARAM_NAME, IPC_CHANNEL, MDC_CONTROL_MODE, MDC_CONTROL_MODE_MANUAL, MTU_LENGTH_URI_PARAM_NAME, RELIABLE_STREAM_PARAM_NAME, SPY_PREFIX, TERM_ID_PARAM_NAME, TERM_LENGTH_PARAM_NAME, TERM_OFFSET_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.
|
AvailableImageHandler |
availableImageHandler()
Get the default callback handler for notifying when
Images become available. |
Aeron.Context |
availableImageHandler(AvailableImageHandler handler)
Setup a default callback for when an
Image is available. |
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. |
DriverProxy |
driverProxy()
Get the proxy for communicating with the media driver.
|
Aeron.Context |
driverProxy(DriverProxy driverProxy)
Set the proxy for communicating with the media driver.
|
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.
|
org.agrona.concurrent.EpochClock |
epochClock()
Get the
Clock used by the client for the epoch time in milliseconds. |
Aeron.Context |
epochClock(org.agrona.concurrent.EpochClock clock)
Set the
EpochClock to be used for tracking wall clock time when interacting with the driver. |
org.agrona.ErrorHandler |
errorHandler()
Get the error handler that will be called for errors reported back from the media driver.
|
Aeron.Context |
errorHandler(org.agrona.ErrorHandler errorHandler)
Handle Aeron exceptions in a callback method.
|
org.agrona.concurrent.IdleStrategy |
idleStrategy()
Get the
IdleStrategy employed by the client conductor thread. |
Aeron.Context |
idleStrategy(org.agrona.concurrent.IdleStrategy idleStrategy)
Provides an IdleStrategy for the thread responsible for communicating with the Aeron Media Driver.
|
java.nio.channels.FileChannel.MapMode |
imageMapMode()
The file memory mapping mode for
Images. |
Aeron.Context |
imageMapMode(java.nio.channels.FileChannel.MapMode imageMapMode)
The file memory mapping mode for
Images. |
long |
interServiceTimeout()
Return the timeout between service calls to the duty cycle for the client.
|
Aeron.Context |
interServiceTimeout(long interServiceTimeout)
Set the timeout between service calls the to
ClientConductor duty cycles. |
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.
|
io.aeron.LogBuffersFactory |
logBuffersFactory()
Get the factory for making log buffers.
|
Aeron.Context |
logBuffersFactory(io.aeron.LogBuffersFactory logBuffersFactory)
This method is used for testing and debugging.
|
org.agrona.concurrent.NanoClock |
nanoClock()
Get the
NanoClock to be used for tracking high resolution time. |
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.
|
org.agrona.concurrent.broadcast.CopyBroadcastReceiver |
toClientBuffer()
The buffer used for communicating from the media driver to the Aeron client.
|
Aeron.Context |
toClientBuffer(org.agrona.concurrent.broadcast.CopyBroadcastReceiver toClientBuffer)
This method is used for testing and debugging.
|
org.agrona.concurrent.ringbuffer.RingBuffer |
toDriverBuffer()
Get the
RingBuffer used for sending commands to the media driver. |
Aeron.Context |
toDriverBuffer(org.agrona.concurrent.ringbuffer.RingBuffer toDriverBuffer)
This method is used for testing and debugging.
|
UnavailableImageHandler |
unavailableImageHandler()
Get the callback handler for when an
Image is unavailable. |
Aeron.Context |
unavailableImageHandler(UnavailableImageHandler handler)
Setup a default callback for when an
Image is unavailable. |
aeronDirectory, aeronDirectoryName, cncFile, concludeAeronDirectory, countersMetaDataBuffer, countersMetaDataBuffer, countersValuesBuffer, countersValuesBuffer, deleteAeronDirectory, driverTimeoutMs, generateRandomDirName, isDriverActive, isDriverActive, isDriverActive, mapExistingCncFile, newDefaultCncFile, saveErrorLog, 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 org.agrona.concurrent.EpochClock epochClock()
Clock used by the client for the epoch time in milliseconds.Clock used by the client for the epoch time in milliseconds.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 org.agrona.concurrent.NanoClock nanoClock()
NanoClock to be used for tracking high resolution time.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 org.agrona.concurrent.IdleStrategy idleStrategy()
IdleStrategy employed by the client conductor thread.IdleStrategy employed by the client conductor thread.public Aeron.Context toClientBuffer(org.agrona.concurrent.broadcast.CopyBroadcastReceiver toClientBuffer)
toClientBuffer - Injected CopyBroadcastReceiverpublic org.agrona.concurrent.broadcast.CopyBroadcastReceiver toClientBuffer()
public Aeron.Context toDriverBuffer(org.agrona.concurrent.ringbuffer.RingBuffer toDriverBuffer)
toDriverBuffer - Injected RingBuffer.public org.agrona.concurrent.ringbuffer.RingBuffer toDriverBuffer()
RingBuffer used for sending commands to the media driver.RingBuffer used for sending commands to the media driver.public Aeron.Context driverProxy(DriverProxy driverProxy)
driverProxy - for communicating with the media driver.public DriverProxy driverProxy()
public Aeron.Context logBuffersFactory(io.aeron.LogBuffersFactory logBuffersFactory)
logBuffersFactory - Injected LogBuffersFactorypublic io.aeron.LogBuffersFactory logBuffersFactory()
public Aeron.Context errorHandler(org.agrona.ErrorHandler errorHandler)
Aeron.DEFAULT_ERROR_HANDLER.errorHandler - Method to handle objects of type Throwable.DriverTimeoutException,
RegistrationExceptionpublic org.agrona.ErrorHandler errorHandler()
public Aeron.Context availableImageHandler(AvailableImageHandler handler)
Image is available.handler - Callback method for handling available image notifications.public AvailableImageHandler availableImageHandler()
Images become available.Images become available.public Aeron.Context unavailableImageHandler(UnavailableImageHandler handler)
Image is unavailable.handler - Callback method for handling unavailable image notifications.public UnavailableImageHandler unavailableImageHandler()
Image is unavailable.Image is unavailable.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 Aeron.Context interServiceTimeout(long interServiceTimeout)
ClientConductor duty cycles.interServiceTimeout - the timeout (ms) between service calls the to ClientConductor duty cycles.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 java.nio.channels.FileChannel.MapMode imageMapMode()
Images.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-2017 Real Logic Ltd. All Rights Reserved.