简体   繁体   中英

Grails @DelegateAsync and dependency injection

I'm trying to use @DelegateAsync and running into some problems.

My setup looks pretty much like this:

@DelegateAsync(SynchronousService)
class AsyncService extends BaseService {}

class SynchronousService extends BaseService {}

abstract class BaseService {
  def grailsApplication
}

It seems that grailsApplication and other beans are never injected into SynchronousService. Should they be? AsyncService has everything wired up as I'd expect.

Looks like this might do the trick, though now I need to figure out why I'm hitting Async execution errors in GPars:

class AsyncService extends BaseService {
   @DelegateAsync SynchronousService synchronousService
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM