Пример #1
0
 @Override
 public Collection<ResourceLoader> getResourceLoadersToRegister() throws Exception {
   ResourceLoader ksbRemoteResourceLoader =
       KSBResourceLoaderFactory.createRootKSBRemoteResourceLoader();
   ksbRemoteResourceLoader.start();
   return Collections.singletonList(ksbRemoteResourceLoader);
 }
Пример #2
0
 @Override
 protected void doAdditionalModuleStartLogic() throws Exception {
   if (StringUtils.isNotBlank(dispatchServletName)) {
     DispatcherServlet loaderServlet =
         new DispatcherServlet(
             (WebApplicationContext)
                 ((SpringResourceLoader) rootResourceLoader.getResourceLoaders().get(0))
                     .getContext());
     ServletRegistration registration =
         getServletContext().addServlet(dispatchServletName, loaderServlet);
     registration.addMapping("/" + dispatchServletName + "/*");
     if (dispatchServletMappings != null) {
       dispatchServletMappings
           .stream()
           .map(mapping -> "/" + mapping + "/*")
           .forEach(registration::addMapping);
     }
     if (mapFilters) {
       for (String filterName : filtersToMap) {
         FilterRegistration filter = getServletContext().getFilterRegistration(filterName);
         filter.addMappingForServletNames(null, true, dispatchServletName);
       }
     }
     if (enableSpringSecurity) {
       DelegatingFilterProxy filterProxy =
           new DelegatingFilterProxy(
               SPRING_SECURITY_FILTER_CHAIN,
               (WebApplicationContext)
                   ((SpringResourceLoader) rootResourceLoader.getResourceLoaders().get(0))
                       .getContext());
       FilterRegistration.Dynamic securityFilter =
           getServletContext()
               .addFilter(KC_PREFIX + getModuleName() + SPRING_SECURITY_FILTER_PROXY, filterProxy);
       securityFilter.addMappingForServletNames(null, true, dispatchServletName);
     }
   }
 }