/** * Checks to see if the client is closed and fails if the client * is closed. * * @throws IllegalStateException if the client is closed. */ private void failIfClosed() throws IllegalStateException { if(mClosed) { throw new IllegalStateException(Messages.CLIENT_CLOSED.getText()); } }
/** * Fails if the connection to the client has been closed. * * @throws IllegalStateException if the connection to the client has been closed. */ protected void failIfClosed() throws IllegalStateException { if(!isRunning()) { throw new IllegalStateException(Messages.CLIENT_CLOSED.getText()); } } /**
public void afterPropertiesSet() throws Exception { if((cachedSessionID != null) && ((beginString != null ) || (senderCompID != null) || (targetCompID != null))) { throw new IllegalStateException(Messages.ERROR_CONFIG_SESSIONID_INDIVIDUAL_PROPS_SET.getText()); } if(cachedSessionID == null) { cachedSessionID = new SessionID(beginString, senderCompID, targetCompID); } updateSessionIDFields(); } }
/** * Verifies if the module is not started. * * @param inMessage the message to use when the module is started. * * @throws IllegalStateException if the module is started. */ private void failIfStarted(I18NMessage0P inMessage) { if(getState().isStarted()) { throw new IllegalStateException(inMessage.getText()); } }
@Override public TradeEvent create() { if(getTradeData().getInstrument() instanceof Equity) { return new EquityTradeEventImpl(getTradeData()); } throw new IllegalArgumentException(VALIDATION_EQUITY_REQUIRED.getText()); } };
@Override public AskEvent create() { if(getQuote().getInstrument() instanceof Equity) { return new EquityAskEventImpl(getQuote()); } throw new IllegalArgumentException(VALIDATION_EQUITY_REQUIRED.getText()); } };
@Override public ImbalanceEvent create() { if(!(getImbalance().getInstrument() instanceof Equity)) { throw new IllegalArgumentException(VALIDATION_EQUITY_REQUIRED.getText()); } return new EquityImbalanceEvent(getImbalance()); } };
@Override public BidEvent create() { if(getQuote().getInstrument() instanceof Equity) { return new EquityBidEventImpl(getQuote()); } throw new IllegalArgumentException(VALIDATION_EQUITY_REQUIRED.getText()); } };
@Override public AskEvent create() { if(getQuote().getInstrument() instanceof Currency) { return new CurrencyAskEventImpl(getQuote(), getCurrency()); } throw new IllegalArgumentException(VALIDATION_CURRENCY_REQUIRED.getText()); } };
@Override public TradeEvent create() { if(getTradeData().getInstrument() instanceof Currency) { return new CurrencyTradeEventImpl(getTradeData(), getCurrency()); } throw new IllegalArgumentException(VALIDATION_CURRENCY_REQUIRED.getText()); } };
@Override public AskEvent create() { if(getQuote().getInstrument() instanceof Option) { return new OptionAskEventImpl(getQuote(), getOption()); } throw new IllegalArgumentException(VALIDATION_OPTION_REQUIRED.getText()); } };
@Override public ImbalanceEvent create() { if(!(getImbalance().getInstrument() instanceof Future)) { throw new IllegalArgumentException(VALIDATION_FUTURE_REQUIRED.getText()); } return new FutureImbalanceEvent(getImbalance(), getFuture()); } };
@Override public MarketstatEvent create() { if(!(getMarketstat().getInstrument() instanceof ConvertibleBond)) { throw new IllegalArgumentException(VALIDATION_BOND_REQUIRED.getText()); } return new ConvertibleBondMarketstatEventImpl(getMarketstat(), getConvertibleBond()); } };
@Override public BidEvent create() { if(getQuote().getInstrument() instanceof Option) { return new OptionBidEventImpl(getQuote(), getOption()); } throw new IllegalArgumentException(VALIDATION_OPTION_REQUIRED.getText()); } };
@Override public BidEvent create() { if(getQuote().getInstrument() instanceof Currency) { return new CurrencyBidEventImpl(getQuote(), getCurrency()); } throw new IllegalArgumentException(VALIDATION_CURRENCY_REQUIRED.getText()); } };
@Override public BidEvent create() { if(getQuote().getInstrument() instanceof ConvertibleBond) { return new ConvertibleBondBidEventImpl(getQuote(), getConvertibleBond()); } throw new IllegalArgumentException(VALIDATION_BOND_REQUIRED.getText()); } };
@Override public ImbalanceEvent create() { if(!(getImbalance().getInstrument() instanceof ConvertibleBond)) { throw new IllegalArgumentException(VALIDATION_BOND_REQUIRED.getText()); } return new ConvertibleBondImbalanceEvent(getImbalance(), getConvertibleBond()); } };
@Override public TradeEvent create() { if(getTradeData().getInstrument() instanceof ConvertibleBond) { return new ConvertibleBondTradeEventImpl(getTradeData(), getConvertibleBond()); } throw new IllegalArgumentException(VALIDATION_BOND_REQUIRED.getText()); } };
@Override public AskEvent create() { if(getQuote().getInstrument() instanceof ConvertibleBond) { return new ConvertibleBondAskEventImpl(getQuote(), getConvertibleBond()); } throw new IllegalArgumentException(VALIDATION_BOND_REQUIRED.getText()); } };