Package com.opengamma

Examples of com.opengamma.OpenGammaRuntimeException


  //-------------------------------------------------------------------------
  private static void loadBeanOperation(final SecurityBeanOperation<?, ?> beanOperation) {
    if (BEAN_OPERATIONS_BY_SECURITY.containsKey(beanOperation.getSecurityClass())) {
      s_logger.error(beanOperation.getSecurityClass() + " is already registered in BEAN_OPERATIONS_BY_SECURITY");
      throw new OpenGammaRuntimeException(beanOperation.getSecurityClass() + " is already registered in BEAN_OPERATIONS_BY_SECURITY");
    }
    BEAN_OPERATIONS_BY_SECURITY.put(beanOperation.getSecurityClass(), beanOperation);
    if (BEAN_OPERATIONS_BY_BEAN.containsKey(beanOperation.getBeanClass())) {
      s_logger.error(beanOperation.getBeanClass() + " is already registered in BEAN_OPERATIONS_BY_SECURITY");
      throw new OpenGammaRuntimeException(beanOperation.getBeanClass() + " is already registered in BEAN_OPERATIONS_BY_SECURITY");
    }
    BEAN_OPERATIONS_BY_BEAN.put(beanOperation.getBeanClass(), beanOperation);
    if (BEAN_OPERATIONS_BY_TYPE.containsKey(beanOperation.getSecurityType())) {
      s_logger.error(beanOperation.getBeanClass() + " is already registered in BEAN_OPERATIONS_BY_SECURITY");
      throw new OpenGammaRuntimeException(beanOperation.getBeanClass() + " is already registered in BEAN_OPERATIONS_BY_SECURITY");
    }
    BEAN_OPERATIONS_BY_TYPE.put(beanOperation.getSecurityType(), beanOperation)
  }
View Full Code Here


  @SuppressWarnings("unchecked")
  private static <T extends Security> SecurityBeanOperation<T, SecurityBean> getBeanOperation(final T security) {
    final SecurityBeanOperation<?, ?> beanOperation = getBeanOperation(BEAN_OPERATIONS_BY_SECURITY, security.getClass());
    if (beanOperation == null) {
      throw new OpenGammaRuntimeException("can't find BeanOperation for " + security);
    }
    return (SecurityBeanOperation<T, SecurityBean>) beanOperation;
  }
View Full Code Here

      }
      if (ZeroCouponInflationSwapSecurity.SECURITY_TYPE.equals(type) || YearOnYearInflationSwapSecurity.SECURITY_TYPE.equals(type)) {
        beanOperation = BEAN_OPERATIONS_BY_TYPE.get(SwapSecurity.SECURITY_TYPE);
      }
      if (beanOperation == null) {
        throw new OpenGammaRuntimeException("can't find BeanOperation for " + type);
      }
    }
    return (SecurityBeanOperation<Security, T>) beanOperation;
  }
View Full Code Here

          }
          FixedHistoricalMarketDataSpecification valuationDateSpec = new FixedHistoricalMarketDataSpecification(valuationDate);
          FixedHistoricalMarketDataSpecification previousHistoricalDateSpec = new FixedHistoricalMarketDataSpecification(previousHistoricalDate);
          return new HistoricalShockMarketDataSpecification(ShockType.PROPORTIONAL, previousHistoricalDateSpec, historicalDateSpec, valuationDateSpec);
        default:
          throw new OpenGammaRuntimeException("Unsupported market data mode: " + _marketDataMode);
      }
    }
View Full Code Here

      case VARIANCE:
        return "variance";
      case VEGA:
        return "vega";
      default:
        throw new OpenGammaRuntimeException("unexpected value " + value);
    }
  }
View Full Code Here

  public void initialize(final InitializingBean object) {
    if (isInitialized(object) == false) {
      try {
        object.afterPropertiesSet();
      } catch (final Exception ex) {
        throw new OpenGammaRuntimeException(ex.getMessage(), ex);
      }
      _initialized.add(object);
    }
  }
View Full Code Here

      // handle factories
      if (instance instanceof FactoryBean<?>) {
        try {
          instance = ((FactoryBean<?>) instance).getObject();
        } catch (final Exception ex) {
          throw new OpenGammaRuntimeException("FactoryBean threw exception", ex);
        }
        initialize0(instance);
        registerInstanceInterfaces0(instance);
      }
View Full Code Here

  private ObjectName generateObjectName(final Object managedResource) {
    ObjectName objectName;
    try {
      objectName = new ObjectName("com.opengamma:name=" + managedResource.getClass().getSimpleName());
    } catch (final Exception ex) {
      throw new OpenGammaRuntimeException("Could not generate object name for " + managedResource, ex);
    }
    return objectName;
  }
View Full Code Here

      case OIS:
        return "ois";
      case OVERNIGHT_ARITHMETIC_AVERAGE:
        return "overnightArithmeticAverage";
      default:
        throw new OpenGammaRuntimeException("unexpected value " + value);
    }
  }
View Full Code Here

    s_logger.debug("Unzipping file:{} to {}", archive, outputDir);
    try {
      FileUtils.forceMkdir(outputDir);
      unzipArchive(new ZipFile(archive), outputDir);
    } catch (Exception ex) {
      throw new OpenGammaRuntimeException("Error while extracting file: " + archive + " to: " + outputDir, ex);
    }
  }
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.