use of com.creditease.monitor.jee.servlet30.DynamicServletContextProcessor in project uavstack by uavorg.
the class JettyPlusIT method onServletRegist.
/**
* onServletRegist
*
* @param args
* @return
*/
public ServletContext onServletRegist(Object... args) {
ServletContext servletContext;
ServletContextEvent sce;
if (ServletContextEvent.class.isAssignableFrom(args[0].getClass())) {
sce = (ServletContextEvent) args[0];
servletContext = sce.getServletContext();
} else {
servletContext = (ServletContext) args[0];
}
ServletContext scProxy = (ServletContext) servletContext.getAttribute("com.creditease.uav.mof.tomcat.servletcontext");
if (scProxy == null) {
scProxy = JDKProxyInvokeUtil.newProxyInstance(ServletContext.class.getClassLoader(), new Class<?>[] { ServletContext.class }, new JDKProxyInvokeHandler<ServletContext>(servletContext, new DynamicServletContextProcessor()));
servletContext.setAttribute("com.creditease.uav.mof.tomcat.servletcontext", scProxy);
}
return scProxy;
}
use of com.creditease.monitor.jee.servlet30.DynamicServletContextProcessor in project uavstack by uavorg.
the class TomcatPlusIT method onServletRegist.
/**
* onServletRegist
*
* @param args
* @return
*/
public ServletContext onServletRegist(Object... args) {
ServletContext servletContext = (ServletContext) args[0];
// uav's inner app doesn't need Profiling,just return origin servletContext here.
if ("/com.creditease.uav".equals(servletContext.getContextPath())) {
return servletContext;
}
ServletContext scProxy = (ServletContext) servletContext.getAttribute("com.creditease.uav.mof.tomcat.servletcontext");
if (scProxy == null) {
scProxy = JDKProxyInvokeUtil.newProxyInstance(ServletContext.class.getClassLoader(), new Class<?>[] { ServletContext.class }, new JDKProxyInvokeHandler<ServletContext>(servletContext, new DynamicServletContextProcessor()));
servletContext.setAttribute("com.creditease.uav.mof.tomcat.servletcontext", scProxy);
}
return scProxy;
}
Aggregations