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.
-
-
Constructor Summary
Constructors Constructor Description ProtocolFactory(ImmutableConfig immutableConfig)
-
Method Summary
Modifier and Type Method Description final ProtocolgetProtocol(WebPage page)Get the protocol for a page. final ProtocolgetProtocol(String url)Returns the appropriate Protocol implementation for a url. final ProtocolgetProtocol(FetchMode mode)Unitclose()-
-
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
-
getProtocol
final Protocol getProtocol(String url)
Returns the appropriate Protocol implementation for a url.
-
getProtocol
final Protocol getProtocol(FetchMode mode)
-
-
-
-