Polish code in Dubbo adapter and use Dubbo common constants (#1245)
This commit is contained in:
parent
fe23d5c11f
commit
9cc52706f5
|
|
@ -24,12 +24,14 @@ import org.apache.dubbo.rpc.Result;
|
||||||
import org.apache.dubbo.rpc.RpcContext;
|
import org.apache.dubbo.rpc.RpcContext;
|
||||||
import org.apache.dubbo.rpc.RpcException;
|
import org.apache.dubbo.rpc.RpcException;
|
||||||
|
|
||||||
|
import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Puts current consumer's application name in the attachment of each invocation.
|
* Puts current consumer's application name in the attachment of each invocation.
|
||||||
*
|
*
|
||||||
* @author Eric Zhao
|
* @author Eric Zhao
|
||||||
*/
|
*/
|
||||||
@Activate(group = "consumer")
|
@Activate(group = CONSUMER)
|
||||||
public class DubboAppContextFilter implements Filter {
|
public class DubboAppContextFilter implements Filter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ import org.apache.dubbo.rpc.RpcContext;
|
||||||
import org.apache.dubbo.rpc.RpcException;
|
import org.apache.dubbo.rpc.RpcException;
|
||||||
import org.apache.dubbo.rpc.support.RpcUtils;
|
import org.apache.dubbo.rpc.support.RpcUtils;
|
||||||
|
|
||||||
|
import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Dubbo service consumer filter for Sentinel. Auto activated by default.</p>
|
* <p>Dubbo service consumer filter for Sentinel. Auto activated by default.</p>
|
||||||
* <p>
|
* <p>
|
||||||
|
|
@ -43,7 +45,7 @@ import org.apache.dubbo.rpc.support.RpcUtils;
|
||||||
* @author Carpenter Lee
|
* @author Carpenter Lee
|
||||||
* @author Eric Zhao
|
* @author Eric Zhao
|
||||||
*/
|
*/
|
||||||
@Activate(group = "consumer")
|
@Activate(group = CONSUMER)
|
||||||
public class SentinelDubboConsumerFilter extends BaseSentinelDubboFilter {
|
public class SentinelDubboConsumerFilter extends BaseSentinelDubboFilter {
|
||||||
|
|
||||||
public SentinelDubboConsumerFilter() {
|
public SentinelDubboConsumerFilter() {
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ import org.apache.dubbo.rpc.Result;
|
||||||
import org.apache.dubbo.rpc.RpcContext;
|
import org.apache.dubbo.rpc.RpcContext;
|
||||||
import org.apache.dubbo.rpc.RpcException;
|
import org.apache.dubbo.rpc.RpcException;
|
||||||
|
|
||||||
|
import static org.apache.dubbo.common.constants.CommonConstants.PROVIDER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Apache Dubbo service provider filter that enables integration with Sentinel. Auto activated by default.</p>
|
* <p>Apache Dubbo service provider filter that enables integration with Sentinel. Auto activated by default.</p>
|
||||||
* <p>Note: this only works for Apache Dubbo 2.7.x or above version.</p>
|
* <p>Note: this only works for Apache Dubbo 2.7.x or above version.</p>
|
||||||
|
|
@ -43,7 +45,7 @@ import org.apache.dubbo.rpc.RpcException;
|
||||||
* @author Carpenter Lee
|
* @author Carpenter Lee
|
||||||
* @author Eric Zhao
|
* @author Eric Zhao
|
||||||
*/
|
*/
|
||||||
@Activate(group = "provider")
|
@Activate(group = PROVIDER)
|
||||||
public class SentinelDubboProviderFilter extends BaseSentinelDubboFilter {
|
public class SentinelDubboProviderFilter extends BaseSentinelDubboFilter {
|
||||||
|
|
||||||
public SentinelDubboProviderFilter() {
|
public SentinelDubboProviderFilter() {
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,14 @@ import com.alibaba.dubbo.rpc.Result;
|
||||||
import com.alibaba.dubbo.rpc.RpcContext;
|
import com.alibaba.dubbo.rpc.RpcContext;
|
||||||
import com.alibaba.dubbo.rpc.RpcException;
|
import com.alibaba.dubbo.rpc.RpcException;
|
||||||
|
|
||||||
|
import static com.alibaba.dubbo.common.Constants.CONSUMER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Puts current consumer's application name in the attachment of each invocation.
|
* Puts current consumer's application name in the attachment of each invocation.
|
||||||
*
|
*
|
||||||
* @author Eric Zhao
|
* @author Eric Zhao
|
||||||
*/
|
*/
|
||||||
@Activate(group = "consumer")
|
@Activate(group = CONSUMER)
|
||||||
public class DubboAppContextFilter implements Filter {
|
public class DubboAppContextFilter implements Filter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ import com.alibaba.dubbo.rpc.Invoker;
|
||||||
import com.alibaba.dubbo.rpc.Result;
|
import com.alibaba.dubbo.rpc.Result;
|
||||||
import com.alibaba.dubbo.rpc.RpcException;
|
import com.alibaba.dubbo.rpc.RpcException;
|
||||||
|
|
||||||
|
import static com.alibaba.dubbo.common.Constants.CONSUMER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Dubbo service consumer filter for Sentinel. Auto activated by default.</p>
|
* <p>Dubbo service consumer filter for Sentinel. Auto activated by default.</p>
|
||||||
*
|
*
|
||||||
|
|
@ -42,7 +44,7 @@ import com.alibaba.dubbo.rpc.RpcException;
|
||||||
* @author leyou
|
* @author leyou
|
||||||
* @author Eric Zhao
|
* @author Eric Zhao
|
||||||
*/
|
*/
|
||||||
@Activate(group = "consumer")
|
@Activate(group = CONSUMER)
|
||||||
public class SentinelDubboConsumerFilter extends AbstractDubboFilter implements Filter {
|
public class SentinelDubboConsumerFilter extends AbstractDubboFilter implements Filter {
|
||||||
|
|
||||||
public SentinelDubboConsumerFilter() {
|
public SentinelDubboConsumerFilter() {
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ import com.alibaba.dubbo.rpc.Invoker;
|
||||||
import com.alibaba.dubbo.rpc.Result;
|
import com.alibaba.dubbo.rpc.Result;
|
||||||
import com.alibaba.dubbo.rpc.RpcException;
|
import com.alibaba.dubbo.rpc.RpcException;
|
||||||
|
|
||||||
|
import static com.alibaba.dubbo.common.Constants.PROVIDER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Dubbo service provider filter for Sentinel. Auto activated by default.</p>
|
* <p>Dubbo service provider filter for Sentinel. Auto activated by default.</p>
|
||||||
*
|
*
|
||||||
|
|
@ -43,7 +45,7 @@ import com.alibaba.dubbo.rpc.RpcException;
|
||||||
* @author leyou
|
* @author leyou
|
||||||
* @author Eric Zhao
|
* @author Eric Zhao
|
||||||
*/
|
*/
|
||||||
@Activate(group = "provider")
|
@Activate(group = PROVIDER)
|
||||||
public class SentinelDubboProviderFilter extends AbstractDubboFilter implements Filter {
|
public class SentinelDubboProviderFilter extends AbstractDubboFilter implements Filter {
|
||||||
|
|
||||||
public SentinelDubboProviderFilter() {
|
public SentinelDubboProviderFilter() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue