类 AbstractProtocol
- java.lang.Object
-
- org.apache.dubbo.rpc.protocol.AbstractProtocol
-
- 所有已实现的接口:
Protocol
- 直接已知子类:
AbstractProxyProtocol,DubboProtocol,InjvmProtocol,MemcachedProtocol,MockProtocol,RedisProtocol,ThriftProtocol
public abstract class AbstractProtocol extends Object implements Protocol
abstract ProtocolSupport.
-
-
构造器概要
构造器 构造器 说明 AbstractProtocol()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voiddestroy()Destroy protocol:
1.Map<String,Exporter<?>>getExporterMap()Collection<Exporter<?>>getExporters()List<ProtocolServer>getServers()Get all servers serving this protocol<T> Invoker<T>refer(Class<T> type, URL url)Refer a remote service:
1.-
从接口继承的方法 org.apache.dubbo.rpc.Protocol
export, getDefaultPort
-
-
-
-
方法详细资料
-
getServers
public List<ProtocolServer> getServers()
从接口复制的说明:ProtocolGet all servers serving this protocol- 指定者:
getServers在接口中Protocol- 返回:
-
destroy
public void destroy()
从接口复制的说明:ProtocolDestroy 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.
-
refer
public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException
从接口复制的说明:ProtocolRefer 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
-
getExporters
public Collection<Exporter<?>> getExporters()
-
-