This also avoids the other option of implementing this by having associated
'params' options for each option which can take a Declarable, thus reducing
the proliferation of options - in particular for 'create region'.

i.e. --cache-listener AND --cache-listener-params.

Further, this json parameter would not allow for arbitrary json but would
be restricted to a simple key/value mapping so that there would be a direct
translation to Declarable parameters in the cache.xml.

--Jens

On Fri, Jan 26, 2018 at 8:07 AM, Jinmei Liao <jil...@pivotal.io> wrote:

> Currently, when you want to specify a call-back in gfsh command option, you
> can only pass in the class name, e.g.:
>
> create region --name=regionA --type=PARTITION --cache-loader=my.CacheLoader
>
> But these callbacks all implements Declarable (CacheLoader, CacheWriter,
> CacheListener, CustomExpiry etc.), i.e they can initialized with extra
> properties that can be set when they are declared in cache.xml, but
> currently, our gfsh command doesn't support that.
>
> We are proposing to add the support to configure Declarables in gfsh
> commands by adding json strings at the end of the class name. like this:
>
> create region --name=regionA --type=PARTITION
> --cache-loader=my.CacheLoader?{"key":"value,"key2":"value2"}
>
> (of course, if you don't need to configure your Declarable, you can still
> only specify a className as before).
>
> Comments/thoughts?
>
> --
> Cheers
>
> Jinmei
>

Reply via email to