@Override public void run() { SLF4JLoggerProxy.warn(SystemMonitor.this, "System monitor over threshold: {}", currentStats); } };
@Override public void onErrorEvent(String inMessage) { SLF4JLoggerProxy.warn(EventLog.class, inMessage); } private void writeTimeStamp(OutputStream out) throws IOException {
@Override public void run() { try { evaluate(); } catch (Exception e) { SLF4JLoggerProxy.warn(SystemInformationLogger.this, e); } } },pollingInterval,pollingInterval,TimeUnit.MILLISECONDS);
/** * Performs necessary actions if the threshold has not been exceeded. */ private void underThreshold() { try { if(underThresholdAction != null) { underThresholdAction.run(); } } catch (Exception e) { SLF4JLoggerProxy.warn(this, e); } } /**
/** * Performs necessary actions if the threshold has been exceeded. */ private void overThreshold() { try { if(overThresholdAction != null) { overThresholdAction.run(); } } catch (Exception e) { SLF4JLoggerProxy.warn(this, e); } } /**
@Override public void run() { try { byte[] buf = new byte[1024]; int len; while((len = inputStream.read(buf)) > 0) { stdoutStream.write(buf,0,len); } } catch(Exception e) { SLF4JLoggerProxy.warn(MultiInstanceApplicationContainer.class, e); } finally { try { stdoutStream.close(); } catch (IOException ignored) {} } } /**
/** * Notify the given listener that the client has been initialized. * * @param inClientInitListener a <code>ClientInitListener</code> value */ private static void notifyClientInitListener(ClientInitListener inClientInitListener) { try { inClientInitListener.receiveClient(client); } catch (Exception e) { SLF4JLoggerProxy.warn(ClientManager.class, e); } } /**
@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 onEvent(String inMessage) { embeddedLog.onEvent(inMessage); for(Log observer : observers) { try { observer.onEvent(inMessage); } catch (Exception e) { SLF4JLoggerProxy.warn(this, e); } } } /* (non-Javadoc)
@Override public void notify(INotification inNotification) { if(verifySeverityThreshold(inNotification)) { try { doNotify(inNotification); } catch (Exception e) { SLF4JLoggerProxy.warn(this, e); } } } /**
@Override public void onErrorEvent(String inMessage) { embeddedLog.onErrorEvent(inMessage); for(Log observer : observers) { try { observer.onErrorEvent(inMessage); } catch (Exception e) { SLF4JLoggerProxy.warn(this, e); } } } /* (non-Javadoc)
@Override public void onOutgoing(String inMessage) { embeddedLog.onOutgoing(inMessage); for(Log observer : observers) { try { observer.onOutgoing(inMessage); } catch (Exception e) { SLF4JLoggerProxy.warn(this, e); } } } /**
@Override public void onIncoming(String inMessage) { embeddedLog.onIncoming(inMessage); for(Log observer : observers) { try { observer.onIncoming(inMessage); } catch (Exception e) { SLF4JLoggerProxy.warn(this, e); } } } /* (non-Javadoc)
@Override public synchronized void stop() { try { for(ComparableTask task : shutdownTasks) { try { task.run(); } catch (Exception e) { SLF4JLoggerProxy.warn(this, e, "Error executing shutdown task: {}", task); } } context.stop(); context = null; } finally { running.set(false); } } /**
@Override public void run() { try { Messages.THREAD_POOL_MONITOR.info(ThreadPoolMonitor.this, name, executor.getActiveCount(), executor.getMaximumPoolSize(), executor.getLargestPoolSize(), executor.getCompletedTaskCount(), executor.getPoolSize(), executor.getTaskCount()); } catch (Exception e) { SLF4JLoggerProxy.warn(ThreadPoolMonitor.this, e); } } },monitorInterval,monitorInterval,TimeUnit.MILLISECONDS);
@Override public synchronized final void stop() { setStatus(ResourcePoolStatus.STOPPING); try { doStop(); } catch (Exception e){ SLF4JLoggerProxy.warn(this, e); } finally { running.set(false); setStatus(ResourcePoolStatus.NOT_READY); } } /* (non-Javadoc)
/** * Cancel the market data request with the given request id. * * @param inRequestId a <code>long</code> value */ public void cancelMarketDataRequest(long inRequestId) { Collection<DataFlowID> dataFlows = dataFlowsByRequestId.removeAll(inRequestId); if(dataFlows != null) { for(DataFlowID dataFlowId : dataFlows) { try { contentByDataFlowId.removeAll(dataFlowId); subscribersByDataFlowId.remove(dataFlowId); SLF4JLoggerProxy.debug(this, "Canceling data flow {} owned by {}", dataFlowId, inRequestId); dataFlowSupport.cancel(dataFlowId); } catch (Exception e) { SLF4JLoggerProxy.warn(this, "Unable to cancel data flow {}: {}", inRequestId, ExceptionUtils.getRootCauseMessage(e)); } } } } /**
@Override @PostConstruct public synchronized void start() { if(isRunning()) { stop(); } try { doStart(); totalRequests = 0; totalEvents = 0; instrumentsBySymbol.clear(); cachedMarketdata.clear(); notifications.clear(); requestsByInstrument.clear(); requestsByAtom.clear(); requestsBySymbol.clear(); notifier = new EventNotifier(); notifier.start(); running.set(true); setFeedStatus(ProviderStatus.AVAILABLE); } catch (Exception e) { SLF4JLoggerProxy.warn(this, e); setFeedStatus(ProviderStatus.ERROR); } } /* (non-Javadoc)
@Override public void run() { try { int numBusy = pool.getNumBusyConnectionsAllUsers(); int numConnections = pool.getNumConnectionsAllUsers(); if(pool instanceof ComboPooledDataSource) { numConnections = ((ComboPooledDataSource)pool).getMaxPoolSize(); } int numIdle = pool.getNumIdleConnectionsAllUsers(); Messages.POOL_MONITOR_STATS.info(PoolMonitor.this, dataSourceName, numIdle, numBusy, numConnections); } catch (Exception e) { SLF4JLoggerProxy.warn(PoolMonitor.this, e); } } },monitorInterval,monitorInterval,TimeUnit.MILLISECONDS);
/** * 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); } } } /**