use of com.creditease.uav.profiling.spi.ProfileFactory in project uavstack by uavorg.
the class AppProfilingListener method handleEvent.
@Override
public void handleEvent(InterceptContext context) {
// get the context path
String contextpath = (String) context.get(InterceptConstants.CONTEXTPATH);
String basepath = (String) context.get(InterceptConstants.BASEPATH);
// swtich event
Event event = context.getEvent();
// create the profile context object
ProfileContext profilecontext = new StandardProfileContext();
// put InterceptContext into profile context, then profile handler can get info from InterceptContext
profilecontext.put(InterceptContext.class, context);
// get the profile factory
ProfileFactory pf = ProfileFactory.instance();
switch(event) {
case AFTER_SERVET_INIT:
break;
case BEFORE_SERVLET_DESTROY:
break;
case WEBCONTAINER_STARTED:
startProfiling(contextpath, basepath, pf, profilecontext);
break;
case WEBCONTAINER_STOPPED:
stopProfiling(contextpath, basepath, pf);
break;
default:
break;
}
}
Aggregations