Apache JMeter

## org.apache.jmeter.protocol.http.sampler
Class HTTPSamplerFactory

    java.lang.Object
      org.apache.jmeter.protocol.http.sampler.HTTPSamplerFactory

    public class HTTPSamplerFactory

extends Object

Factory to return the appropriate HTTPSampler for use with classes that need an HTTPSampler

Field Summary
`static String` `DEFAULT_CLASSNAME`
`static String` `HTTP_SAMPLER_APACHE` Use Apache HTTPClient HTTP implementation
`static String` `HTTP_SAMPLER_JAVA` Use the the default Java HTTP implementation

Method Summary
`static HTTPSamplerBase` `newInstance()` Create a new instance of the default sampler
`static HTTPSamplerBase` `newInstance(String alias)` Create a new instance of the required sampler type

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### HTTP_SAMPLER_JAVA

    public static final String HTTP_SAMPLER_JAVA

  Use the the default Java HTTP implementation

  See Also:
    Constant Field Values

### HTTP_SAMPLER_APACHE

    public static final String HTTP_SAMPLER_APACHE

  Use Apache HTTPClient HTTP implementation

  See Also:
    Constant Field Values

### DEFAULT_CLASSNAME

    public static final String DEFAULT_CLASSNAME

Method Detail

### newInstance

    public static HTTPSamplerBase newInstance()

  Create a new instance of the default sampler

  Returns:
    instance of default sampler

### newInstance

    public static HTTPSamplerBase newInstance(String alias)

  Create a new instance of the required sampler type

  Parameters:
    `alias` - HTTP_SAMPLER or HTTP_SAMPLER_APACHE
  Returns:
    the appropriate sampler
  Throws:
    `UnsupportedOperationException` - if alias is not recognised

Apache JMeter

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.