@PointCut:聲明切點如:@anotation(package.class.name),execution(* package.class.method(..))
@EnableAspectJAutoProxy:開啟spring對AspectJ的支持
@AspectJ聲明一個切面
@Before定義一個前置切點
@After定義一個后置切點:,可以在增加入?yún)oinPoint或者ProceedingJoinPoint
@Around定義環(huán)繞切點
@PropertySource("classpath:path/to/property"):注入配置配件,需要指定配置文件路徑,可以通過@Value獲取值
@Value:${xx.yy},#{}
@PostConstruct:spring調(diào)用構(gòu)造函數(shù)后執(zhí)行的方法,相當(dāng)與@bean的initMethod
@preDestroy:銷毀前調(diào)用的方法,相當(dāng)與@Bean的destroyMethod
@Profile:根據(jù)不同的profie加載不同的配置,可以使用ctx.getEnvironment.setActiveProfiles("profie")設(shè)置
@EnableScheduling:開啟對計劃任務(wù)的支持
@Scheduled:聲明一個計劃任務(wù)
@ConfigurationProperty:指定一個locations可以將文件和bean中的屬性對應(yīng),在bean類中標(biāo)注
@EnableConfigurationProperties:標(biāo)注后可以注入相關(guān)的property配置類