| 1234567891011121314151617181920212223242526 |
- local DebugMediator = requireMediator("DebugMediator")
- local CustomCacheMediator = class("CustomCacheMediator", DebugMediator)
- CustomCacheMediator.NAME = "CustomCacheMediator"
- function CustomCacheMediator:ctor()
- CustomCacheMediator.super.ctor(self)
- end
- function CustomCacheMediator:listNotificationInterests()
- local noticeTable = global.NoticeTable
- return {
- noticeTable.ReleaseMemory
- }
- end
- function CustomCacheMediator:handleNotification(notification)
- local noticeName = notification:getName()
- local noticeTable = global.NoticeTable
- local noticeData = notification:getBody()
- if noticeName == noticeTable.ReleaseMemory then
- global.CustomCache:Clear()
- end
- end
- return CustomCacheMediator
|