/*------------------------------------------------------------ */
  @Override
  public void doStart() throws Exception {
    super.doStart();
    __log.debug("KVStoreSessionManager::doStart method");
    String kvstorename = this._session_id_manager.getKvstorename();
    if (kvstorename == null) throw new IllegalStateException("kvstore name is null");
    String kvstorehosts = this._session_id_manager.getKvstorehosts();
    if (kvstorehosts == null) throw new IllegalStateException("kvstore hosts list is null");
    this._kvstorehandler = this._session_id_manager.getKVStore();
    String[] hhosts = this._session_id_manager.getKvstorehosts().split(",");
    KVStoreConfig kconfig = new KVStoreConfig(this._session_id_manager.getKvstorename(), hhosts);
    KVStore kvstore = KVStoreFactory.getStore(kconfig);
    if (kvstore == null)
      throw new IllegalStateException(
          "cannot connect to kvstore, hosts=" + kvstorehosts + ";storename=" + kvstorename);
    else __log.debug("succesfully connected to the kvstore instance");
    this._kvstorehandler = kvstore;

    if (this._kvstorehandler == null)
      throw new IllegalStateException("kvstore handler passed from session id manager is null");
    String[] hosts = getContextHandler().getVirtualHosts();

    if (hosts == null || hosts.length == 0) hosts = new String[] {"::"}; // IPv6 equiv of 0.0.0.0

    String contextPath = getContext().getContextPath();
    if (contextPath == null || "".equals(contextPath)) {
      contextPath = "*";
    }

    _contextId = createContextId(hosts, contextPath);
    this.kvstore_object_ops = new ArrayList<Operation>();
  }
  /*------------------------------------------------------------ */
  @Override
  public void doStart() throws Exception {
    super.doStart();
    String[] hosts = getContextHandler().getVirtualHosts();
    // TODO: can this be replaced?
    /*if (hosts == null || hosts.length == 0)
    hosts = getContextHandler().getConnectorNames();*/
    if (hosts == null || hosts.length == 0) hosts = new String[] {"::"}; // IPv6 equiv of 0.0.0.0

    String contextPath = getContext().getContextPath();
    if (contextPath == null || "".equals(contextPath)) {
      contextPath = "*";
    }

    _contextId = createContextId(hosts, contextPath);

    __version_1 = new BasicDBObject(getContextKey(__VERSION), 1);
  }