Class RuleConstructor.MethodClause

java.lang.Object
org.jboss.byteman.contrib.dtest.RuleConstructor.MethodClause
Enclosing class:
RuleConstructor

public final class RuleConstructor.MethodClause extends Object
  • Constructor Details

    • MethodClause

      public MethodClause()
  • Method Details

    • includeSubclases

      public RuleConstructor.MethodClause includeSubclases()

      Defining that the rule will be injected to all sub-classes or classes implementing the interface.

      By default Byteman injects the rule only to the specified class and children classes are not instrumented.

      The rule class definition is enriched with ^. As example: CLASS ^org.jboss.byteman.ExampleClass.

      Returns:
      this, for having fluent api
    • inMethod

      public RuleConstructor.LocationClause inMethod(String methodName)

      Defining method where the rule is injected to.

      Example:

      new RuleBuilder("rule name")
      .onInterface("javax.transaction.xa.XAResource")
      .inMethod("commit")
      ...

      Parameters:
      methodName - method name for rule injection
      Returns:
      this, for having fluent api
    • inMethod

      public RuleConstructor.LocationClause inMethod(String methodName, String... argTypes)

      Defining method specified by argument types where the rule is injected to. Arguments restrict which methods are instrumented based on parameters definition.

      Example:

      new RuleBuilder("rule name")
      .onInterface("javax.transaction.xa.XAResource")
      .inMethod("commit", "Xid" , "boolean")
      ...

      Parameters:
      methodName - method name for rule injection
      argTypes - method argument types to closer specify what method is instrumented
      Returns:
      this, for having fluent api
    • inConstructor

      public RuleConstructor.LocationClause inConstructor()
      Defining constructor, special method type, as place for rule injection.
      Returns:
      this, for having fluent api
    • inConstructor

      public RuleConstructor.LocationClause inConstructor(String... argTypes)

      Defining constructor, special method type, as place for rule injection.

      The type of constructor method is specified by its arguments.

      Parameters:
      argTypes - method argument types to closer specify which method
      Returns:
      this, for having fluent api
    • inClassInitMethod

      public RuleConstructor.LocationClause inClassInitMethod()
      Defining class initialization method as place for rule injection.
      Returns:
      this, for having fluent api
    • inClassInitMethod

      public RuleConstructor.LocationClause inClassInitMethod(String... argTypes)
      Defining class initialization method as place for rule injection.
      Parameters:
      argTypes - method argument types to closer specify which method
      Returns:
      this, for having fluent api