-
- 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 ProtocolgetProtocol(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 ProtocolgetProtocol(String url)Returns the appropriate Protocol implementation for a url. final ProtocolgetProtocol(FetchMode mode)Unitclose()-
-
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
-
getProtocol
final Protocol getProtocol(String url)
Returns the appropriate Protocol implementation for a url.
- Parameters:
url- The url
-
getProtocol
final Protocol getProtocol(FetchMode mode)
-
-
-
-