Package 

Class ProtocolFactory

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    @Component() 
    public final class ProtocolFactory
     implements AutoCloseable
                        

    Creates and caches Protocol plugins. Protocol plugins should define the attribute "protocolName" with the name of the protocol that they implement. Configuration object is used for caching. Cache key is constructed from appending protocol name (eg. http) to constant

    • Constructor Summary

      Constructors 
      Constructor Description
      ProtocolFactory(ImmutableConfig immutableConfig)
    • Method Summary

      Modifier and Type Method Description
      final Protocol getProtocol(WebPage page) TODO: configurable, using major protocol/sub protocol is a good idea Using major protocol/sub protocol is a good idea, for example: selenium:http://www.baidu.
      final Protocol getProtocol(String url) Returns the appropriate Protocol implementation for a url.
      final Protocol getProtocol(FetchMode mode)
      Unit close()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProtocolFactory

        ProtocolFactory(ImmutableConfig immutableConfig)
    • Method Detail

      • getProtocol

         final Protocol getProtocol(WebPage page)

        TODO: configurable, using major protocol/sub protocol is a good idea Using major protocol/sub protocol is a good idea, for example: selenium:http://www.baidu.com/ jdbc:h2:tcp://localhost/~/test