Hi Tristan,
extensions to Infinispan are already using a service interface, have
you noticed the "infinispan-module.properties" for example in the
Query module and Lucene modules?
It's an interesting concept to have the AS7 deployer take advantage of
this, but this doesn't solve the problem related to using Infinispan
from Hibernate Search: that the classes are not there when AS7 boots,
as an application can be deployed at a later time. Not least,
different applications should be deployable containing different
versions of the registering library (which are very likely going to
have the same commandID but possibly different implementations)
The JDBC layer is a great analogy which Pete used too at our face to
face meeting; the critical difference is that a datasource can be
started at application deploy time if needed, or if it's started
already it won't need to have a different JDBC implementation: so my
conclusion - for Search at least - is that I'm not going to reuse the
AS7 provided Infinispan CacheManager but it will start a new one. I
still consider it much more interesting to reuse the JGroups channel.
Sanne
On 6 October 2011 14:29, Tristan Tarrant <ttarrant(a)redhat.com> wrote:
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
_______________________________________________
infinispan-dev mailing list
infinispan-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev