Search in sources :

Example 1 with GlobalFilterDispatchListener

use of com.creditease.uav.appserver.listeners.GlobalFilterDispatchListener in project uavstack by uavorg.

the class InvokeChainSupporter method start.

@Override
public void start() {
    // init the simple invokechain dataloggermgr
    dlm = this.newDataLoggerManager("ivc", "com.creditease.uav.invokechain");
    /**
     * NOTE: when start the invokechain, we have to clean all ivc logs & lock files
     */
    dlm.clearLogs();
    ServerVendor vendor = (ServerVendor) UAVServer.instance().getServerInfo(CaptureConstants.INFO_APPSERVER_VENDOR);
    // MSCP
    if (vendor == ServerVendor.MSCP) {
    // TODO
    } else // JEE
    {
        // register ServiceStartInvokeChainHandler to GlobalFilter
        GlobalFilterDispatchListener listener = (GlobalFilterDispatchListener) InterceptSupport.instance().getEventListener(GlobalFilterDispatchListener.class);
        listener.registerHandler(new JEEServiceRunGlobalFilterHandler("JEEServiceRunGlobalFilterHandler"));
    }
    // register ServiceEndInvokeChainHandler
    handlerMap.put(InvokeChainConstants.CHAIN_APP_SERVICE, new ServiceSpanInvokeChainHandler());
    // register ClientSpanInvokeChainHandler
    handlerMap.put(InvokeChainConstants.CHAIN_APP_CLIENT, new ClientSpanInvokeChainHandler());
    // register MethodSpanInvokeChainHandler
    handlerMap.put(InvokeChainConstants.CHAIN_APP_METHOD, new MethodSpanInvokeChainHandler());
}
Also used : MethodSpanInvokeChainHandler(com.creditease.uav.apm.invokechain.handlers.MethodSpanInvokeChainHandler) JEEServiceRunGlobalFilterHandler(com.creditease.uav.apm.invokechain.jee.JEEServiceRunGlobalFilterHandler) ServerVendor(com.creditease.monitor.UAVServer.ServerVendor) GlobalFilterDispatchListener(com.creditease.uav.appserver.listeners.GlobalFilterDispatchListener) ServiceSpanInvokeChainHandler(com.creditease.uav.apm.invokechain.handlers.ServiceSpanInvokeChainHandler) ClientSpanInvokeChainHandler(com.creditease.uav.apm.invokechain.handlers.ClientSpanInvokeChainHandler)

Example 2 with GlobalFilterDispatchListener

use of com.creditease.uav.appserver.listeners.GlobalFilterDispatchListener in project uavstack by uavorg.

the class InvokeChainSupporter method stop.

@Override
public void stop() {
    ServerVendor vendor = (ServerVendor) UAVServer.instance().getServerInfo(CaptureConstants.INFO_APPSERVER_VENDOR);
    // MSCP
    if (vendor == ServerVendor.MSCP) {
    // TODO
    } else // JEE
    {
        GlobalFilterDispatchListener listener = (GlobalFilterDispatchListener) InterceptSupport.instance().getEventListener(GlobalFilterDispatchListener.class);
        listener.unregisterHandler("JEEServiceRunGlobalFilterHandler");
    }
    dlm.destroy();
    adapterMap.clear();
    handlerMap.clear();
    super.stop();
}
Also used : ServerVendor(com.creditease.monitor.UAVServer.ServerVendor) GlobalFilterDispatchListener(com.creditease.uav.appserver.listeners.GlobalFilterDispatchListener)

Example 3 with GlobalFilterDispatchListener

use of com.creditease.uav.appserver.listeners.GlobalFilterDispatchListener in project uavstack by uavorg.

the class HttpDataObserverWorker method start.

@Override
public void start() {
    GlobalFilterDispatchListener listener = (GlobalFilterDispatchListener) InterceptSupport.instance().getEventListener(GlobalFilterDispatchListener.class);
    // register Observer to GlobalFilterDispatchListener
    ServerVendor sv = (ServerVendor) UAVServer.instance().getServerInfo(CaptureConstants.INFO_APPSERVER_VENDOR);
    /**
     * MSCP
     */
    if (sv == ServerVendor.MSCP) {
    // TODO
    } else /**
     * JEE
     */
    {
        listener.registerHandler(new HttpJEEJVMObserver("HttpJEEJVMObserver"));
        listener.registerHandler(new HttpJEEMonitorObserver("HttpJEEMonitorObserver", this));
        listener.registerHandler(new HttpJEEProfileObserver("HttpJEEProfileObserver", this));
    }
}
Also used : GlobalFilterDispatchListener(com.creditease.uav.appserver.listeners.GlobalFilterDispatchListener) ServerVendor(com.creditease.monitor.UAVServer.ServerVendor)

Example 4 with GlobalFilterDispatchListener

use of com.creditease.uav.appserver.listeners.GlobalFilterDispatchListener in project uavstack by uavorg.

the class HttpDataObserverWorker method stop.

@Override
public void stop() {
    GlobalFilterDispatchListener listener = (GlobalFilterDispatchListener) InterceptSupport.instance().getEventListener(GlobalFilterDispatchListener.class);
    // unregister Observer to GlobalFilterDispatchListener
    ServerVendor sv = (ServerVendor) UAVServer.instance().getServerInfo(CaptureConstants.INFO_APPSERVER_VENDOR);
    /**
     * MSCP
     */
    if (sv == ServerVendor.MSCP) {
    } else /**
     * JEE
     */
    {
        listener.unregisterHandler("HttpJEEJVMObserver()");
        listener.unregisterHandler("HttpJEEMonitorObserver");
        listener.unregisterHandler("HttpJEEProfileObserver");
    }
    monitorMap.clear();
    monitorMBeanMap.clear();
    profileMap.clear();
    profileMBeanMap.clear();
}
Also used : GlobalFilterDispatchListener(com.creditease.uav.appserver.listeners.GlobalFilterDispatchListener) ServerVendor(com.creditease.monitor.UAVServer.ServerVendor)

Example 5 with GlobalFilterDispatchListener

use of com.creditease.uav.appserver.listeners.GlobalFilterDispatchListener 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

GlobalFilterDispatchListener (com.creditease.uav.appserver.listeners.GlobalFilterDispatchListener)7 ServerVendor (com.creditease.monitor.UAVServer.ServerVendor)5 UAVServerJEEController (com.creditease.monitor.globalfilter.jee.UAVServerJEEController)1 InterceptSupport (com.creditease.monitor.interceptframework.InterceptSupport)1 InterceptEventListener (com.creditease.monitor.interceptframework.spi.InterceptEventListener)1 ClientSpanInvokeChainHandler (com.creditease.uav.apm.invokechain.handlers.ClientSpanInvokeChainHandler)1 MethodSpanInvokeChainHandler (com.creditease.uav.apm.invokechain.handlers.MethodSpanInvokeChainHandler)1 ServiceSpanInvokeChainHandler (com.creditease.uav.apm.invokechain.handlers.ServiceSpanInvokeChainHandler)1 JEEServiceRunGlobalFilterHandler (com.creditease.uav.apm.invokechain.jee.JEEServiceRunGlobalFilterHandler)1