Repository: activemq-artemis Updated Branches: refs/heads/master b3a8327ab -> ffccd7efb
ARTEMIS-591 Fixing typos Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/ad21b5b7 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/ad21b5b7 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/ad21b5b7 Branch: refs/heads/master Commit: ad21b5b70b4bc34605291773ca424a31c57b41b5 Parents: b3a8327 Author: Clebert Suconic <[email protected]> Authored: Mon Aug 15 22:01:46 2016 -0400 Committer: Clebert Suconic <[email protected]> Committed: Mon Aug 15 22:04:38 2016 -0400 ---------------------------------------------------------------------- .../artemis/api/core/ActiveMQExceptionType.java | 13 ++++----- .../ActiveMQTranasactionTimeoutException.java | 29 -------------------- .../ActiveMQTransactionTimeoutException.java | 29 ++++++++++++++++++++ .../core/transaction/impl/TransactionImpl.java | 6 ++-- 4 files changed, 38 insertions(+), 39 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ad21b5b7/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQExceptionType.java ---------------------------------------------------------------------- diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQExceptionType.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQExceptionType.java index 73616a8..752574a 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQExceptionType.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQExceptionType.java @@ -154,12 +154,6 @@ public enum ActiveMQExceptionType { return new ActiveMQTransactionOutcomeUnknownException(msg); } }, - TRANSACTION_TIMEOUT(116) { - @Override - public ActiveMQException createException(String msg) { - return new ActiveMQTranasactionTimeoutException(msg); - } - }, ALREADY_REPLICATING(116) { @Override public ActiveMQException createException(String msg) { @@ -184,7 +178,12 @@ public enum ActiveMQExceptionType { return new ActiveMQRemoteDisconnectException(msg); } }, - + TRANSACTION_TIMEOUT(120) { + @Override + public ActiveMQException createException(String msg) { + return new ActiveMQTransactionTimeoutException(msg); + } + }, GENERIC_EXCEPTION(999), NATIVE_ERROR_INTERNAL(200), NATIVE_ERROR_INVALID_BUFFER(201), http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ad21b5b7/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQTranasactionTimeoutException.java ---------------------------------------------------------------------- diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQTranasactionTimeoutException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQTranasactionTimeoutException.java deleted file mode 100644 index 753422f..0000000 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQTranasactionTimeoutException.java +++ /dev/null @@ -1,29 +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.activemq.artemis.api.core; - -public class ActiveMQTranasactionTimeoutException extends ActiveMQException { - - public ActiveMQTranasactionTimeoutException() { - super(ActiveMQExceptionType.TRANSACTION_TIMEOUT); - } - - public ActiveMQTranasactionTimeoutException(String message) { - super(ActiveMQExceptionType.TRANSACTION_TIMEOUT, message); - } -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ad21b5b7/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQTransactionTimeoutException.java ---------------------------------------------------------------------- diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQTransactionTimeoutException.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQTransactionTimeoutException.java new file mode 100644 index 0000000..5ca46f8 --- /dev/null +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQTransactionTimeoutException.java @@ -0,0 +1,29 @@ +/** + * 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.activemq.artemis.api.core; + +public class ActiveMQTransactionTimeoutException extends ActiveMQException { + + public ActiveMQTransactionTimeoutException() { + super(ActiveMQExceptionType.TRANSACTION_TIMEOUT); + } + + public ActiveMQTransactionTimeoutException(String message) { + super(ActiveMQExceptionType.TRANSACTION_TIMEOUT, message); + } +} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ad21b5b7/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java index 4148bec..44e626a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/transaction/impl/TransactionImpl.java @@ -25,7 +25,7 @@ import java.util.List; import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.ActiveMQExceptionType; import org.apache.activemq.artemis.api.core.ActiveMQIllegalStateException; -import org.apache.activemq.artemis.api.core.ActiveMQTranasactionTimeoutException; +import org.apache.activemq.artemis.api.core.ActiveMQTransactionTimeoutException; import org.apache.activemq.artemis.core.io.IOCallback; import org.apache.activemq.artemis.core.persistence.StorageManager; import org.apache.activemq.artemis.core.server.ActiveMQServerLogger; @@ -171,7 +171,7 @@ public class TransactionImpl implements Transaction { } if (timedout) { - markAsRollbackOnly(new ActiveMQTranasactionTimeoutException()); + markAsRollbackOnly(new ActiveMQTransactionTimeoutException()); } return timedout; @@ -180,7 +180,7 @@ public class TransactionImpl implements Transaction { @Override public boolean hasTimedOut() { - return state == State.ROLLBACK_ONLY && exception.getType() == ActiveMQExceptionType.TRANSACTION_TIMEOUT; + return state == State.ROLLBACK_ONLY && exception != null && exception.getType() == ActiveMQExceptionType.TRANSACTION_TIMEOUT; } @Override
