Class HTTPSamplerProxy

All Implemented Interfaces:
Serializable, Cloneable, ConfigMergabilityIndicator, Replaceable, Searchable, HTTPConstantsInterface, Interruptible, Sampler, org.apache.jmeter.testelement.TestElement, TestIterationListener, TestStateListener, ThreadListener

public final class HTTPSamplerProxy extends HTTPSamplerBase implements Interruptible
Proxy class that dispatches to the appropriate HTTP sampler.

This class is stored in the test plan, and holds all the configuration settings. The actual implementation is created at run-time, and is passed a reference to this class so it can get access to all the settings stored by HTTPSamplerProxy.

See Also:
  • Constructor Details

    • HTTPSamplerProxy

      public HTTPSamplerProxy()
    • HTTPSamplerProxy

      public HTTPSamplerProxy(String impl)
      Convenience method used to initialise the implementation.
      Parameters:
      impl - the implementation to use.
  • Method Details

    • sample

      protected HTTPSampleResult sample(URL u, String method, boolean areFollowingRedirect, int depth)
      Samples the URL passed in and stores the result in HTTPSampleResult, following redirects and downloading page resources as appropriate.

      When getting a redirect target, redirects are not followed and resources are not downloaded. The caller will take care of this.

      Specified by:
      sample in class HTTPSamplerBase
      Parameters:
      u - URL to sample
      method - HTTP method: GET, POST,...
      areFollowingRedirect - whether we're getting a redirect target
      depth - Depth of this target in the frame structure. Used only to prevent infinite recursion.
      Returns:
      results of the sampling, can be null if u is in CacheManager
    • threadFinished

      public void threadFinished()
      Description copied from interface: ThreadListener
      Called for each thread after all samples have been processed. See org.apache.jmeter.threads.JMeterThread#threadFinished(org.apache.jmeter.engine.event.LoopIterationListener)
      Specified by:
      threadFinished in interface ThreadListener
      Overrides:
      threadFinished in class HTTPSamplerBase
    • interrupt

      public boolean interrupt()
      Description copied from interface: Interruptible
      Interrupt the current operation if possible.
      Specified by:
      interrupt in interface Interruptible
      Returns:
      true if there was an operation to interrupt.
    • testIterationStart

      public void testIterationStart(LoopIterationEvent event)
      Description copied from interface: TestIterationListener
      Each time through a Thread Group's test script, an iteration event is fired for each thread. This will be after the test elements have been cloned, so in general the instance will not be the same as the ones the start/end methods call.
      Specified by:
      testIterationStart in interface TestIterationListener
      Overrides:
      testIterationStart in class HTTPSamplerBase
      Parameters:
      event - the iteration event