http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedActiveMQBuffer.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedActiveMQBuffer.java b/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedActiveMQBuffer.java new file mode 100644 index 0000000..84291bf --- /dev/null +++ b/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedActiveMQBuffer.java @@ -0,0 +1,392 @@ +/* + * Copyright 2005-2014 Red Hat, Inc. + * Red Hat 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.core.buffers.impl; + +import java.nio.ByteBuffer; + +import org.apache.activemq.api.core.ActiveMQBuffer; +import org.apache.activemq.api.core.SimpleString; +import org.apache.activemq.core.message.impl.MessageInternal; + +/** + * A ResetLimitWrappedActiveMQBuffer + * TODO: Move this to commons + * @author Tim Fox + * + */ +public final class ResetLimitWrappedActiveMQBuffer extends ChannelBufferWrapper +{ + private final int limit; + + private MessageInternal message; + + /** + * We need to turn of notifications of body changes on reset on the server side when dealing with AMQP conversions, + * for that reason this method will set the message to null here + * @param message + */ + public void setMessage(MessageInternal message) + { + this.message = message; + } + + public ResetLimitWrappedActiveMQBuffer(final int limit, final ActiveMQBuffer buffer, final MessageInternal message) + { + super(buffer.byteBuf()); + + this.limit = limit; + + if (writerIndex() < limit) + { + writerIndex(limit); + } + + buffer.readerIndex(limit); + + this.message = message; + } + + private void changed() + { + if (message != null) + { + message.bodyChanged(); + } + } + + public void setBuffer(final ActiveMQBuffer buffer) + { + if (this.buffer != null) + { + this.buffer.release(); + } + this.buffer = buffer.byteBuf(); + } + + @Override + public void clear() + { + changed(); + + buffer.clear(); + + buffer.setIndex(limit, limit); + + } + + @Override + public void readerIndex(int readerIndex) + { + changed(); + + if (readerIndex < limit) + { + readerIndex = limit; + } + + buffer.readerIndex(readerIndex); + } + + @Override + public void resetReaderIndex() + { + changed(); + + buffer.readerIndex(limit); + } + + @Override + public void resetWriterIndex() + { + changed(); + + buffer.writerIndex(limit); + } + + @Override + public void setIndex(int readerIndex, int writerIndex) + { + changed(); + + if (readerIndex < limit) + { + readerIndex = limit; + } + if (writerIndex < limit) + { + writerIndex = limit; + } + buffer.setIndex(readerIndex, writerIndex); + } + + @Override + public void writerIndex(int writerIndex) + { + changed(); + + if (writerIndex < limit) + { + writerIndex = limit; + } + + buffer.writerIndex(writerIndex); + } + + @Override + public void setByte(final int index, final byte value) + { + changed(); + + super.setByte(index, value); + } + + @Override + public void setBytes(final int index, final byte[] src, final int srcIndex, final int length) + { + changed(); + + super.setBytes(index, src, srcIndex, length); + } + + @Override + public void setBytes(final int index, final byte[] src) + { + changed(); + + super.setBytes(index, src); + } + + @Override + public void setBytes(final int index, final ByteBuffer src) + { + changed(); + + super.setBytes(index, src); + } + + @Override + public void setBytes(final int index, final ActiveMQBuffer src, final int srcIndex, final int length) + { + changed(); + + super.setBytes(index, src, srcIndex, length); + } + + @Override + public void setBytes(final int index, final ActiveMQBuffer src, final int length) + { + changed(); + + super.setBytes(index, src, length); + } + + @Override + public void setBytes(final int index, final ActiveMQBuffer src) + { + changed(); + + super.setBytes(index, src); + } + + @Override + public void setChar(final int index, final char value) + { + changed(); + + super.setChar(index, value); + } + + @Override + public void setDouble(final int index, final double value) + { + changed(); + + super.setDouble(index, value); + } + + @Override + public void setFloat(final int index, final float value) + { + changed(); + + super.setFloat(index, value); + } + + @Override + public void setInt(final int index, final int value) + { + changed(); + + super.setInt(index, value); + } + + @Override + public void setLong(final int index, final long value) + { + changed(); + + super.setLong(index, value); + } + + @Override + public void setShort(final int index, final short value) + { + changed(); + + super.setShort(index, value); + } + + @Override + public void writeBoolean(final boolean val) + { + changed(); + + super.writeBoolean(val); + } + + @Override + public void writeByte(final byte value) + { + changed(); + + super.writeByte(value); + } + + @Override + public void writeBytes(final byte[] src, final int srcIndex, final int length) + { + changed(); + + super.writeBytes(src, srcIndex, length); + } + + @Override + public void writeBytes(final byte[] src) + { + changed(); + + super.writeBytes(src); + } + + @Override + public void writeBytes(final ByteBuffer src) + { + changed(); + + super.writeBytes(src); + } + + @Override + public void writeBytes(final ActiveMQBuffer src, final int srcIndex, final int length) + { + changed(); + + super.writeBytes(src, srcIndex, length); + } + + @Override + public void writeBytes(final ActiveMQBuffer src, final int length) + { + changed(); + + super.writeBytes(src, length); + } + + @Override + public void writeChar(final char chr) + { + changed(); + + super.writeChar(chr); + } + + @Override + public void writeDouble(final double value) + { + changed(); + + super.writeDouble(value); + } + + @Override + public void writeFloat(final float value) + { + changed(); + + super.writeFloat(value); + } + + @Override + public void writeInt(final int value) + { + changed(); + + super.writeInt(value); + } + + @Override + public void writeLong(final long value) + { + changed(); + + super.writeLong(value); + } + + @Override + public void writeNullableSimpleString(final SimpleString val) + { + changed(); + + super.writeNullableSimpleString(val); + } + + @Override + public void writeNullableString(final String val) + { + changed(); + + super.writeNullableString(val); + } + + @Override + public void writeShort(final short value) + { + changed(); + + super.writeShort(value); + } + + @Override + public void writeSimpleString(final SimpleString val) + { + changed(); + + super.writeSimpleString(val); + } + + @Override + public void writeString(final String val) + { + changed(); + + super.writeString(val); + } + + @Override + public void writeUTF(final String utf) + { + changed(); + + super.writeUTF(utf); + } +}
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java b/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java deleted file mode 100644 index 71ef0a4..0000000 --- a/activemq-core-client/src/main/java/org/apache/activemq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java +++ /dev/null @@ -1,392 +0,0 @@ -/* - * Copyright 2005-2014 Red Hat, Inc. - * Red Hat 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.core.buffers.impl; - -import java.nio.ByteBuffer; - -import org.apache.activemq.api.core.ActiveMQBuffer; -import org.apache.activemq.api.core.SimpleString; -import org.apache.activemq.core.message.impl.MessageInternal; - -/** - * A ResetLimitWrappedHornetQBuffer - * TODO: Move this to commons - * @author Tim Fox - * - */ -public final class ResetLimitWrappedHornetQBuffer extends ChannelBufferWrapper -{ - private final int limit; - - private MessageInternal message; - - /** - * We need to turn of notifications of body changes on reset on the server side when dealing with AMQP conversions, - * for that reason this method will set the message to null here - * @param message - */ - public void setMessage(MessageInternal message) - { - this.message = message; - } - - public ResetLimitWrappedHornetQBuffer(final int limit, final ActiveMQBuffer buffer, final MessageInternal message) - { - super(buffer.byteBuf()); - - this.limit = limit; - - if (writerIndex() < limit) - { - writerIndex(limit); - } - - buffer.readerIndex(limit); - - this.message = message; - } - - private void changed() - { - if (message != null) - { - message.bodyChanged(); - } - } - - public void setBuffer(final ActiveMQBuffer buffer) - { - if (this.buffer != null) - { - this.buffer.release(); - } - this.buffer = buffer.byteBuf(); - } - - @Override - public void clear() - { - changed(); - - buffer.clear(); - - buffer.setIndex(limit, limit); - - } - - @Override - public void readerIndex(int readerIndex) - { - changed(); - - if (readerIndex < limit) - { - readerIndex = limit; - } - - buffer.readerIndex(readerIndex); - } - - @Override - public void resetReaderIndex() - { - changed(); - - buffer.readerIndex(limit); - } - - @Override - public void resetWriterIndex() - { - changed(); - - buffer.writerIndex(limit); - } - - @Override - public void setIndex(int readerIndex, int writerIndex) - { - changed(); - - if (readerIndex < limit) - { - readerIndex = limit; - } - if (writerIndex < limit) - { - writerIndex = limit; - } - buffer.setIndex(readerIndex, writerIndex); - } - - @Override - public void writerIndex(int writerIndex) - { - changed(); - - if (writerIndex < limit) - { - writerIndex = limit; - } - - buffer.writerIndex(writerIndex); - } - - @Override - public void setByte(final int index, final byte value) - { - changed(); - - super.setByte(index, value); - } - - @Override - public void setBytes(final int index, final byte[] src, final int srcIndex, final int length) - { - changed(); - - super.setBytes(index, src, srcIndex, length); - } - - @Override - public void setBytes(final int index, final byte[] src) - { - changed(); - - super.setBytes(index, src); - } - - @Override - public void setBytes(final int index, final ByteBuffer src) - { - changed(); - - super.setBytes(index, src); - } - - @Override - public void setBytes(final int index, final ActiveMQBuffer src, final int srcIndex, final int length) - { - changed(); - - super.setBytes(index, src, srcIndex, length); - } - - @Override - public void setBytes(final int index, final ActiveMQBuffer src, final int length) - { - changed(); - - super.setBytes(index, src, length); - } - - @Override - public void setBytes(final int index, final ActiveMQBuffer src) - { - changed(); - - super.setBytes(index, src); - } - - @Override - public void setChar(final int index, final char value) - { - changed(); - - super.setChar(index, value); - } - - @Override - public void setDouble(final int index, final double value) - { - changed(); - - super.setDouble(index, value); - } - - @Override - public void setFloat(final int index, final float value) - { - changed(); - - super.setFloat(index, value); - } - - @Override - public void setInt(final int index, final int value) - { - changed(); - - super.setInt(index, value); - } - - @Override - public void setLong(final int index, final long value) - { - changed(); - - super.setLong(index, value); - } - - @Override - public void setShort(final int index, final short value) - { - changed(); - - super.setShort(index, value); - } - - @Override - public void writeBoolean(final boolean val) - { - changed(); - - super.writeBoolean(val); - } - - @Override - public void writeByte(final byte value) - { - changed(); - - super.writeByte(value); - } - - @Override - public void writeBytes(final byte[] src, final int srcIndex, final int length) - { - changed(); - - super.writeBytes(src, srcIndex, length); - } - - @Override - public void writeBytes(final byte[] src) - { - changed(); - - super.writeBytes(src); - } - - @Override - public void writeBytes(final ByteBuffer src) - { - changed(); - - super.writeBytes(src); - } - - @Override - public void writeBytes(final ActiveMQBuffer src, final int srcIndex, final int length) - { - changed(); - - super.writeBytes(src, srcIndex, length); - } - - @Override - public void writeBytes(final ActiveMQBuffer src, final int length) - { - changed(); - - super.writeBytes(src, length); - } - - @Override - public void writeChar(final char chr) - { - changed(); - - super.writeChar(chr); - } - - @Override - public void writeDouble(final double value) - { - changed(); - - super.writeDouble(value); - } - - @Override - public void writeFloat(final float value) - { - changed(); - - super.writeFloat(value); - } - - @Override - public void writeInt(final int value) - { - changed(); - - super.writeInt(value); - } - - @Override - public void writeLong(final long value) - { - changed(); - - super.writeLong(value); - } - - @Override - public void writeNullableSimpleString(final SimpleString val) - { - changed(); - - super.writeNullableSimpleString(val); - } - - @Override - public void writeNullableString(final String val) - { - changed(); - - super.writeNullableString(val); - } - - @Override - public void writeShort(final short value) - { - changed(); - - super.writeShort(value); - } - - @Override - public void writeSimpleString(final SimpleString val) - { - changed(); - - super.writeSimpleString(val); - } - - @Override - public void writeString(final String val) - { - changed(); - - super.writeString(val); - } - - @Override - public void writeUTF(final String utf) - { - changed(); - - super.writeUTF(utf); - } -} http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientLogger.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientLogger.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientLogger.java new file mode 100644 index 0000000..08e3f49 --- /dev/null +++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientLogger.java @@ -0,0 +1,415 @@ +/* + * Copyright 2005-2014 Red Hat, Inc. + * Red Hat 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.core.client; + +import org.apache.activemq.api.core.ActiveMQExceptionType; +import org.apache.activemq.api.core.Interceptor; +import org.apache.activemq.core.protocol.core.Packet; +import org.jboss.logging.BasicLogger; +import org.jboss.logging.Logger; +import org.jboss.logging.annotations.Cause; +import org.jboss.logging.annotations.LogMessage; +import org.jboss.logging.annotations.Message; +import org.jboss.logging.annotations.MessageLogger; +import org.w3c.dom.Node; + +/** + * Logger Code 21 + * <p> + * Each message id must be 6 digits long starting with 10, the 3rd digit donates the level so + * + * <pre> + * INF0 1 + * WARN 2 + * DEBUG 3 + * ERROR 4 + * TRACE 5 + * FATAL 6 + * </pre> + * + * so an INFO message would be 101000 to 101999. + * <p> + * Once released, methods should not be deleted as they may be referenced by knowledge base + * articles. Unused methods should be marked as deprecated. + * + * @author <a href="mailto:[email protected]">Andy Taylor</a> + */ +@MessageLogger(projectCode = "AMQ") +public interface ActiveMQClientLogger extends BasicLogger +{ + /** + * The default logger. + */ + ActiveMQClientLogger LOGGER = Logger.getMessageLogger(ActiveMQClientLogger.class, ActiveMQClientLogger.class.getPackage().getName()); + + @LogMessage(level = Logger.Level.INFO) + @Message(id = 211000, value = "**** Dumping session creation stacks ****", format = Message.Format.MESSAGE_FORMAT) + void dumpingSessionStacks(); + + @LogMessage(level = Logger.Level.INFO) + @Message(id = 211001, value = "session created", format = Message.Format.MESSAGE_FORMAT) + void dumpingSessionStack(@Cause Exception e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212000, value = "{0}", format = Message.Format.MESSAGE_FORMAT) + void warn(String message); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212001, value = "Error on clearing messages", format = Message.Format.MESSAGE_FORMAT) + void errorClearingMessages(@Cause Throwable e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212002, value = "Timed out waiting for handler to complete processing", format = Message.Format.MESSAGE_FORMAT) + void timeOutWaitingForProcessing(); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212003, value = "Unable to close session", format = Message.Format.MESSAGE_FORMAT) + void unableToCloseSession(@Cause Exception e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212004, value = "Failed to connect to server.", format = Message.Format.MESSAGE_FORMAT) + void failedToConnectToServer(); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212005, value = "Tried {0} times to connect. Now giving up on reconnecting it.", format = Message.Format.MESSAGE_FORMAT) + void failedToConnectToServer(Integer reconnectAttempts); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212006, value = "Waiting {0} milliseconds before next retry. RetryInterval={1} and multiplier={2}", format = Message.Format.MESSAGE_FORMAT) + void waitingForRetry(Long interval, Long retryInterval, Double multiplier); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212007, + value = "connector.create or connectorFactory.createConnector should never throw an exception, implementation is badly behaved, but we will deal with it anyway.", + format = Message.Format.MESSAGE_FORMAT) + void createConnectorException(@Cause Exception e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212008, + value = "I am closing a core ClientSessionFactory you left open. Please make sure you close all ClientSessionFactories explicitly " + + "before letting them go out of scope! {0}", + format = Message.Format.MESSAGE_FORMAT) + void factoryLeftOpen(@Cause Exception e, int i); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212009, value = "resetting session after failure", format = Message.Format.MESSAGE_FORMAT) + void resettingSessionAfterFailure(); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212010, value = "Server is starting, retry to create the session {0}", format = Message.Format.MESSAGE_FORMAT) + void retryCreateSessionSeverStarting(String name); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212011, value = "committing transaction after failover occurred, any non persistent messages may be lost", format = Message.Format.MESSAGE_FORMAT) + void commitAfterFailover(); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212012, value = "failover occurred during commit throwing XAException.XA_RETRY", format = Message.Format.MESSAGE_FORMAT) + void failoverDuringCommit(); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212014, value = "failover occurred during prepare rolling back", format = Message.Format.MESSAGE_FORMAT) + void failoverDuringPrepareRollingBack(); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212015, value = "failover occurred during prepare rolling back", format = Message.Format.MESSAGE_FORMAT) + void errorDuringPrepare(@Cause Throwable e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212016, + value = "I am closing a core ClientSession you left open. Please make sure you close all ClientSessions explicitly before letting them go out of scope! {0}", + format = Message.Format.MESSAGE_FORMAT) + void clientSessionNotClosed(@Cause Exception e, int identity); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212017, value = "error adding packet", format = Message.Format.MESSAGE_FORMAT) + void errorAddingPacket(@Cause Exception e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212018, value = "error calling cancel", format = Message.Format.MESSAGE_FORMAT) + void errorCallingCancel(@Cause Exception e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212019, value = "error reading index", format = Message.Format.MESSAGE_FORMAT) + void errorReadingIndex(@Cause Exception e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212020, value = "error setting index", format = Message.Format.MESSAGE_FORMAT) + void errorSettingIndex(@Cause Exception e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212021, value = "error resetting index", format = Message.Format.MESSAGE_FORMAT) + void errorReSettingIndex(@Cause Exception e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212022, value = "error reading LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT) + void errorReadingCache(@Cause Exception e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212023, value = "error closing LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT) + void errorClosingCache(@Cause Exception e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212024, value = "Exception during finalization for LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT) + void errorFinalisingCache(@Cause Exception e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212025, value = "did not connect the cluster connection to other nodes", format = Message.Format.MESSAGE_FORMAT) + void errorConnectingToNodes(@Cause Exception e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212026, value = "Timed out waiting for pool to terminate", format = Message.Format.MESSAGE_FORMAT) + void timedOutWaitingForTermination(); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212027, value = "Timed out waiting for scheduled pool to terminate", format = Message.Format.MESSAGE_FORMAT) + void timedOutWaitingForScheduledPoolTermination(); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212028, value = "error starting server locator", format = Message.Format.MESSAGE_FORMAT) + void errorStartingLocator(@Cause Exception e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212029, + value = "Closing a Server Locator left open. Please make sure you close all Server Locators explicitly before letting them go out of scope! {0}", + format = Message.Format.MESSAGE_FORMAT) + void serverLocatorNotClosed(@Cause Exception e, int identity); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212030, value = "error sending topology", format = Message.Format.MESSAGE_FORMAT) + void errorSendingTopology(@Cause Throwable e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212031, value = "error sending topology", format = Message.Format.MESSAGE_FORMAT) + void errorSendingTopologyNodedown(@Cause Throwable e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212032, value = "Timed out waiting to stop discovery thread", format = Message.Format.MESSAGE_FORMAT) + void timedOutStoppingDiscovery(); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212033, value = "unable to send notification when discovery group is stopped", format = Message.Format.MESSAGE_FORMAT) + void errorSendingNotifOnDiscoveryStop(@Cause Throwable e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212034, + value = "There are more than one servers on the network broadcasting the same node id. " + + "You will see this message exactly once (per node) if a node is restarted, in which case it can be safely " + + "ignored. But if it is logged continuously it means you really do have more than one node on the same network " + + "active concurrently with the same node id. This could occur if you have a backup node active at the same time as " + + "its live node. nodeID={0}", + format = Message.Format.MESSAGE_FORMAT) + void multipleServersBroadcastingSameNode(String nodeId); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212035, value = "error receiving packet in discovery", format = Message.Format.MESSAGE_FORMAT) + void errorReceivingPAcketInDiscovery(@Cause Throwable e); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212036, + value = "Can not find packet to clear: {0} last received command id first stored command id {1}", + format = Message.Format.MESSAGE_FORMAT) + void cannotFindPacketToClear(Integer lastReceivedCommandID, Integer firstStoredCommandID); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212037, value = "Connection failure has been detected: {0} [code={1}]", format = Message.Format.MESSAGE_FORMAT) + void connectionFailureDetected(String message, ActiveMQExceptionType type); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212038, value = "Failure in calling interceptor: {0}", format = Message.Format.MESSAGE_FORMAT) + void errorCallingInterceptor(@Cause Throwable e, Interceptor interceptor); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212040, value = "Timed out waiting for netty ssl close future to complete", format = Message.Format.MESSAGE_FORMAT) + void timeoutClosingSSL(); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212041, value = "Timed out waiting for netty channel to close", format = Message.Format.MESSAGE_FORMAT) + void timeoutClosingNettyChannel(); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212042, value = "Timed out waiting for packet to be flushed", format = Message.Format.MESSAGE_FORMAT) + void timeoutFlushingPacket(); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212043, value = "Property {0} must be an Integer, it is {1}", format = Message.Format.MESSAGE_FORMAT) + void propertyNotInteger(String propName, String name); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212044, value = "Property {0} must be an Long, it is {1}", format = Message.Format.MESSAGE_FORMAT) + void propertyNotLong(String propName, String name); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212045, value = "Property {0} must be an Boolean, it is {1}", format = Message.Format.MESSAGE_FORMAT) + void propertyNotBoolean(String propName, String name); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212046, value = "Cannot find activemq-version.properties on classpath: {0}", + format = Message.Format.MESSAGE_FORMAT) + void noVersionOnClasspath(String classpath); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212047, value = "Warning: JVM allocated more data what would make results invalid {0}:{1}", format = Message.Format.MESSAGE_FORMAT) + void jvmAllocatedMoreMemory(Long totalMemory1, Long totalMemory2); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212048, value = "local-bind-address specified for broadcast group but no local-bind-port specified so socket will NOT be bound to a local address/port", + format = Message.Format.MESSAGE_FORMAT) + void broadcastGroupBindError(); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212049, + value = "Could not bind to {0} ({1} address); " + + "make sure your discovery group-address is of the same type as the IP stack (IPv4 or IPv6)." + + "\nIgnoring discovery group-address, but this may lead to cross talking.", + format = Message.Format.MESSAGE_FORMAT) + void ioDiscoveryError(String hostAddress, String s); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212050, value = "Compressed large message tried to read {0} bytes from stream {1}", + format = Message.Format.MESSAGE_FORMAT) + void compressedLargeMessageError(int length, int nReadBytes); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212051, + value = "Invalid concurrent session usage. Sessions are not supposed to be used by more than one thread concurrently.", + format = Message.Format.MESSAGE_FORMAT) + void invalidConcurrentSessionUsage(@Cause Throwable t); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212052, + value = "Packet {0} was answered out of sequence due to a previous server timeout and it''s being ignored", + format = Message.Format.MESSAGE_FORMAT) + void packetOutOfOrder(Object obj, @Cause Throwable t); + + /** + * Warns about usage of {@link org.apache.activemq.api.core.client.SendAcknowledgementHandler} or JMS's {@code CompletionWindow} with + * confirmations disabled (confirmationWindowSize=-1). + */ + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212053, + value = "CompletionListener/SendAcknowledgementHandler used with confirmationWindowSize=-1. Enable confirmationWindowSize to receive acks from server!", + format = Message.Format.MESSAGE_FORMAT) + void confirmationWindowDisabledWarning(); + + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212054, + value = "Destination address={0} is blocked. If the system is configured to block make sure you consume messages on this configuration.", + format = Message.Format.MESSAGE_FORMAT) + void outOfCreditOnFlowControl(String address); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 212055, value = "Unable to close consumer", format = Message.Format.MESSAGE_FORMAT) + void unableToCloseConsumer(@Cause Exception e); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214000, value = "Failed to call onMessage", format = Message.Format.MESSAGE_FORMAT) + void onMessageError(@Cause Throwable e); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214001, value = "failed to cleanup session", format = Message.Format.MESSAGE_FORMAT) + void failedToCleanupSession(@Cause Exception e); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214002, value = "Failed to execute failure listener", format = Message.Format.MESSAGE_FORMAT) + void failedToExecuteListener(@Cause Throwable t); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214003, value = "Failed to handle failover", format = Message.Format.MESSAGE_FORMAT) + void failedToHandleFailover(@Cause Throwable t); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214004, value = "XA end operation failed ", format = Message.Format.MESSAGE_FORMAT) + void errorCallingEnd(@Cause Throwable t); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214005, value = "XA start operation failed {0} code:{1}", format = Message.Format.MESSAGE_FORMAT) + void errorCallingStart(String message, Integer code); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214006, value = "Session is not XA", format = Message.Format.MESSAGE_FORMAT) + void sessionNotXA(); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214007, value = "Received exception asynchronously from server", format = Message.Format.MESSAGE_FORMAT) + void receivedExceptionAsynchronously(@Cause Exception e); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214008, value = "Failed to handle packet", format = Message.Format.MESSAGE_FORMAT) + void failedToHandlePacket(@Cause Exception e); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214009, value = "Failed to stop discovery group", format = Message.Format.MESSAGE_FORMAT) + void failedToStopDiscovery(@Cause Throwable e); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214010, value = "Failed to receive datagram", format = Message.Format.MESSAGE_FORMAT) + void failedToReceiveDatagramInDiscovery(@Cause Exception e); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214011, value = "Failed to call discovery listener", format = Message.Format.MESSAGE_FORMAT) + void failedToCallListenerInDiscovery(@Cause Throwable e); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214012, value = "Unexpected error handling packet {0}", format = Message.Format.MESSAGE_FORMAT) + void errorHandlingPacket(@Cause Throwable t, Packet packet); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214013, value = "Failed to decode packet", format = Message.Format.MESSAGE_FORMAT) + void errorDecodingPacket(@Cause Exception e); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214014, value = "Failed to execute failure listener", format = Message.Format.MESSAGE_FORMAT) + void errorCallingFailureListener(@Cause Throwable e); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214015, value = "Failed to execute connection life cycle listener", format = Message.Format.MESSAGE_FORMAT) + void errorCallingLifeCycleListener(@Cause Throwable e); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214016, value = "Failed to create netty connection", format = Message.Format.MESSAGE_FORMAT) + void errorCreatingNettyConnection(@Cause Throwable e); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214017, value = "Caught unexpected Throwable", format = Message.Format.MESSAGE_FORMAT) + void caughtunexpectedThrowable(@Cause Throwable t); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214018, value = "Failed to invoke getTextContent() on node {0}", format = Message.Format.MESSAGE_FORMAT) + void errorOnXMLTransform(@Cause Throwable t, Node n); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214019, value = "Invalid configuration", format = Message.Format.MESSAGE_FORMAT) + void errorOnXMLTransformInvalidConf(@Cause Throwable t); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214020, value = "Exception happened while stopping Discovery BroadcastEndpoint {0}", format = Message.Format.MESSAGE_FORMAT) + void errorStoppingDiscoveryBroadcastEndpoint(Object endpoint, @Cause Throwable t); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214021, value = "Invalid cipher suite specified. Supported cipher suites are: {0}", format = Message.Format.MESSAGE_FORMAT) + void invalidCipherSuite(String validSuites); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214022, value = "Invalid protocol specified. Supported protocols are: {0}", format = Message.Format.MESSAGE_FORMAT) + void invalidProtocol(String validProtocols); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214023, value = "HTTP Handshake failed, the received accept value %s does not match the expected response %s") + void httpHandshakeFailed(String response, String expectedResponse); + + @LogMessage(level = Logger.Level.ERROR) + @Message(id = 214024, value = "HTTP upgrade not supported by remote acceptor") + void httpUpgradeNotSupportedByRemoteAcceptor(); +} http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientMessageBundle.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientMessageBundle.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientMessageBundle.java new file mode 100644 index 0000000..f9ad2ba --- /dev/null +++ b/activemq-core-client/src/main/java/org/apache/activemq/core/client/ActiveMQClientMessageBundle.java @@ -0,0 +1,247 @@ +/* + * Copyright 2005-2014 Red Hat, Inc. + * Red Hat 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.core.client; + + +import org.apache.activemq.api.core.ActiveMQAddressFullException; +import org.apache.activemq.api.core.ActiveMQConnectionTimedOutException; +import org.apache.activemq.api.core.ActiveMQDisconnectedException; +import org.apache.activemq.api.core.ActiveMQIllegalStateException; +import org.apache.activemq.api.core.ActiveMQInterceptorRejectedPacketException; +import org.apache.activemq.api.core.ActiveMQInternalErrorException; +import org.apache.activemq.api.core.ActiveMQLargeMessageException; +import org.apache.activemq.api.core.ActiveMQLargeMessageInterruptedException; +import org.apache.activemq.api.core.ActiveMQNotConnectedException; +import org.apache.activemq.api.core.ActiveMQObjectClosedException; +import org.apache.activemq.api.core.ActiveMQTransactionOutcomeUnknownException; +import org.apache.activemq.api.core.ActiveMQTransactionRolledBackException; +import org.apache.activemq.api.core.ActiveMQUnBlockedException; +import org.apache.activemq.core.cluster.DiscoveryGroup; +import org.apache.activemq.spi.core.remoting.Connection; +import org.jboss.logging.annotations.Cause; +import org.jboss.logging.annotations.Message; +import org.jboss.logging.annotations.MessageBundle; +import org.jboss.logging.Messages; +import org.w3c.dom.Node; + +/** + * @author <a href="mailto:[email protected]">Andy Taylor</a> + * 3/12/12 + * + * Logger Code 11 + * + * each message id must be 6 digits long starting with 10, the 3rd digit should be 9 + * + * so 119000 to 119999 + */ +@MessageBundle(projectCode = "AMQ") +public interface ActiveMQClientMessageBundle +{ + ActiveMQClientMessageBundle BUNDLE = Messages.getBundle(ActiveMQClientMessageBundle.class); + + @Message(id = 119000, value = "ClientSession closed while creating session", format = Message.Format.MESSAGE_FORMAT) + ActiveMQInternalErrorException clientSessionClosed(); + + @Message(id = 119001, value = "Failed to create session", format = Message.Format.MESSAGE_FORMAT) + ActiveMQInternalErrorException failedToCreateSession(@Cause Throwable t); + + @Message(id = 119002, value = "Internal Error! ClientSessionFactoryImpl::createSessionInternal " + + "just reached a condition that was not supposed to happen. " + + "Please inform this condition to the ActiveMQ team", format = Message.Format.MESSAGE_FORMAT) + ActiveMQInternalErrorException clietSessionInternal(); + + @Message(id = 119003, value = "Queue can not be both durable and temporary", format = Message.Format.MESSAGE_FORMAT) + ActiveMQInternalErrorException queueMisConfigured(); + + @Message(id = 119004, value = "Failed to initialise session factory", format = Message.Format.MESSAGE_FORMAT) + ActiveMQInternalErrorException failedToInitialiseSessionFactory(@Cause Exception e); + + @Message(id = 119005, value = "Exception in Netty transport", format = Message.Format.MESSAGE_FORMAT) + ActiveMQInternalErrorException nettyError(); + + @Message(id = 119006, value = "Channel disconnected", format = Message.Format.MESSAGE_FORMAT) + ActiveMQNotConnectedException channelDisconnected(); + + @Message(id = 119007, value = "Cannot connect to server(s). Tried with all available servers.", format = Message.Format.MESSAGE_FORMAT) + ActiveMQNotConnectedException cannotConnectToServers(); + + @Message(id = 119008, value = "Failed to connect to any static connectors", format = Message.Format.MESSAGE_FORMAT) + ActiveMQNotConnectedException cannotConnectToStaticConnectors(@Cause Exception e); + + @Message(id = 119009, value = "Failed to connect to any static connectors", format = Message.Format.MESSAGE_FORMAT) + ActiveMQNotConnectedException cannotConnectToStaticConnectors2(); + + @Message(id = 119010, value = "Connection is destroyed", format = Message.Format.MESSAGE_FORMAT) + ActiveMQNotConnectedException connectionDestroyed(); + + @Message(id = 119011, value = "Did not receive data from server for {0}", format = Message.Format.MESSAGE_FORMAT) + ActiveMQConnectionTimedOutException connectionTimedOut(Connection transportConnection); + + @Message(id = 119012, value = "Timed out waiting to receive initial broadcast from cluster", format = Message.Format.MESSAGE_FORMAT) + ActiveMQConnectionTimedOutException connectionTimedOutInInitialBroadcast(); + + @Message(id = 119013, value = "Timed out waiting to receive cluster topology. Group:{0}", format = Message.Format.MESSAGE_FORMAT) + ActiveMQConnectionTimedOutException connectionTimedOutOnReceiveTopology(DiscoveryGroup discoveryGroup); + + @Message(id = 119014, value = "Timed out waiting for response when sending packet {0}", format = Message.Format.MESSAGE_FORMAT) + ActiveMQConnectionTimedOutException timedOutSendingPacket(Byte type); + + @Message(id = 119015, value = "The connection was disconnected because of server shutdown", format = Message.Format.MESSAGE_FORMAT) + ActiveMQDisconnectedException disconnected(); + + @Message(id = 119016, value = "Connection failure detected. Unblocking a blocking call that will never get a resp" + + "onse", format = Message.Format.MESSAGE_FORMAT) + ActiveMQUnBlockedException unblockingACall(@Cause Throwable t); + + @Message(id = 119017, value = "Consumer is closed", format = Message.Format.MESSAGE_FORMAT) + ActiveMQObjectClosedException consumerClosed(); + + @Message(id = 119018, value = "Producer is closed", format = Message.Format.MESSAGE_FORMAT) + ActiveMQObjectClosedException producerClosed(); + + @Message(id = 119019, value = "Session is closed", format = Message.Format.MESSAGE_FORMAT) + ActiveMQObjectClosedException sessionClosed(); + + @Message(id = 119020, value = "Cannot call receive(...) - a MessageHandler is set", format = Message.Format.MESSAGE_FORMAT) + ActiveMQIllegalStateException messageHandlerSet(); + + @Message(id = 119021, value = "Cannot set MessageHandler - consumer is in receive(...)", format = Message.Format.MESSAGE_FORMAT) + ActiveMQIllegalStateException inReceive(); + + @Message(id = 119022, value = "Header size ({0}) is too big, use the messageBody for large data, or increase minLargeMessageSize", + format = Message.Format.MESSAGE_FORMAT) + ActiveMQIllegalStateException headerSizeTooBig(Integer headerSize); + + @Message(id = 119023, value = "The large message lost connection with its session, either because of a rollback or a closed session", format = Message.Format.MESSAGE_FORMAT) + ActiveMQIllegalStateException largeMessageLostSession(); + + @Message(id = 119024, value = "Could not select a TransportConfiguration to create SessionFactory", format = Message.Format.MESSAGE_FORMAT) + ActiveMQIllegalStateException noTCForSessionFactory(); + + @Message(id = 119025, value = "Error saving the message body", format = Message.Format.MESSAGE_FORMAT) + ActiveMQLargeMessageException errorSavingBody(@Cause Exception e); + + @Message(id = 119026, value = "Error reading the LargeMessageBody", format = Message.Format.MESSAGE_FORMAT) + ActiveMQLargeMessageException errorReadingBody(@Cause Exception e); + + @Message(id = 119027, value = "Error closing stream from LargeMessageBody", format = Message.Format.MESSAGE_FORMAT) + ActiveMQLargeMessageException errorClosingLargeMessage(@Cause Exception e); + + @Message(id = 119028, value = "Timeout waiting for LargeMessage Body", format = Message.Format.MESSAGE_FORMAT) + ActiveMQLargeMessageException timeoutOnLargeMessage(); + + @Message(id = 119029, value = "Error writing body of message", format = Message.Format.MESSAGE_FORMAT) + ActiveMQLargeMessageException errorWritingLargeMessage(@Cause Exception e); + + @Message(id = 119030, value = "The transaction was rolled back on failover to a backup server", format = Message.Format.MESSAGE_FORMAT) + ActiveMQTransactionRolledBackException txRolledBack(); + + @Message(id = 119031, value = "The transaction was rolled back on failover however commit may have been successful" + + "", format = Message.Format.MESSAGE_FORMAT) + ActiveMQTransactionOutcomeUnknownException txOutcomeUnknown(); + + @Message(id = 119032, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException invalidType(Object type); + + @Message(id = 119033, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException invalidEncodeType(Object type); + + @Message(id = 119034, value = "Params for management operations must be of the following type: int long double String boolean Map or array thereof but found {0}", + format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException invalidManagementParam(Object type); + + @Message(id = 119035, value = "Invalid window size {0}", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException invalidWindowSize(Integer size); + + @Message(id = 119036, value = "No operation mapped to int {0}", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException noOperationMapped(Integer operation); + + @Message(id = 119037, value = "Invalid last Received Command ID: {0}", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException invalidCommandID(Integer lastReceivedCommandID); + + @Message(id = 119038, value = "Cannot find channel with id {0} to close", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException noChannelToClose(Long id); + + @Message(id = 119039, value = "Close Listener cannot be null", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException closeListenerCannotBeNull(); + + @Message(id = 119040, value = "Fail Listener cannot be null", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException failListenerCannotBeNull(); + + @Message(id = 119041, value = "Connection already exists with id {0}", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException connectionExists(Object id); + + @Message(id = 119042, value = "Invalid argument null listener", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException nullListener(); + + @Message(id = 119043, value = "Invalid argument null handler", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException nullHandler(); + + @Message(id = 119044, value = "No available codec to decode password!", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException noCodec(); + + @Message(id = 119045, value = "the first node to be compared is null", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException firstNodeNull(); + + @Message(id = 119046, value = "the second node to be compared is null", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException secondNodeNull(); + + @Message(id = 119047, value = "nodes have different node names", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException nodeHaveDifferentNames(); + + @Message(id = 119048, value = "nodes hava a different number of attributes", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException nodeHaveDifferentAttNumber(); + + @Message(id = 119049, value = "attribute {0}={1} does not match", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException attsDontMatch(String name, String value); + + @Message(id = 119050, value = "one node has children and the other does not" , format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException oneNodeHasChildren(); + + @Message(id = 119051, value = "nodes hava a different number of children" , format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException nodeHasDifferentChildNumber(); + + @Message(id = 119052, value = "Element {0} requires a valid Boolean value, but ''{1}'' cannot be parsed as a Boolean" , format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException mustBeBoolean(Node elem, String value); + + @Message(id = 119053, value = "Element {0} requires a valid Double value, but ''{1}'' cannot be parsed as a Double" , format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException mustBeDouble(Node elem, String value); + + @Message(id = 119054, value = "Element {0} requires a valid Integer value, but ''{1}'' cannot be parsed as a Integer" , format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException mustBeInteger(Node elem, String value); + + @Message(id = 119055, value = "Element {0} requires a valid Long value, but ''{1}'' cannot be parsed as a Long" , format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException mustBeLong(Node elem, String value); + + @Message(id = 119056, value = "Failed to get decoder" , format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException failedToGetDecoder(@Cause Exception e); + + @Message(id = 119057, value = "Error decoding password" , format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException errordecodingPassword(@Cause Exception e); + + @Message(id = 119058, value = "Address \"{0}\" is full. Message encode size = {1}B", format = Message.Format.MESSAGE_FORMAT) + ActiveMQAddressFullException addressIsFull(String addressName, int size); + + @Message(id = 119059, value = "Interceptor {0} rejected packet in a blocking call. This call will never complete." + , format = Message.Format.MESSAGE_FORMAT) + ActiveMQInterceptorRejectedPacketException interceptorRejectedPacket(String interceptionResult); + + @Message(id = 119060, value = "Large Message Transmission interrupted on consumer shutdown." + , format = Message.Format.MESSAGE_FORMAT) + ActiveMQLargeMessageInterruptedException largeMessageInterrupted(); + + @Message(id = 119061, value = "error decoding AMQP frame", format = Message.Format.MESSAGE_FORMAT) + String decodeError(); + +} http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/core/client/HornetQClientLogger.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/core/client/HornetQClientLogger.java b/activemq-core-client/src/main/java/org/apache/activemq/core/client/HornetQClientLogger.java deleted file mode 100644 index 742bb34..0000000 --- a/activemq-core-client/src/main/java/org/apache/activemq/core/client/HornetQClientLogger.java +++ /dev/null @@ -1,415 +0,0 @@ -/* - * Copyright 2005-2014 Red Hat, Inc. - * Red Hat 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.core.client; - -import org.apache.activemq.api.core.ActiveMQExceptionType; -import org.apache.activemq.api.core.Interceptor; -import org.apache.activemq.core.protocol.core.Packet; -import org.jboss.logging.BasicLogger; -import org.jboss.logging.Logger; -import org.jboss.logging.annotations.Cause; -import org.jboss.logging.annotations.LogMessage; -import org.jboss.logging.annotations.Message; -import org.jboss.logging.annotations.MessageLogger; -import org.w3c.dom.Node; - -/** - * Logger Code 21 - * <p> - * Each message id must be 6 digits long starting with 10, the 3rd digit donates the level so - * - * <pre> - * INF0 1 - * WARN 2 - * DEBUG 3 - * ERROR 4 - * TRACE 5 - * FATAL 6 - * </pre> - * - * so an INFO message would be 101000 to 101999. - * <p> - * Once released, methods should not be deleted as they may be referenced by knowledge base - * articles. Unused methods should be marked as deprecated. - * - * @author <a href="mailto:[email protected]">Andy Taylor</a> - */ -@MessageLogger(projectCode = "HQ") -public interface HornetQClientLogger extends BasicLogger -{ - /** - * The default logger. - */ - HornetQClientLogger LOGGER = Logger.getMessageLogger(HornetQClientLogger.class, HornetQClientLogger.class.getPackage().getName()); - - @LogMessage(level = Logger.Level.INFO) - @Message(id = 211000, value = "**** Dumping session creation stacks ****", format = Message.Format.MESSAGE_FORMAT) - void dumpingSessionStacks(); - - @LogMessage(level = Logger.Level.INFO) - @Message(id = 211001, value = "session created", format = Message.Format.MESSAGE_FORMAT) - void dumpingSessionStack(@Cause Exception e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212000, value = "{0}", format = Message.Format.MESSAGE_FORMAT) - void warn(String message); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212001, value = "Error on clearing messages", format = Message.Format.MESSAGE_FORMAT) - void errorClearingMessages(@Cause Throwable e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212002, value = "Timed out waiting for handler to complete processing", format = Message.Format.MESSAGE_FORMAT) - void timeOutWaitingForProcessing(); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212003, value = "Unable to close session", format = Message.Format.MESSAGE_FORMAT) - void unableToCloseSession(@Cause Exception e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212004, value = "Failed to connect to server.", format = Message.Format.MESSAGE_FORMAT) - void failedToConnectToServer(); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212005, value = "Tried {0} times to connect. Now giving up on reconnecting it.", format = Message.Format.MESSAGE_FORMAT) - void failedToConnectToServer(Integer reconnectAttempts); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212006, value = "Waiting {0} milliseconds before next retry. RetryInterval={1} and multiplier={2}", format = Message.Format.MESSAGE_FORMAT) - void waitingForRetry(Long interval, Long retryInterval, Double multiplier); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212007, - value = "connector.create or connectorFactory.createConnector should never throw an exception, implementation is badly behaved, but we will deal with it anyway.", - format = Message.Format.MESSAGE_FORMAT) - void createConnectorException(@Cause Exception e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212008, - value = "I am closing a core ClientSessionFactory you left open. Please make sure you close all ClientSessionFactories explicitly " - + "before letting them go out of scope! {0}", - format = Message.Format.MESSAGE_FORMAT) - void factoryLeftOpen(@Cause Exception e, int i); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212009, value = "resetting session after failure", format = Message.Format.MESSAGE_FORMAT) - void resettingSessionAfterFailure(); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212010, value = "Server is starting, retry to create the session {0}", format = Message.Format.MESSAGE_FORMAT) - void retryCreateSessionSeverStarting(String name); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212011, value = "committing transaction after failover occurred, any non persistent messages may be lost", format = Message.Format.MESSAGE_FORMAT) - void commitAfterFailover(); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212012, value = "failover occurred during commit throwing XAException.XA_RETRY", format = Message.Format.MESSAGE_FORMAT) - void failoverDuringCommit(); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212014, value = "failover occurred during prepare rolling back", format = Message.Format.MESSAGE_FORMAT) - void failoverDuringPrepareRollingBack(); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212015, value = "failover occurred during prepare rolling back", format = Message.Format.MESSAGE_FORMAT) - void errorDuringPrepare(@Cause Throwable e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212016, - value = "I am closing a core ClientSession you left open. Please make sure you close all ClientSessions explicitly before letting them go out of scope! {0}", - format = Message.Format.MESSAGE_FORMAT) - void clientSessionNotClosed(@Cause Exception e, int identity); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212017, value = "error adding packet", format = Message.Format.MESSAGE_FORMAT) - void errorAddingPacket(@Cause Exception e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212018, value = "error calling cancel", format = Message.Format.MESSAGE_FORMAT) - void errorCallingCancel(@Cause Exception e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212019, value = "error reading index", format = Message.Format.MESSAGE_FORMAT) - void errorReadingIndex(@Cause Exception e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212020, value = "error setting index", format = Message.Format.MESSAGE_FORMAT) - void errorSettingIndex(@Cause Exception e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212021, value = "error resetting index", format = Message.Format.MESSAGE_FORMAT) - void errorReSettingIndex(@Cause Exception e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212022, value = "error reading LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT) - void errorReadingCache(@Cause Exception e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212023, value = "error closing LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT) - void errorClosingCache(@Cause Exception e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212024, value = "Exception during finalization for LargeMessage file cache", format = Message.Format.MESSAGE_FORMAT) - void errorFinalisingCache(@Cause Exception e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212025, value = "did not connect the cluster connection to other nodes", format = Message.Format.MESSAGE_FORMAT) - void errorConnectingToNodes(@Cause Exception e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212026, value = "Timed out waiting for pool to terminate", format = Message.Format.MESSAGE_FORMAT) - void timedOutWaitingForTermination(); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212027, value = "Timed out waiting for scheduled pool to terminate", format = Message.Format.MESSAGE_FORMAT) - void timedOutWaitingForScheduledPoolTermination(); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212028, value = "error starting server locator", format = Message.Format.MESSAGE_FORMAT) - void errorStartingLocator(@Cause Exception e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212029, - value = "Closing a Server Locator left open. Please make sure you close all Server Locators explicitly before letting them go out of scope! {0}", - format = Message.Format.MESSAGE_FORMAT) - void serverLocatorNotClosed(@Cause Exception e, int identity); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212030, value = "error sending topology", format = Message.Format.MESSAGE_FORMAT) - void errorSendingTopology(@Cause Throwable e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212031, value = "error sending topology", format = Message.Format.MESSAGE_FORMAT) - void errorSendingTopologyNodedown(@Cause Throwable e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212032, value = "Timed out waiting to stop discovery thread", format = Message.Format.MESSAGE_FORMAT) - void timedOutStoppingDiscovery(); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212033, value = "unable to send notification when discovery group is stopped", format = Message.Format.MESSAGE_FORMAT) - void errorSendingNotifOnDiscoveryStop(@Cause Throwable e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212034, - value = "There are more than one servers on the network broadcasting the same node id. " - + "You will see this message exactly once (per node) if a node is restarted, in which case it can be safely " - + "ignored. But if it is logged continuously it means you really do have more than one node on the same network " - + "active concurrently with the same node id. This could occur if you have a backup node active at the same time as " - + "its live node. nodeID={0}", - format = Message.Format.MESSAGE_FORMAT) - void multipleServersBroadcastingSameNode(String nodeId); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212035, value = "error receiving packet in discovery", format = Message.Format.MESSAGE_FORMAT) - void errorReceivingPAcketInDiscovery(@Cause Throwable e); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212036, - value = "Can not find packet to clear: {0} last received command id first stored command id {1}", - format = Message.Format.MESSAGE_FORMAT) - void cannotFindPacketToClear(Integer lastReceivedCommandID, Integer firstStoredCommandID); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212037, value = "Connection failure has been detected: {0} [code={1}]", format = Message.Format.MESSAGE_FORMAT) - void connectionFailureDetected(String message, ActiveMQExceptionType type); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212038, value = "Failure in calling interceptor: {0}", format = Message.Format.MESSAGE_FORMAT) - void errorCallingInterceptor(@Cause Throwable e, Interceptor interceptor); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212040, value = "Timed out waiting for netty ssl close future to complete", format = Message.Format.MESSAGE_FORMAT) - void timeoutClosingSSL(); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212041, value = "Timed out waiting for netty channel to close", format = Message.Format.MESSAGE_FORMAT) - void timeoutClosingNettyChannel(); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212042, value = "Timed out waiting for packet to be flushed", format = Message.Format.MESSAGE_FORMAT) - void timeoutFlushingPacket(); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212043, value = "Property {0} must be an Integer, it is {1}", format = Message.Format.MESSAGE_FORMAT) - void propertyNotInteger(String propName, String name); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212044, value = "Property {0} must be an Long, it is {1}", format = Message.Format.MESSAGE_FORMAT) - void propertyNotLong(String propName, String name); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212045, value = "Property {0} must be an Boolean, it is {1}", format = Message.Format.MESSAGE_FORMAT) - void propertyNotBoolean(String propName, String name); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212046, value = "Cannot find hornetq-version.properties on classpath: {0}", - format = Message.Format.MESSAGE_FORMAT) - void noVersionOnClasspath(String classpath); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212047, value = "Warning: JVM allocated more data what would make results invalid {0}:{1}", format = Message.Format.MESSAGE_FORMAT) - void jvmAllocatedMoreMemory(Long totalMemory1, Long totalMemory2); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212048, value = "local-bind-address specified for broadcast group but no local-bind-port specified so socket will NOT be bound to a local address/port", - format = Message.Format.MESSAGE_FORMAT) - void broadcastGroupBindError(); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212049, - value = "Could not bind to {0} ({1} address); " + - "make sure your discovery group-address is of the same type as the IP stack (IPv4 or IPv6)." + - "\nIgnoring discovery group-address, but this may lead to cross talking.", - format = Message.Format.MESSAGE_FORMAT) - void ioDiscoveryError(String hostAddress, String s); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212050, value = "Compressed large message tried to read {0} bytes from stream {1}", - format = Message.Format.MESSAGE_FORMAT) - void compressedLargeMessageError(int length, int nReadBytes); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212051, - value = "Invalid concurrent session usage. Sessions are not supposed to be used by more than one thread concurrently.", - format = Message.Format.MESSAGE_FORMAT) - void invalidConcurrentSessionUsage(@Cause Throwable t); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212052, - value = "Packet {0} was answered out of sequence due to a previous server timeout and it''s being ignored", - format = Message.Format.MESSAGE_FORMAT) - void packetOutOfOrder(Object obj, @Cause Throwable t); - - /** - * Warns about usage of {@link org.apache.activemq.api.core.client.SendAcknowledgementHandler} or JMS's {@code CompletionWindow} with - * confirmations disabled (confirmationWindowSize=-1). - */ - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212053, - value = "CompletionListener/SendAcknowledgementHandler used with confirmationWindowSize=-1. Enable confirmationWindowSize to receive acks from server!", - format = Message.Format.MESSAGE_FORMAT) - void confirmationWindowDisabledWarning(); - - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212054, - value = "Destination address={0} is blocked. If the system is configured to block make sure you consume messages on this configuration.", - format = Message.Format.MESSAGE_FORMAT) - void outOfCreditOnFlowControl(String address); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 212055, value = "Unable to close consumer", format = Message.Format.MESSAGE_FORMAT) - void unableToCloseConsumer(@Cause Exception e); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214000, value = "Failed to call onMessage", format = Message.Format.MESSAGE_FORMAT) - void onMessageError(@Cause Throwable e); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214001, value = "failed to cleanup session", format = Message.Format.MESSAGE_FORMAT) - void failedToCleanupSession(@Cause Exception e); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214002, value = "Failed to execute failure listener", format = Message.Format.MESSAGE_FORMAT) - void failedToExecuteListener(@Cause Throwable t); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214003, value = "Failed to handle failover", format = Message.Format.MESSAGE_FORMAT) - void failedToHandleFailover(@Cause Throwable t); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214004, value = "XA end operation failed ", format = Message.Format.MESSAGE_FORMAT) - void errorCallingEnd(@Cause Throwable t); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214005, value = "XA start operation failed {0} code:{1}", format = Message.Format.MESSAGE_FORMAT) - void errorCallingStart(String message, Integer code); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214006, value = "Session is not XA", format = Message.Format.MESSAGE_FORMAT) - void sessionNotXA(); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214007, value = "Received exception asynchronously from server", format = Message.Format.MESSAGE_FORMAT) - void receivedExceptionAsynchronously(@Cause Exception e); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214008, value = "Failed to handle packet", format = Message.Format.MESSAGE_FORMAT) - void failedToHandlePacket(@Cause Exception e); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214009, value = "Failed to stop discovery group", format = Message.Format.MESSAGE_FORMAT) - void failedToStopDiscovery(@Cause Throwable e); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214010, value = "Failed to receive datagram", format = Message.Format.MESSAGE_FORMAT) - void failedToReceiveDatagramInDiscovery(@Cause Exception e); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214011, value = "Failed to call discovery listener", format = Message.Format.MESSAGE_FORMAT) - void failedToCallListenerInDiscovery(@Cause Throwable e); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214012, value = "Unexpected error handling packet {0}", format = Message.Format.MESSAGE_FORMAT) - void errorHandlingPacket(@Cause Throwable t, Packet packet); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214013, value = "Failed to decode packet", format = Message.Format.MESSAGE_FORMAT) - void errorDecodingPacket(@Cause Exception e); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214014, value = "Failed to execute failure listener", format = Message.Format.MESSAGE_FORMAT) - void errorCallingFailureListener(@Cause Throwable e); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214015, value = "Failed to execute connection life cycle listener", format = Message.Format.MESSAGE_FORMAT) - void errorCallingLifeCycleListener(@Cause Throwable e); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214016, value = "Failed to create netty connection", format = Message.Format.MESSAGE_FORMAT) - void errorCreatingNettyConnection(@Cause Throwable e); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214017, value = "Caught unexpected Throwable", format = Message.Format.MESSAGE_FORMAT) - void caughtunexpectedThrowable(@Cause Throwable t); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214018, value = "Failed to invoke getTextContent() on node {0}", format = Message.Format.MESSAGE_FORMAT) - void errorOnXMLTransform(@Cause Throwable t, Node n); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214019, value = "Invalid configuration", format = Message.Format.MESSAGE_FORMAT) - void errorOnXMLTransformInvalidConf(@Cause Throwable t); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214020, value = "Exception happened while stopping Discovery BroadcastEndpoint {0}", format = Message.Format.MESSAGE_FORMAT) - void errorStoppingDiscoveryBroadcastEndpoint(Object endpoint, @Cause Throwable t); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214021, value = "Invalid cipher suite specified. Supported cipher suites are: {0}", format = Message.Format.MESSAGE_FORMAT) - void invalidCipherSuite(String validSuites); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214022, value = "Invalid protocol specified. Supported protocols are: {0}", format = Message.Format.MESSAGE_FORMAT) - void invalidProtocol(String validProtocols); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214023, value = "HTTP Handshake failed, the received accept value %s does not match the expected response %s") - void httpHandshakeFailed(String response, String expectedResponse); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 214024, value = "HTTP upgrade not supported by remote acceptor") - void httpUpgradeNotSupportedByRemoteAcceptor(); -}
