Java Code Examples for org.apache.dubbo.common.utils.StringUtils#isEmpty()

The following examples show how to use org.apache.dubbo.common.utils.StringUtils#isEmpty() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: dubbo-samples   File: LegacyBlockFilter.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
    RpcContext context = RpcContext.getContext();
    String filters = (String) context.getAttachment("filters");
    if (StringUtils.isEmpty(filters)) {
        filters = "";
    }
    filters += " legacy-block-filter";
    context.setAttachment("filters", filters);

    Result result = invoker.invoke(invocation);

    logger.info("This is the default return value: " + result.getValue());

    if (result.hasException()) {
        System.out.println("LegacyBlockFilter: This will only happen when the real exception returns: " + result.getException());
        logger.warn("This will only happen when the real exception returns", result.getException());
    }

    logger.info("LegacyBlockFilter: This msg should not be blocked.");
    return result;
}
 
Example 2
@Override
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
    RpcContext context = RpcContext.getContext();
    String filters = (String) context.getAttachment("filters");
    if (StringUtils.isEmpty(filters)) {
        filters = "";
    }
    filters += " legacy-block-filter";
    context.setAttachment("filters", filters);

    return invoker.invoke(invocation);
}
 
Example 3
@Override
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
    RpcContext context = RpcContext.getContext();
    String filters = (String) context.getAttachment("filters");
    if (StringUtils.isEmpty(filters)) {
        filters = "";
    }
    filters += " async-post-process-filter";
    context.setAttachment("filters", filters);

    return invoker.invoke(invocation);
}
 
Example 4
Source Project: dubbo-samples   File: ZKTools.java    License: Apache License 2.0 4 votes vote down vote up
private static String pathToKey(String path) {
    if (StringUtils.isEmpty(path)) {
        return path;
    }
    return path.replace("/dubbo/config/", "").replaceAll("/", ".");
}
 
Example 5
Source Project: dubbo-samples   File: ZKTools.java    License: Apache License 2.0 4 votes vote down vote up
private static String pathToKey(String path) {
    if (StringUtils.isEmpty(path)) {
        return path;
    }
    return path.replace("/dubbo/config/", "").replaceAll("/", ".");
}
 
Example 6
Source Project: dubbo-samples   File: ZKTools.java    License: Apache License 2.0 4 votes vote down vote up
private static String pathToKey(String path) {
    if (StringUtils.isEmpty(path)) {
        return path;
    }
    return path.replace("/dubbo/config/", "").replaceAll("/", ".");
}
 
Example 7
Source Project: dubbo-samples   File: ZKTools.java    License: Apache License 2.0 4 votes vote down vote up
private static String pathToKey(String path) {
    if (StringUtils.isEmpty(path)) {
        return path;
    }
    return path.replace("/dubbo/config/", "").replaceAll("/", ".");
}
 
Example 8
Source Project: dubbo-samples   File: ZKTools.java    License: Apache License 2.0 4 votes vote down vote up
private static String pathToKey(String path) {
    if (StringUtils.isEmpty(path)) {
        return path;
    }
    return path.replace("/dubbo/config/", "").replaceAll("/", ".");
}
 
Example 9
Source Project: dubbo-samples   File: ZKTools.java    License: Apache License 2.0 4 votes vote down vote up
private static String pathToKey(String path) {
    if (StringUtils.isEmpty(path)) {
        return path;
    }
    return path.replace("/dubbo/config/", "").replaceAll("/", ".");
}
 
Example 10
Source Project: dubbo-samples   File: ZKTools.java    License: Apache License 2.0 4 votes vote down vote up
private static String pathToKey(String path) {
    if (StringUtils.isEmpty(path)) {
        return path;
    }
    return path.replace("/dubbo/config/", "").replaceAll("/", ".");
}
 
Example 11
Source Project: dubbo-samples   File: RuleUtil.java    License: Apache License 2.0 4 votes vote down vote up
private static String pathToKey(String path) {
    if (StringUtils.isEmpty(path)) {
        return path;
    }
    return path.replace("/dubbo/config/", "").replaceAll("/", ".");
}