public void refresh() throws IOException { // IOException is declared to maintain strict compatibility with QF JNI final String text = "memory store does not support refresh!"; final Session session = sessionID != null ? Session.lookupSession(sessionID) : null; if (session != null) { session.getLog().onErrorEvent("ERROR: " + text); } else { LoggerFactory.getLogger(MemoryStore.class).error(text); } }
private boolean send(String messageString) { getLog().onOutgoing(messageString); Responder responder; synchronized (responderLock) { responder = this.responder; } if (responder == null) { getLog().onEvent("No responder, not sending message: " + messageString); return false; } return responder.send(messageString); }
public void refresh() throws IOException { // IOException is declared to maintain strict compatibility with QF JNI final String text = "memory store does not support refresh!"; final Session session = sessionID != null ? Session.lookupSession(sessionID) : null; if (session != null) { session.getLog().onErrorEvent("ERROR: " + text); } else { LoggerFactory.getLogger(MemoryStore.class).error(text); } }
public void refresh() throws IOException { // IOException is declared to maintain strict compatibility with QF JNI final String text = "memory store does not support refresh!"; if (sessionID != null) { Session session = Session.lookupSession(sessionID); session.getLog().onErrorEvent("ERROR: " + text); } else { LoggerFactory.getLogger(MemoryStore.class).error(text); } }
private boolean send(String messageString) { getLog().onOutgoing(messageString); Responder responder; synchronized (responderLock) { responder = this.responder; } if (responder == null) { getLog().onEvent("No responder, not sending message: " + messageString); return false; } return responder.send(messageString); }
public void enqueue(Message message) { if (message == END_OF_STREAM && stopping) { return; } try { queueTracker.put(message); } catch (final InterruptedException e) { quickfixSession.getLog().onErrorEvent(e.toString()); } }
public void enqueue(Message message) { if (message == END_OF_STREAM && stopping) { return; } try { queueTracker.put(message); } catch (final InterruptedException e) { quickfixSession.getLog().onErrorEvent(e.toString()); } }
private void enqueueMessage(final Message msg, final int msgSeqNum) { state.enqueue(msgSeqNum, msg); getLog().onEvent("Enqueued at pos " + msgSeqNum + ": " + msg); }
private static void suspendReads(Session qfSession, int queueUpperWatermark) { final IoSession ioSession = lookupIoSession(qfSession); if (ioSession != null && !ioSession.isReadSuspended()) { ioSession.suspendRead(); qfSession.getLog().onEvent(format(UPPER_WATERMARK_FMT, queueUpperWatermark)); } }
private boolean logErrorAndDisconnectIfRequired(final Exception e, Message message) { final boolean resetOrDisconnectIfRequired = resetOrDisconnectIfRequired(message); if (resetOrDisconnectIfRequired) { getLog().onErrorEvent("Encountered invalid message: " + e + ": " + getMessageToLog(message)); } return resetOrDisconnectIfRequired; }
private static void resumeReads(Session qfSession, int queueLowerWatermark) { final IoSession ioSession = lookupIoSession(qfSession); if (ioSession != null && ioSession.isReadSuspended()) { ioSession.resumeRead(); qfSession.getLog().onEvent(format(LOWER_WATERMARK_FMT, queueLowerWatermark)); } }
private void resetIfSessionNotCurrent(SessionID sessionID, long time) throws IOException { if (!isCurrentSession(time)) { getLog().onEvent("Session state is not current; resetting " + sessionID); reset(); } }
private static void resumeReads(Session qfSession, int queueLowerWatermark) { final IoSession ioSession = lookupIoSession(qfSession); if (ioSession != null && ioSession.isReadSuspended()) { ioSession.resumeRead(); qfSession.getLog().onEvent(format(LOWER_WATERMARK_FMT, queueLowerWatermark)); } }
private static void suspendReads(Session qfSession, int queueUpperWatermark) { final IoSession ioSession = lookupIoSession(qfSession); if (ioSession != null && !ioSession.isReadSuspended()) { ioSession.suspendRead(); qfSession.getLog().onEvent(format(UPPER_WATERMARK_FMT, queueUpperWatermark)); } }
private void resetIfSessionNotCurrent(SessionID sessionID, long time) throws IOException { if (!isCurrentSession(time)) { getLog().onEvent("Session state is not current; resetting " + sessionID); reset(); } }
private boolean logErrorAndDisconnectIfRequired(final Exception e, Message message) { final boolean resetOrDisconnectIfRequired = resetOrDisconnectIfRequired(message); if (resetOrDisconnectIfRequired) { getLog().onErrorEvent("Encountered invalid message: " + e + ": " + getMessageToLog(message)); } return resetOrDisconnectIfRequired; }
/** * Closes session resources and unregisters session. This is for internal * use and should typically not be called by an user application. */ @Override public void close() throws IOException { closeIfCloseable(getLog()); closeIfCloseable(getStore()); // clean up session just in case close() was not called from Session.unregisterSession() unregisterSession(this.sessionID, false); }
/** * Closes session resources and unregisters session. This is for internal * use and should typically not be called by an user application. */ @Override public void close() throws IOException { closeIfCloseable(getLog()); closeIfCloseable(getStore()); // clean up session just in case close() was not called from Session.unregisterSession() unregisterSession(this.sessionID, false); }
private void handleExceptionAndRejectMessage(final String msgType, final Message message, final HasFieldAndReason e) throws FieldNotFound, IOException { if (MsgType.LOGON.equals(msgType)) { logoutWithErrorMessage(e.getMessage()); } else { getLog().onErrorEvent("Rejecting invalid message: " + e + ": " + getMessageToLog(message)); generateReject(message, e.getMessage(), e.getSessionRejectReason(), e.getField()); } }
private void handleExceptionAndRejectMessage(final String msgType, final Message message, final HasFieldAndReason e) throws FieldNotFound, IOException { if (MsgType.LOGON.equals(msgType)) { logoutWithErrorMessage(e.getMessage()); } else { getLog().onErrorEvent("Rejecting invalid message: " + e + ": " + getMessageToLog(message)); generateReject(message, e.getMessage(), e.getSessionRejectReason(), e.getField()); } }