Skip to content

Commit 8be2a43

Browse files
committed
Rename SystemArchitecture aspect to CommonPointcuts in AOP ref doc
See gh-25357
1 parent 52c2ca6 commit 8be2a43

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

src/docs/asciidoc/core/core-aop.adoc

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -524,10 +524,10 @@ matching.
524524
[[aop-common-pointcuts]]
525525
==== Sharing Common Pointcut Definitions
526526

527-
When working with enterprise applications, developers often want to refer to modules of the
528-
application and particular sets of operations from within several aspects. We recommend
529-
defining a `SystemArchitecture` aspect that captures common pointcut expressions for
530-
this purpose. Such an aspect typically resembles the following example:
527+
When working with enterprise applications, developers often want to refer to modules of
528+
the application and particular sets of operations from within several aspects. We
529+
recommend defining a `CommonPointcuts` aspect that captures common pointcut expressions
530+
for this purpose. Such an aspect typically resembles the following example:
531531

532532
[source,java,indent=0,subs="verbatim",role="primary"]
533533
.Java
@@ -538,7 +538,7 @@ this purpose. Such an aspect typically resembles the following example:
538538
import org.aspectj.lang.annotation.Pointcut;
539539
540540
@Aspect
541-
public class SystemArchitecture {
541+
public class CommonPointcuts {
542542
543543
/**
544544
* A join point is in the web layer if the method is defined
@@ -602,7 +602,7 @@ this purpose. Such an aspect typically resembles the following example:
602602
import org.springframework.aop.Pointcut
603603
604604
@Aspect
605-
class SystemArchitecture {
605+
class CommonPointcuts {
606606
607607
/**
608608
* A join point is in the web layer if the method is defined
@@ -669,7 +669,7 @@ write the following:
669669
----
670670
<aop:config>
671671
<aop:advisor
672-
pointcut="com.xyz.myapp.SystemArchitecture.businessService()"
672+
pointcut="com.xyz.myapp.CommonPointcuts.businessService()"
673673
advice-ref="tx-advice"/>
674674
</aop:config>
675675
@@ -923,7 +923,7 @@ You can declare before advice in an aspect by using the `@Before` annotation:
923923
@Aspect
924924
public class BeforeExample {
925925
926-
@Before("com.xyz.myapp.SystemArchitecture.dataAccessOperation()")
926+
@Before("com.xyz.myapp.CommonPointcuts.dataAccessOperation()")
927927
public void doAccessCheck() {
928928
// ...
929929
}
@@ -939,7 +939,7 @@ You can declare before advice in an aspect by using the `@Before` annotation:
939939
@Aspect
940940
class BeforeExample {
941941
942-
@Before("com.xyz.myapp.SystemArchitecture.dataAccessOperation()")
942+
@Before("com.xyz.myapp.CommonPointcuts.dataAccessOperation()")
943943
fun doAccessCheck() {
944944
// ...
945945
}
@@ -999,7 +999,7 @@ declare it by using the `@AfterReturning` annotation:
999999
@Aspect
10001000
public class AfterReturningExample {
10011001
1002-
@AfterReturning("com.xyz.myapp.SystemArchitecture.dataAccessOperation()")
1002+
@AfterReturning("com.xyz.myapp.CommonPointcuts.dataAccessOperation()")
10031003
public void doAccessCheck() {
10041004
// ...
10051005
}
@@ -1015,7 +1015,7 @@ declare it by using the `@AfterReturning` annotation:
10151015
@Aspect
10161016
class AfterReturningExample {
10171017
1018-
@AfterReturning("com.xyz.myapp.SystemArchitecture.dataAccessOperation()")
1018+
@AfterReturning("com.xyz.myapp.CommonPointcuts.dataAccessOperation()")
10191019
fun doAccessCheck() {
10201020
// ...
10211021
}
@@ -1040,7 +1040,7 @@ the following example shows:
10401040
public class AfterReturningExample {
10411041
10421042
@AfterReturning(
1043-
pointcut="com.xyz.myapp.SystemArchitecture.dataAccessOperation()",
1043+
pointcut="com.xyz.myapp.CommonPointcuts.dataAccessOperation()",
10441044
returning="retVal")
10451045
public void doAccessCheck(Object retVal) {
10461046
// ...
@@ -1058,7 +1058,7 @@ the following example shows:
10581058
class AfterReturningExample {
10591059
10601060
@AfterReturning(
1061-
pointcut = "com.xyz.myapp.SystemArchitecture.dataAccessOperation()",
1061+
pointcut = "com.xyz.myapp.CommonPointcuts.dataAccessOperation()",
10621062
returning = "retVal")
10631063
fun doAccessCheck(retVal: Any) {
10641064
// ...
@@ -1093,7 +1093,7 @@ example shows:
10931093
@Aspect
10941094
public class AfterThrowingExample {
10951095
1096-
@AfterThrowing("com.xyz.myapp.SystemArchitecture.dataAccessOperation()")
1096+
@AfterThrowing("com.xyz.myapp.CommonPointcuts.dataAccessOperation()")
10971097
public void doRecoveryActions() {
10981098
// ...
10991099
}
@@ -1109,7 +1109,7 @@ example shows:
11091109
@Aspect
11101110
class AfterThrowingExample {
11111111
1112-
@AfterThrowing("com.xyz.myapp.SystemArchitecture.dataAccessOperation()")
1112+
@AfterThrowing("com.xyz.myapp.CommonPointcuts.dataAccessOperation()")
11131113
fun doRecoveryActions() {
11141114
// ...
11151115
}
@@ -1133,7 +1133,7 @@ following example shows how to do so:
11331133
public class AfterThrowingExample {
11341134
11351135
@AfterThrowing(
1136-
pointcut="com.xyz.myapp.SystemArchitecture.dataAccessOperation()",
1136+
pointcut="com.xyz.myapp.CommonPointcuts.dataAccessOperation()",
11371137
throwing="ex")
11381138
public void doRecoveryActions(DataAccessException ex) {
11391139
// ...
@@ -1151,7 +1151,7 @@ following example shows how to do so:
11511151
class AfterThrowingExample {
11521152
11531153
@AfterThrowing(
1154-
pointcut = "com.xyz.myapp.SystemArchitecture.dataAccessOperation()",
1154+
pointcut = "com.xyz.myapp.CommonPointcuts.dataAccessOperation()",
11551155
throwing = "ex")
11561156
fun doRecoveryActions(ex: DataAccessException) {
11571157
// ...
@@ -1184,7 +1184,7 @@ The following example shows how to use after finally advice:
11841184
@Aspect
11851185
public class AfterFinallyExample {
11861186
1187-
@After("com.xyz.myapp.SystemArchitecture.dataAccessOperation()")
1187+
@After("com.xyz.myapp.CommonPointcuts.dataAccessOperation()")
11881188
public void doReleaseLock() {
11891189
// ...
11901190
}
@@ -1200,7 +1200,7 @@ The following example shows how to use after finally advice:
12001200
@Aspect
12011201
class AfterFinallyExample {
12021202
1203-
@After("com.xyz.myapp.SystemArchitecture.dataAccessOperation()")
1203+
@After("com.xyz.myapp.CommonPointcuts.dataAccessOperation()")
12041204
fun doReleaseLock() {
12051205
// ...
12061206
}
@@ -1252,7 +1252,7 @@ The following example shows how to use around advice:
12521252
@Aspect
12531253
public class AroundExample {
12541254
1255-
@Around("com.xyz.myapp.SystemArchitecture.businessService()")
1255+
@Around("com.xyz.myapp.CommonPointcuts.businessService()")
12561256
public Object doBasicProfiling(ProceedingJoinPoint pjp) throws Throwable {
12571257
// start stopwatch
12581258
Object retVal = pjp.proceed();
@@ -1272,7 +1272,7 @@ The following example shows how to use around advice:
12721272
@Aspect
12731273
class AroundExample {
12741274
1275-
@Around("com.xyz.myapp.SystemArchitecture.businessService()")
1275+
@Around("com.xyz.myapp.CommonPointcuts.businessService()")
12761276
fun doBasicProfiling(pjp: ProceedingJoinPoint): Any {
12771277
// start stopwatch
12781278
val retVal = pjp.proceed()
@@ -1331,15 +1331,15 @@ You could write the following:
13311331
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
13321332
.Java
13331333
----
1334-
@Before("com.xyz.myapp.SystemArchitecture.dataAccessOperation() && args(account,..)")
1334+
@Before("com.xyz.myapp.CommonPointcuts.dataAccessOperation() && args(account,..)")
13351335
public void validateAccount(Account account) {
13361336
// ...
13371337
}
13381338
----
13391339
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
13401340
.Kotlin
13411341
----
1342-
@Before("com.xyz.myapp.SystemArchitecture.dataAccessOperation() && args(account,..)")
1342+
@Before("com.xyz.myapp.CommonPointcuts.dataAccessOperation() && args(account,..)")
13431343
fun validateAccount(account: Account) {
13441344
// ...
13451345
}
@@ -1358,7 +1358,7 @@ from the advice. This would look as follows:
13581358
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
13591359
.Java
13601360
----
1361-
@Pointcut("com.xyz.myapp.SystemArchitecture.dataAccessOperation() && args(account,..)")
1361+
@Pointcut("com.xyz.myapp.CommonPointcuts.dataAccessOperation() && args(account,..)")
13621362
private void accountDataAccessOperation(Account account) {}
13631363
13641364
@Before("accountDataAccessOperation(account)")
@@ -1369,7 +1369,7 @@ from the advice. This would look as follows:
13691369
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
13701370
.Kotlin
13711371
----
1372-
@Pointcut("com.xyz.myapp.SystemArchitecture.dataAccessOperation() && args(account,..)")
1372+
@Pointcut("com.xyz.myapp.CommonPointcuts.dataAccessOperation() && args(account,..)")
13731373
private fun accountDataAccessOperation(account: Account) {
13741374
}
13751375
@@ -1612,7 +1612,7 @@ The following example shows how to do so:
16121612
.Java
16131613
----
16141614
@Around("execution(List<Account> find*(..)) && " +
1615-
"com.xyz.myapp.SystemArchitecture.inDataAccessLayer() && " +
1615+
"com.xyz.myapp.CommonPointcuts.inDataAccessLayer() && " +
16161616
"args(accountHolderNamePattern)")
16171617
public Object preProcessQueryPattern(ProceedingJoinPoint pjp,
16181618
String accountHolderNamePattern) throws Throwable {
@@ -1624,7 +1624,7 @@ The following example shows how to do so:
16241624
.Kotlin
16251625
----
16261626
@Around("execution(List<Account> find*(..)) && " +
1627-
"com.xyz.myapp.SystemArchitecture.inDataAccessLayer() && " +
1627+
"com.xyz.myapp.CommonPointcuts.inDataAccessLayer() && " +
16281628
"args(accountHolderNamePattern)")
16291629
fun preProcessQueryPattern(pjp: ProceedingJoinPoint,
16301630
accountHolderNamePattern: String): Any {
@@ -1695,7 +1695,7 @@ the `UsageTracked` interface (to expose statistics via JMX for example):
16951695
@DeclareParents(value="com.xzy.myapp.service.*+", defaultImpl=DefaultUsageTracked.class)
16961696
public static UsageTracked mixin;
16971697
1698-
@Before("com.xyz.myapp.SystemArchitecture.businessService() && this(usageTracked)")
1698+
@Before("com.xyz.myapp.CommonPointcuts.businessService() && this(usageTracked)")
16991699
public void recordUsage(UsageTracked usageTracked) {
17001700
usageTracked.incrementUseCount();
17011701
}
@@ -1713,7 +1713,7 @@ the `UsageTracked` interface (to expose statistics via JMX for example):
17131713
lateinit var mixin: UsageTracked
17141714
}
17151715
1716-
@Before("com.xyz.myapp.SystemArchitecture.businessService() && this(usageTracked)")
1716+
@Before("com.xyz.myapp.CommonPointcuts.businessService() && this(usageTracked)")
17171717
fun recordUsage(usageTracked: UsageTracked) {
17181718
usageTracked.incrementUseCount()
17191719
}
@@ -1757,12 +1757,12 @@ annotation. Consider the following example:
17571757
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
17581758
.Java
17591759
----
1760-
@Aspect("perthis(com.xyz.myapp.SystemArchitecture.businessService())")
1760+
@Aspect("perthis(com.xyz.myapp.CommonPointcuts.businessService())")
17611761
public class MyAspect {
17621762
17631763
private int someState;
17641764
1765-
@Before("com.xyz.myapp.SystemArchitecture.businessService()")
1765+
@Before("com.xyz.myapp.CommonPointcuts.businessService()")
17661766
public void recordServiceUsage() {
17671767
// ...
17681768
}
@@ -1772,12 +1772,12 @@ annotation. Consider the following example:
17721772
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
17731773
.Kotlin
17741774
----
1775-
@Aspect("perthis(com.xyz.myapp.SystemArchitecture.businessService())")
1775+
@Aspect("perthis(com.xyz.myapp.CommonPointcuts.businessService())")
17761776
class MyAspect {
17771777
17781778
private val someState: Int = 0
17791779
1780-
@Before("com.xyz.myapp.SystemArchitecture.businessService()")
1780+
@Before("com.xyz.myapp.CommonPointcuts.businessService()")
17811781
fun recordServiceUsage() {
17821782
// ...
17831783
}
@@ -1841,7 +1841,7 @@ call `proceed` multiple times. The following listing shows the basic aspect impl
18411841
this.order = order;
18421842
}
18431843
1844-
@Around("com.xyz.myapp.SystemArchitecture.businessService()")
1844+
@Around("com.xyz.myapp.CommonPointcuts.businessService()")
18451845
public Object doConcurrentOperation(ProceedingJoinPoint pjp) throws Throwable {
18461846
int numAttempts = 0;
18471847
PessimisticLockingFailureException lockFailureException;
@@ -1881,7 +1881,7 @@ call `proceed` multiple times. The following listing shows the basic aspect impl
18811881
this.order = order
18821882
}
18831883
1884-
@Around("com.xyz.myapp.SystemArchitecture.businessService()")
1884+
@Around("com.xyz.myapp.CommonPointcuts.businessService()")
18851885
fun doConcurrentOperation(pjp: ProceedingJoinPoint): Any {
18861886
var numAttempts = 0
18871887
var lockFailureException: PessimisticLockingFailureException
@@ -1944,7 +1944,7 @@ expression so that only `@Idempotent` operations match, as follows:
19441944
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
19451945
.Java
19461946
----
1947-
@Around("com.xyz.myapp.SystemArchitecture.businessService() && " +
1947+
@Around("com.xyz.myapp.CommonPointcuts.businessService() && " +
19481948
"@annotation(com.xyz.myapp.service.Idempotent)")
19491949
public Object doConcurrentOperation(ProceedingJoinPoint pjp) throws Throwable {
19501950
// ...
@@ -1953,7 +1953,7 @@ expression so that only `@Idempotent` operations match, as follows:
19531953
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
19541954
.Kotlin
19551955
----
1956-
@Around("com.xyz.myapp.SystemArchitecture.businessService() && " +
1956+
@Around("com.xyz.myapp.CommonPointcuts.businessService() && " +
19571957
"@annotation(com.xyz.myapp.service.Idempotent)")
19581958
fun doConcurrentOperation(pjp: ProceedingJoinPoint): Any {
19591959
// ...
@@ -2048,12 +2048,12 @@ pointcut expression. Another way of defining the above pointcut would be as foll
20482048
<aop:config>
20492049
20502050
<aop:pointcut id="businessService"
2051-
expression="com.xyz.myapp.SystemArchitecture.businessService()"/>
2051+
expression="com.xyz.myapp.CommonPointcuts.businessService()"/>
20522052
20532053
</aop:config>
20542054
----
20552055

2056-
Assume that you have a `SystemArchitecture` aspect as described in <<aop-common-pointcuts>>.
2056+
Assume that you have a `CommonPointcuts` aspect as described in <<aop-common-pointcuts>>.
20572057

20582058
Then declaring a pointcut inside an aspect is very similar to declaring a top-level pointcut,
20592059
as the following example shows:
@@ -2617,7 +2617,7 @@ through JMX for example.)
26172617
default-impl="com.xyz.myapp.service.tracking.DefaultUsageTracked"/>
26182618
26192619
<aop:before
2620-
pointcut="com.xyz.myapp.SystemArchitecture.businessService()
2620+
pointcut="com.xyz.myapp.CommonPointcuts.businessService()
26212621
and this(usageTracked)"
26222622
method="recordUsage"/>
26232623
@@ -3606,7 +3606,7 @@ fully qualified class names:
36063606
// the creation of a new bean (any object in the domain model)
36073607
protected pointcut beanCreation(Object beanInstance) :
36083608
initialization(new(..)) &&
3609-
SystemArchitecture.inDomainModel() &&
3609+
CommonPointcuts.inDomainModel() &&
36103610
this(beanInstance);
36113611
}
36123612
----

0 commit comments

Comments
 (0)