dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkeeper (GitHub) <git...@apache.org>
Subject [GitHub] [incubator-dubbo] vkeeper opened issue #2726: refactor ProtocolFilterWrapper buildInvokerChain method
Date Thu, 01 Nov 2018 10:10:21 GMT
- [ ] I have searched the [issues](https://github.com/apache/incubator-dubbo/issues) of this
repository and believe that this is not a duplicate.
- [ ] I have checked the [FAQ](https://github.com/apache/incubator-dubbo/blob/master/FAQ.md)
of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: Latest
* Operating System version: win10
* Java version: 1.8

### Steps to reproduce this issue

```java
private static <T> Invoker<T> buildInvokerChain(final Invoker<T> invoker,
String key, String group) {
        Invoker<T> last = invoker;
        List<Filter> filters = ExtensionLoader.getExtensionLoader(Filter.class).getActivateExtension(invoker.getUrl(),
key, group);
        if (!filters.isEmpty()) {
            for (int i = filters.size() - 1; i >= 0; i--) {
                final Filter filter = filters.get(i);
                final Invoker<T> next = last;
                last = new Invoker<T>() {

                   ...........
                    @Override
                    public Result invoke(Invocation invocation) throws RpcException {
                        return filter.invoke(next, invocation);
                    }
                   ...........
                };
            }
        }
        return last;
    }
```
it will creates the same number of the **anonymous Invoker class** as **filters size** when
refer() or export(...) every time, it's a linked structure

Pls. provide [GitHub address] to reproduce this issue.

### Expected Result

use one **anonymous Invoker class** to instead of it 

use one **for** call to instead of **linked** call

### Actual Result

NONE


[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2726 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


Mime
View raw message