com.alibaba.dubbo.rpc.InvokerListener Java Examples

The following examples show how to use com.alibaba.dubbo.rpc.InvokerListener. 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 File: ListenerInvokerWrapper.java    From dubbo-2.6.5 with Apache License 2.0 6 votes vote down vote up
public ListenerInvokerWrapper(Invoker<T> invoker, List<InvokerListener> listeners) {
    if (invoker == null) {
        throw new IllegalArgumentException("invoker == null");
    }
    this.invoker = invoker;
    this.listeners = listeners;
    if (listeners != null && !listeners.isEmpty()) {
        for (InvokerListener listener : listeners) {
            if (listener != null) {
                try {
                    listener.referred(invoker);
                } catch (Throwable t) {
                    logger.error(t.getMessage(), t);
                }
            }
        }
    }
}
 
Example #2
Source File: ListenerInvokerWrapper.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public ListenerInvokerWrapper(Invoker<T> invoker, List<InvokerListener> listeners){
    if (invoker == null) {
        throw new IllegalArgumentException("invoker == null");
    }
    this.invoker = invoker;
    this.listeners = listeners;
    if (listeners != null && listeners.size() > 0) {
        for (InvokerListener listener : listeners) {
            if (listener != null) {
                try {
                    listener.referred(invoker);
                } catch (Throwable t) {
                    logger.error(t.getMessage(), t);
                }
            }
        }
    }
}
 
Example #3
Source File: ListenerInvokerWrapper.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public void destroy() {
    try {
        invoker.destroy();
    } finally {
        if (listeners != null && listeners.size() > 0) {
            for (InvokerListener listener : listeners) {
                if (listener != null) {
                    try {
                        listener.destroyed(invoker);
                    } catch (Throwable t) {
                        logger.error(t.getMessage(), t);
                    }
                }
            }
        }
    }
}
 
Example #4
Source File: ListenerInvokerWrapper.java    From dubbox-hystrix with Apache License 2.0 6 votes vote down vote up
public void destroy() {
    try {
        invoker.destroy();
    } finally {
        if (listeners != null && listeners.size() > 0) {
            for (InvokerListener listener : listeners) {
                if (listener != null) {
                    try {
                        listener.destroyed(invoker);
                    } catch (Throwable t) {
                        logger.error(t.getMessage(), t);
                    }
                }
            }
        }
    }
}
 
Example #5
Source File: ListenerInvokerWrapper.java    From dubbox-hystrix with Apache License 2.0 6 votes vote down vote up
public ListenerInvokerWrapper(Invoker<T> invoker, List<InvokerListener> listeners){
    if (invoker == null) {
        throw new IllegalArgumentException("invoker == null");
    }
    this.invoker = invoker;
    this.listeners = listeners;
    if (listeners != null && listeners.size() > 0) {
        for (InvokerListener listener : listeners) {
            if (listener != null) {
                try {
                    listener.referred(invoker);
                } catch (Throwable t) {
                    logger.error(t.getMessage(), t);
                }
            }
        }
    }
}
 
Example #6
Source File: ListenerInvokerWrapper.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public ListenerInvokerWrapper(Invoker<T> invoker, List<InvokerListener> listeners){
    if (invoker == null) {
        throw new IllegalArgumentException("invoker == null");
    }
    this.invoker = invoker;
    this.listeners = listeners;
    if (listeners != null && listeners.size() > 0) {
        for (InvokerListener listener : listeners) {
            if (listener != null) {
                try {
                    listener.referred(invoker);
                } catch (Throwable t) {
                    logger.error(t.getMessage(), t);
                }
            }
        }
    }
}
 
Example #7
Source File: ListenerInvokerWrapper.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public void destroy() {
    try {
        invoker.destroy();
    } finally {
        if (listeners != null && listeners.size() > 0) {
            for (InvokerListener listener : listeners) {
                if (listener != null) {
                    try {
                        listener.destroyed(invoker);
                    } catch (Throwable t) {
                        logger.error(t.getMessage(), t);
                    }
                }
            }
        }
    }
}
 
