code: @Override
      public final void setHandler(org.apache.mina.core.service.IoHandler handler) {
          if (handler == null) {
              throw new NullPointerException("handler cannot be null");
          }
  
          if (isActive()) {
              throw new IllegalStateException(
                      "handler cannot be set while the service is active.");
          }
  
          this.handler = handler;
      }
docs: {@inheritDoc}