Skip to content

Implement AfterThrows and AfterFinally advice #1

@tylertreat

Description

@tylertreat

AOP currently supportsBefore, Around, and After advice. We would also like to support AfterThrows (invoked after the advised method throws a Throwable) and AfterFinally (invoked after the advised method regardless of whether an exception was thrown).

Visually, the order of these operations looks something like this:

try {
    // Execute Before advice
    advisedObject.advisedMethod(); // Execute Around advice
    // Execute After advice
} catch (Throwable tr) {
    // Execute AfterThrows advice
} finally {
    // Execute AfterFinally advice
}

Thia new advice should be supported by both AdvisedJdkDynamicProxy and AdvisedDexMakerProxy.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions