public abstract class AbstractProxyProtocol extends AbstractProtocol
| 构造器和说明 |
|---|
AbstractProxyProtocol() |
AbstractProxyProtocol(Class<?>... exceptions) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addRpcException(Class<?> exception) |
<T> Exporter<T> |
export(Invoker<T> invoker)
暴露远程服务:
1. |
ProxyFactory |
getProxyFactory() |
<T> Invoker<T> |
refer(Class<T> type,
URL url)
引用远程服务:
1. |
void |
setProxyFactory(ProxyFactory proxyFactory) |
destroygetDefaultPortpublic AbstractProxyProtocol()
public AbstractProxyProtocol(Class<?>... exceptions)
public void addRpcException(Class<?> exception)
public ProxyFactory getProxyFactory()
public void setProxyFactory(ProxyFactory proxyFactory)
public <T> Exporter<T> export(Invoker<T> invoker) throws RpcException
ProtocolT - 服务的类型invoker - 服务的执行体RpcException - 当暴露服务出错时抛出,比如端口已占用public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException
ProtocolT - 服务的类型type - 服务的类型url - 远程服务的URL地址RpcException - 当连接服务提供方失败时抛出Copyright © 2012–2017 Alibaba. All rights reserved.