1616 */
1717package org .apache .dubbo .monitor .dubbo ;
1818
19- import org .apache .dubbo .common .Constants ;
2019import org .apache .dubbo .common .URL ;
2120import org .apache .dubbo .common .utils .StringUtils ;
2221import org .apache .dubbo .monitor .Monitor ;
2625import org .apache .dubbo .rpc .Protocol ;
2726import org .apache .dubbo .rpc .ProxyFactory ;
2827
28+ import static org .apache .dubbo .common .Constants .CHECK_KEY ;
29+ import static org .apache .dubbo .common .Constants .PROTOCOL_KEY ;
30+ import static org .apache .dubbo .common .Constants .REFERENCE_FILTER_KEY ;
31+
2932/**
3033 * DefaultMonitorFactory
3134 */
@@ -45,21 +48,20 @@ public void setProxyFactory(ProxyFactory proxyFactory) {
4548
4649 @ Override
4750 protected Monitor createMonitor (URL url ) {
48- url = url .setProtocol (url .getParameter (Constants . PROTOCOL_KEY , "dubbo" ));
51+ url = url .setProtocol (url .getParameter (PROTOCOL_KEY , "dubbo" ));
4952 if (StringUtils .isEmpty (url .getPath ())) {
5053 url = url .setPath (MonitorService .class .getName ());
5154 }
52- String filter = url .getParameter (Constants . REFERENCE_FILTER_KEY );
55+ String filter = url .getParameter (REFERENCE_FILTER_KEY );
5356 if (StringUtils .isEmpty (filter )) {
5457 filter = "" ;
5558 } else {
5659 filter = filter + "," ;
5760 }
58- url = url .addParameters (Constants .CLUSTER_KEY , "failsafe" , Constants .CHECK_KEY , String .valueOf (false ),
59- Constants .REFERENCE_FILTER_KEY , filter + "-monitor" );
61+ url = url .addParameters (CHECK_KEY , String .valueOf (false ), REFERENCE_FILTER_KEY , filter + "-monitor" );
6062 Invoker <MonitorService > monitorInvoker = protocol .refer (MonitorService .class , url );
6163 MonitorService monitorService = proxyFactory .getProxy (monitorInvoker );
6264 return new DubboMonitor (monitorInvoker , monitorService );
6365 }
6466
65- }
67+ }
0 commit comments