Is defining interceptors within xml configuration file out of the
question?
If so, option 1) seems better to me. Maybe with clever object
abstractions adding even few interceptors would be not so hard.
Say you have InterceptorInjectionPoint that contains position (defined
in various way) and Interceptor itself or something like that....
Cheers.
-----Original Message-----
From: jbosscache-dev-bounces(a)lists.jboss.org
[mailto:jbosscache-dev-bounces@lists.jboss.org] On Behalf Of
Manik Surtani
Sent: Tuesday, January 23, 2007 1:31 PM
To: jbosscache-dev(a)lists.jboss.org
Subject: [jbosscache-dev] Really DUMB API method
Writing user guides does have it's merits.
I picked up a really pointless method in CacheSPI.
CacheSPI.add/removeInterceptor(), meant for people who want
to inject their own custom interceptors in the chain.
Great, very useful, but how does one get a hold of a CacheSPI
to do this? CacheSPIs will get injected into the custom interceptor,
*after* it is added to the chain, but until then, a user does
not have a CacheSPI reference.
I see 2 ways around this, each one as unpalatable as the next.
1. Overload createCache() methods in CacheFactory to pass in
interceptor(s) to be added, and their relative positions in
the chain. Ok if we're just adding one interceptor, horrible
if we're adding several. We could have used varargs and it
would have been fine if it was just interceptors we're
passing in and not interceptors AND positions.
2. Pull up add/removeInterceptor() to Cache. Ugly for
obvious reasons.
Can anyone think of anything else?
I'm holding back tagging BETA1 till the end of the week; now
that CC is alive again I want to stabilise the code as well
as some more work on the docs.
Cheers,
--
Manik Surtani
Lead, JBoss Cache
JBoss, a division of Red Hat
Email: manik(a)jboss.org
Telephone: +44 7786 702 706
MSN: manik(a)surtani.org
Yahoo/AIM/Skype: maniksurtani
_______________________________________________
jbosscache-dev mailing list
jbosscache-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jbosscache-dev