docs: protected void initDelegate(boolean require) throws PortletException {
          final ApplicationContext wac = findWebApplicationContext();
          PortletFilter delegate = null;
  
          //Check if initialization is complete
          this.delegateReadLock.lock();
          try {
              delegate = this.delegate;
          }
          finally {
              this.delegateReadLock.unlock();
          }
  
          //Return if the delegate filter was found
          if (delegate != null) {
              return;
          }
  
          this.delegateWriteLock.lock();
          try {
              //Already initialized
              if (this.delegate != null) {
                  return;
              }
  
              //Verify app context is available
              if (wac == null) {
                  //If required init throw an exception for a missing app context
                  if (require) {
                      throw new IllegalStateException("No ApplicationContext found: no ContextLoaderListener registered?");
                  }
  
                  //No app context and not required init, just ignore the init request
                  return;
              }
  
              //Load and init the delegate filter
              delegate = wac.getBean(getTargetBeanName(), PortletFilter.class);
              if (isTargetFilterLifecycle()) {
                  delegate.init(getFilterConfig());
              }
  
              //init local fields
              this.delegate = delegate;
              if (delegate instanceof ActionFilter) {
                  actionDelegate = (ActionFilter)delegate;
              }
              if (delegate instanceof EventFilter) {
                  eventDelegate = (EventFilter)delegate;
              }
              if (delegate instanceof RenderFilter) {
                  renderDelegate = (RenderFilter)delegate;
              }
              if (delegate instanceof ResourceFilter) {
                  resourceDelegate = (ResourceFilter)delegate;
              }
          }
          finally {
              this.delegateWriteLock.unlock();
          }
      }