Class ProtocolFactory

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    
    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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      ProtocolFactory(ImmutableConfig immutableConfig)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Protocol getProtocol(WebPage page) Get the protocol for a page.
      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)

        Get the protocol for a page.

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