Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 31A8317913 for ; Tue, 2 Jun 2015 10:37:41 +0000 (UTC) Received: (qmail 96366 invoked by uid 500); 2 Jun 2015 10:37:41 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 96334 invoked by uid 500); 2 Jun 2015 10:37:41 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 96325 invoked by uid 99); 2 Jun 2015 10:37:41 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jun 2015 10:37:41 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id A6BB9CAAF7 for ; Tue, 2 Jun 2015 10:37:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.771 X-Spam-Level: * X-Spam-Status: No, score=1.771 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Z21c2pqKWIXh for ; Tue, 2 Jun 2015 10:37:40 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 94E1325497 for ; Tue, 2 Jun 2015 10:37:33 +0000 (UTC) Received: (qmail 96093 invoked by uid 99); 2 Jun 2015 10:37:32 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jun 2015 10:37:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E9F4CDFF69; Tue, 2 Jun 2015 10:37:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Tue, 02 Jun 2015 10:37:42 -0000 Message-Id: <99526077f1364123bc39a8258ca07a64@git.apache.org> In-Reply-To: <4632fd9e0a8b4ccdb11278781531ec12@git.apache.org> References: <4632fd9e0a8b4ccdb11278781531ec12@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [12/41] incubator-ignite git commit: # IGNITE-891 - Cache store improvements # IGNITE-891 - Cache store improvements Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d4bcd19b Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d4bcd19b Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d4bcd19b Branch: refs/heads/ignite-218 Commit: d4bcd19b6b68355e37fa446319030112b0e52d65 Parents: 2c28381 Author: Valentin Kulichenko Authored: Wed May 20 17:35:00 2015 -0700 Committer: Valentin Kulichenko Committed: Wed May 20 17:35:00 2015 -0700 ---------------------------------------------------------------------- .../store/GridCacheStoreManagerAdapter.java | 68 ++++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d4bcd19b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java index a4a4212..79ac86d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java @@ -105,40 +105,6 @@ public abstract class GridCacheStoreManagerAdapter extends GridCacheManagerAdapt sesHolder = sesHolder0; locStore = U.hasAnnotation(cfgStore, CacheLocalStore.class); - - sesLsnrs = createSessionListeners(cfg.getCacheStoreSessionListenerFactories()); - - if (sesLsnrs == null) - sesLsnrs = createSessionListeners(ctx.config().getCacheStoreSessionListenerFactories()); - } - - /** - * Creates session listeners. - * - * @param factories Factories. - * @return Listeners. - */ - private Collection createSessionListeners(Factory[] factories) - throws IgniteCheckedException { - if (factories == null) - return null; - - Collection lsnrs = new ArrayList<>(factories.length); - - for (Factory factory : factories) { - CacheStoreSessionListener lsnr = factory.create(); - - if (lsnr != null) { - cctx.kernalContext().resource().injectGeneric(lsnr); - - if (lsnr instanceof LifecycleAware) - ((LifecycleAware)lsnr).start(); - - lsnrs.add(lsnr); - } - } - - return lsnrs; } /** {@inheritDoc} */ @@ -200,6 +166,40 @@ public abstract class GridCacheStoreManagerAdapter extends GridCacheManagerAdapt "case, ignore this warning. Otherwise, fix the configuration for cache: " + cfg.getName(), "Persistence store is configured, but both read-through and write-through are disabled."); } + + sesLsnrs = createSessionListeners(cfg.getCacheStoreSessionListenerFactories()); + + if (sesLsnrs == null) + sesLsnrs = createSessionListeners(cctx.kernalContext().config().getCacheStoreSessionListenerFactories()); + } + + /** + * Creates session listeners. + * + * @param factories Factories. + * @return Listeners. + */ + private Collection createSessionListeners(Factory[] factories) + throws IgniteCheckedException { + if (factories == null) + return null; + + Collection lsnrs = new ArrayList<>(factories.length); + + for (Factory factory : factories) { + CacheStoreSessionListener lsnr = factory.create(); + + if (lsnr != null) { + cctx.kernalContext().resource().injectGeneric(lsnr); + + if (lsnr instanceof LifecycleAware) + ((LifecycleAware)lsnr).start(); + + lsnrs.add(lsnr); + } + } + + return lsnrs; } /** {@inheritDoc} */