public final class Aeron
extends java.lang.Object
implements java.lang.AutoCloseable
Publications and Subscriptions.
Use an Aeron.Context to configure the Aeron object.
A client application requires only one Aeron object per Media Driver.| Modifier and Type | Class and Description |
|---|---|
static class |
Aeron.Context
This class provides configuration for the
Aeron class via the connect(Aeron.Context)
method and its overloads. |
| Modifier and Type | Field and Description |
|---|---|
static org.agrona.ErrorHandler |
DEFAULT_ERROR_HANDLER
The Default handler for Aeron runtime exceptions.
|
static long |
IDLE_SLEEP_NS
Duration in nanoseconds for which the client conductor will sleep between duty cycles.
|
static long |
INTER_SERVICE_TIMEOUT_NS
Default interval that if exceeded between duty cycles the conductor will consider itself a zombie and suicide.
|
static long |
KEEPALIVE_INTERVAL_NS
Default interval between sending keepalive control messages to the driver.
|
static long |
PUBLICATION_CONNECTION_TIMEOUT_MS
Timeout after which if no status messages have been receiver then a publication is considered not connected.
|
| Modifier and Type | Method and Description |
|---|---|
Publication |
addPublication(java.lang.String channel,
int streamId)
Add a
Publication for publishing messages to subscribers. |
Subscription |
addSubscription(java.lang.String channel,
int streamId)
Add a new
Subscription for subscribing to messages from publishers. |
void |
close()
Clean up and release all Aeron internal resources and shutdown threads.
|
static Aeron |
connect()
Create an Aeron instance and connect to the media driver with a default
Aeron.Context. |
static Aeron |
connect(Aeron.Context ctx)
Create an Aeron instance and connect to the media driver.
|
org.agrona.concurrent.status.CountersReader |
countersReader()
Create and return a
CountersReader for the Aeron media driver counters. |
public static final org.agrona.ErrorHandler DEFAULT_ERROR_HANDLER
DriverTimeoutException is encountered, this handler will
exit the program.
The error handler can be overridden by supplying an Aeron.Context with a custom handler.Aeron.Context.errorHandler(ErrorHandler)public static final long IDLE_SLEEP_NS
public static final long KEEPALIVE_INTERVAL_NS
public static final long INTER_SERVICE_TIMEOUT_NS
public static final long PUBLICATION_CONNECTION_TIMEOUT_MS
public static Aeron connect()
Aeron.Context.
Threads required for interacting with the media driver are created and managed within the Aeron instance.Aeron instance connected to the Media Driver.public static Aeron connect(Aeron.Context ctx)
ctx - for configuration of the client.Aeron instance connected to the Media Driver.public void close()
close in interface java.lang.AutoCloseablepublic Publication addPublication(java.lang.String channel, int streamId)
Publication for publishing messages to subscribers.channel - for receiving the messages known to the media layer.streamId - within the channel scope.public Subscription addSubscription(java.lang.String channel, int streamId)
Subscription for subscribing to messages from publishers.channel - for receiving the messages known to the media layer.streamId - within the channel scope.Subscription for the channel and streamId pair.public org.agrona.concurrent.status.CountersReader countersReader()
CountersReader for the Aeron media driver counters.CountersReader for the Aeron media driver in use.Copyright © 2014 - 2016 Real Logic Ltd. All Rights Reserved.