public class NetworkPublication extends java.lang.Object implements RetransmitSender, DriverManagedResource, Subscribable
Modifier and Type | Class and Description |
---|---|
static class |
NetworkPublication.State |
Modifier and Type | Field and Description |
---|---|
protected long |
cleanPosition |
protected static org.agrona.concurrent.status.ReadablePosition[] |
EMPTY_POSITIONS |
protected long |
lastSenderPosition |
protected long |
p1 |
protected long |
p10 |
protected long |
p11 |
protected long |
p12 |
protected long |
p13 |
protected long |
p14 |
protected long |
p15 |
protected long |
p16 |
protected long |
p17 |
protected long |
p18 |
protected long |
p19 |
protected long |
p2 |
protected long |
p20 |
protected long |
p21 |
protected long |
p22 |
protected long |
p23 |
protected long |
p24 |
protected long |
p25 |
protected long |
p26 |
protected long |
p27 |
protected long |
p28 |
protected long |
p29 |
protected long |
p3 |
protected long |
p30 |
protected long |
p31 |
protected long |
p32 |
protected long |
p33 |
protected long |
p34 |
protected long |
p35 |
protected long |
p36 |
protected long |
p37 |
protected long |
p38 |
protected long |
p39 |
protected long |
p4 |
protected long |
p40 |
protected long |
p41 |
protected long |
p42 |
protected long |
p43 |
protected long |
p44 |
protected long |
p45 |
protected long |
p5 |
protected long |
p6 |
protected long |
p7 |
protected long |
p8 |
protected long |
p9 |
protected int |
refCount |
protected boolean |
shouldSendSetupFrame |
protected org.agrona.concurrent.status.ReadablePosition[] |
spyPositions |
protected long |
statusMessageDeadlineNs |
protected long |
timeOfLastActivityNs |
protected long |
timeOfLastSendOrHeartbeatNs |
protected long |
timeOfLastSetupNs |
protected boolean |
trackSenderLimits |
Constructor and Description |
---|
NetworkPublication(long registrationId,
long tag,
SendChannelEndpoint channelEndpoint,
org.agrona.concurrent.NanoClock nanoClock,
RawLog rawLog,
org.agrona.concurrent.status.Position publisherPos,
org.agrona.concurrent.status.Position publisherLimit,
org.agrona.concurrent.status.Position senderPosition,
org.agrona.concurrent.status.Position senderLimit,
int sessionId,
int streamId,
int initialTermId,
int mtuLength,
SystemCounters systemCounters,
FlowControl flowControl,
RetransmitHandler retransmitHandler,
NetworkPublicationThreadLocals threadLocals,
long unblockTimeoutNs,
long connectionTimeoutNs,
long lingerTimeoutNs,
boolean isExclusive,
boolean spiesSimulateConnection) |
Modifier and Type | Method and Description |
---|---|
void |
addSubscriber(org.agrona.concurrent.status.ReadablePosition spyPosition)
Add a subscriber identified by its position.
|
java.lang.String |
channel() |
SendChannelEndpoint |
channelEndpoint() |
void |
close()
Close resources that are not external.
|
void |
decRef() |
boolean |
free()
Free external resources such as files.
|
boolean |
hasReachedEndOfLife()
Has resource reached end of its life and should be reclaimed?
|
void |
incRef() |
boolean |
isExclusive() |
int |
mtuLength() |
void |
onNak(int termId,
int termOffset,
int length) |
void |
onRttMeasurement(RttMeasurementFlyweight msg,
java.net.InetSocketAddress srcAddress) |
void |
onStatusMessage(StatusMessageFlyweight msg,
java.net.InetSocketAddress srcAddress) |
void |
onTimeEvent(long timeNs,
long timeMs,
DriverConductor conductor)
Inform resource of timeNs passing and pass it DriverConductor to inform of any state transitions.
|
long |
registrationId() |
void |
removeSubscriber(org.agrona.concurrent.status.ReadablePosition spyPosition)
Remove a subscriber identified by its position.
|
void |
resend(int termId,
int termOffset,
int length)
Called when a retransmit should be sent
|
int |
send(long nowNs) |
int |
sessionId() |
int |
streamId() |
long |
tag() |
int |
termBufferLength() |
void |
triggerSendSetupFrame() |
protected long p31
protected long p32
protected long p33
protected long p34
protected long p35
protected long p36
protected long p37
protected long p38
protected long p39
protected long p40
protected long p41
protected long p42
protected long p43
protected long p44
protected long p45
protected long timeOfLastSendOrHeartbeatNs
protected long timeOfLastSetupNs
protected long statusMessageDeadlineNs
protected boolean trackSenderLimits
protected boolean shouldSendSetupFrame
protected long p16
protected long p17
protected long p18
protected long p19
protected long p20
protected long p21
protected long p22
protected long p23
protected long p24
protected long p25
protected long p26
protected long p27
protected long p28
protected long p29
protected long p30
protected static final org.agrona.concurrent.status.ReadablePosition[] EMPTY_POSITIONS
protected long cleanPosition
protected long timeOfLastActivityNs
protected long lastSenderPosition
protected int refCount
protected org.agrona.concurrent.status.ReadablePosition[] spyPositions
protected long p1
protected long p2
protected long p3
protected long p4
protected long p5
protected long p6
protected long p7
protected long p8
protected long p9
protected long p10
protected long p11
protected long p12
protected long p13
protected long p14
protected long p15
public NetworkPublication(long registrationId, long tag, SendChannelEndpoint channelEndpoint, org.agrona.concurrent.NanoClock nanoClock, RawLog rawLog, org.agrona.concurrent.status.Position publisherPos, org.agrona.concurrent.status.Position publisherLimit, org.agrona.concurrent.status.Position senderPosition, org.agrona.concurrent.status.Position senderLimit, int sessionId, int streamId, int initialTermId, int mtuLength, SystemCounters systemCounters, FlowControl flowControl, RetransmitHandler retransmitHandler, NetworkPublicationThreadLocals threadLocals, long unblockTimeoutNs, long connectionTimeoutNs, long lingerTimeoutNs, boolean isExclusive, boolean spiesSimulateConnection)
public boolean free()
DriverManagedResource
free
in interface DriverManagedResource
public void close()
DriverManagedResource
close
in interface DriverManagedResource
public long tag()
public int termBufferLength()
public int mtuLength()
public long registrationId()
public boolean isExclusive()
public final int send(long nowNs)
public SendChannelEndpoint channelEndpoint()
public java.lang.String channel()
public int sessionId()
public int streamId()
public void resend(int termId, int termOffset, int length)
RetransmitSender
resend
in interface RetransmitSender
termId
- for the NAKtermOffset
- for the NAKlength
- for the NAKpublic void triggerSendSetupFrame()
public void addSubscriber(org.agrona.concurrent.status.ReadablePosition spyPosition)
Subscribable
addSubscriber
in interface Subscribable
spyPosition
- for tracking and identifying the subscriber.public void removeSubscriber(org.agrona.concurrent.status.ReadablePosition spyPosition)
Subscribable
Note: The Subscribable
is responsible for calling ReadablePosition.close()
on
removed positions.
removeSubscriber
in interface Subscribable
spyPosition
- to be identified by.public void onNak(int termId, int termOffset, int length)
public void onStatusMessage(StatusMessageFlyweight msg, java.net.InetSocketAddress srcAddress)
public void onRttMeasurement(RttMeasurementFlyweight msg, java.net.InetSocketAddress srcAddress)
public void onTimeEvent(long timeNs, long timeMs, DriverConductor conductor)
DriverManagedResource
onTimeEvent
in interface DriverManagedResource
timeNs
- now in nanosecondstimeMs
- now in milliseconds for epochconductor
- to inform of any state transitionspublic boolean hasReachedEndOfLife()
DriverManagedResource
hasReachedEndOfLife
in interface DriverManagedResource
public void decRef()
public void incRef()
Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.