/** * Create a new CompilationFailed instance. * * @param inStrategy a <code>Strategy</code> value */ public CompilationFailed(Strategy inStrategy) { super(new I18NBoundMessage2P(COMPILATION_FAILED, inStrategy.toString(), "")); //$NON-NLS-1$ } /**
/** * Create a new CompilationFailed instance. * * @param inNested a <code>Throwable</code> value * @param inStrategy a <code>Strategy</code> value */ public CompilationFailed(Throwable inNested, Strategy inStrategy) { super(inNested, new I18NBoundMessage2P(COMPILATION_FAILED, inStrategy.toString(), "")); //$NON-NLS-1$ } /* (non-Javadoc)
/** * Creates an instance. * * @param inModuleURN the URN of the module throwing this error. * @param inParameter the offending parameter value. */ public UnsupportedRequestParameterType(ModuleURN inModuleURN, Object inParameter) { super(new I18NBoundMessage2P(Messages.UNSUPPORTED_REQ_PARM_TYPE, inModuleURN.getValue(), inParameter == null ? String.valueOf(null) :inParameter.getClass().getName())); } }
public static MarketceteraFIXException createFieldNotFoundException(FieldNotFound fnf, Message message) { String fieldName = CurrentFIXDataDictionary.getCurrentFIXDataDictionary().getHumanFieldName(fnf.field); return new MarketceteraFIXException(fnf, new I18NBoundMessage2P(Messages.FIX_FNF_MSG, fieldName, message)); } private static final long serialVersionUID = 5430289756961955558L;
/** * Creates an instance. * * @param inModuleURN the module throwing this exception * @param inParameter the offending parameter value */ public IllegalRequestParameterValue(ModuleURN inModuleURN, Object inParameter) { super(new I18NBoundMessage2P(Messages.ILLEGAL_REQ_PARM_VALUE, inModuleURN.getValue(), ObjectUtils.toString(inParameter,null))); }
/** * Creates an instance * * @param inModuleURN the module throwing this exception * @param inParameter the parameter value * @param inCause the cause */ public IllegalRequestParameterValue(ModuleURN inModuleURN, Object inParameter, Throwable inCause) { super(inCause, new I18NBoundMessage2P(Messages.ILLEGAL_REQ_PARM_VALUE, inModuleURN.getValue(), ObjectUtils.toString(inParameter,null))); } }
/** * Validates that the module instance with the specified URN is * from the provider with the specified provider URN. * * @param inInstanceURN the instance URN * @param inProviderURN the provider URN * * @throws InvalidURNException if the module instance is not * from the specified provider URN */ private static void validateInstanceOf(ModuleURN inInstanceURN, ModuleURN inProviderURN) throws InvalidURNException { if(!inProviderURN.parentOf(inInstanceURN)) { throw new InvalidURNException(new I18NBoundMessage2P( Messages.INSTANCE_PROVIDER_URN_MISMATCH, inInstanceURN.toString(), inProviderURN.toString())); } }
/** * Cancel the market data request with the given id. * * @param inMarketDataRequestData a <code>String</code> value * @throws FieldNotFound if the market data request cancel cannot be constructed * @throws SessionNotFound if the cancel message cannot be sent */ private void cancelMarketDataRequest(RequestData inMarketDataRequestData) throws FieldNotFound, SessionNotFound { Message marketDataCancel = messageFactory.newMarketDataRequest(inMarketDataRequestData.requestId, inMarketDataRequestData.requestedInstruments, inMarketDataRequestData.marketDataRequest.getExchange(), Lists.newArrayList(inMarketDataRequestData.marketDataRequest.getContent()), quickfix.field.SubscriptionRequestType.DISABLE_PREVIOUS_SNAPSHOT_PLUS_UPDATE_REQUEST); if(!Session.sendToTarget(marketDataCancel, sessionId)) { throw new CoreException(new I18NBoundMessage2P(Messages.CANNOT_CANCEL_DATA, marketDataCancel, sessionId)); } } /**
/** * Validates the contents of the given list. * * @param inQuotes a <code>List<? extends QuoteEvent></code> value * @param inInstrument an <code>Instrument</code> value * @throws IllegalArgumentException if any entry in the list is null * @throws IllegalArgumentException if an entry in the list is for a different instrument than the one given */ private static void validateList(List<? extends QuoteEvent> inQuotes, Instrument inInstrument) { for(QuoteEvent quote : inQuotes) { if(quote == null) { EventServices.error(new I18NBoundMessage1P(VALIDATION_LIST_CONTAINS_NULL, String.valueOf(inQuotes))); } if(!inInstrument.equals(quote.getInstrument())) { EventServices.error(new I18NBoundMessage2P(VALIDATION_LIST_INCORRECT_INSTRUMENT, quote, inInstrument)); } } } /**
/** * Validates if this entity can be saved. This method * * @throws ValidationException if the validation failed. * @throws PersistenceException if a problem was encountered * when carrying out validation. */ @PreUpdate @PrePersist public void validate() throws PersistenceException { if(getName() == null || getName().trim().length() < 1) { throw new ValidationException(UNSPECIFIED_NAME_ATTRIBUTE); } if(getName().length() > 255) { throw new ValidationException(new I18NBoundMessage1P( NAME_ATTRIBUTE_TOO_LONG,getName())); } //Verify that the name can be saved if(!namePattern.matcher(getName()).matches()) { throw new ValidationException(new I18NBoundMessage2P( NAME_ATTRIBUTE_INVALID,getName(), namePattern.toString())); } } /**
@Override public synchronized final void start() { doStart(); if(parameters.getUseJms()) { try { emitter = new RemoteDataEmitter(parameters.getURL(), parameters.getUsername(), String.valueOf(parameters.getPassword()), this); } catch (Exception e) { throw new ConnectionException(e, new I18NBoundMessage2P(Messages.ERROR_JMS_CONNECT, parameters.getURL(), parameters.getUsername())); } } else { emitter = null; } running.set(true); } /* (non-Javadoc)
} catch (IllegalArgumentException e) { throw new MXBeanOperationException(e, new I18NBoundMessage2P( Messages.CANNOT_CREATE_MODULE_PARAM_CONVERT_ERROR, providerURN.toString(),i));
throw new CoreException(new I18NBoundMessage2P(Messages.ALGO_SPEC_MISMATCH, algoSpec.getName(), inCannonicalAlgoSpec.getName()));
throw new MessageCreationException(new I18NBoundMessage2P( Messages.MESSAGE_HAS_GROUPS, iterator.next(), inMessage.toString()));
inSupport); } catch (Exception e) { throw new RequestDataException(new I18NBoundMessage2P(Messages.INVALID_DATA_REQUEST_PAYLOAD, stringPayload, ExceptionUtils.getRootCause(e))); new I18NBoundMessage2P(Messages.MARKET_DATA_REQUEST_FAILED, inRequest, ExceptionUtils.getRootCause(e)));
/** * Validates the module instance URN. * * @param inURN the module instance URN. * @param inProviderURN the module provider URN. If not null, * the module URN is verified to have this URN as its prefix. * * @throws InvalidURNException if the module URN is invalid. */ public static void validateInstanceURN(ModuleURN inURN, ModuleURN inProviderURN) throws InvalidURNException { validateProviderURN(inURN, Messages.INCOMPLETE_INSTANCE_URN, true); if(!inURN.instanceURN()) { throw new InvalidURNException(new I18NBoundMessage1P( Messages.INCOMPLETE_INSTANCE_URN, inURN.toString())); } String instanceName = inURN.instanceName(); if(!isValidIdentifier(instanceName)) { throw new InvalidURNException(new I18NBoundMessage2P( Messages.INVALID_INSTANCE_URN, inURN.toString(), instanceName)); } if (inProviderURN != null) { validateInstanceOf(inURN, inProviderURN); } }
parameters[0]); case 2 : return new I18NBoundMessage2P((I18NMessage2P)message, parameters[0], parameters[1]);
getClient().sendOrderRaw((FIXOrder) inData); } else { throw new UnsupportedDataTypeException(new I18NBoundMessage2P( Messages.UNSUPPORTED_DATA_TYPE, inFlowID.getValue(), ObjectUtils.toString(inData))); ObjectUtils.toString(inData))); } catch (OrderValidationException e) { throw new ReceiveDataException(e, new I18NBoundMessage2P( Messages.SEND_ORDER_VALIDATION_FAILED, inFlowID.getValue(), ObjectUtils.toString(inData)));
getFlowsParticipatingNotInitiated(inModule.getURN()); if(participating != null && (!participating.isEmpty())) { throw new DataFlowException(new I18NBoundMessage2P( Messages.CANNOT_STOP_MODULE_DATAFLOWS, inModule.getURN().toString(),
throw new InvalidURNException(new I18NBoundMessage2P( Messages.INVALID_PROVIDER_TYPE, inURN.toString(),provType)); throw new InvalidURNException(new I18NBoundMessage2P( Messages.INVALID_PROVIDER_NAME, inURN.toString(),provName));