1
我很難訪問doWithDynamicMethod中的特定服務。doWithDynamicMethods訪問服務
def doWithDynamicMethods = { ctx ->
def nodeDriverProxy = application.getServiceClass('NodeDriverProxyService')
application.domainClasses.each{ cClass ->
delegate.log.warn('cClass: ' + cClass.toString())
cClass.metaClass.cacheInstance = { domainIns->
delegate.log.warn "domain is being cached id: ? with version ?"
nodeDriverProxy.registerUpdate(domainIns.id, domainIns.version)
}
變量nodeDriveProxy爲空,或者在訪問'application.serviceClasses'時出現異常我做錯了什麼?謝謝
謝謝伯特。你真的很棒。我從其他Grails開發人員的其他答案中學到了很多東西。感謝您的幫助 – latvian