Repository: incubator-ignite Updated Branches: refs/heads/ignite-45 60d63a61a -> afb1de605
IGNITE-45 - Moved exception to public package. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/afb1de60 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/afb1de60 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/afb1de60 Branch: refs/heads/ignite-45 Commit: afb1de605d36b5b8f2ca4e4163485d25c34a7ce4 Parents: 60d63a6 Author: Alexey Goncharuk <agoncha...@gridgain.com> Authored: Sun Mar 22 12:52:30 2015 -0700 Committer: Alexey Goncharuk <agoncha...@gridgain.com> Committed: Sun Mar 22 12:52:30 2015 -0700 ---------------------------------------------------------------------- .../ignite/cache/CacheExistsException.java | 52 ++++++++++++++++++++ .../processors/cache/GridCacheProcessor.java | 8 +-- .../cache/IgniteCacheExistsException.java | 52 -------------------- .../resources/META-INF/classnames.properties | 2 +- .../cache/IgniteDynamicCacheStartSelfTest.java | 2 +- 5 files changed, 58 insertions(+), 58 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afb1de60/modules/core/src/main/java/org/apache/ignite/cache/CacheExistsException.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheExistsException.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheExistsException.java new file mode 100644 index 0000000..f1db94d --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheExistsException.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.cache; + +import org.jetbrains.annotations.*; + +import javax.cache.*; + +/** + * Exception thrown when cache already exists. + */ +public class CacheExistsException extends CacheException { + /** */ + private static final long serialVersionUID = 0L; + + /** + * @param msg Error message. + */ + public CacheExistsException(String msg) { + super(msg); + } + + /** + * @param cause Error cause. + */ + public CacheExistsException(Throwable cause) { + super(cause); + } + + /** + * @param msg Error message. + * @param cause Error cause. + */ + public CacheExistsException(String msg, @Nullable Throwable cause) { + super(msg, cause); + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afb1de60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java index 5bbba49..e9b7ae2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java @@ -1577,7 +1577,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { if (ccfg != null) { if (desc != null && !desc.cancelled()) { if (failIfExists) - return new GridFinishedFuture<>(new IgniteCacheExistsException("Failed to start cache " + + return new GridFinishedFuture<>(new CacheExistsException("Failed to start cache " + "(a cache with the same name is already started): " + cacheName)); else { CacheConfiguration descCfg = desc.cacheConfiguration(); @@ -1627,7 +1627,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { ccfg = desc.cacheConfiguration(); if (ccfg == null) - return new GridFinishedFuture<>(new IgniteCacheExistsException("Failed to start near cache " + + return new GridFinishedFuture<>(new CacheExistsException("Failed to start near cache " + "(a cache with the given name is not started): " + cacheName)); if (ccfg.getNodeFilter().apply(ctx.discovery().localNode())) { @@ -1696,7 +1696,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { if (old != null) { if (req.start() && !req.clientStartOnly()) { - fut.onDone(new IgniteCacheExistsException("Failed to start cache " + + fut.onDone(new CacheExistsException("Failed to start cache " + "(a cache with the same name is already being started or stopped): " + req.cacheName())); } else { @@ -1745,7 +1745,7 @@ public class GridCacheProcessor extends GridProcessorAdapter { if (!req.clientStartOnly() && req.failIfExists()) { // If local node initiated start, fail the start future. if (startFut != null && startFut.deploymentId().equals(req.deploymentId())) { - startFut.onDone(new IgniteCacheExistsException("Failed to start cache " + + startFut.onDone(new CacheExistsException("Failed to start cache " + "(a cache with the same name is already started): " + ccfg.getName())); } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afb1de60/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheExistsException.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheExistsException.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheExistsException.java deleted file mode 100644 index 2cb5834..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheExistsException.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.cache; - -import org.jetbrains.annotations.*; - -import javax.cache.*; - -/** - * Exception thrown when cache already exists. - */ -public class IgniteCacheExistsException extends CacheException { - /** */ - private static final long serialVersionUID = 0L; - - /** - * @param msg Error message. - */ - public IgniteCacheExistsException(String msg) { - super(msg); - } - - /** - * @param cause Error cause. - */ - public IgniteCacheExistsException(Throwable cause) { - super(cause); - } - - /** - * @param msg Error message. - * @param cause Error cause. - */ - public IgniteCacheExistsException(String msg, @Nullable Throwable cause) { - super(msg, cause); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afb1de60/modules/core/src/main/resources/META-INF/classnames.properties ---------------------------------------------------------------------- diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties index f2ba4e3..9c1e7e3 100644 --- a/modules/core/src/main/resources/META-INF/classnames.properties +++ b/modules/core/src/main/resources/META-INF/classnames.properties @@ -436,7 +436,7 @@ org.apache.ignite.internal.processors.cache.GridCacheWriteBehindStore$StatefulVa org.apache.ignite.internal.processors.cache.GridCacheWriteBehindStore$StoreOperation org.apache.ignite.internal.processors.cache.GridCacheWriteBehindStore$ValueStatus org.apache.ignite.internal.processors.cache.GridPartitionLockKey -org.apache.ignite.internal.processors.cache.IgniteCacheExistsException +org.apache.ignite.cache.CacheExistsException org.apache.ignite.internal.processors.cache.IgniteCacheProxy org.apache.ignite.internal.processors.cache.IgniteCacheProxy$1 org.apache.ignite.internal.processors.cache.IgniteCacheProxy$2 http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afb1de60/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java index 3caadb0..da4a2c2 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java @@ -452,7 +452,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest { return kernal.createCache(ccfg); } - }, IgniteCacheExistsException.class, null); + }, CacheExistsException.class, null); } /**