[infinispan-dev] AS7's Infinispan subsystem custom classes

Tristan Tarrant ttarrant at redhat.com
Thu Oct 6 09:29:56 EDT 2011


Hi everybody,

I've been thinking about what would be the best way for users to provide 
their own custom classes to be used by caches built by AS7's Infinispan 
subsystem.

There are two ways: as modules or as deployments.

I don't really like the modules approach as it requires users to then 
add the module as a dependency of the Infinispan subsystem, and I would 
like that to stay untouched.

I've been playing instead with the deployment approach, borrowing code 
from the JCA/JDBC layer within AS7 which allows JDBC drivers to be 
deployed by using the standard Java services interface (i.e. via 
META-INF/services/com.example.ServiceInterface). Using this method, 
users just drop a JAR with their implementation in 
standalone/deployments (or the equivalent domain method), add the 
necessary bits to META-INF/services/* and META-INF/MANIFEST.MF (for 
importing the org.infinispan classes), and the deployer picks them up 
and makes them available as an AS7 service. The classes can then be 
referenced in the Infinispan subsystem definition.
For bits that don't have interfaces (e.g. Listeners) but are defined via 
annotations, AS7 provides equivalent support.

Paul, I would very much like your opinion on this, and especially on any 
bits I might have overlooked.

Tristan


More information about the infinispan-dev mailing list