Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 Spring Web 应用程序中有一些方面用@Aspect. 我想通过某些服务在运行时禁用或启用方面。是否可以根据某些设置完全关闭或打开方面?我有日志记录方面,但我只希望在启用日志记录时运行这些方面。
@Aspect
不,我不认为这是可能的。我能想到的最接近的方法是if(foo.Configuration.isLoggingEnabled)在您的切入点定义中添加一个。
if(foo.Configuration.isLoggingEnabled)