Class RuleConstructor.LocationClause

  • Enclosing class:
    RuleConstructor

    public final class RuleConstructor.LocationClause
    extends java.lang.Object
    • Constructor Detail

      • LocationClause

        public LocationClause()
    • Method Detail

      • helper

        public RuleConstructor.LocationClause helper​(java.lang.Class<?> helperClass)
        Byteman helper class to be used in rule definition.
        Parameters:
        helperClass - byteman helper class
        Returns:
        this, for having fluent api
      • helper

        public RuleConstructor.LocationClause helper​(java.lang.String helperClassName)
        Class name of Byteman helper class.
        Parameters:
        helperClassName - byteman helper class name
        Returns:
        this, for having fluent api
      • atEntry

        public RuleConstructor.ConditionClause atEntry()

        Rule is invoked at entry point of method.

        Location specifier is set as AT ENTRY.

        Returns:
        this, for having fluent api
      • atExit

        public RuleConstructor.ConditionClause atExit()

        Rule is invoked at exit point of method.

        Location specifier is set as AT EXIT.

        Returns:
        this, for having fluent api
      • atLine

        public RuleConstructor.ConditionClause atLine​(int line)

        Rule is invoked at specific line of code within the method.

        Location specifier is set as AT LINE <line>.

        Parameters:
        line - line number to be rule injection point
        Returns:
        this, for having fluent api
      • atRead

        public RuleConstructor.ConditionClause atRead​(java.lang.String variable)

        Rule is invoked at point where method reads a variable.

        Location specifier is set as AT READ <variable>.

        Parameters:
        variable - rule is triggered at write from this variable happen
        Returns:
        this, for having fluent api
      • atRead

        public RuleConstructor.ConditionClause atRead​(java.lang.String variable,
                                                      int occurencePosition)

        Rule is invoked at point where method reads a variable where occurencePosition defines Nth textual occurrence of the field access.

        Location specifier is set as AT READ <variable> <occurencePosition>.

        Parameters:
        variable - rule is triggered at write from this variable happen
        occurencePosition - Nth textual occurrence of reading the field
        Returns:
        this, for having fluent api
      • afterRead

        public RuleConstructor.ConditionClause afterRead​(java.lang.String variable)

        Rule is invoked after point where method reads a variable.

        Location specifier is set as AFTER READ <variable>.

        Parameters:
        variable - rule is triggered after write from this variable happen
        Returns:
        this, for having fluent api
      • afterRead

        public RuleConstructor.ConditionClause afterRead​(java.lang.String variable,
                                                         int occurencePosition)

        Rule is invoked after point where method reads a variable where occurencePosition defines Nth textual occurrence of the field access.

        Location specifier is set as AFTER READ <variable> <occurencePosition>.

        Parameters:
        variable - rule is triggered after write from this variable happen
        occurencePosition - Nth textual occurrence of reading the field
        Returns:
        this, for having fluent api
      • atWrite

        public RuleConstructor.ConditionClause atWrite​(java.lang.String variable)

        Rule is invoked at point where method writes to a variable.

        Location specifier is set as AT WRITE <variable>.

        Parameters:
        variable - rule is triggered at write to this variable happen
        Returns:
        this, for having fluent api
      • atWrite

        public RuleConstructor.ConditionClause atWrite​(java.lang.String variable,
                                                       int occurencePosition)

        Rule is invoked at point where method writes to a variable where occurencePosition defines Nth textual occurrence of the field write.

        Location specifier is set as AT WRITE <variable> <occurencePosition>.

        Parameters:
        variable - rule is triggered at write to this variable happen
        occurencePosition - Nth textual occurrence of the field write
        Returns:
        this, for having fluent api
      • afterWrite

        public RuleConstructor.ConditionClause afterWrite​(java.lang.String variable)

        Rule is invoked after point where method writes to a variable.

        Location specifier is set as AFTER WRITE <variable>.

        Parameters:
        variable - rule is triggered after write to this variable happen
        Returns:
        this, for having fluent api
      • afterWrite

        public RuleConstructor.ConditionClause afterWrite​(java.lang.String variable,
                                                          int occurencePosition)

        Rule is invoked after point where method writes to a variable where occurencePosition defines Nth textual occurrence of the field write.

        Location specifier is set as AFTER WRITE <variable> <occurencePosition>.

        Parameters:
        variable - rule is triggered after write to this variable happen
        occurencePosition - Nth textual occurrence of the field write
        Returns:
        this, for having fluent api
      • atInvoke

        public RuleConstructor.ConditionClause atInvoke​(java.lang.String method)

        Rule is invoked at point of invocation of method within the trigger method.

        Location specifier is set as AT INVOKE <variable>.

        Parameters:
        method - method name after which invocation the rule is executed
        Returns:
        this, for having fluent api
      • atInvoke

        public RuleConstructor.ConditionClause atInvoke​(java.lang.String method,
                                                        int occurencePosition)

        Rule is invoked at point of invocation of method within the trigger method where occurencePosition defines Nth textual occurrence of the method invocation.

        Location specifier is set as AT INVOKE <variable> <occurencePosition>.

        Parameters:
        method - method name after which invocation the rule is executed
        occurencePosition - Nth textual occurrence of the method invocation
        Returns:
        this, for having fluent api
      • afterInvoke

        public RuleConstructor.ConditionClause afterInvoke​(java.lang.String method)

        Rule is invoked after invocation of method within the trigger method.

        Location specifier is set as AFTER INVOKE <variable>.

        Parameters:
        method - method name after which invocation the rule is executed
        Returns:
        this, for having fluent api
      • afterInvoke

        public RuleConstructor.ConditionClause afterInvoke​(java.lang.String method,
                                                           int occurencePosition)

        Rule is invoked after invocation of method within the trigger method where occurencePosition defines Nth textual occurrence of the method invocation.

        Location specifier is set as AFTER INVOKE <variable> <occurencePosition>.

        Parameters:
        method - method name after which invocation the rule is executed
        occurencePosition - Nth textual occurrence of the method invocation
        Returns:
        this, for having fluent api
      • atSynchronize

        public RuleConstructor.ConditionClause atSynchronize()

        Rule is invoked at entry of synchronization block in the target method.

        Location specifier is set as AT SYNCHRONIZE.

        Returns:
        this, for having fluent api
      • atSynchronize

        public RuleConstructor.ConditionClause atSynchronize​(int occurencePosition)

        Rule is invoked at point of invocation of method within the trigger method where occurencePosition defines Nth textual occurrence of the method invocation.

        Location specifier is set as AT SYNCHRONIZE <occurencePosition>.

        Parameters:
        occurencePosition - Nth textual occurrence of the method invocation
        Returns:
        this, for having fluent api
      • afterSynchronize

        public RuleConstructor.ConditionClause afterSynchronize()
        Rule is invoked after invocation of method within the trigger method.
        Location specifier is set as AFTER SYNCHRONIZE.
        Returns:
        this, for having fluent api
      • afterSynchronize

        public RuleConstructor.ConditionClause afterSynchronize​(int occurencePosition)

        Rule is invoked after invocation of method within the trigger method where occurencePosition defines Nth textual occurrence of the method invocation.

        Location specifier is set as AFTER SYNCHRONIZE <occurencePosition>.

        Parameters:
        occurencePosition - Nth textual occurrence of the method invocation
        Returns:
        this, for having fluent api
      • atThrow

        public RuleConstructor.ConditionClause atThrow()

        Identifies a throw operation within the trigger method.

        Location specifier is set as AT THROW.

        Returns:
        this, for having fluent api
      • atThrow

        public RuleConstructor.ConditionClause atThrow​(int occurencePosition)

        Identifies a throw operation within the trigger method, specified with count as Nth textual occurrence of a throw inside of the method defining only that occurrence to trigger execution of the rule.

        Location specifier is set as AT THROW <occurencePosition>.

        Parameters:
        occurencePosition - which Nth textual occurrence of a throw triggers the rule
        Returns:
        this, for having fluent api
      • atExceptionExit

        public RuleConstructor.ConditionClause atExceptionExit()

        Identifies the point where a method returns control back to its caller via unhandled exceptional control flow.

        Location specifier is set as AT EXCEPTION EXIT.

        Returns:
        this, for having fluent api
      • at

        public RuleConstructor.ConditionClause at​(java.lang.String at)

        Rule is invoked AT point which is specified with parameter.

        Location specifier is predefined with AT keyword and the rest is up to parameter you provide.

        When you provide LINE 123 as parameter the location specifier is set as AT LINE 123.

        Parameters:
        at - specifying rule injection point that is enriched with AT keyword
        Returns:
        this, for having fluent api
      • after

        public RuleConstructor.ConditionClause after​(java.lang.String after)

        Rule is invoked AFTER point which is specified with parameter.

        Location specifier is predefined with AFTER keyword and the rest is up to parameter you provide.

        When you provide READ $0 as parameter the location specifier is set as AFTER READ $0.

        Parameters:
        after - specifying rule injection point that is enriched with AFTER keyword
        Returns:
        this, for having fluent api
      • where

        RuleConstructor.ConditionClause where​(java.lang.String where)

        Location specifier definition.

        Defined string is directly used in rule definition.

        The parameter is expected to be defined as whole location specifier. For example when you provide AT LINE 123 as parameter the location specifier is set as AT LINE 123.

        Parameters:
        where - location specifier
        Returns:
        this, for having fluent api