[infinispan-dev] Refactoring API and Commons

Tristan Tarrant ttarrant at redhat.com
Tue Oct 25 10:56:28 EDT 2011


Hi all,

I've been looking into refactoring certain interfaces and common classes 
as part of https://issues.jboss.org/browse/ISPN-1490
I have come across a couple of snags (more will come I'm sure).

Firstly all modules use org.infinispan.util.logging.LoggingFactory to 
get a logger. Unfortunately the logger in question implements the 
org.infinispan.util.logging.Log interface which contains a ton of 
logging methods mostly related to core functionality, and therefore 
irrelevant for things such as the remote APIs. My suggestion here is 
that each module either uses a specialized LoggingFactory or create a 
common one which returns implementations of BasicLogger (which is the 
root interface of our Logs).

Another one is related to org.infinispan.util.FileLookupFactory which 
references OSGi classes, even though the org.osgi dependency is marked 
as optional in the infinispan-core POM. In my opinion the OsgiFileLookup 
should be put in an external class and loaded via reflection so that we 
don't get NoClassDefFoundErrors.

I've also introduced at the API level a BasicCache<K,V> which now 
Cache<K,V> extends. BasicCache<K,V> knows nothing about Lifecycle, 
Listenable, AdvancedCache, Configuration, eviction, batching and is 
intended to be the base for the RemoteCache<K,V> interface.

Suggestions, recommendations, etc.

Tristan




More information about the infinispan-dev mailing list