Search in sources :

Example 1 with UAVServerJEEController

use of com.creditease.monitor.globalfilter.jee.UAVServerJEEController in project uavstack by uavorg.

the class InterceptFrameworkSupportor method start.

@Override
public void start() {
    String listenersString = System.getProperty("com.creditease.uav.interceptlisteners");
    if (null == listenersString) {
        return;
    }
    String[] defaultListeners = listenersString.split(",");
    // Step 1: install intercept listeners
    InterceptSupport is = InterceptSupport.instance();
    for (String listenerClass : defaultListeners) {
        InterceptEventListener listener = is.createInterceptEventListener(listenerClass);
        if (listener != null) {
            if (this.logger.isLogEnabled()) {
                this.logger.info("InterceptEventListener[" + listenerClass + "] load SUCCESS");
            }
            is.addEventListener(listener);
        }
    }
    // Step 2: register UAVServerController
    ServerVendor vendor = (ServerVendor) UAVServer.instance().getServerInfo(CaptureConstants.INFO_APPSERVER_VENDOR);
    GlobalFilterDispatchListener listener = (GlobalFilterDispatchListener) InterceptSupport.instance().getEventListener(GlobalFilterDispatchListener.class);
    // MSCP
    if (vendor == ServerVendor.MSCP) {
    // TODO
    } else // JEE
    {
        listener.registerHandler(new UAVServerJEEController("UAVServerJEEController"));
    }
    // init MonitorUrlFilterMgr
    MonitorUrlFilterMgr.getInstance().init();
}
Also used : InterceptSupport(com.creditease.monitor.interceptframework.InterceptSupport) ServerVendor(com.creditease.monitor.UAVServer.ServerVendor) GlobalFilterDispatchListener(com.creditease.uav.appserver.listeners.GlobalFilterDispatchListener) UAVServerJEEController(com.creditease.monitor.globalfilter.jee.UAVServerJEEController) InterceptEventListener(com.creditease.monitor.interceptframework.spi.InterceptEventListener)

Aggregations

ServerVendor (com.creditease.monitor.UAVServer.ServerVendor)1 UAVServerJEEController (com.creditease.monitor.globalfilter.jee.UAVServerJEEController)1 InterceptSupport (com.creditease.monitor.interceptframework.InterceptSupport)1 InterceptEventListener (com.creditease.monitor.interceptframework.spi.InterceptEventListener)1 GlobalFilterDispatchListener (com.creditease.uav.appserver.listeners.GlobalFilterDispatchListener)1