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());
}
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();
}
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));
}
}
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();
}
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();
}
Aggregations