类 RegistryProtocol
- java.lang.Object
-
- com.alibaba.dubbo.registry.integration.RegistryProtocol
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
RegistryProtocol.InvokerDelegete<T>
-
构造器概要
构造器 构造器 说明 RegistryProtocol()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 void
destroy()
Destroy protocol:
1.<T> Exporter<T>
export(Invoker<T> originInvoker)
Export service for remote invocation:
1.int
getDefaultPort()
Get default port when user doesn't config the port.Map<URL,NotifyListener>
getOverrideListeners()
URL
getRegisteredConsumerUrl(URL consumerUrl, URL registryUrl)
static RegistryProtocol
getRegistryProtocol()
<T> Invoker<T>
refer(Class<T> type, URL url)
Refer a remote service:
1.void
register(URL registryUrl, URL registedProviderUrl)
void
setCluster(Cluster cluster)
void
setProtocol(Protocol protocol)
void
setProxyFactory(ProxyFactory proxyFactory)
void
setRegistryFactory(RegistryFactory registryFactory)
-
-
-
方法详细资料
-
getRegistryProtocol
public static RegistryProtocol getRegistryProtocol()
-
setCluster
public void setCluster(Cluster cluster)
-
setProtocol
public void setProtocol(Protocol protocol)
-
setRegistryFactory
public void setRegistryFactory(RegistryFactory registryFactory)
-
setProxyFactory
public void setProxyFactory(ProxyFactory proxyFactory)
-
getDefaultPort
public int getDefaultPort()
从接口复制的说明:Protocol
Get default port when user doesn't config the port.- 指定者:
getDefaultPort
在接口中Protocol
- 返回:
- default port
-
getOverrideListeners
public Map<URL,NotifyListener> getOverrideListeners()
-
export
public <T> Exporter<T> export(Invoker<T> originInvoker) throws RpcException
从接口复制的说明:Protocol
Export service for remote invocation:
1. Protocol should record request source address after receive a request: RpcContext.getContext().setRemoteAddress();
2. export() must be idempotent, that is, there's no difference between invoking once and invoking twice when export the same URL
3. Invoker instance is passed in by the framework, protocol needs not to care- 指定者:
export
在接口中Protocol
- 类型参数:
T
- Service type- 参数:
originInvoker
- Service invoker- 返回:
- exporter reference for exported service, useful for unexport the service later
- 抛出:
RpcException
- thrown when error occurs during export the service, for example: port is occupied
-
refer
public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException
从接口复制的说明:Protocol
Refer a remote service:
1. When user calls `invoke()` method of `Invoker` object which's returned from `refer()` call, the protocol needs to correspondingly execute `invoke()` method of `Invoker` object
2. It's protocol's responsibility to implement `Invoker` which's returned from `refer()`. Generally speaking, protocol sends remote request in the `Invoker` implementation.
3. When there's check=false set in URL, the implementation must not throw exception but try to recover when connection fails.- 指定者:
refer
在接口中Protocol
- 类型参数:
T
- Service type- 参数:
type
- Service classurl
- URL address for the remote service- 返回:
- invoker service's local proxy
- 抛出:
RpcException
- when there's any error while connecting to the service provider
-
destroy
public void destroy()
从接口复制的说明:Protocol
Destroy protocol:
1. Cancel all services this protocol exports and refers
2. Release all occupied resources, for example: connection, port, etc.
3. Protocol can continue to export and refer new service even after it's destroyed.
-
-