public void run() { try { executeTick(); } catch (Exception e) { SIMULATED_EXCHANGE_TICK_ERROR.warn(SimulatedExchange.class, e, getName()); } } },
/** * Creates an instance. * * @param inStream the input stream that contains the property * key value pairs. If null, the configurator return null values * for all property names. */ public PropertyFileConfigurator(InputStream inStream) { mProperties = new Properties(); if(inStream == null) { return; } try { try { mProperties.load(inStream); } finally { inStream.close(); } } catch (IOException e) { Messages.LOG_ERR_LOADING_PROPERTIES.warn(this, e, inStream); } }
/** * Gets the parameter associated with the given name. * * @param inName a <code>String</code> value containing the key of a parameter key/value value * @return a <code>String</code> value or null if no parameter is associated with the given name */ protected final String getParameter(String inName) { Properties parameters = strategy.getParameters(); if(parameters == null) { NO_PARAMETERS.warn(AbstractRunningStrategy.class, strategy); return null; } return parameters.getProperty(inName); } /**
/** * Executes the invalidation of the handles passed. * * <p>The feed will be notified that each handle passed is invalid. * * @param inHandles a <code>List<MarketDataHandle></code> value */ private void doHandleInvalidation(List<MarketDataHandle> inHandles) { for(MarketDataHandle handle : inHandles) { try { doCancel(handle.decompose()); } catch (Exception e) { Messages.WARNING_MARKET_DATA_FEED_CANNOT_CANCEL_SUBSCRIPTION.warn(this, e, handle); } } } /**
@Override public void cancel(DataFlowID inFlowId, RequestID inRequestID) { RequestData requestData = requestsByDataFlowId.remove(inFlowId); if(requestData == null) { Messages.DATA_FLOW_ALREADY_CANCELED.warn(this, inFlowId); } else { SLF4JLoggerProxy.debug(this, "Canceling data flow {} with market data request id {}", //$NON-NLS-1$ inFlowId, requestData); requestsByRequestId.remove(requestData); try { cancelMarketDataRequest(requestData); } catch (Exception e) { if(SLF4JLoggerProxy.isDebugEnabled(this)) { Messages.CANNOT_CANCEL_DATA_FLOW.warn(this, e, inFlowId); } else { Messages.CANNOT_CANCEL_DATA_FLOW.warn(this, inFlowId); } } } } /* (non-Javadoc)
@Override public void receiveData(DataFlowID inFlowID, Object inData) { DataFlowHandler handler = getHandler(inFlowID); if(handler != null) { handler.receiveData(inData); } else { //This cannot happen but it will be good to warn if it does. Messages.DATA_RECVD_UNKNOWN_FLOW.warn(this, inFlowID); } }
@Override public void receiveData(Object inObject) { synchronized (receivers) { for(DataReceiver receiver: receivers) { try { receiver.receiveData(inObject); } catch (Exception e) { Messages.LOG_ERROR_RECEIVE_DATA.warn(this, e, inObject); ExceptUtils.interrupt(e); } } } } /* (non-Javadoc)
/** * Cancels the request with the emitter module and * disables all the communication through the coupling */ final void cancelRequest() { try { sNestedFlowCall.set(Boolean.TRUE); try { ((DataEmitter)mEmitter).cancel(mFlowID, mRequestID); } finally { sNestedFlowCall.set(Boolean.FALSE); } } catch(Throwable t) { Messages.LOG_UNEXPECTED_ERROR_CANCELING_REQ.warn( this,t, mRequestID); } finally { mRequestCanceled = true; postCancel(); } }
@Override public void connectionStatusChanged(boolean inOldStatus, boolean inNewStatus) { if(inOldStatus == inNewStatus) { return; } running.set(inNewStatus); synchronized(listeners) { for(ConnectionStatusListener listener: listeners) { try { listener.receiveConnectionStatus(inNewStatus); } catch (Exception e) { Messages.LOG_ERROR_RECEIVE_CONNECT_STATUS.warn(this, e, inNewStatus); ExceptUtils.interrupt(e); } } } } /**
@Override @PreDestroy public synchronized void stop() { if(!isRunning()) { return; } try { onStop(); } catch (Exception e) { Messages.ERROR_DURING_STOP.warn(this, e, threadDescriptor); } keepAlive.set(false); if(thread != null) { thread.interrupt(); try { thread.join(); } catch (InterruptedException ignored) {} } for(String metricName : metricNames) { try { metrics.remove(metricName); } catch (Exception ignored) {} } } /* (non-Javadoc)
void exceptionThrown(ConnectionException inException) { synchronized (mExceptionListeners) { for(ExceptionListener l: mExceptionListeners) { try { l.exceptionThrown(inException); } catch (Exception e) { Messages.LOG_ERROR_NOTIFY_EXCEPTION.warn(this, e, ObjectUtils.toString(inException)); ExceptUtils.interrupt(e); } } } }
@Override public void receiveMessage (TradeMessage inReport) { if (inReport instanceof ExecutionReport) { notifyExecutionReport((ExecutionReport)inReport); } else if (inReport instanceof OrderCancelReject) { notifyCancelReject((OrderCancelReject)inReport); } else { Messages.LOG_RECEIVED_FIX_REPORT.warn (this,ObjectUtils.toString(inReport)); } } }
void notifyServerStatus(boolean status) { SLF4JLoggerProxy.debug (TRAFFIC,"Received Server Status:{}",status); //$NON-NLS-1$ synchronized (mServerStatusListeners) { for (ServerStatusListener listener: mServerStatusListeners) { try { listener.receiveServerStatus(status); } catch (Throwable t) { Messages.LOG_ERROR_RECEIVE_SERVER_STATUS.warn(this, t, status); ExceptUtils.interrupt(t); } } } }
@Override protected void preStop() throws ModuleException { try { strategy.stop(); } catch (ModuleException e) { throw e; } catch (Exception e) { // otherwise a strategy may not prevent itself from being stopped STOP_ERROR.warn(StrategyModule.class, e, strategy); } cancelAllDataRequests(); disconnectORSRouting(); } /**
void notifyExecutionReport(ExecutionReport inReport) { SLF4JLoggerProxy.debug(TRAFFIC, "Received Exec Report:{}", inReport); //$NON-NLS-1$ synchronized (mReportListeners) { for(ReportListener listener: mReportListeners) { try { listener.receiveExecutionReport(inReport); } catch (Throwable t) { Messages.LOG_ERROR_RECEIVE_EXEC_REPORT.warn(this, t, ObjectUtils.toString(inReport)); ExceptUtils.interrupt(t); } } } }
void notifyCancelReject(OrderCancelReject inReport) { SLF4JLoggerProxy.debug(TRAFFIC, "Received Cancel Reject:{}", inReport); //$NON-NLS-1$ synchronized (mReportListeners) { for(ReportListener listener: mReportListeners) { try { listener.receiveCancelReject(inReport); } catch (Throwable t) { Messages.LOG_ERROR_RECEIVE_CANCEL_REJECT.warn(this, t, ObjectUtils.toString(inReport)); ExceptUtils.interrupt(t); } } } }
void notifyBrokerStatus(BrokerStatus status) { SLF4JLoggerProxy.debug (TRAFFIC,"Received Broker Status:{}",status); //$NON-NLS-1$ synchronized (mBrokerStatusListeners) { for (BrokerStatusListener listener: mBrokerStatusListeners) { try { listener.receiveBrokerStatus(status); } catch (Throwable t) { Messages.LOG_ERROR_RECEIVE_BROKER_STATUS.warn(this, t, ObjectUtils.toString(status)); ExceptUtils.interrupt(t); } } } }
private boolean isValid(ExecutionReport report) { if (notNull(report.getInstrument()) && positive(report.getLastPrice()) && notZero(report.getLastQuantity())) { return true; } else { Messages.VALIDATION_MATCHER_INVALID_EXECUTION_REPORT.warn(PositionEngineFactory.class, report); return false; } }
break; } catch (FeedException e) { Messages.ERROR_TOKEN_RESUBMIT_FAILED.warn(this, e, token);
exception = new ConnectionException(e, new I18NBoundMessage1P(Messages.ERROR_SEND_MESSAGE, ObjectUtils.toString(inEvent))); Messages.LOG_ERROR_SEND_EXCEPTION.warn(this, exception, ObjectUtils.toString(inEvent));