InterceptionMethod (JProfiler help)
Date: 2012-06-30

## JProfiler API documentation

## com.jprofiler.api.agent.probe
Class InterceptionMethod

    java.lang.Object
      com.jprofiler.api.agent.probe.InterceptionMethod

    public class InterceptionMethod

extends java.lang.Object

Defines a single method that should be intercepted by an @{link InterceptorProbe interceptor probe}. You can define a method in a concrete class or a wildcard interception that intercepts all methods based on the method name an signature only. For wildcard interceptions, make sure to try to intercept uncommon method signatures only in order to reduce the instrumentation overhead. For example, intercepting `getName()` as a wildcard interception leads to many unwanted instrumentations.

The method signature is written in JVM format. This format is also used by JNI and is of the form:

     (argument-type*)return-type

and uses the JVM's representation of type signatures for both argument type and return type. The following table shows all type signatures:

Type | Signature
--- | ---
Z | boolean
B | byte
C | char
S | short
I | int
J | long
F | float
D | double
L fully-qualified-class ; | fully-qualified-class
[ type | type[]

The fully qualified class references have to be written with '/' package separators instead of the usual '.' package separators. There must be no spaces in a type signature.

For example, the Java method:

     long someMethod (int n, String s, int[] arr);

has the following type signature:

     (ILjava/lang/String;[I)J

See Also:
  `InterceptorProbe`

Constructor Summary
`InterceptionMethod(java.lang.String methodName, java.lang.String methodSignature)` Constructor for a wildcard method interception.
`InterceptionMethod(java.lang.String className, java.lang.String methodName, java.lang.String methodSignature)` Constructor for a method interception of a concrete class.

Method Summary
`java.lang.String` | `getClassName()` Returns the class name.
`java.lang.String` | `getMethodName()` Returns the method name.
`java.lang.String` | `getMethodSignature()` Returns the method signature
`java.lang.String` | `toString()`

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

Constructor Detail

### InterceptionMethod

    public InterceptionMethod(java.lang.String className,
                              java.lang.String methodName,
                              java.lang.String methodSignature)

  Constructor for a method interception of a concrete class.

  Parameters:
    `className` - the fully qualified name of the class that contains the intercepted method. Can be written with '/' or '.' package separators. If `null`, this constructor is equivalent to `InterceptionMethod(String, String)`.
    `methodName` - the name of the intercepted method
    `methodSignature` - the signature of the intercepted method in the JVM format explained above

### InterceptionMethod

    public InterceptionMethod(java.lang.String methodName,
                              java.lang.String methodSignature)

  Constructor for a wildcard method interception. All classes are checked whether they contains such a method and are instrumented accordingly.

  Parameters:
    `methodName` - the name of the intercepted method
    `methodSignature` - the signature of the intercepted method in the JVM format explained above

Method Detail

### getClassName

    public java.lang.String getClassName()

  Returns the class name.

  Returns:
    the class name

### getMethodName

    public java.lang.String getMethodName()

  Returns the method name.

  Returns:
    the method name

### getMethodSignature

    public java.lang.String getMethodSignature()

  Returns the method signature

  Returns:
    the method signature in the format explained above.

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`