Class AbstractProtocol

java.lang.Object
org.apache.dubbo.rpc.protocol.AbstractProtocol
All Implemented Interfaces:
ScopeModelAware, Protocol
Direct Known Subclasses:
AbstractProxyProtocol, MockProtocol

public abstract class AbstractProtocol extends Object implements Protocol, ScopeModelAware
abstract ProtocolSupport.
  • Constructor Details

    • AbstractProtocol

      public AbstractProtocol()
  • Method Details

    • setFrameworkModel

      public void setFrameworkModel(FrameworkModel frameworkModel)
      Specified by:
      setFrameworkModel in interface ScopeModelAware
    • getServers

      public List<ProtocolServer> getServers()
      Description copied from interface: Protocol
      Get all servers serving this protocol
      Specified by:
      getServers in interface Protocol
      Returns:
    • destroy

      public void destroy()
      Description copied from interface: 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.
      Specified by:
      destroy in interface Protocol
    • refer

      public <T> Invoker<T> refer(Class<T> type, URL url) throws RpcException
      Description copied from interface: 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.
      Specified by:
      refer in interface Protocol
      Type Parameters:
      T - Service type
      Parameters:
      type - Service class
      url - 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

      public Map<String,Exporter<?>> getExporterMap()
    • getExporters

      public Collection<Exporter<?>> getExporters()