1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  package psiprobe.controllers.apps;
12  
13  import org.apache.catalina.Context;
14  import org.slf4j.Logger;
15  import org.slf4j.LoggerFactory;
16  import org.springframework.security.core.Authentication;
17  import org.springframework.security.core.context.SecurityContextHolder;
18  
19  
20  
21  
22  public class BaseReloadContextController extends AbstractNoSelfContextHandlerController {
23  
24    
25    private static final Logger logger = LoggerFactory.getLogger(BaseReloadContextController.class);
26  
27    @Override
28    protected void executeAction(String contextName) throws Exception {
29      Context context = getContainerWrapper().getTomcatContainer().findContext(contextName);
30      if (context != null) {
31        context.reload();
32  
33        
34        Authentication auth = SecurityContextHolder.getContext().getAuthentication();
35        
36        String name = auth.getName();
37        logger.info(getMessageSourceAccessor().getMessage("probe.src.log.reload"), name, contextName);
38      }
39    }
40  
41  }