我嘗試使用platform-core-1.0 rc5插件來按事件服務。現在,我在grails-插件「listadmin」寫一個服務:grails 2.2.2 platform-core-plugin在域模型中沒有方法事件的簽名
package listadmin
class SECO_ListenService {
@grails.events.Listener(topic='getEntriesOfList', namespace='listadmin')
def getEntriesOfList(String intnalListName) {
println "SECO_ListenService"
def Liste aList = Liste.findByInternal_name(intnalListName)
return aList.eintrage.toList()
}
}
這種服務應該叫「institutionadmin」的其他Grails,插件下拉返回一個列表。我想用這個服務列表來下拉域模型。我應該提到我使用動態腳手架。現在,我嘗試在域模型來調用此事件:
package institutionadmin
import org.springframework.dao.DataIntegrityViolationException
class Einrichtung {
Long einrichtungs_type
Long type_of_conzept
int anzahl_gruppen
int anzahl_kinder_pro_Gruppe
String offnungszeiten
static hasMany = [rooms : Raum]
static constraints = {
def aList = []
def reply = event(for:"listadmin", topic:"getEntriesOfList", data:"einrichtung_type").waitFor()
aList = reply.value.toList()
einrichtungs_type(inList: aList)
}
}
如果我嘗試運行此應用程序,我得到以下錯誤:
Caused by MissingMethodException: No signature of method: institutionadmin.Einrichtung.event() is applicable for argument types: (java.util.LinkedHashMap) values: [[for:listadmin, topic:testEventBus]] Possible solutions: ident(), every(), every(groovy.lang.Closure), count(), get(java.io.Serializable), print(java.lang.Object)
如果調用此事件的控制器一切都很好這個插件的文件描述了我也呼籲事件域模型和服務......這種錯誤的方法告訴我,這個類不知道事件的方法。
我一定要配置什麼嗎?
應該以其他方式致電活動或我的錯誤在哪裏?
有沒有人有這個模塊出現?