Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9A5F5200B61 for ; Tue, 9 Aug 2016 14:32:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9942C160AB6; Tue, 9 Aug 2016 12:32:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 58E4C160AEA for ; Tue, 9 Aug 2016 14:32:30 +0200 (CEST) Received: (qmail 19935 invoked by uid 500); 9 Aug 2016 12:32:29 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 19644 invoked by uid 99); 9 Aug 2016 12:32:29 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Aug 2016 12:32:29 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 627EC2C02A9 for ; Tue, 9 Aug 2016 12:32:29 +0000 (UTC) Date: Tue, 9 Aug 2016 12:32:29 +0000 (UTC) From: "Pavel Tupitsyn (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (IGNITE-2909) Checking cache object type in runtime MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 09 Aug 2016 12:32:35 -0000 [ https://issues.apache.org/jira/browse/IGNITE-2909?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pavel Tupitsyn updated IGNITE-2909: ----------------------------------- Fix Version/s: (was: 1.7) 1.8 > 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.8 > > > 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 inserted. > 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 (v6.3.4#6332)