Tabnine Logo
ProxyMethod
Code IndexAdd Tabnine to your IDE (free)

How to use
ProxyMethod
in
rocks.inspectit.agent.java.proxy

Best Java code snippets using rocks.inspectit.agent.java.proxy.ProxyMethod (Showing top 20 results out of 315)

origin: inspectIT/inspectIT

/**
 * See {@link #setContentLength(int)} for the reasons for proxying.
 *
 * @param len
 *            parameter of the proxied method
 */
@ProxyMethod
public void setContentLengthLong(final long len) {
  contentLengthHeaderModifications.add(new Runnable() {
    @Override
    public void run() {
      wrappedResponse.setContentLengthLong(len);
    }
  });
}
origin: inspectIT/inspectIT

if (StringUtils.isEmpty(anno.methodName())) {
  methodPlan.methodName = method.getName();
} else {
  methodPlan.methodName = anno.methodName();
if (StringUtils.isEmpty(anno.returnType())) {
  methodPlan.returnType = method.getReturnType();
} else {
  methodPlan.returnType = getType(anno.returnType(), context);
if (ArrayUtils.isEmpty(anno.parameterTypes())) {
  for (Class<?> paramType : targetMethodParamTypes) {
    methodPlan.parameterTypes.add(paramType);
  if (anno.parameterTypes().length != targetMethodParamTypes.length) {
    InvalidProxyDescriptionException.throwException("The parameter count in the ProxyMethod annotation " + "does not match the actual parameter count for " + method.getName());
  for (int i = 0; i < anno.parameterTypes().length; i++) {
    String typeName = anno.parameterTypes()[i];
    if (StringUtils.isEmpty(typeName)) {
      InvalidProxyDescriptionException.throwException("Invalid parameter type: %s", typeName);
if (anno.isOptional()) {
origin: inspectIT/inspectIT

/**
 * Overrides setContentLength to consume the call and to postpone it. When we inject our script
 * tag, the content length is not known beforehand. Therefore, in case we perform an injection,
 * we have to force chunked encoding by not setting any content length.
 *
 * @param len
 *            the parameter from the proxied method.
 */
@ProxyMethod
public void setContentLength(final int len) {
  contentLengthHeaderModifications.add(new Runnable() {
    @Override
    public void run() {
      wrappedResponse.setContentLength(len);
    }
  });
}
origin: inspectIT/inspectIT

@Override
@ProxyMethod
public void flush() throws IOException {
  originalStream.flush();
}
origin: inspectIT/inspectIT

@Override
@ProxyMethod
public void close() throws IOException {
  originalStream.close();
}
origin: inspectIT/inspectIT

/**
 * Proxy method for setting the write listener.
 *
 * @param listener
 *            write listener which should get set.
 */
@ProxyMethod(parameterTypes = { "javax.servlet.WriteListener" }, isOptional = true)
public void setWriteListener(Object listener) {
  originalStream.setWriteListener(listener);
}
origin: inspectIT/inspectIT

/**
 * Proxy method for isReady method of the OutputStream.
 *
 * @return the ready state
 */
@ProxyMethod(isOptional = true)
public boolean isReady() {
  return originalStream.isReady();
}
origin: inspectIT/inspectIT

@ProxyMethod(methodName = "doubleInt")
public int doubleInt_renamed(int a) {
  return 2 * a;
}
origin: inspectIT/inspectIT

@ProxyMethod
public String sayHello() {
  return "Hello!";
}
origin: inspectIT/inspectIT

/**
 * See {@link #setContentLength(int)} for the reasons for proxying.
 *
 * @param name
 *            the name of the header
 * @param value
 *            the value of the header
 */
@ProxyMethod
public void setIntHeader(final String name, final int value) {
  if (CONTENT_LENGTH_HEADER_NAME.equalsIgnoreCase(name)) {
    contentLengthHeaderModifications.add(new Runnable() {
      @Override
      public void run() {
        wrappedResponse.setIntHeader(name, value);
      }
    });
  } else {
    wrappedResponse.setIntHeader(name, value);
  }
}
origin: inspectIT/inspectIT

/**
 * Response status event. We can capture status here.
 *
 * @param version
 *            version
 * @param status
 *            status
 * @param reason
 *            reason
 * @throws IOException
 *             IOException
 */
@ProxyMethod(parameterTypes = { "org.eclipse.jetty.io.Buffer", "int", "org.eclipse.jetty.io.Buffer" })
public void onResponseStatus(Object version, int status, Object reason) throws IOException {
  this.status = status;
  if (null != originalListener) {
    WHttpEventListenerWrapper.ON_RESPONSE_STATUS.call(originalListener, version, status, reason);
  }
}
origin: inspectIT/inspectIT

/**
 * See {@link #setContentLength(int)} for the reasons for proxying.
 *
 * @param name
 *            the name of the header
 * @param value
 *            the value of the header
 */
@ProxyMethod
public void addIntHeader(final String name, final int value) {
  if (CONTENT_LENGTH_HEADER_NAME.equalsIgnoreCase(name)) {
    contentLengthHeaderModifications.add(new Runnable() {
      @Override
      public void run() {
        wrappedResponse.addIntHeader(name, value);
      }
    });
  } else {
    wrappedResponse.addIntHeader(name, value);
  }
}
origin: inspectIT/inspectIT

/**
 * See {@link #setContentLength(int)} for the reasons for proxying.
 *
 * @param name
 *            the name of the header
 * @param value
 *            the value of the header
 */
@ProxyMethod
public void setHeader(final String name, final String value) {
  if (CONTENT_LENGTH_HEADER_NAME.equalsIgnoreCase(name)) {
    contentLengthHeaderModifications.add(new Runnable() {
      @Override
      public void run() {
        wrappedResponse.setHeader(name, value);
      }
    });
  } else {
    wrappedResponse.setHeader(name, value);
  }
}
origin: inspectIT/inspectIT

/**
 * See {@link #setContentLength(int)} for the reasons for proxying.
 *
 * @param name
 *            the name of the header
 * @param value
 *            the value of the header
 */
@ProxyMethod
public void addHeader(final String name, final String value) {
  if (CONTENT_LENGTH_HEADER_NAME.equalsIgnoreCase(name)) {
    contentLengthHeaderModifications.add(new Runnable() {
      @Override
      public void run() {
        wrappedResponse.addHeader(name, value);
      }
    });
  } else {
    wrappedResponse.addHeader(name, value);
  }
}
origin: inspectIT/inspectIT

@ProxyMethod(returnType = "java.lang.StringBuffer")
public Object createStringBuffer() {
  return new StringBuffer();
}
origin: inspectIT/inspectIT

@ProxyMethod(parameterTypes = { "java.lang.StringBuffer", "java.lang.String" })
public void appendToStringBuffer(Object sb, Object stringToAppend) {
  ((StringBuffer) sb).append((String) stringToAppend);
}
origin: inspectIT/inspectIT

@ProxyMethod
public void throwException() throws FileNotFoundException {
  throw new FileNotFoundException("testtext");
}
origin: inspectIT/inspectIT

/**
 * Request committed event. This is earliest place we can start a span.
 *
 * @throws IOException
 *             IOException
 */
@ProxyMethod()
public void onRequestCommitted() throws IOException {
  spanStore.startSpan();
  if (null != originalListener) {
    WHttpEventListenerWrapper.ON_REQUEST_COMMITED.call(originalListener);
  }
}
origin: inspectIT/inspectIT

/**
 * Connection failed.
 *
 * @param ex
 *            Throwable
 */
@ProxyMethod(parameterTypes = "java.lang.Throwable")
public void onConnectionFailed(Throwable ex) {
  handleThrowable(ex);
  if (null != originalListener) {
    WHttpEventListenerWrapper.ON_CONNECTION_FAILED.call(originalListener, ex);
  }
}
origin: inspectIT/inspectIT

/**
 * Exception occurred.
 *
 * @param ex
 *            Throwable
 */
@ProxyMethod(parameterTypes = "java.lang.Throwable")
public void onException(Throwable ex) {
  handleThrowable(ex);
  if (null != originalListener) {
    WHttpEventListenerWrapper.ON_EXCEPTION.call(originalListener, ex);
  }
}
rocks.inspectit.agent.java.proxyProxyMethod

Most used methods

  • <init>
  • isOptional
  • methodName
  • parameterTypes
  • returnType

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (Timer)
  • getApplicationContext (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now