Example #8
Source File: ListenerInvokerWrapper.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public void destroy() {
    try {
        invoker.destroy();
    } finally {
        if (listeners != null && listeners.size() > 0) {
            for (InvokerListener listener : listeners) {
                if (listener != null) {
                    try {
                        listener.destroyed(invoker);
                    } catch (Throwable t) {
                        logger.error(t.getMessage(), t);
                    }
                }
            }
        }
    }
}
 
Example #9
Source File: ListenerInvokerWrapper.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public ListenerInvokerWrapper(Invoker<T> invoker, List<InvokerListener> listeners){
    if (invoker == null) {
        throw new IllegalArgumentException("invoker == null");
    }
    this.invoker = invoker;
    this.listeners = listeners;
    if (listeners != null && listeners.size() > 0) {
        for (InvokerListener listener : listeners) {
            if (listener != null) {
                try {
                    listener.referred(invoker);
                } catch (Throwable t) {
                    logger.error(t.getMessage(), t);
                }
            }
        }
    }
}
 
Example #10
Source File: ListenerInvokerWrapper.java    From dubbo-2.6.5 with Apache License 2.0 6 votes vote down vote up
@Override
public void destroy() {
    try {
        invoker.destroy();
    } finally {
        if (listeners != null && !listeners.isEmpty()) {
            for (InvokerListener listener : listeners) {
                if (listener != null) {
                    try {
                        listener.destroyed(invoker);
                    } catch (Throwable t) {
                        logger.error(t.getMessage(), t);
                    }
                }
            }
        }
    }
}
 
Example #11
Source File: ProtocolListenerWrapper.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException {
    if (Constants.REGISTRY_PROTOCOL.equals(url.getProtocol())) {
        return protocol.refer(type, url);
    }
    return new ListenerInvokerWrapper<T>(protocol.refer(type, url), 
            Collections.unmodifiableList(
                    ExtensionLoader.getExtensionLoader(InvokerListener.class)
                    .getActivateExtension(url, Constants.INVOKER_LISTENER_KEY)));
}
 
Example #12
Source File: ProtocolListenerWrapper.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException {
    if (Constants.REGISTRY_PROTOCOL.equals(url.getProtocol())) {
        return protocol.refer(type, url);
    }
    return new ListenerInvokerWrapper<T>(protocol.refer(type, url), 
            Collections.unmodifiableList(
                    ExtensionLoader.getExtensionLoader(InvokerListener.class)
                    .getActivateExtension(url, Constants.INVOKER_LISTENER_KEY)));
}
 
Example #13
Source File: ProtocolListenerWrapper.java    From dubbo-2.6.5 with Apache License 2.0 5 votes vote down vote up
@Override
    public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException {
        if (Constants.REGISTRY_PROTOCOL.equals(url.getProtocol())) {
//            com.alibaba.dubbo.registry.integration.RegistryProtocol.refer()
            return protocol.refer(type, url);
        }
        return new ListenerInvokerWrapper<T>(protocol.refer(type, url),
                Collections.unmodifiableList(
                        ExtensionLoader.getExtensionLoader(InvokerListener.class)
                                .getActivateExtension(url, Constants.INVOKER_LISTENER_KEY)));
    }
 
Example #14
Source File: ProtocolListenerWrapper.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException {
    if (Constants.REGISTRY_PROTOCOL.equals(url.getProtocol())) {
        return protocol.refer(type, url);
    }
    return new ListenerInvokerWrapper<T>(protocol.refer(type, url), 
            Collections.unmodifiableList(
                    ExtensionLoader.getExtensionLoader(InvokerListener.class)
                    .getActivateExtension(url, Constants.INVOKER_LISTENER_KEY)));
}
 
Example #15
Source File: ProtocolListenerWrapper.java    From dubbo3 with Apache License 2.0 5 votes vote down vote up
public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException {
    if (Constants.REGISTRY_PROTOCOL.equals(url.getProtocol())) {
        return protocol.refer(type, url);
    }
    return new ListenerInvokerWrapper<>(protocol.refer(type, url),
            Collections.unmodifiableList(
                    ExtensionLoader.getExtensionLoader(InvokerListener.class)
                    .getActivateExtension(url, Constants.INVOKER_LISTENER_KEY)));
}
 
