@Override public void onLogout(SessionID inSessionId) { SLF4JLoggerProxy.debug(ExsimFeedModule.this, "Session {} logout", //$NON-NLS-1$ inSessionId); updateFeedStatus(FeedStatus.OFFLINE); } /* (non-Javadoc)
@Override public void run() { try { // we're accessing this list concurrently, so the contents might change. let's use a copy of the list Collection<ServiceSubscriber> subscribers = Lists.newArrayList(subscribersByRequestId.values()); SLF4JLoggerProxy.debug(MarketDataServiceImpl.this, "Reaper examining {} subscription(s)", subscribers.size()); for(ServiceSubscriber subscriber : subscribers) { if(subscriber.storeEvents && subscriber.retrieveTimestamp < System.currentTimeMillis()-maxSubscriptionInterval) { SLF4JLoggerProxy.debug(MarketDataServiceImpl.this, "Reaper canceling {}", subscriber); doCancel(subscriber.getRequestId()); } } } catch (Exception e) { SLF4JLoggerProxy.warn(MarketDataServiceImpl.this, e); } } }
@Override public void run() { SLF4JLoggerProxy.trace(SystemMonitor.this, "System monitor under threshold: {}", currentStats); } };
@Override public void toApp(Message inMessage, SessionID inSessionId) throws DoNotSend { SLF4JLoggerProxy.trace(ExsimFeedModule.this, "{} sending app {}", //$NON-NLS-1$ inSessionId, inMessage); if(SLF4JLoggerProxy.isTraceEnabled(ExsimFeedModule.this)) { FIXMessageUtil.logMessage(inSessionId, inMessage); } } /* (non-Javadoc)
@Override public void run() { SLF4JLoggerProxy.warn(SystemMonitor.this, "System monitor over threshold: {}", currentStats); } };
/** * Log the given message. * * @param inSessionId a <code>SessionID</code> value * @param inMessage a <code>Message</code> value */ public static void logMessage(SessionID inSessionId, Message inMessage) { if(SLF4JLoggerProxy.isDebugEnabled(FIXMessageUtil.prettyPrintCategory)) { SLF4JLoggerProxy.debug(FIXMessageUtil.prettyPrintCategory, new AnalyzedMessage(FIXMessageUtil.getDataDictionary(FIXVersion.getFIXVersion(inSessionId)), inMessage).toString()); } } /**
/** * Log the given message. * * @param inMessage a <code>Message</code> value */ public static void logMessage(Message inMessage) { if(SLF4JLoggerProxy.isDebugEnabled(FIXMessageUtil.prettyPrintCategory)) { try { SLF4JLoggerProxy.debug(FIXMessageUtil.prettyPrintCategory, new AnalyzedMessage(FIXMessageUtil.getDataDictionary(FIXVersion.getFIXVersion(inMessage)), inMessage).toString()); } catch (FieldNotFound e) { SLF4JLoggerProxy.warn(FIXMessageUtil.prettyPrintCategory, e); } } } /**
SLF4JLoggerProxy.debug(this, "Received market data request {}, exploded to {}", //$NON-NLS-1$ inRequestToken, SLF4JLoggerProxy.trace(this, "Acquired lock"); //$NON-NLS-1$ try { for(MarketDataRequestAtom atom : atoms) { if(requestsByAtom.containsKey(atom)) { SLF4JLoggerProxy.debug(this, "Already requested {}, adding to reference count", atom); Instrument snapshotInstrument = instrumentsBySymbol.get(atom.getSymbol()); if(snapshotInstrument == null) { SLF4JLoggerProxy.warn(this, "Symbol {} not yet mapped, cannot send snapshot", atom.getSymbol()); SLF4JLoggerProxy.debug(this, "Sending snapshot: {}", snapshotEvent); SLF4JLoggerProxy.debug(this, "No snapshot for {}", atom); requestsBySymbol.put(atom.getSymbol(), inRequestToken);
SLF4JLoggerProxy.debug(this, "Not publishing {} to {} because it seems to have just been canceled", //$NON-NLS-1$ inEvents, return; SLF4JLoggerProxy.trace(this, "Publishing {} to {}", //$NON-NLS-1$ inEvents, requestData.getDataEmitterSupport().send(event); } catch (Exception e) { if(SLF4JLoggerProxy.isDebugEnabled(this)) { Messages.IGNORED_EXCEPTION_ON_SEND.warn(this, e,
SLF4JLoggerProxy.debug(this, "Adding {} to order history", inReport); SLF4JLoggerProxy.debug(this, "Created new {} for actual order ID: {} because there was no order history for this actual order ID nor the original order ID: {}", history, SLF4JLoggerProxy.debug(this, "Using existing {} for actual order ID: {} because there was already history for original order ID: {}", history, SLF4JLoggerProxy.debug(this, "Selected order history {} based on actual orderID: {} from {}", history, SLF4JLoggerProxy.debug(this, "Added {} to {}", inReport, SLF4JLoggerProxy.debug(this, "{} represents an open order ({}), updating live order list for {}", //$NON-NLS-1$ inReport.getOrderID(), SLF4JLoggerProxy.debug(this, "{} represents a closed order ({}) updating live order list for {}", //$NON-NLS-1$ inReport.getOrderID(), SLF4JLoggerProxy.debug(this,
requestBuilder.build()); if(response.getStatus().getFailed()) { SLF4JLoggerProxy.warn(this, response.getStatus().getMessage()); if(SLF4JLoggerProxy.isDebugEnabled(this)) { SLF4JLoggerProxy.warn(this, e); } else { SLF4JLoggerProxy.warn(this, ExceptionUtils.getRootCauseMessage(e));
/** * Determines if the given event should be logged or not. * * @param inEvent a <code>LogEvent</code> value * @param inCategory a <code>String</code> value containing the log category * @return a <code>boolean</code> value */ public static boolean shouldLog(LogEvent inEvent, String inCategory) { if(inEvent == null) { return false; } if(DEBUG.equals(inEvent.getLevel())) { return SLF4JLoggerProxy.isDebugEnabled(inCategory); } if(INFO.equals(inEvent.getLevel())) { return SLF4JLoggerProxy.isInfoEnabled(inCategory); } if(WARN.equals(inEvent.getLevel())) { return SLF4JLoggerProxy.isWarnEnabled(inCategory); } if(ERROR.equals(inEvent.getLevel())) { return SLF4JLoggerProxy.isErrorEnabled(inCategory); } return false; } }
/** * Injects an isotope into the given message. * * @param inFixResponse a <code>FIXResponse</code> value */ public void inject(FIXResponse inFixResponse) { if(SLF4JLoggerProxy.isDebugEnabled(isotopeCategory)) { inject(((FIXMessageWrapper)inFixResponse).getMessage()); } } /**
@Override public void run() { // TODO message SLF4JLoggerProxy.info(STARTUP_CATEGORY, "Shutting down"); try { killProcesses(); } catch (InterruptedException ignored) {} } });
@Override public void onErrorEvent(String inMessage) { SLF4JLoggerProxy.warn(EventLog.class, inMessage); } private void writeTimeStamp(OutputStream out) throws IOException {
private PositionMetrics createPositionMetrics() { BigDecimal unrealizedPL = null; BigDecimal realizedPL = null; BigDecimal tradingPL = null; BigDecimal positionPL = null; BigDecimal totalPL = null; if (mClosingPriceAvailable) { realizedPL = mRealizedPL; if (mLastTradePrice != null) { positionPL = mPositionCost.getPL(mLastTradePrice); unrealizedPL = mUnrealizedCost.getPL(mLastTradePrice); tradingPL = tradingCost.getPL(mLastTradePrice); totalPL = realizedPL.add(unrealizedPL); } } PositionMetricsImpl positionMetrics = new PositionMetricsImpl(mIncomingPosition, mPosition, positionPL, tradingPL, realizedPL, unrealizedPL, totalPL); // Theoretically, both ways of calculating total PL should give the same results assert !mClosingPriceAvailable || mLastTradePrice == null || totalPL.compareTo(positionPL.add(tradingPL)) == 0 : positionMetrics; if (SLF4JLoggerProxy.isDebugEnabled(this)) { if (mLastTradePrice != null && totalPL.compareTo(positionPL.add(tradingPL)) != 0) { SLF4JLoggerProxy.debug(this, MessageFormat.format( "There is a discrepancy in the total PL.\n{0}", positionMetrics)); //$NON-NLS-1$ } } return positionMetrics; }
SLF4JLoggerProxy.debug(this, "Requesting market data: {} from {}", inRequest, SLF4JLoggerProxy.debug(this, "No provider requested, issuing request to all providers"); for(ModuleURN providerUrn : ModuleManager.getInstance().getProviders()) { inSubscriber); } catch (Exception e) { SLF4JLoggerProxy.warn(this, "Unable to request market data from {}: {}", instanceUrn, if(SLF4JLoggerProxy.isDebugEnabled(this)) { SLF4JLoggerProxy.warn(this, e, "Unable to request market data {}: {}", ExceptionUtils.getRootCauseMessage(e)); } else { SLF4JLoggerProxy.warn(this, "Unable to request market data {}: {}", inRequest,
Message message = messageWrapper.getMessage(); try { SLF4JLoggerProxy.trace(ExsimFeedModule.this, "{} processing {}", //$NON-NLS-1$ this, SLF4JLoggerProxy.debug(this, "Produced {}", //$NON-NLS-1$ events); if(SLF4JLoggerProxy.isDebugEnabled(ExsimFeedModule.this)) { Messages.UNABLE_TO_PROCESS_MESSAGE.warn(ExsimFeedModule.this, e,