private FixLibrary connect() { poller.startConnecting(); final ErrorHandler remoteThreadErrorHandler = createRemoteThreadErrorHandler(errorHandler); scheduler.launch(configuration, remoteThreadErrorHandler, monitoringAgent, conductorAgent()); return this; }
private void initStreams() { if (enginesAreClustered || isFirstConnect()) { transport.initStreams(currentAeronChannel); inboundSubscription = transport.inboundSubscription(); outboundPublication = transport.outboundPublication(); } }
ReleaseToGatewayReply( final LibraryPoller libraryPoller, final long latestReplyArrivalTime, final InternalSession session) { super(libraryPoller, latestReplyArrivalTime); this.session = session; if (libraryPoller.isConnected()) { sendMessage(); } }
static Reply<Session> initiate( final FixLibrary library, final int port, final String initiatorId, final String acceptorId) { final SessionConfiguration config = SessionConfiguration.builder() .address("localhost", port) .credentials(USERNAME, PASSWORD) .senderCompId(initiatorId) .targetCompId(acceptorId) .build(); return library.initiate(config); }
private void onConnect() { DebugLogger.log( LIBRARY_CONNECT, "%d: Connected to [%s]%n", libraryId, currentAeronChannel); configuration.libraryConnectHandler().onConnect(fixLibrary); setLibraryConnected(true); }
private void deleteFiles() { removeParentDirectory(configuration.histogramLoggingFile()); removeParentDirectory(configuration.monitoringFile()); }
private void onDisconnect() { DebugLogger.log( LIBRARY_CONNECT, "%d: Disconnected from [%s]%n", libraryId, currentAeronChannel); configuration.libraryConnectHandler().onDisconnect(fixLibrary); setLibraryConnected(false); state = ATTEMPT_CONNECT; }
private void setupAndConnectToFirstChannel() { newLibraryPoller(CLUSTER_CHANNELS); library.startConnecting(); poll(); attemptToConnectTo(FIRST_CHANNEL); }
private void reconnectAfterTimeout() { receiveOneApplicationHeartbeat(); pollTwice(); assertTrue("Library still timed out", library.isConnected()); }
InitiateSessionReply( final LibraryPoller libraryPoller, final long latestReplyArrivalTime, final SessionConfiguration configuration) { super(libraryPoller, latestReplyArrivalTime); this.configuration = configuration; if (libraryPoller.isConnected()) { sendMessage(); } }
private void nextConnectingStep(final long timeInMs) { if (timeInMs > nextEngineAttemptTime) { attemptNextEngine(); connectToNewEngine(timeInMs); } else if (timeInMs > nextSendLibraryConnectTime) { sendLibraryConnect(timeInMs); } }
Reply<Session> initiate(final SessionConfiguration configuration) { requireNonNull(configuration, "configuration"); return new InitiateSessionReply(this, timeInMs() + configuration.timeoutInMs(), configuration); }
boolean poll(final long timeInMs) { if (requiresResend) { sendMessage(); } return super.poll(timeInMs); } }
boolean poll(final long timeInMs) { if (requiresResend) { sendMessage(); } return super.poll(timeInMs); }
boolean poll(final long timeInMs) { if (requiresResend) { sendMessage(); } return super.poll(timeInMs); } }
private void closeWithParent() { try { fixLibrary.internalClose(); } finally { close(); } }
void onComplete(final SessionReplyStatus result) { if (result == SessionReplyStatus.OK) { libraryPoller.disableSession(session); } super.onComplete(result); }
Reply<SessionReplyStatus> requestSession( final long sessionId, final int resendFromSequenceNumber, final int resendFromSequenceIndex, final long timeoutInMs) { return new RequestSessionReply( this, timeInMs() + timeoutInMs, sessionId, resendFromSequenceNumber, resendFromSequenceIndex); }
/** * Get the identifier of the library. * * @return the identifier of the library. */ public int libraryId() { return poller.libraryId(); }
private Answer<Integer> replyWithApplicationHeartbeat() { return (inv) -> { library.onApplicationHeartbeat(libraryId()); return 1; }; }