Example #16
Source File: ProtocolListenerWrapper.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException {
    if (Constants.REGISTRY_PROTOCOL.equals(url.getProtocol())) {
        return protocol.refer(type, url);
    }
    return new ListenerInvokerWrapper<T>(protocol.refer(type, url), 
            Collections.unmodifiableList(
                    ExtensionLoader.getExtensionLoader(InvokerListener.class)
                    .getActivateExtension(url, Constants.INVOKER_LISTENER_KEY)));
}
 
Example #17
Source File: AbstractReferenceConfig.java    From dubbox with Apache License 2.0 4 votes vote down vote up
@Override
public void setListener(String listener) {
    checkMultiExtension(InvokerListener.class, "listener", listener);
    super.setListener(listener);
}
 
Example #18
Source File: AbstractInterfaceConfig.java    From dubbox with Apache License 2.0 4 votes vote down vote up
@Parameter(key = Constants.INVOKER_LISTENER_KEY, append = true)
public String getListener() {
    checkMultiExtension(InvokerListener.class, "listener", listener);
    return listener;
}
 
Example #19
Source File: AbstractReferenceConfig.java    From dubbox with Apache License 2.0 4 votes vote down vote up
@Override
public void setListener(String listener) {
    checkMultiExtension(InvokerListener.class, "listener", listener);
    super.setListener(listener);
}
 
Example #20
Source File: AbstractInterfaceConfig.java    From dubbox with Apache License 2.0 4 votes vote down vote up
@Parameter(key = Constants.INVOKER_LISTENER_KEY, append = true)
public String getListener() {
    checkMultiExtension(InvokerListener.class, "listener", listener);
    return listener;
}
 
Example #21
Source File: AbstractInterfaceConfig.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
@Parameter(key = Constants.INVOKER_LISTENER_KEY, append = true)
public String getListener() {
    checkMultiExtension(InvokerListener.class, "listener", listener);
    return listener;
}
 
Example #22
Source File: AbstractReferenceConfig.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
@Override
public void setListener(String listener) {
    checkMultiExtension(InvokerListener.class, "listener", listener);
    super.setListener(listener);
}
 
Example #23
Source File: AbstractInterfaceConfig.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
@Parameter(key = Constants.INVOKER_LISTENER_KEY, append = true)
public String getListener() {
    checkMultiExtension(InvokerListener.class, "listener", listener);
    return listener;
}
 
Example #24
Source File: AbstractReferenceConfig.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
@Override
public void setListener(String listener) {
    checkMultiExtension(InvokerListener.class, "listener", listener);
    super.setListener(listener);
}
 
Example #25
Source File: AbstractInterfaceConfig.java    From dubbox with Apache License 2.0 4 votes vote down vote up
@Parameter(key = Constants.INVOKER_LISTENER_KEY, append = true)
public String getListener() {
    checkMultiExtension(InvokerListener.class, "listener", listener);
    return listener;
}
 
Example #26
Source File: AbstractReferenceConfig.java    From dubbox with Apache License 2.0 4 votes vote down vote up
@Override
public void setListener(String listener) {
    checkMultiExtension(InvokerListener.class, "listener", listener);
    super.setListener(listener);
}
 
Example #27
Source File: AbstractInterfaceConfig.java    From dubbo-2.6.5 with Apache License 2.0 4 votes vote down vote up
public void setListener(String listener) {
    checkMultiExtension(InvokerListener.class, "listener", listener);
    this.listener = listener;
}
 
Example #28
Source File: AbstractReferenceConfig.java    From dubbo-2.6.5 with Apache License 2.0 4 votes vote down vote up
@Override
public void setListener(String listener) {
    checkMultiExtension(InvokerListener.class, "listener", listener);
    super.setListener(listener);
}