Class HttpClient3TimeoutTransformer

  • All Implemented Interfaces:
    java.lang.instrument.ClassFileTransformer

    public class HttpClient3TimeoutTransformer
    extends MBeanAwareTimeoutTransformer
    Sets timeouts for HTTP calls done using Apache Commons HttpClient 3.x

    It inserts two calls in org.apache.commons.httpclient.params.DefaultHttpParamsFactory.createParams that set default values for http.connection.timeout and http.socket.timeout.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected byte[] doTransformClass​(javassist.CtClass cc)
      Transform a class that is guaranteed to exist and in scope of this agent instance
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.instrument.ClassFileTransformer

        transform
    • Constructor Detail

      • HttpClient3TimeoutTransformer

        public HttpClient3TimeoutTransformer​(long connectTimeoutMillis,
                                             long readTimeoutMillis,
                                             AgentInfo agentInfoMBean)
    • Method Detail

      • doTransformClass

        protected byte[] doTransformClass​(javassist.CtClass cc)
                                   throws java.lang.Exception
        Description copied from class: MBeanAwareTimeoutTransformer
        Transform a class that is guaranteed to exist and in scope of this agent instance
        Specified by:
        doTransformClass in class MBeanAwareTimeoutTransformer
        Parameters:
        cc - the class
        Returns:
        the new class definition
        Throws:
        java.lang.Exception - in case of any problems while transforming