ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Magda (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-2909) Checking cache object type in runtime
Date Wed, 04 May 2016 05:38:12 GMT

    [ https://issues.apache.org/jira/browse/IGNITE-2909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15270142#comment-15270142

Denis Magda commented on IGNITE-2909:

As a part of this ticket the generic cache interceptor source code should be provided and
placed in the new article on readme.io that describes how to check object type in runtime.

> Checking cache object type in runtime
> -------------------------------------
>                 Key: IGNITE-2909
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2909
>             Project: Ignite
>          Issue Type: Improvement
>          Components: cache
>    Affects Versions: 1.5.0.final
>            Reporter: Denis Magda
>            Assignee: Vladislav Pyatkov
>            Priority: Critical
>              Labels: community, important
>             Fix For: 1.6
> In some cases there is necessity to control a type of object that is being
> inserted into a cache.
> Presently this kind of check is accomplished at compile time only relying
> on Java Generics. However it doesn't prevent us from connecting to a
> cluster using a non-generic instance of a cache and put any kind of data in
> it. This may be not a harmful intention but rather a silly developer mistake.
> It's preferable to rely on the cache interceptor based solution:
> - user will create a generic interceptor that will accept "typeName" in its constructor;
> - class of this interceptor will be placed in the classpath of all the nodes;
> - when a new cache is started statically (Spring cfg) or dynamically this interceptor
can be set with a particular allowed "typeName";
> - when interceptor is invoked allowed typeId (taken from allowed "typeName") will be
compared with a typeID of a key/value being inserted;
> - exception has to be thrown if allowed typeId is not equal to a key/value typeId being
> We need to allow to throw exceptions from interceptor and provide an example on how perform
type validation using interceptors based approach.
> Refer to the discussion on the dev list:
> http://apache-ignite-developers.2346864.n4.nabble.com/Controlling-type-of-object-inserted-in-IgniteCache-td8128.html

This message was sent by Atlassian JIRA

View raw message