以下从E文中摘得:
Common AspectJ annotations :
<bean id="strategyAspect" class="cn.iscas.ac.gz.sems.domain.strategy.aop.ControllorStrategyAspect"> <property name="concentratorDomainService" ref="concentratorDomainService" /> </bean>
public int turnOnOffLightByTermId(String concentUID, String termUID, String operateMode, boolean isTurnOnLight) throws Exception; public int turnOnOffLightByGroupId(String concentUID, int GroupId, String operateMode, boolean isTurnOnLight) throws Exception; public int turnOnOffLightByConcentId(String concentUID, String operateMode, boolean isTurnOnLight) throws Exception; public int dimmingByTermId(String concentUID,String termUID, int dimmingValue) throws Exception ; public int dimmingByGroupId(String concentUID,int GroupId, int dimmingValue) throws Exception; public int dimmingByConcentId(String concentUID, int dimmingValue) throws Exception ; public int queryLightByTermId(String concentUID, String termUID) throws Exception; public int queryLightByGroupId(String concentUID, int GroupID) throws Exception; public int queryLightByConcentId(String concentUID) throws Exception;
@Aspect public class ControllorStrategyAspect { private ConcentratorDomainService concentratorDomainService; private static final Logger logger = Logger.getLogger(ControllorStrategyAspect.class); public ConcentratorDomainService getConcentratorDomainService() { return concentratorDomainService; } public void setConcentratorDomainService(ConcentratorDomainService concentratorDomainService) { this.concentratorDomainService = concentratorDomainService; } @Pointcut("execution(* cn.iscas.ac.gz.sems.domain.internal.MonitorServerDomainServiceImpl.turnOnOffLight*(..))") void turnOnOffLightCommandExecution() { // ............................................... } @Pointcut("execution(* cn.iscas.ac.gz.sems.domain.internal.MonitorServerDomainServiceImpl.dimming*(..))") void dimmingCommandExecution() { //.............................................. } @Pointcut("execution(* cn.iscas.ac.gz.sems.domain.internal.MonitorServerDomainServiceImpl.circuitPowerOnOff(..))") void circuitPowerOnOffCommandExecution() { //......................................... } @Around(" turnOnOffLightCommandExecution() || dimmingCommandExecution() || circuitPowerOnOffCommandExecution()") public Object commandExecutionPointCut(ProceedingJoinPoint joinPoint) throws Exception { ................................ return null; } }