Package com.bloomberglp.blpapi

Examples of com.bloomberglp.blpapi.Session


      }
    }
    s_logger.info("Connecting to {} ", SessionOptionsUtils.toString(_bloombergConnector.getSessionOptions()));
    BloombergTickCollectorHandler handler = new BloombergTickCollectorHandler(_allTicksQueue, this);
    for (int i = 0; i < _bbgSessions; i++) {
      Session session = new Session(_bloombergConnector.getSessionOptions(), handler);
      if (!session.start()) {
        s_logger.info("Failed to start session");
        return false;
      }
      if (!session.openService("//blp/mktdata")) {
        s_logger.info("Failed to open service //blp/mktdata");
        session.stop();
        return false;
      }
      _sessionList.add(session);
    }
    s_logger.info("Connected successfully\n");
   
    s_logger.info("Subscribing ...");
    int index = 0;
    for (Session session : _sessionList) {
      session.subscribe(_subscriptionsList.get(index));
      index++;
    }
    return true;
  }
View Full Code Here


   *
   * @return the started Bloomberg session, not null
   * @throws RuntimeException if an error occurs
   */
  public Session createOpenSession() {
    Session session = createSession();
    try {
      if (session.start() == false) {
        throw new OpenGammaRuntimeException("Bloomberg session failed to start: " + SessionOptionsUtils.toString(getSessionOptions()));
      }
    } catch (InterruptedException ex) {
      Thread.interrupted();
      throw new OpenGammaRuntimeException("Bloomberg session failed to start: " + SessionOptionsUtils.toString(getSessionOptions()), ex);
View Full Code Here

   * The session is not opened.
   *
   * @return the Bloomberg session, not null
   */
  public Session createSession() {
    return new Session(getSessionOptions());
  }
View Full Code Here

        if (Duration.between(_lastRetry, now).compareTo(_retryDuration) < 0) {
          throw new ConnectionUnavailableException("No Bloomberg connection is available");
        }
        _lastRetry = now;
        s_logger.info("Bloomberg session being opened...");
        Session session;
        try {
          session = _connector.createOpenSession();
        } catch (OpenGammaRuntimeException e) {
          throw new ConnectionUnavailableException("Failed to open session", e);
        }
        s_logger.info("Bloomberg session open");
        s_logger.info("Bloomberg service being opened...");
        try {
          if (!session.openService(_serviceName)) {
            throw new ConnectionUnavailableException("Bloomberg service failed to start: " + _serviceName);
          }
        } catch (InterruptedException ex) {
          Thread.interrupted();
          throw new ConnectionUnavailableException("Bloomberg service failed to start: " + _serviceName, ex);
View Full Code Here

TOP

Related Classes of com.bloomberglp.blpapi.Session

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.