public static final class AeronCluster.Context extends Object implements Cloneable
| Constructor and Description |
|---|
Context() |
| Modifier and Type | Method and Description |
|---|---|
Aeron |
aeron()
Aeron client for communicating with the local Media Driver. |
AeronCluster.Context |
aeron(Aeron aeron)
Aeron client for communicating with the local Media Driver. |
String |
aeronDirectoryName()
Get the top level Aeron directory used for communication between the Aeron client and Media Driver.
|
AeronCluster.Context |
aeronDirectoryName(String aeronDirectoryName)
Set the top level Aeron directory used for communication between the Aeron client and Media Driver.
|
AeronCluster.Context |
clone()
Perform a shallow copy of the object.
|
void |
close()
Close the context and free applicable resources.
|
void |
conclude()
Conclude configuration by setting up defaults when specifics are not provided.
|
ControlledEgressListener |
controlledEgressListener()
Get the
ControlledEgressListener function that will be called when polling for egress via
AeronCluster.controlledPollEgress(). |
AeronCluster.Context |
controlledEgressListener(ControlledEgressListener listener)
Set the
ControlledEgressListener function that will be called when polling for egress via
AeronCluster.controlledPollEgress(). |
CredentialsSupplier |
credentialsSupplier()
Get the
CredentialsSupplier to be used for authentication with the cluster. |
AeronCluster.Context |
credentialsSupplier(CredentialsSupplier credentialsSupplier)
Set the
CredentialsSupplier to be used for authentication with the cluster. |
String |
egressChannel()
Get the channel parameter for the egress channel.
|
AeronCluster.Context |
egressChannel(String channel)
Set the channel parameter for the egress channel.
|
EgressListener |
egressListener()
Get the
EgressListener function that will be called when polling for egress via
AeronCluster.pollEgress(). |
AeronCluster.Context |
egressListener(EgressListener listener)
Set the
EgressListener function that will be called when polling for egress via
AeronCluster.pollEgress(). |
int |
egressStreamId()
Get the stream id for the egress channel.
|
AeronCluster.Context |
egressStreamId(int streamId)
Set the stream id for the egress channel.
|
ErrorHandler |
errorHandler()
Get the
ErrorHandler to be used for handling any exceptions. |
AeronCluster.Context |
errorHandler(ErrorHandler errorHandler)
Set the
ErrorHandler to be used for handling any exceptions. |
IdleStrategy |
idleStrategy()
Get the
IdleStrategy used when waiting for responses. |
AeronCluster.Context |
idleStrategy(IdleStrategy idleStrategy)
Set the
IdleStrategy used when waiting for responses. |
String |
ingressChannel()
Get the channel parameter for the ingress channel.
|
AeronCluster.Context |
ingressChannel(String channel)
Set the channel parameter for the ingress channel.
|
String |
ingressEndpoints()
The endpoints representing members for use with unicast to be substituted into the
ingressChannel()
for endpoints. |
AeronCluster.Context |
ingressEndpoints(String clusterMembers)
The endpoints representing members for use with unicast to be substituted into the
ingressChannel()
for endpoints. |
int |
ingressStreamId()
Get the stream id for the ingress channel.
|
AeronCluster.Context |
ingressStreamId(int streamId)
Set the stream id for the ingress channel.
|
boolean |
isDirectAssemblers()
Are direct buffers used for fragment assembly on egress?
|
AeronCluster.Context |
isDirectAssemblers(boolean isDirectAssemblers)
Are direct buffers used for fragment assembly on egress?
|
boolean |
isIngressExclusive()
Is ingress to the cluster exclusively from a single thread to this client?
|
AeronCluster.Context |
isIngressExclusive(boolean isIngressExclusive)
Is ingress to the cluster exclusively from a single thread to this client? Only set this if you are sure
the client will not be used from another thread, e.g.
|
long |
messageTimeoutNs()
The message timeout in nanoseconds to wait for sending or receiving a message.
|
AeronCluster.Context |
messageTimeoutNs(long messageTimeoutNs)
Set the message timeout in nanoseconds to wait for sending or receiving a message.
|
boolean |
ownsAeronClient()
Does this context own the
aeron() client and this takes responsibility for closing it? |
AeronCluster.Context |
ownsAeronClient(boolean ownsAeronClient)
Does this context own the
aeron() client and this takes responsibility for closing it? |
public AeronCluster.Context clone()
public void conclude()
public AeronCluster.Context messageTimeoutNs(long messageTimeoutNs)
messageTimeoutNs - to wait for sending or receiving a message.AeronCluster.Configuration.MESSAGE_TIMEOUT_PROP_NAMEpublic long messageTimeoutNs()
AeronCluster.Configuration.MESSAGE_TIMEOUT_PROP_NAMEpublic AeronCluster.Context ingressEndpoints(String clusterMembers)
ingressChannel()
for endpoints. A null value can be used when multicast where the ingressChannel() contains the
multicast endpoint.clusterMembers - which are all candidates to be leader.AeronCluster.Configuration.INGRESS_ENDPOINTS_PROP_NAMEpublic String ingressEndpoints()
ingressChannel()
for endpoints. A null value can be used when multicast where the ingressChannel() contains the
multicast endpoint.AeronCluster.Configuration.INGRESS_ENDPOINTS_PROP_NAMEpublic AeronCluster.Context ingressChannel(String channel)
The endpoints representing members for use with unicast are substituted from ingressEndpoints()
for endpoints. A null value can be used when multicast where this contains the multicast endpoint.
channel - parameter for the ingress channel.AeronCluster.Configuration.INGRESS_CHANNEL_PROP_NAMEpublic String ingressChannel()
The endpoints representing members for use with unicast are substituted from ingressEndpoints()
for endpoints. A null value can be used when multicast where this contains the multicast endpoint.
AeronCluster.Configuration.INGRESS_CHANNEL_PROP_NAMEpublic AeronCluster.Context ingressStreamId(int streamId)
streamId - for the ingress channel.AeronCluster.Configuration.INGRESS_STREAM_ID_PROP_NAMEpublic int ingressStreamId()
AeronCluster.Configuration.INGRESS_STREAM_ID_PROP_NAMEpublic AeronCluster.Context egressChannel(String channel)
channel - parameter for the egress channel.AeronCluster.Configuration.EGRESS_CHANNEL_PROP_NAMEpublic String egressChannel()
AeronCluster.Configuration.EGRESS_CHANNEL_PROP_NAMEpublic AeronCluster.Context egressStreamId(int streamId)
streamId - for the egress channel.AeronCluster.Configuration.EGRESS_STREAM_ID_PROP_NAMEpublic int egressStreamId()
AeronCluster.Configuration.EGRESS_STREAM_ID_PROP_NAMEpublic AeronCluster.Context idleStrategy(IdleStrategy idleStrategy)
IdleStrategy used when waiting for responses.idleStrategy - used when waiting for responses.public IdleStrategy idleStrategy()
IdleStrategy used when waiting for responses.IdleStrategy used when waiting for responses.public AeronCluster.Context aeronDirectoryName(String aeronDirectoryName)
aeronDirectoryName - the top level Aeron directory.public String aeronDirectoryName()
public AeronCluster.Context aeron(Aeron aeron)
Aeron client for communicating with the local Media Driver.
This client will be closed when the AeronCluster.close() or close() methods are called if
ownsAeronClient() is true.
aeron - client for communicating with the local Media Driver.Aeron.connect()public Aeron aeron()
Aeron client for communicating with the local Media Driver.
If not provided then a default will be established during conclude() by calling
Aeron.connect().
public AeronCluster.Context ownsAeronClient(boolean ownsAeronClient)
aeron() client and this takes responsibility for closing it?ownsAeronClient - does this context own the aeron() client.public boolean ownsAeronClient()
aeron() client and this takes responsibility for closing it?aeron() client and this takes responsibility for closing it?public AeronCluster.Context isIngressExclusive(boolean isIngressExclusive)
AeronCluster.sendKeepAlive() - which is a really bad design by the way!isIngressExclusive - true if ingress to the cluster is exclusively from a single thread for this client?public boolean isIngressExclusive()
public AeronCluster.Context credentialsSupplier(CredentialsSupplier credentialsSupplier)
CredentialsSupplier to be used for authentication with the cluster.credentialsSupplier - to be used for authentication with the cluster.public CredentialsSupplier credentialsSupplier()
CredentialsSupplier to be used for authentication with the cluster.CredentialsSupplier to be used for authentication with the cluster.public AeronCluster.Context errorHandler(ErrorHandler errorHandler)
ErrorHandler to be used for handling any exceptions.errorHandler - Method to handle objects of type Throwable.public ErrorHandler errorHandler()
ErrorHandler to be used for handling any exceptions.ErrorHandler to be used for handling any exceptions.public AeronCluster.Context isDirectAssemblers(boolean isDirectAssemblers)
isDirectAssemblers - true if direct buffers used for fragment assembly on egress.public boolean isDirectAssemblers()
public AeronCluster.Context egressListener(EgressListener listener)
EgressListener function that will be called when polling for egress via
AeronCluster.pollEgress().
Only EgressListener.onMessage(long, long, DirectBuffer, int, int, Header) will be dispatched
when using AeronCluster.pollEgress().
listener - function that will be called when polling for egress via AeronCluster.pollEgress().public EgressListener egressListener()
EgressListener function that will be called when polling for egress via
AeronCluster.pollEgress().EgressListener function that will be called when polling for egress via
AeronCluster.pollEgress().public AeronCluster.Context controlledEgressListener(ControlledEgressListener listener)
ControlledEgressListener function that will be called when polling for egress via
AeronCluster.controlledPollEgress().
Only ControlledEgressListener.onMessage(long, long, DirectBuffer, int, int, Header) will be
dispatched when using AeronCluster.controlledPollEgress().
listener - function that will be called when polling for egress via
AeronCluster.controlledPollEgress().public ControlledEgressListener controlledEgressListener()
ControlledEgressListener function that will be called when polling for egress via
AeronCluster.controlledPollEgress().ControlledEgressListener function that will be called when polling for egress via
AeronCluster.controlledPollEgress().public void close()
If ownsAeronClient() is true then the aeron() client will be closed.
Copyright © 2014-2020 Real Logic Limited. All Rights Reserved.