public class DubboProtocol extends AbstractProtocol
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
COMPATIBLE_CODEC_NAME |
static int |
DEFAULT_PORT |
ReentrantLock |
lock |
static String |
NAME |
| 构造器和说明 |
|---|
DubboProtocol() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
destroy()
释放协议:
1. |
<T> Exporter<T> |
export(Invoker<T> invoker)
暴露远程服务:
1. |
int |
getDefaultPort()
获取缺省端口,当用户没有配置端口时使用。
|
static DubboProtocol |
getDubboProtocol() |
Collection<Exporter<?>> |
getExporters() |
Collection<Invoker<?>> |
getInvokers() |
Collection<ExchangeServer> |
getServers() |
<T> Invoker<T> |
refer(Class<T> serviceType,
URL url)
引用远程服务:
1. |
public static final int DEFAULT_PORT
public final ReentrantLock lock
public static DubboProtocol getDubboProtocol()
public Collection<ExchangeServer> getServers()
public Collection<Exporter<?>> getExporters()
public Collection<Invoker<?>> getInvokers()
public int getDefaultPort()
Protocolpublic <T> Exporter<T> export(Invoker<T> invoker) throws RpcException
ProtocolT - 服务的类型invoker - 服务的执行体RpcException - 当暴露服务出错时抛出,比如端口已占用public <T> Invoker<T> refer(Class<T> serviceType, URL url) throws RpcException
ProtocolT - 服务的类型serviceType - 服务的类型url - 远程服务的URL地址RpcException - 当连接服务提供方失败时抛出public void destroy()
Protocoldestroy 在接口中 Protocoldestroy 在类中 AbstractProtocolCopyright © 2012–2017 Alibaba. All rights reserved.