> extends ClientClosedProvider, Closeable {
30 |
31 | /**
32 | * The server reads the bytes {@code in} from the client and sends a response {@code out} back
33 | * to the client.
34 | *
35 | * @param in the bytes send from the client
36 | * @param out the response send back to the client
37 | */
38 | void process(@NotNull Bytes> in, @NotNull Bytes> out, N nc);
39 |
40 | default void sendHeartBeat(Bytes> out, SessionDetailsProvider sessionDetails) {
41 | }
42 |
43 | default void onEndOfConnection(boolean heartbeatTimeOut) {
44 | }
45 |
46 | default void onReadTime(long readTimeNS, final ByteBuffer inBB, final int position, final int limit) {
47 | }
48 |
49 | default void onWriteTime(long writeTimeNS,
50 | final ByteBuffer byteBuffer,
51 | final int start,
52 | final int position) {
53 | }
54 |
55 | /**
56 | * Perform any low priority work, called when the handler is not busy, or after it has been
57 | * busy for a long time.
58 | */
59 | default void performIdleWork() {
60 | }
61 |
62 | /**
63 | * Check if an application-layer timeout has occurred, if this returns true,
64 | * the current connection will be dropped and a reconnection attempt will be made
65 | */
66 | default boolean hasTimedOut() {
67 | return false;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/network/api/session/SessionDetails.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-2020 chronicle.software
3 | *
4 | * https://chronicle.software
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package net.openhft.chronicle.network.api.session;
19 |
20 | import net.openhft.chronicle.network.SessionMode;
21 | import net.openhft.chronicle.network.connection.EventId;
22 | import net.openhft.chronicle.wire.WireOut;
23 | import net.openhft.chronicle.wire.WireType;
24 | import net.openhft.chronicle.wire.WriteMarshallable;
25 | import org.jetbrains.annotations.NotNull;
26 | import org.jetbrains.annotations.Nullable;
27 |
28 | import java.net.InetSocketAddress;
29 | import java.util.UUID;
30 |
31 | /**
32 | * Session local details stored here. Created by Peter Lawrey on 01/06/15.
33 | */
34 | public interface SessionDetails extends WriteMarshallable {
35 |
36 | // a unique id used to identify this session, this field is by contract immutable
37 | UUID sessionId();
38 |
39 | // a unique id used to identify the client
40 | UUID clientId();
41 |
42 | @Nullable
43 | String userId();
44 |
45 | @Nullable
46 | String securityToken();
47 |
48 | @Nullable
49 | String domain();
50 |
51 | SessionMode sessionMode();
52 |
53 | @Nullable
54 | InetSocketAddress clientAddress();
55 |
56 | long connectTimeMS();
57 |
58 | void set(Class infoClass, I info);
59 |
60 | @NotNull
61 | I get(Class infoClass);
62 |
63 | @Nullable
64 | WireType wireType();
65 |
66 | byte hostId();
67 |
68 | @Override
69 | default void writeMarshallable(@NotNull WireOut w) {
70 | w.writeEventName(EventId.userId).text(userId())
71 | .writeEventName(EventId.domain).text(domain());
72 | if (sessionMode() != null)
73 | w.writeEventName(EventId.sessionMode).text(sessionMode().toString());
74 | w.writeEventName(EventId.securityToken).text(securityToken())
75 | .writeEventName(EventId.clientId).text(clientId().toString())
76 | .writeEventName(EventId.hostId).int8(hostId())
77 | .writeEventName(EventId.wireType).asEnum(wireType());
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/network/api/session/SessionDetailsProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-2020 chronicle.software
3 | *
4 | * https://chronicle.software
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package net.openhft.chronicle.network.api.session;
19 |
20 | import net.openhft.chronicle.core.io.IORuntimeException;
21 | import net.openhft.chronicle.network.SessionMode;
22 | import net.openhft.chronicle.network.VanillaSessionDetails;
23 | import net.openhft.chronicle.network.connection.EventId;
24 | import net.openhft.chronicle.wire.Marshallable;
25 | import net.openhft.chronicle.wire.WireIn;
26 | import net.openhft.chronicle.wire.WireOut;
27 | import net.openhft.chronicle.wire.WireType;
28 | import org.jetbrains.annotations.NotNull;
29 | import org.jetbrains.annotations.Nullable;
30 |
31 | import java.net.InetSocketAddress;
32 | import java.util.UUID;
33 | public interface SessionDetailsProvider extends SessionDetails, Marshallable {
34 |
35 | void connectTimeMS(long connectTimeMS);
36 |
37 | void clientAddress(InetSocketAddress connectionAddress);
38 |
39 | void securityToken(String securityToken);
40 |
41 | void userId(String userId);
42 |
43 | void domain(String domain);
44 |
45 | void sessionMode(SessionMode sessionMode);
46 |
47 | void clientId(UUID clientId);
48 |
49 | void wireType(@Nullable WireType wireType);
50 |
51 | void hostId(byte id);
52 |
53 | @Override
54 | default void readMarshallable(@NotNull WireIn wire) throws IORuntimeException {
55 | userId(wire.read(EventId.userId).text());
56 | domain(wire.read(EventId.domain).text());
57 | sessionMode(wire.read(EventId.sessionMode).object(SessionMode.class));
58 | securityToken(wire.read(EventId.securityToken).text());
59 | @Nullable final String uid = wire.read(EventId.clientId).text();
60 | if (uid != null)
61 | clientId(UUID.fromString(uid));
62 | wireType(wire.read(EventId.wireType).object(WireType.class));
63 | hostId(wire.read(EventId.hostId).int8());
64 | }
65 |
66 | @Override
67 | default void writeMarshallable(@NotNull WireOut w) {
68 | SessionDetails.super.writeMarshallable(w);
69 | }
70 |
71 | @NotNull
72 | static SessionDetailsProvider create() {
73 | return new VanillaSessionDetails();
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/network/api/session/SessionProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-2020 chronicle.software
3 | *
4 | * https://chronicle.software
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package net.openhft.chronicle.network.api.session;
19 |
20 | import org.jetbrains.annotations.NotNull;
21 | import org.jetbrains.annotations.Nullable;
22 |
23 | /**
24 | * A holder for the Session specific details i.e. for a remote client.
25 | */
26 | public interface SessionProvider {
27 | /**
28 | * @return the current session details
29 | */
30 | @Nullable
31 | SessionDetails get();
32 |
33 | /**
34 | * Replace the session details
35 | *
36 | * @param sessionDetails to set to
37 | */
38 | void set(@NotNull SessionDetails sessionDetails);
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/network/api/session/SubHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-2020 chronicle.software
3 | *
4 | * https://chronicle.software
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package net.openhft.chronicle.network.api.session;
19 |
20 | import net.openhft.chronicle.core.io.Closeable;
21 | import net.openhft.chronicle.core.io.ManagedCloseable;
22 | import net.openhft.chronicle.network.NetworkContext;
23 | import net.openhft.chronicle.network.NetworkContextManager;
24 | import net.openhft.chronicle.wire.WireIn;
25 | import net.openhft.chronicle.wire.WireOut;
26 | import org.jetbrains.annotations.NotNull;
27 |
28 | import java.util.concurrent.RejectedExecutionException;
29 |
30 | public interface SubHandler> extends NetworkContextManager, ManagedCloseable {
31 |
32 | void cid(long cid);
33 |
34 | long cid();
35 |
36 | void csp(@NotNull String cspText);
37 |
38 | String csp();
39 |
40 | void onRead(@NotNull WireIn inWire, @NotNull WireOut outWire);
41 |
42 | Closeable closable();
43 |
44 | void remoteIdentifier(int remoteIdentifier);
45 |
46 | void localIdentifier(int localIdentifier);
47 |
48 | /**
49 | * called after all the construction and configuration has completed
50 | *
51 | * @param outWire allow data to be written
52 | */
53 | void onInitialize(WireOut outWire) throws RejectedExecutionException;
54 |
55 | /**
56 | * Some events may result in long-lived actions, which must yield periodically to allow (eg) buffers to clear (out messages to be sent)
57 | * A busy handler can indicate a long-lived action by returning true
from inProgress
58 | * The caller should then use this to invoke onTouch to give the handler another slice
59 | *
60 | * @param outWire
61 | * @return - true if the long-lived action is complete; false if there's more to do
62 | */
63 | default boolean onTouch(WireOut outWire) { return true; }
64 |
65 | /**
66 | * Is a long-lived action (see above) in progress?
67 | * @return - true if long-lived action in progress; else false
68 | */
69 | default boolean inProgress() { return false; }
70 |
71 | void closeable(Closeable closeable);
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/network/api/session/WritableSubHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-2020 chronicle.software
3 | *
4 | * https://chronicle.software
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package net.openhft.chronicle.network.api.session;
19 |
20 | import net.openhft.chronicle.network.NetworkContext;
21 | import net.openhft.chronicle.wire.WireOut;
22 |
23 | public interface WritableSubHandler> extends SubHandler {
24 | void onWrite(WireOut outWire);
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/network/cluster/AbstractSubHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-2020 chronicle.software
3 | *
4 | * https://chronicle.software
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package net.openhft.chronicle.network.cluster;
19 |
20 | import net.openhft.chronicle.core.io.Closeable;
21 | import net.openhft.chronicle.network.NetworkContext;
22 | import net.openhft.chronicle.network.api.session.SubHandler;
23 | import net.openhft.chronicle.wire.WireIn;
24 | import net.openhft.chronicle.wire.WireOut;
25 | import net.openhft.chronicle.wire.WriteMarshallable;
26 | import org.jetbrains.annotations.NotNull;
27 |
28 | public abstract class AbstractSubHandler> implements SubHandler {
29 | private Closeable closeable;
30 | private T nc;
31 | private long cid;
32 | private String csp;
33 | private int remoteIdentifier;
34 | private int localIdentifier;
35 | private volatile boolean isClosed;
36 |
37 | @Override
38 | public void cid(long cid) {
39 | this.cid = cid;
40 | }
41 |
42 | @Override
43 | public long cid() {
44 | return cid;
45 | }
46 |
47 | @Override
48 | public void csp(@NotNull String csp) {
49 | this.csp = csp;
50 | }
51 |
52 | @Override
53 | public String csp() {
54 | return this.csp;
55 | }
56 |
57 | @Override
58 | public T nc() {
59 | return nc;
60 | }
61 |
62 | @Override
63 | public void closeable(Closeable closeable) {
64 | this.closeable = closeable;
65 | }
66 |
67 | @Override
68 | public Closeable closable() {
69 | return closeable;
70 | }
71 |
72 | @Override
73 | public void nc(T nc) {
74 | this.nc = nc;
75 | }
76 |
77 | public int remoteIdentifier() {
78 | return remoteIdentifier;
79 | }
80 |
81 | @Override
82 | public void remoteIdentifier(int remoteIdentifier) {
83 | this.remoteIdentifier = remoteIdentifier;
84 | }
85 |
86 | public void publish(WriteMarshallable event) {
87 | nc().wireOutPublisher().publish(event);
88 | }
89 |
90 | @Override
91 | public void localIdentifier(int localIdentifier) {
92 | this.localIdentifier = localIdentifier;
93 | }
94 |
95 | public int localIdentifier() {
96 | return localIdentifier;
97 | }
98 |
99 | @Override
100 | public void close() {
101 | isClosed = true;
102 | }
103 |
104 | @Override
105 | public boolean isClosed() {
106 | return isClosed;
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/network/cluster/ClusteredNetworkContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-2020 chronicle.software
3 | *
4 | * https://chronicle.software
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package net.openhft.chronicle.network.cluster;
19 |
20 | import net.openhft.chronicle.core.threads.EventLoop;
21 | import net.openhft.chronicle.network.NetworkContext;
22 |
23 | public interface ClusteredNetworkContext> extends NetworkContext {
24 | default EventLoop eventLoop() {
25 | throw new UnsupportedOperationException();
26 | }
27 |
28 | byte getLocalHostIdentifier();
29 |
30 | > C clusterContext();
31 | }
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/network/cluster/HeartbeatEventHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-2020 chronicle.software
3 | *
4 | * https://chronicle.software
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package net.openhft.chronicle.network.cluster;
19 |
20 | @FunctionalInterface
21 | public interface HeartbeatEventHandler {
22 | void onMessageReceived();
23 |
24 | /**
25 | * Has a timeout been detected?
26 | *
27 | * @return true if a timeout has been detected, false otherwise
28 | */
29 | default boolean hasTimedOut() {
30 | return false;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/network/cluster/HostDetails.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-2020 chronicle.software
3 | *
4 | * https://chronicle.software
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package net.openhft.chronicle.network.cluster;
19 |
20 | import net.openhft.chronicle.wire.SelfDescribingMarshallable;
21 | import org.jetbrains.annotations.NotNull;
22 |
23 | public class HostDetails extends SelfDescribingMarshallable {
24 |
25 | private int hostId;
26 | private int tcpBufferSize;
27 | private String connectUri;
28 |
29 | public int tcpBufferSize() {
30 | return tcpBufferSize;
31 | }
32 |
33 | @NotNull
34 | public HostDetails hostId(int hostId) {
35 | this.hostId = hostId;
36 | return this;
37 | }
38 |
39 | public String connectUri() {
40 | return connectUri;
41 | }
42 |
43 | public int hostId() {
44 | return hostId;
45 | }
46 |
47 | @NotNull
48 | public HostDetails tcpBufferSize(int tcpBufferSize) {
49 | this.tcpBufferSize = tcpBufferSize;
50 | return this;
51 | }
52 |
53 | @NotNull
54 | public HostDetails connectUri(@NotNull String connectUri) {
55 | this.connectUri = connectUri;
56 | return this;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/network/cluster/LoggingNetworkStatsListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-2020 chronicle.software
3 | */
4 | package net.openhft.chronicle.network.cluster;
5 |
6 | import net.openhft.chronicle.core.Jvm;
7 | import net.openhft.chronicle.network.NetworkContext;
8 | import net.openhft.chronicle.network.NetworkStatsListener;
9 |
10 | @SuppressWarnings("rawtypes")
11 | public enum LoggingNetworkStatsListener implements NetworkStatsListener {
12 | INSTANCE;
13 |
14 | @Override
15 | public void networkContext(final NetworkContext networkContext) {
16 | // Ignore
17 | }
18 |
19 | @Override
20 | public void onNetworkStats(final long writeBps, final long readBps, final long socketPollCountPerSecond) {
21 | if (Jvm.isDebugEnabled(LoggingNetworkStatsListener.class))
22 | Jvm.debug().on(LoggingNetworkStatsListener.class, String.format(
23 | "networkStats: writeBps %d, readBps %d, pollCount/sec %d",
24 | writeBps, readBps, socketPollCountPerSecond));
25 |
26 | }
27 |
28 | @Override
29 | public void onHostPort(final String hostName, final int port) {
30 | if (Jvm.isDebugEnabled(LoggingNetworkStatsListener.class))
31 | Jvm.debug().on(LoggingNetworkStatsListener.class, String.format("onHostPort %s, %d",
32 | hostName, port));
33 | }
34 |
35 | @Override
36 | public void onRoundTripLatency(final long latencyNanos) {
37 | if (Jvm.isDebugEnabled(LoggingNetworkStatsListener.class))
38 | Jvm.debug().on(LoggingNetworkStatsListener.class, String.format("onRoundTripLatency %d", latencyNanos));
39 | }
40 |
41 | @Override
42 | public void close() {
43 | // Do nothing
44 | }
45 |
46 | @Override
47 | public boolean isClosed() {
48 | return false;
49 | }
50 | }
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/network/cluster/VanillaClusteredNetworkContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-2022 chronicle.software
3 | *
4 | * https://chronicle.software
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package net.openhft.chronicle.network.cluster;
20 |
21 | import net.openhft.chronicle.core.Jvm;
22 | import net.openhft.chronicle.core.threads.EventLoop;
23 | import net.openhft.chronicle.network.VanillaNetworkContext;
24 | import org.jetbrains.annotations.NotNull;
25 |
26 | public class VanillaClusteredNetworkContext, C extends ClusterContext>
27 | extends VanillaNetworkContext implements ClusteredNetworkContext {
28 |
29 | @NotNull
30 | private final EventLoop eventLoop;
31 |
32 | @NotNull
33 | protected final C clusterContext;
34 |
35 | public VanillaClusteredNetworkContext(@NotNull C clusterContext) {
36 | this.clusterContext = clusterContext;
37 | this.eventLoop = clusterContext.eventLoop();
38 | heartbeatListener(this::logMissedHeartbeat);
39 | serverThreadingStrategy(clusterContext.serverThreadingStrategy());
40 | }
41 |
42 | @Override
43 | public EventLoop eventLoop() {
44 | return eventLoop;
45 | }
46 |
47 | @Override
48 | public byte getLocalHostIdentifier() {
49 | return clusterContext.localIdentifier();
50 | }
51 |
52 | @Override
53 | public C clusterContext() {
54 | return clusterContext;
55 | }
56 |
57 | private boolean logMissedHeartbeat() {
58 | Jvm.warn().on(VanillaClusteredNetworkContext.class, "Missed heartbeat on network context " + socketChannel());
59 | return false;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/network/cluster/handlers/Registerable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016-2020 chronicle.software
3 | *
4 | * https://chronicle.software
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package net.openhft.chronicle.network.cluster.handlers;
19 |
20 | import net.openhft.chronicle.network.api.session.SubHandler;
21 |
22 | import java.util.Map;
23 |
24 | public interface Registerable {
25 | Object registryKey();
26 |
27 | void registry(Map