Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#6 Adding property to mail.properties + AOP class
Remain IHM adjustment
- Loading branch information
jmaupoux
authored and
jmaupoux
committed
Jul 17, 2012
1 parent
8c11826
commit a9224ba
Showing
6 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...reakfast-domain/src/main/java/fr/ultimate/breakfast/domain/aop/mail/MailEnableAspect.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package fr.ultimate.breakfast.domain.aop.mail; | ||
|
||
import org.aspectj.lang.ProceedingJoinPoint; | ||
import org.aspectj.lang.annotation.Around; | ||
import org.aspectj.lang.annotation.Aspect; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Aspect | ||
@Component | ||
public class MailEnableAspect | ||
{ | ||
@Value("${mail.enabled}") | ||
private boolean mailEnabled; | ||
|
||
// @Around("execution(* *(..))") | ||
@Around("execution(* fr.ultimate.breakfast.mail.service.UltimateBreakfastMailService.*(..))") | ||
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable | ||
{ | ||
if (mailEnabled) { return joinPoint.proceed(); } | ||
return null; | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
ultimate-breakfast-domain/src/main/resources/applicationContext-aop.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" | ||
xmlns:util="http://www.springframework.org/schema/util" xmlns:tx="http://www.springframework.org/schema/tx" | ||
xmlns:aop="http://www.springframework.org/schema/aop" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd | ||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd | ||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd | ||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd | ||
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd"> | ||
|
||
<aop:aspectj-autoproxy/> | ||
|
||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,6 @@ | |
|
||
<!-- End Security beans --> | ||
|
||
<import resource="classpath*:applicationContext-aop.xml"/> | ||
|
||
</beans> |