import org.springframework.web.servlet.mvc.ParameterizableViewController;
import org.tanukisoftware.wrapper.WrapperManager;
public class WrapperInfoController extends ParameterizableViewController {
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
WrapperInfo wi = new WrapperInfo();
try {
Class.forName("org.tanukisoftware.wrapper.WrapperManager");
wi.setVersion(WrapperManager.getVersion());
wi.setBuildTime(WrapperManager.getBuildTime());
wi.setUser(WrapperManager.getUser(false) != null ? WrapperManager.getUser(false).getUser() : null);
wi.setInteractiveUser(WrapperManager.getInteractiveUser(false) != null ? WrapperManager.getInteractiveUser(false).getUser() : null);
wi.setJvmPid(WrapperManager.getJavaPID());
wi.setWrapperPid(WrapperManager.getWrapperPID());
wi.setProperties(WrapperManager.getProperties().entrySet());
wi.setControlledByWrapper(WrapperManager.isControlledByNativeWrapper());
wi.setDebugEnabled(WrapperManager.isDebugEnabled());
wi.setLaunchedAsService(WrapperManager.isLaunchedAsService());
} catch (ClassNotFoundException e) {
logger.info("Could not find WrapperManager class. Is wrapper.jar in the classpath?");
wi.setControlledByWrapper(false);
}
return new ModelAndView(getViewName(), "wrapperInfo", wi);
}