2012-12-14 67 views
0

我已經使用Hibernate二級的Ehcache和註冊緩存事件監聽器使用指令緩存事件監聽器 - 檢索元

在這裏實現:http://ehcache.org/documentation/apis/cache-event-listeners

的CacheEventListenerFactory和CacheEventListener的作品,但我知道如何檢索出我的實體來自元素?

我有嘗試

public void notifyElementPut(final Ehcache cache, final Element element) throws CacheException{ 
    ABEEntity entity = (ABCEntity)element.getObjectValue(); // throws ClassCastException 

} 

它不斷拋出類轉換異常。我可以知道ObjectValue是否被包裝?我相信是一個數組,但我無法找到任何信息。

有人可以提供答案和文檔嗎?

該文檔比答案更重要????

回答