Search in sources :

Example 41 with InterceptContext

use of com.creditease.monitor.interceptframework.spi.InterceptContext in project uavstack by uavorg.

the class JaxWSCxfHookProxy method insertIntercepter.

private void insertIntercepter(HookContext context, ClassLoader webapploader) {
    if (isHookEventDone("InsertInterceptToClients")) {
        return;
    }
    InterceptContext ic = (InterceptContext) context.get(HookConstants.INTERCEPTCONTEXT);
    String contextPath = (String) ic.get(InterceptConstants.CONTEXTPATH);
    String basePath = (String) ic.get(InterceptConstants.BASEPATH);
    final String appid = MonitorServerUtil.getApplicationId(contextPath, basePath);
    doInstallDProxy(webapploader, appid);
}
Also used : InterceptContext(com.creditease.monitor.interceptframework.spi.InterceptContext)

Example 42 with InterceptContext

use of com.creditease.monitor.interceptframework.spi.InterceptContext in project uavstack by uavorg.

the class TransportHookProxy method insertIntercepter.

protected void insertIntercepter(HookContext context, ClassLoader webapploader) {
    if (isHookEventDone("insertIntercepter")) {
        return;
    }
    InterceptContext ic = (InterceptContext) context.get(HookConstants.INTERCEPTCONTEXT);
    String contextPath = (String) ic.get(InterceptConstants.CONTEXTPATH);
    String basePath = (String) ic.get(InterceptConstants.BASEPATH);
    final String appid = MonitorServerUtil.getApplicationId(contextPath, basePath);
    doProxyInstall(webapploader, appid);
}
Also used : InterceptContext(com.creditease.monitor.interceptframework.spi.InterceptContext)

Example 43 with InterceptContext

use of com.creditease.monitor.interceptframework.spi.InterceptContext in project uavstack by uavorg.

the class HttpClientHookProxy method InsertInterceptToClients.

public void InsertInterceptToClients(HookContext context, ClassLoader webapploader) {
    if (isHookEventDone("InsertInterceptToClients")) {
        return;
    }
    InterceptContext ic = (InterceptContext) context.get(HookConstants.INTERCEPTCONTEXT);
    String contextPath = (String) ic.get(InterceptConstants.CONTEXTPATH);
    String basePath = (String) ic.get(InterceptConstants.BASEPATH);
    final String appid = MonitorServerUtil.getApplicationId(contextPath, basePath);
    doInstallDProxy(webapploader, appid);
}
Also used : InterceptContext(com.creditease.monitor.interceptframework.spi.InterceptContext)

Example 44 with InterceptContext

use of com.creditease.monitor.interceptframework.spi.InterceptContext in project uavstack by uavorg.

the class JdbcHookProxy method start.

@Override
public void start(HookContext context, ClassLoader webapploader) {
    Event event = context.get(Event.class);
    InterceptContext ic = (InterceptContext) context.get(HookConstants.INTERCEPTCONTEXT);
    switch(event) {
        case SPRING_BEAN_REGIST:
        case WEBCONTAINER_RESOURCE_INIT:
            this.injectDriverManager(webapploader, ic);
            this.injectDBCP2(webapploader, ic);
            this.injectTomcatDBCP2(webapploader, ic);
            this.injectTomcatJdbc(webapploader, ic);
            this.injectHikari(webapploader, ic);
            this.injectDruid(webapploader, ic);
            break;
        case WEBCONTAINER_RESOURCE_CREATE:
            this.injectDataSource(ic);
            break;
        case WEBCONTAINER_INIT:
            this.injectDriverManager(webapploader, ic);
            this.injectDBCP2(webapploader, ic);
            this.injectTomcatDBCP2(webapploader, ic);
            this.injectTomcatJdbc(webapploader, ic);
            this.injectHikari(webapploader, ic);
            this.injectDruid(webapploader, ic);
            break;
        case AFTER_SERVET_INIT:
            break;
        case BEFORE_SERVLET_DESTROY:
            break;
        case WEBCONTAINER_STARTED:
            break;
        case WEBCONTAINER_STOPPED:
            break;
        default:
            break;
    }
}
Also used : InterceptContext(com.creditease.monitor.interceptframework.spi.InterceptContext) Event(com.creditease.monitor.interceptframework.spi.InterceptContext.Event)

Example 45 with InterceptContext

use of com.creditease.monitor.interceptframework.spi.InterceptContext in project uavstack by uavorg.

the class AbsDBPoolHookProxy method start.

@Override
public void start(HookContext context, ClassLoader webapploader) {
    Event event = context.get(Event.class);
    InterceptContext ic = (InterceptContext) context.get(HookConstants.INTERCEPTCONTEXT);
    switch(event) {
        case SPRING_BEAN_REGIST:
        case WEBCONTAINER_INIT:
            initHook(ic);
            break;
        case AFTER_SERVET_INIT:
            break;
        case BEFORE_SERVLET_DESTROY:
            break;
        case GLOBAL_FILTER_REQUEST:
            break;
        case GLOBAL_FILTER_RESPONSE:
            break;
        case WEBCONTAINER_RESOURCE_CREATE:
            break;
        case WEBCONTAINER_RESOURCE_INIT:
            break;
        case WEBCONTAINER_STARTED:
            break;
        case WEBCONTAINER_STOPPED:
            break;
        default:
            break;
    }
}
Also used : InterceptContext(com.creditease.monitor.interceptframework.spi.InterceptContext) Event(com.creditease.monitor.interceptframework.spi.InterceptContext.Event)

Aggregations

InterceptContext (com.creditease.monitor.interceptframework.spi.InterceptContext)66 InterceptSupport (com.creditease.monitor.interceptframework.InterceptSupport)28 ServletContext (javax.servlet.ServletContext)12 StandardContext (org.apache.catalina.core.StandardContext)12 Servlet (javax.servlet.Servlet)6 ProfileElementInstance (com.creditease.uav.profiling.spi.ProfileElementInstance)5 LinkedHashMap (java.util.LinkedHashMap)4 Map (java.util.Map)4 StandardWrapper (org.apache.catalina.core.StandardWrapper)4 WebappClassLoader (org.apache.catalina.loader.WebappClassLoader)4 UAVServer (com.creditease.monitor.UAVServer)3 Event (com.creditease.monitor.interceptframework.spi.InterceptContext.Event)3 DynamicProxyProcessor (com.creditease.uav.monitorframework.dproxy.DynamicProxyProcessor)3 DPMethod (com.creditease.uav.monitorframework.dproxy.bytecode.DPMethod)3 DubboServiceProfileInfo (com.creditease.uav.profiling.handlers.dubbo.DubboServiceProfileInfo)3 LogProfileInfo (com.creditease.uav.profiling.handlers.log.LogProfileInfo)3 HashMap (java.util.HashMap)3 LinkedList (java.util.LinkedList)3 ServletException (javax.servlet.ServletException)3 WebAppContext (org.eclipse.jetty.webapp.WebAppContext)3