docs: @Override
      public void setWriteListener(WriteListener appWLObject) {
          //Throw a NullPointerException if the WriteListener passed in was null
          if(appWLObject == null){            
  
              Tr.error(tc, "writelistener.is.null");  
              throw new NullPointerException(Tr.formatMessage(tc, "writelistener.is.null"));
          } 
          if(_outHelper.isOutputStream_closed() || _outHelper.isOutputStream_close_initiated_but_not_Flush_ready()){
              Tr.error(tc, "stream.is.closed.no.read.write");                         
              throw new IllegalStateException(Tr.formatMessage(tc, "stream.is.closed.no.read.write"));           
          }
          //Throw an IllegalStateException is there was already a WriteListener set for this InputStream
          if(this._listener != null){            
              Tr.error(tc, "writelistener.already.started");                         
              throw new IllegalStateException(Tr.formatMessage(tc, "writelistener.already.started"));
          } 
          this._listener = appWLObject;        
          //Create the ThreadContextManager to save off the threads information to pass onto new threads
          ThreadContextManager tcm = new ThreadContextManager();
          //Create a new callback
          this.callback = new UpgradeAsyncWriteCallback(this._listener, this , tcm, _outHelper._upConn);                         
          _outHelper.setWriteListenerCallBack(callback);
          _outHelper.set_listener(_listener);
  
          //Create the WriteListenerRunnable to call onWritePossible on a new thread
          UpgradeWriteListenerRunnable wlRunnable = new UpgradeWriteListenerRunnable(this._listener, this , tcm, callback);
  
          // make sure no more write allowed on this Thread as this set
          // WriteListener.
          WebContainerRequestState reqState = WebContainerRequestState.getInstance(true);
  //        reqState.setAttribute("com.ibm.ws.webcontainer.upgrade.ThisThreadSetWL", true);
          reqState.removeAttribute("com.ibm.ws.webcontainer.upgrade.WriteAllowedonThisThread");
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){  
              Tr.debug(tc, "setWriteListener: start new thread with wlRunnable");
          }
  
          try {
              com.ibm.ws.webcontainer.osgi.WebContainer.getExecutorService().execute(wlRunnable);
          } catch (Exception e) {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){  
                  Tr.debug(tc, "setWriteListener: An exception occurred during the execute : " + e);
              }
              this.callback.error(_outHelper.get_vc(), e);                
          }
  
  
      }