Package com.opengamma

Examples of com.opengamma.OpenGammaRuntimeException


  @Override
  public FutureSecurity visitRateFutureNode(final RateFutureNode rateFuture) {
    final Convention futureConvention = _conventionSource.getConvention(rateFuture.getFutureConvention());
    if (futureConvention == null) {
      throw new OpenGammaRuntimeException("Future convention was null");
    }
    if (futureConvention instanceof InterestRateFutureConvention) {
      return getInterestRateFuture(rateFuture, (InterestRateFutureConvention) futureConvention, _rate);
    } else if (futureConvention instanceof FederalFundsFutureConvention) {
      return getFederalFundsFuture(rateFuture, (FederalFundsFutureConvention) futureConvention, _rate);
    }
    throw new OpenGammaRuntimeException("Could not handle future convention of type " + futureConvention.getClass());
  }
View Full Code Here


  }

  public static void fromFudgeMsg(FudgeDeserializer deserializer, FudgeMsg msg, FXForwardSecurity object) {
    FinancialSecurityFudgeBuilder.fromFudgeMsg(deserializer, msg, object);
    if (msg.getInt(VERSION_FIELD_NAME) != VERSION) {
      throw new OpenGammaRuntimeException("Incorrect version of FXForwardSecurity persisted.  Object model has changed to not include underlying");
    }
    object.setPayCurrency(msg.getValue(Currency.class, PAY_CURRENCY_FIELD_NAME));
    object.setPayAmount(msg.getDouble(PAY_AMOUNT_FIELD_NAME));
    object.setReceiveCurrency(msg.getValue(Currency.class, RECEIVE_CURRENCY_FIELD_NAME));
    object.setReceiveAmount(msg.getDouble(RECEIVE_AMOUNT_FIELD_NAME));
View Full Code Here

      getClient().accessFudge(uri).post(msg);
      try {
        if (!_startedSignalLatch.await(START_JMS_RESULT_STREAM_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)) {
          s_logger.error("Timed out after {} ms waiting for JMS result stream to be started", START_JMS_RESULT_STREAM_TIMEOUT_MILLIS);
          closeJms();
          throw new OpenGammaRuntimeException("Timed out after " + START_JMS_RESULT_STREAM_TIMEOUT_MILLIS + " ms waiting for JMS result stream to be started");
        }
      } catch (InterruptedException e) {
        s_logger.warn("Interrupted while starting JMS result stream");
        closeJms();
        throw e;
View Full Code Here

  }

  public static void validateFrequency(final String name) {
    final Frequency f = SimpleFrequencyFactory.INSTANCE.getFrequency(name);
    if (f == null) {
      throw new OpenGammaRuntimeException("Bad value for frequency (" + name + ")");
    }
  }
View Full Code Here

  }

  public static void validateDayCount(final String name) {
    final DayCount dc = DayCountFactory.INSTANCE.getDayCount(name);
    if (dc == null) {
      throw new OpenGammaRuntimeException("Bad value for dayCount (" + name + ")");
    }
  }
View Full Code Here

  }

  public static void validateBusinessDayConvention(final String name) {
    final BusinessDayConvention bdc = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention(name);
    if (bdc == null) {
      throw new OpenGammaRuntimeException("Bad value for businessDayConvention (" + name + ")");
    }
  }
View Full Code Here

    if (yieldConventionBean == null) {
      return null;
    }
    final YieldConvention yc = YieldConventionFactory.INSTANCE.getYieldConvention(yieldConventionBean.getName());
    if (yc == null) {
      throw new OpenGammaRuntimeException("Bad value for yieldConventionBean (" + yieldConventionBean.getName() + ")");
    }
    return yc;
  }
View Full Code Here

  }

  public static void validateYieldConvention(final String name) {
    final YieldConvention yc = YieldConventionFactory.INSTANCE.getYieldConvention(name);
    if (yc == null) {
      throw new OpenGammaRuntimeException("Bad value for yieldConvention (" + name + ")");
    }
  }
View Full Code Here

  private static void validateStubType(final String name) {
    try {
      StubType.valueOf(name);
    } catch (final IllegalArgumentException e) {
      throw new OpenGammaRuntimeException("Bad value for stub type (" + name + ")");
    }
  }
View Full Code Here

      return null;
    }
    try {
      return DebtSeniority.valueOf(bean.getName());
    } catch (final IllegalArgumentException e) {
      throw new OpenGammaRuntimeException("Bad value for DebtSeniority type (" + bean.getName() + ")");
    }
  }
View Full Code Here

TOP

Related Classes of com.opengamma.OpenGammaRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.