docs: @Override
      public synchronized String register(ServletConfig config) throws PortletContainerException {
          ServletContext servletContext = config.getServletContext();
          String contextPath = servletContext.getContextPath();
          if (!portletContexts.containsKey(contextPath)) {
  
              PortletApplicationDefinition portletApp =
                      this.getPortletAppDD(servletContext, contextPath, contextPath);
  
              DriverPortletContext portletContext =
                      new DriverPortletContextImpl(
                              servletContext, portletApp, requestDispatcherService);
  
              portletContext.setAttribute(
                      PlatformApiBroker.PORTLET_CONTEXT_ATTRIBUTE_NAME, platformApiBroker);
              portletContexts.put(contextPath, portletContext);
  
              fireRegistered(portletContext);
  
              if (logger.isInfoEnabled()) {
                  logger.info("Registered portlet application for context '" + contextPath + "'");
  
                  logger.info(
                          "Registering "
                                  + portletApp.getPortlets().size()
                                  + " portlets for context "
                                  + portletContext.getApplicationName());
              }
  
              // TODO have the portlet servlet provide the portlet's classloader as parameter to this
              // method
              // This approach is needed as all pluto callbacks in uPortal have an aspect that
              // switches the thread classloader back
              // to uPortal's classloader.
              ClassLoader classLoader = ThreadContextClassLoaderAspect.getPreviousClassLoader();
              if (classLoader == null) {
                  classLoader = Thread.currentThread().getContextClassLoader();
              }
              classLoaders.put(portletApp.getName(), classLoader);
              for (PortletDefinition portlet : portletApp.getPortlets()) {
                  String appName = portletContext.getApplicationName();
                  if (appName == null) {
                      throw new PortletContainerException(
                              "Portlet application name should not be null.");
                  }
                  portletConfigs.put(
                          portletContext.getApplicationName() + "/" + portlet.getPortletName(),
                          new DriverPortletConfigImpl(portletContext, portlet));
              }
          } else {
              if (logger.isInfoEnabled()) {
                  logger.info(
                          "Portlet application for context '"
                                  + contextPath
                                  + "' already registered.");
              }
          }
          return contextPath;
      }