Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
51 lines (48 loc) · 1.48 KB

File metadata and controls

51 lines (48 loc) · 1.48 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import java.lang.reflect.Method;
/*
A simple aspect-oriented mechanism that supports
the basic AOP feature of applying before/after/around
advice on selected methods of objects that implement
specific interfaces.
The mechanism employs runtime aspect weaving
implemented through the dynamic proxy API.
*/
public interface Aspect {
/*
Returns the array of Interfaces
that this aspect should be applied upon
*/
Class<?>[] getTargets();
/*
Returns the Runnable, if any,
that should be run as before advice for the given method
*/
Runnable beforeAdviceFor(Method method);
/*
Returns the Runnable, if any,
that should be run as after advice for the given method
*/
Runnable afterAdviceFor(Method method);
/*
Returns the Runnable, if any,
that should be run as before advice for the given method
*/
Runnable aroundAdviceFor(Method method);
/* The Aspect builder */
interface Builder {
Builder withTargets(Class<?>[] targets);
Builder withBeforeAdviceFor(Runnable beforeAdvice, Method... methods);
Builder withAfterAdviceFor(Runnable afterAdvice, Method... methods);
Builder withAroundAdviceFor(Runnable aroundAdvice, Method... methods);
Aspect build();
}
/* The Aspect weaver */
interface Weaver {
Object weave(Object target);
}
/* Helper Factory */
interface Factory {
Builder newBuilder();
Weaver newWeaver();
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.