[jbosscache-dev] Really DUMB API method

Manik Surtani manik at jboss.org
Tue Jan 23 14:34:12 EST 2007


On 23 Jan 2007, at 19:06, Vladimir Blagojevic wrote:

> Is defining interceptors within xml configuration file out of the
> question?

For now, yes.  It means redefining the XML format altogether and we  
chose to leave it out for now, since the plan is to move to a proper  
AOP framework like JBossAOP which will give us stuff like this for free.

>
> 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....

Yeah I thought of that.  Don't like it, but it does seem the best I  
can think of.

>
> Cheers.
>
>
>
>> -----Original Message-----
>> From: jbosscache-dev-bounces at lists.jboss.org
>> [mailto:jbosscache-dev-bounces at lists.jboss.org] On Behalf Of
>> Manik Surtani
>> Sent: Tuesday, January 23, 2007 1:31 PM
>> To: jbosscache-dev at 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 at jboss.org
>> Telephone: +44 7786 702 706
>> MSN: manik at surtani.org
>> Yahoo/AIM/Skype: maniksurtani
>>
>>
>>
>>
>> _______________________________________________
>> jbosscache-dev mailing list
>> jbosscache-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/jbosscache-dev
>>





More information about the jbosscache-dev mailing list