Package org.apache.dubbo.rpc.protocol
Class AbstractProtocol
java.lang.Object
org.apache.dubbo.rpc.protocol.AbstractProtocol
- All Implemented Interfaces:
ScopeModelAware,Protocol
- Direct Known Subclasses:
AbstractProxyProtocol,MockProtocol
abstract ProtocolSupport.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroy protocol:
1.Collection<Exporter<?>> Get all servers serving this protocol<T> Invoker<T> Refer a remote service:
1.voidsetFrameworkModel(FrameworkModel frameworkModel) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.dubbo.rpc.Protocol
export, getDefaultPortMethods inherited from interface org.apache.dubbo.rpc.model.ScopeModelAware
setApplicationModel, setModuleModel, setScopeModel
-
Constructor Details
-
AbstractProtocol
public AbstractProtocol()
-
-
Method Details
-
setFrameworkModel
- Specified by:
setFrameworkModelin interfaceScopeModelAware
-
getServers
Description copied from interface:ProtocolGet all servers serving this protocol- Specified by:
getServersin interfaceProtocol- Returns:
-
destroy
public void destroy()Description copied from interface: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
Description copied from interface: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.- Specified by:
referin interfaceProtocol- Type Parameters:
T- Service type- Parameters:
type- Service classurl- URL address for the remote service- Returns:
- invoker service's local proxy
- Throws:
RpcException- when there's any error while connecting to the service provider
-
getExporterMap
-
getExporters
-