public static 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.
|
String |
clusterMemberEndpoints()
The endpoints representing members for use with unicast to be substituted into the
ingressChannel()
for endpoints. |
AeronCluster.Context |
clusterMemberEndpoints(String clusterMembers)
The endpoints representing members for use with unicast to be substituted into the
ingressChannel()
for endpoints. |
void |
conclude() |
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.
|
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 for this client?
|
AeronCluster.Context |
isIngressExclusive(boolean isIngressExclusive)
Is ingress to the cluster exclusively from a single thread for this client?
|
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_NAME
public long messageTimeoutNs()
AeronCluster.Configuration.MESSAGE_TIMEOUT_PROP_NAME
public AeronCluster.Context clusterMemberEndpoints(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.CLUSTER_MEMBER_ENDPOINTS_PROP_NAME
public String clusterMemberEndpoints()
ingressChannel()
for endpoints. A null value can be used when multicast where the ingressChannel()
contains the
multicast endpoint.AeronCluster.Configuration.CLUSTER_MEMBER_ENDPOINTS_PROP_NAME
public AeronCluster.Context ingressChannel(String channel)
The endpoints representing members for use with unicast are substituted from the
clusterMemberEndpoints()
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_NAME
public String ingressChannel()
The endpoints representing members for use with unicast are substituted from the
clusterMemberEndpoints()
for endpoints. A null value can be used when multicast
where this contains the multicast endpoint.
AeronCluster.Configuration.INGRESS_CHANNEL_PROP_NAME
public AeronCluster.Context ingressStreamId(int streamId)
streamId
- for the ingress channel.AeronCluster.Configuration.INGRESS_STREAM_ID_PROP_NAME
public int ingressStreamId()
AeronCluster.Configuration.INGRESS_STREAM_ID_PROP_NAME
public AeronCluster.Context egressChannel(String channel)
channel
- parameter for the egress channel.AeronCluster.Configuration.EGRESS_CHANNEL_PROP_NAME
public String egressChannel()
AeronCluster.Configuration.EGRESS_CHANNEL_PROP_NAME
public AeronCluster.Context egressStreamId(int streamId)
streamId
- for the egress channel.AeronCluster.Configuration.EGRESS_STREAM_ID_PROP_NAME
public int egressStreamId()
AeronCluster.Configuration.EGRESS_STREAM_ID_PROP_NAME
public 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)
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-2019 Real Logic Ltd. All Rights Reserved.