【发布时间】:2014-09-18 05:57:55
【问题描述】:
我有 cq5 应用程序。
我们有以下类层次结构(伪代码):
class serviceA{
methodA1(){...}
methodA2(){...}
methodA3(){
...
httprequest
...
}
methodA4(){...}
}
class serviceB{
methodB1(){
...
httprequest
...
httprequest
...
httprequest
}
methodB2(){...}
methodB3(){...}
methodB4(){
...
httprequest
...
}
}
class serviceC{
methodC1(){
...
httprequest
...
httprequest
...
}
methodC2(){...}
methodC3(){
...
httprequest
....
}
methodC4(){...}
}
而且我需要在 httprequest 之前和之后记录(以测量时间)。
但是在每个服务内部都更改代码是非常可悲的。
你能提供更优雅的决定吗?
OSGI 会与 Aspectj 一起使用吗?
@AspectService 呢?
【问题讨论】:
标签: java logging osgi bundle aop