public abstract class AbstractStatelessClient<E extends net.openhft.chronicle.wire.ParameterizeWireKey> extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
protected String |
csp |
protected TcpChannelHub |
hub |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractStatelessClient(TcpChannelHub hub,
long cid,
String csp) |
| Modifier and Type | Method and Description |
|---|---|
protected <T> T |
attempt(net.openhft.chronicle.core.util.ThrowingSupplier<T,TimeoutException> s)
this method will re attempt a number of times until successful,if connection is dropped to
the remote server the TcpChannelHub may ( if configured ) automatically failover to another
host.
|
void |
close() |
protected boolean |
proxyReturnBoolean(net.openhft.chronicle.wire.WireKey eventId) |
protected boolean |
proxyReturnBooleanWithArgs(E eventId,
Object... args) |
protected boolean |
proxyReturnBooleanWithSequence(E eventId,
Collection sequence) |
protected byte |
proxyReturnByte(net.openhft.chronicle.wire.WireKey eventId) |
protected byte |
proxyReturnByte(net.openhft.chronicle.wire.WireKey reply,
net.openhft.chronicle.wire.WireKey eventId) |
protected int |
proxyReturnInt(E eventId,
Object... args) |
protected int |
proxyReturnInt(net.openhft.chronicle.wire.WireKey eventId) |
protected long |
proxyReturnLong(net.openhft.chronicle.wire.WireKey eventId) |
protected long |
proxyReturnLongWithArgs(E eventId,
Object... args) |
protected <R> R |
proxyReturnTypedObject(E eventId,
R usingValue,
Class<R> resultType) |
protected <R> R |
proxyReturnTypedObject(E eventId,
R usingValue,
Class<R> resultType,
Object... args) |
protected int |
proxyReturnUint16(net.openhft.chronicle.wire.WireKey eventId) |
protected void |
proxyReturnVoid(net.openhft.chronicle.wire.WireKey eventId) |
protected void |
proxyReturnVoid(net.openhft.chronicle.wire.WireKey eventId,
net.openhft.chronicle.wire.WriteValue consumer) |
protected <T> T |
proxyReturnWireConsumer(net.openhft.chronicle.wire.WireKey eventId,
Function<net.openhft.chronicle.wire.ValueIn,T> consumer) |
protected <T> T |
proxyReturnWireConsumerInOut(net.openhft.chronicle.wire.WireKey eventId,
net.openhft.chronicle.wire.WireKey reply,
net.openhft.chronicle.wire.WriteValue consumerOut,
Function<net.openhft.chronicle.wire.ValueIn,T> consumerIn) |
protected <R> R |
proxyReturnWireTypedObject(E eventId,
R usingValue,
Class<R> resultType,
Object... args) |
protected boolean |
readBoolean(long tid,
long startTime) |
protected int |
readInt(long tid,
long startTime) |
protected boolean |
sendBytes(net.openhft.chronicle.bytes.Bytes bytes,
boolean reattemptUponFailure) |
protected long |
sendEvent(long startTime,
net.openhft.chronicle.wire.WireKey eventId,
net.openhft.chronicle.wire.WriteValue consumer) |
protected boolean |
sendEventAsync(net.openhft.chronicle.wire.WireKey eventId,
net.openhft.chronicle.wire.WriteValue consumer,
boolean reattemptUponFailure) |
protected static <E extends net.openhft.chronicle.wire.ParameterizeWireKey> |
toParameters(E eventId,
Object... args) |
protected void |
writeMetaDataForKnownTID(long tid)
Useful for when you know the tid
|
@NotNull protected final TcpChannelHub hub
@NotNull protected final String csp
protected AbstractStatelessClient(@NotNull
TcpChannelHub hub,
long cid,
@NotNull
String csp)
hub - for this connectioncid - used by proxies such as the entry-setcsp - the uri of the requestprotected static <E extends net.openhft.chronicle.wire.ParameterizeWireKey> net.openhft.chronicle.wire.WriteValue toParameters(@NotNull
E eventId,
@Nullable
Object... args)
@Nullable
protected <R> R proxyReturnWireTypedObject(@NotNull
E eventId,
@Nullable
R usingValue,
@NotNull
Class<R> resultType,
@NotNull
Object... args)
@Nullable
protected <R> R proxyReturnTypedObject(@NotNull
E eventId,
@Nullable
R usingValue,
@NotNull
Class<R> resultType,
@NotNull
Object... args)
@Nullable
protected <R> R proxyReturnTypedObject(@NotNull
E eventId,
@Nullable
R usingValue,
@NotNull
Class<R> resultType)
protected <T> T attempt(@NotNull
net.openhft.chronicle.core.util.ThrowingSupplier<T,TimeoutException> s)
T - the type of supplys - the supplyprotected long proxyReturnLong(@NotNull
net.openhft.chronicle.wire.WireKey eventId)
protected int proxyReturnInt(@NotNull
net.openhft.chronicle.wire.WireKey eventId)
protected byte proxyReturnByte(@NotNull
net.openhft.chronicle.wire.WireKey eventId)
protected byte proxyReturnByte(@NotNull
net.openhft.chronicle.wire.WireKey reply,
@NotNull
net.openhft.chronicle.wire.WireKey eventId)
protected int proxyReturnUint16(@NotNull
net.openhft.chronicle.wire.WireKey eventId)
protected <T> T proxyReturnWireConsumer(@NotNull
net.openhft.chronicle.wire.WireKey eventId,
@NotNull
Function<net.openhft.chronicle.wire.ValueIn,T> consumer)
protected <T> T proxyReturnWireConsumerInOut(@NotNull
net.openhft.chronicle.wire.WireKey eventId,
@NotNull
net.openhft.chronicle.wire.WireKey reply,
@Nullable
net.openhft.chronicle.wire.WriteValue consumerOut,
@NotNull
Function<net.openhft.chronicle.wire.ValueIn,T> consumerIn)
protected void proxyReturnVoid(@NotNull
net.openhft.chronicle.wire.WireKey eventId,
@Nullable
net.openhft.chronicle.wire.WriteValue consumer)
protected void proxyReturnVoid(@NotNull
net.openhft.chronicle.wire.WireKey eventId)
protected long sendEvent(long startTime,
@NotNull
net.openhft.chronicle.wire.WireKey eventId,
@Nullable
net.openhft.chronicle.wire.WriteValue consumer)
protected boolean sendEventAsync(@NotNull
net.openhft.chronicle.wire.WireKey eventId,
@Nullable
net.openhft.chronicle.wire.WriteValue consumer,
boolean reattemptUponFailure)
eventId - the wire event idconsumer - a function consume the wirereattemptUponFailure - if false - will only be sent if the connection is validprotected boolean sendBytes(@NotNull
net.openhft.chronicle.bytes.Bytes bytes,
boolean reattemptUponFailure)
bytes - the bytes to sendreattemptUponFailure - if false - will only be sent if the connection is validprotected void writeMetaDataForKnownTID(long tid)
tid - the tid transactionprotected boolean readBoolean(long tid,
long startTime)
throws net.openhft.chronicle.bytes.ConnectionDroppedException,
TimeoutException
net.openhft.chronicle.bytes.ConnectionDroppedExceptionTimeoutExceptionprotected boolean proxyReturnBooleanWithArgs(@NotNull
E eventId,
@NotNull
Object... args)
protected long proxyReturnLongWithArgs(@NotNull
E eventId,
@NotNull
Object... args)
protected boolean proxyReturnBooleanWithSequence(@NotNull
E eventId,
@NotNull
Collection sequence)
protected boolean proxyReturnBoolean(@NotNull
net.openhft.chronicle.wire.WireKey eventId)
protected int readInt(long tid,
long startTime)
throws net.openhft.chronicle.bytes.ConnectionDroppedException,
TimeoutException
net.openhft.chronicle.bytes.ConnectionDroppedExceptionTimeoutExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2018. All rights reserved.