Package com.opengamma.financial.portfolio.save

Examples of com.opengamma.financial.portfolio.save.SavePortfolio


    s_logger.info("Aggregation complete, about to persist...");
    if (aggregatedPortfolio == null) {
      s_logger.error("Portfolio " + portfolioName + " was not correctly aggregated by the Portfolio Aggregator");
      System.exit(1);
    }
    SavePortfolio savePortfolio = new SavePortfolio(newFixedThreadPool, portfolioMaster, positionMaster);
    if (split) {
      for (PortfolioNode portfolioNode : aggregatedPortfolio.getRootNode().getChildNodes()) {
        String splitPortfolioName = portfolioName + " (" + aggregationName + " " + portfolioNode.getName() + ")";
        SimplePortfolioNode root = new SimplePortfolioNode("root");
        root.addChildNode(portfolioNode);
        Portfolio splitPortfolio = new SimplePortfolio(splitPortfolioName, root);
        splitPortfolio.setAttributes(aggregatedPortfolio.getAttributes());
        s_logger.info("Saving split portfolio " + portfolioName + "...");
        savePortfolio.savePortfolio(splitPortfolio, true);
      }

    } else {
      savePortfolio.savePortfolio(aggregatedPortfolio, true); // update matching named portfolio.
    }
    s_logger.info("Saved.");

    // Shut down thread pool before returning
    newFixedThreadPool.shutdown();
View Full Code Here


            resolvePortfolio = PortfolioCompiler.resolvePortfolio(portfolio, _executorService, getToolContext().getSecuritySource());
          } catch (Exception ex) {
            s_logger.warn(String.format("Error resolving porfolio %s", portfolio.getName()), ex);
            continue;
          }
          SavePortfolio savePortfolio = new SavePortfolio(_executorService, demoPortfolioMaster, demoPositionMaster);
          savePortfolio.savePortfolio(resolvePortfolio, true);
        }
      }
    };
    String[] args = {"-c", _serverUrl };
    remoteServerTool.initAndRun(args, ToolContext.class);
View Full Code Here

    _securitySource = securitySource;
    _combinedConfigSource = combinedConfigSource;
    _userConfigMaster = userConfigMaster;
    _userPortfolioMaster = userPortfolioMaster;
    _portfolioAggregators = portfolioAggregators;
    _portfolioSaver = new SavePortfolio(Executors.newSingleThreadExecutor(), userPortfolioMaster, userPositionMaster);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.financial.portfolio.save.SavePortfolio

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.