code: public void attachWriter(final HttpSession newWriter) {
          // The attachWriter processing must be done in this WsebSession's IO thread so we can do
          // getProcessor().flush(). We may need to do "thread hopping" for this since attachWriter gets called by
          // WsebDownstreamHandler.reconnectSession during sessionOpened on the downstream, which may be running
          // in another I/O thread.
          if (Thread.currentThread() == getIoThread()) {
              attachWriter0(newWriter);
          }
          else {
              final Thread ioThread = getIoThread();
              final Executor ioExecutor = getIoExecutor();
              newWriter.setIoAlignment(NO_THREAD, NO_EXECUTOR);
              ioExecutor.execute(new Runnable() {
                  @Override
                  public void run() {
                      newWriter.setIoAlignment(ioThread, ioExecutor);
                      attachWriter0(newWriter);
                  }
              });
          }
      }
docs: Attach new writer immediately if there is none. Or, if there already is one, enqueue a request to
  switch to the new writer, which will be done by WsebAcceptProcessor.flushInternal (this avoids
  races between that method and this one, see KG-2756).
  @param newWriter