mhan810/liferay-portal — pull request #74 by ehan (2013-02-28 02:37:53+00:00)
Title: Lps 33359

2 tickets on this, LPS-33360 is a sub-task to remove JGroupReplication. Did a simple cluster test and it looks like things work correctly.

1. With clustering disabled saw the expected behavior: adding/removing a portlet to a layout did not show on the other node - Demonstrates that caching works.
2. With clustering enabled (cluster link replication): adding/removing a portlet to a layout did show on the other node - demonstrating that the custom cache listeners work.

A note on the code changes:
CacheKey .equals methods had to be modified to do a check on the key type. It looks like ehcache 2.6.5 will sometimes compare a dummy key to the cache key which made get() calls fail with ClassCastExceptions. Hopefully the additional instanceof call will not contribute much to cache lookup overhead. Would a try/catch block be better since a ClassCastException (should) be rare?