On 14 Sep 2010, at 11:17, Mircea Markus wrote:
On 13 Sep 2010, at 18:05, Manik Surtani wrote:
>
> On 13 Sep 2010, at 17:19, Mircea Markus wrote:
>
>> Hi,
>>
>> I've been working on an POC for continuous-query in ISPN. This runs on top of
Drools, and is a independent mvn module.
>> One of the things I needed to do was broadcasting remote commands and make them
available in the interceptor chain. As Infinispan does only support a fixed number of
Commands and I cannot (and don't want to) add a new command as I am in a different
module, I hacked the PutKeyValue: on special key values, my interceptors know that they
should handle it. This way, PutKeyValue is not a put per se, but a way to facilitate RPC
and an ugly hack :)
>
> What "command" is this, what do you need to be able to broadcast?
It would be a GenericVisitableCommand, see bellow.
In my scenario I need to broadcast query definitions and queries. More to come
potentially.
I think you need a RemoteQueryCommand. This will solve Israel's use case as well.
Perhaps work with him on a command that can be used by the both of you?
>> was thinking that a GenericCommand that would contain a Map
of parameters would be handy for this scenario. Also a method on the visitor,
visitGenericCommand. This would allow integration projects (like cq) to be done nicely. If
this sounds appealing I can detail..
>
> -1. This sounds like it opens a huge can of worms, making things hard to maintain
and open to abuse.
Maintenance shouldn't be a problem as we won't support other people's code.
Not other peoples code - our own! :) We are growing fast in terms of LOC, features and
modules and even committers.
> Commands should be very specific and properly typed.
That's imposible in my scenario, as I am in a different module. I can add the command
to the core, but that's not the way to do it.
Then that's what we need to fix. How can other modules define new commands? Perhaps
this is where we hit limitations of the command/visitor pattern in general, but maybe not,
even. The "easy fix" is to define the new commands in core and use them
externally (or interface in core, impl outside like Israel has done). But this isn't
perfect either.
Cheers
Manik
--
Manik Surtani
manik(a)jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org