code: void doDeploy(URI uri, Consumer<EndpointServlet> endpointServletConsumer, Consumer<DeploymentInfo> deploymentInfoConsumer, Consumer<DeploymentImpl> deploymentConsumer) {
  
          final ServletInfo servletInfo = Servlets.servlet(EndpointServlet.NAME, EndpointServlet.class).addMapping("/*")
                  .setAsyncSupported(true);
  
          final DeploymentInfo mainDeploymentInfo = deploymentInfoSupplier.getValue();
  
          DeploymentInfo endPointDeplyomentInfo = adaptDeploymentInfo(mainDeploymentInfo, uri, servletInfo);
          deploymentInfoConsumer.accept(endPointDeplyomentInfo);
          CamelLogger.LOGGER.debug("Deploying endpoint {}", endPointDeplyomentInfo.getDeploymentName());
  
          final ClassLoader old = Thread.currentThread().getContextClassLoader();
          Thread.currentThread().setContextClassLoader(endPointDeplyomentInfo.getClassLoader());
          try {
              final DeploymentManager manager = servletContainerServiceSupplier.getValue().getServletContainer()
                      .addDeployment(endPointDeplyomentInfo);
              manager.deploy();
              final Deployment deployment = manager.getDeployment();
              try {
                  deploymentConsumer.accept((DeploymentImpl) deployment);
                  manager.start();
                  hostSupplier.getValue().registerDeployment(deployment, deployment.getHandler());
  
                  ManagedServlet managedServlet = deployment.getServlets().getManagedServlet(EndpointServlet.NAME);
  
                  EndpointServlet servletInstance = (EndpointServlet) managedServlet.getServlet().getInstance();
                  endpointServletConsumer.accept(servletInstance);
              } catch (ServletException ex) {
                  throw new IllegalStateException(ex);
              }
              synchronized (deployments) {
                  deployments.put(uri, manager);
              }
          } finally {
              Thread.currentThread().setContextClassLoader(old);
          }
      }
docs: The stuff common for {@link #deploy(URI, EndpointHttpHandler)} and {@link #deploy(URI, HttpHandler)}.
  
  @param uri
  @param endpointServletConsumer customize the {@link EndpointServlet}
  @param deploymentInfoConsumer customize the {@link DeploymentInfo}
  @param deploymentConsumer customize the {@link DeploymentImpl}