diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java index a489a93ca6..bcd345a003 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java @@ -39,7 +39,6 @@ import org.apache.activemq.artemis.api.core.ActiveMQBuffers; import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.ActiveMQNonExistentQueueException; import org.apache.activemq.artemis.api.core.ActiveMQSecurityException; -import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQBrokerStoppedException; import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQCompositeConsumerBrokerExchange; import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQConnectionContext; import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQConsumer; @@ -635,28 +634,6 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor, S if (e instanceof IOException) { serviceTransportException((IOException) e); } - else if (e.getClass() == AMQBrokerStoppedException.class) { - // Handle the case where the broker is stopped - // But the client is still connected. - if (!stopping.get()) { - ConnectionError ce = new ConnectionError(); - ce.setException(e); - dispatchSync(ce); - // Record the error that caused the transport to stop - this.stopError = e; - // Wait a little bit to try to get the output buffer to flush - // the exception notification to the client. - try { - Thread.sleep(500); - } - catch (InterruptedException ie) { - Thread.currentThread().interrupt(); - } - // Worst case is we just kill the connection before the - // notification gets to him. - stopAsync(); - } - } else if (!stopping.get() && !inServiceException) { inServiceException = true; try { diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQBrokerStoppedException.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQBrokerStoppedException.java deleted file mode 100644 index b82ccdd6c8..0000000000 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQBrokerStoppedException.java +++ /dev/null @@ -1,40 +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.core.protocol.openwire.amq; - -public class AMQBrokerStoppedException extends IllegalStateException { - - private static final long serialVersionUID = -7543507221414251115L; - - public AMQBrokerStoppedException() { - super(); - } - - public AMQBrokerStoppedException(String message, Throwable cause) { - super(message); - initCause(cause); - } - - public AMQBrokerStoppedException(String s) { - super(s); - } - - public AMQBrokerStoppedException(Throwable cause) { - initCause(cause); - } - -}