Class RuleConstructor.MethodClause
- java.lang.Object
-
- org.jboss.byteman.contrib.dtest.RuleConstructor.MethodClause
-
- Enclosing class:
- RuleConstructor
public final class RuleConstructor.MethodClause extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MethodClause()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RuleConstructor.LocationClauseinClassInitMethod()Defining class initialization method as place for rule injection.RuleConstructor.LocationClauseinClassInitMethod(java.lang.String... argTypes)Defining class initialization method as place for rule injection.RuleConstructor.MethodClauseincludeSubclases()Defining that the rule will be injected to all sub-classes or classes implementing the interface.RuleConstructor.LocationClauseinConstructor()Defining constructor, special method type, as place for rule injection.RuleConstructor.LocationClauseinConstructor(java.lang.String... argTypes)Defining constructor, special method type, as place for rule injection.RuleConstructor.LocationClauseinMethod(java.lang.String methodName)Defining method where the rule is injected to.RuleConstructor.LocationClauseinMethod(java.lang.String methodName, java.lang.String... argTypes)Defining method specified by argument types where the rule is injected to.
-
-
-
Method Detail
-
includeSubclases
public RuleConstructor.MethodClause includeSubclases()
Defining that the rule will be injected to all sub-classes or classes implementing the interface.
By default
Bytemaninjects 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(java.lang.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(java.lang.String methodName, java.lang.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 injectionargTypes- 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(java.lang.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(java.lang.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
-
-