com.alibaba.dubbo.rpc.listener.ListenerExporterWrapper Java Examples

The following examples show how to use com.alibaba.dubbo.rpc.listener.ListenerExporterWrapper. 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: ProtocolListenerWrapper.java    From dubbo-2.6.5 with Apache License 2.0 5 votes vote down vote up
@Override
    public <T> Exporter<T> export(Invoker<T> invoker) throws RpcException {
//        invoker.getUrl().getProtocol()取值是scope的值,scope默认值值是registry,如果设置injvm会走本地服务export
        if (Constants.REGISTRY_PROTOCOL.equals(invoker.getUrl().getProtocol())) {
//          RegistryProtocol.export()
            return protocol.export(invoker);
        }
//        这里可以实现自己的ExporterListener实现,在服务export、unexport的时候的监听器实现 com.alibaba.dubbo.rpc.protocol.injvm.InjvmProtocol.export()=》
        return new ListenerExporterWrapper<T>(protocol.export(invoker),
                Collections.unmodifiableList(ExtensionLoader.getExtensionLoader(ExporterListener.class)
                        .getActivateExtension(invoker.getUrl(), Constants.EXPORTER_LISTENER_KEY)));
    }
 
Example #2
Source File: ProtocolListenerWrapper.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public <T> Exporter<T> export(Invoker<T> invoker) throws RpcException {
    if (Constants.REGISTRY_PROTOCOL.equals(invoker.getUrl().getProtocol())) {
        return protocol.export(invoker);
    }
    return new ListenerExporterWrapper<T>(protocol.export(invoker), 
            Collections.unmodifiableList(ExtensionLoader.getExtensionLoader(ExporterListener.class)
                    .getActivateExtension(invoker.getUrl(), Constants.EXPORTER_LISTENER_KEY)));
}
 
Example #3
Source File: ProtocolListenerWrapper.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
public <T> Exporter<T> export(Invoker<T> invoker) throws RpcException {
    if (Constants.REGISTRY_PROTOCOL.equals(invoker.getUrl().getProtocol())) {
        return protocol.export(invoker);
    }
    return new ListenerExporterWrapper<T>(protocol.export(invoker), 
            Collections.unmodifiableList(ExtensionLoader.getExtensionLoader(ExporterListener.class)
                    .getActivateExtension(invoker.getUrl(), Constants.EXPORTER_LISTENER_KEY)));
}
 
Example #4
Source File: ProtocolListenerWrapper.java    From dubbo3 with Apache License 2.0 5 votes vote down vote up
public <T> Exporter<T> export(Invoker<T> invoker) throws RpcException {
    if (Constants.REGISTRY_PROTOCOL.equals(invoker.getUrl().getProtocol())) {
        return protocol.export(invoker);
    }
    return new ListenerExporterWrapper<>(protocol.export(invoker),
            Collections.unmodifiableList(ExtensionLoader.getExtensionLoader(ExporterListener.class)
                    .getActivateExtension(invoker.getUrl(), Constants.EXPORTER_LISTENER_KEY)));
}
 
Example #5
Source File: ProtocolListenerWrapper.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public <T> Exporter<T> export(Invoker<T> invoker) throws RpcException {
    if (Constants.REGISTRY_PROTOCOL.equals(invoker.getUrl().getProtocol())) {
        return protocol.export(invoker);
    }
    return new ListenerExporterWrapper<T>(protocol.export(invoker), 
            Collections.unmodifiableList(ExtensionLoader.getExtensionLoader(ExporterListener.class)
                    .getActivateExtension(invoker.getUrl(), Constants.EXPORTER_LISTENER_KEY)));
}
 
Example #6
Source File: ProtocolListenerWrapper.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public <T> Exporter<T> export(Invoker<T> invoker) throws RpcException {
    if (Constants.REGISTRY_PROTOCOL.equals(invoker.getUrl().getProtocol())) {
        return protocol.export(invoker);
    }
    return new ListenerExporterWrapper<T>(protocol.export(invoker), 
            Collections.unmodifiableList(ExtensionLoader.getExtensionLoader(ExporterListener.class)
                    .getActivateExtension(invoker.getUrl(), Constants.EXPORTER_LISTENER_KEY)));
}