http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/HornetQBootstrapLogger.java ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/HornetQBootstrapLogger.java b/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/HornetQBootstrapLogger.java deleted file mode 100644 index eb40644..0000000 --- a/activemq-bootstrap/src/main/java/org/apache/activemq/integration/bootstrap/HornetQBootstrapLogger.java +++ /dev/null @@ -1,71 +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.integration.bootstrap; - -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; - -/** - * @author <a href="mailto:andy.tay...@jboss.org">Andy Taylor</a> - * 3/15/12 - * - * Logger Code 10 - * - * each message id must be 6 digits long starting with 10, the 3rd digit donates the level so - * - * INF0 1 - * WARN 2 - * DEBUG 3 - * ERROR 4 - * TRACE 5 - * FATAL 6 - * - * so an INFO message would be 101000 to 101999 - */ -@MessageLogger(projectCode = "HQ") -public interface HornetQBootstrapLogger extends BasicLogger -{ - /** - * The default logger. - */ - HornetQBootstrapLogger LOGGER = Logger.getMessageLogger(HornetQBootstrapLogger.class, HornetQBootstrapLogger.class.getPackage().getName()); - - @LogMessage(level = Logger.Level.INFO) - @Message(id = 101000, value = "Starting ActiveMQ Server", format = Message.Format.MESSAGE_FORMAT) - void serverStarting(); - - @LogMessage(level = Logger.Level.INFO) - @Message(id = 101001, value = "Stopping ActiveMQ Server", format = Message.Format.MESSAGE_FORMAT) - void serverStopping(); - - @LogMessage(level = Logger.Level.INFO) - @Message(id = 101002, value = "Starting Naming server on {0}:{1,number,#} (rmi {2}:{3,number,#})", format = Message.Format.MESSAGE_FORMAT) - void startedNamingService(String bindAddress, int port, String rmiBindAddress, int rmiPort); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 102000, value = "Error during undeployment: {0}", format = Message.Format.MESSAGE_FORMAT) - void errorDuringUndeployment(@Cause Throwable t, String name); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 104000, value = "Failed to delete file {0}", format = Message.Format.MESSAGE_FORMAT) - void errorDeletingFile(String name); - - @LogMessage(level = Logger.Level.ERROR) - @Message(id = 104001, value = "Failed to start server", format = Message.Format.MESSAGE_FORMAT) - void errorStartingServer(@Cause Exception e); -}
http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffer.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffer.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffer.java index b6065cf..4b9f443 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffer.java +++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffer.java @@ -18,7 +18,7 @@ import java.nio.ByteBuffer; import io.netty.buffer.ByteBuf; /** - * A HornetQBuffer wraps a Netty's ChannelBuffer and is used throughout HornetQ code base. + * A ActiveMQBuffer wraps a Netty's ChannelBuffer and is used throughout ActiveMQ code base. * <p> * Instances of it can be obtained from {@link ActiveMQBuffers} factory. * <p> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffers.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffers.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffers.java index 482e801..93e798d 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffers.java +++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQBuffers.java @@ -25,10 +25,10 @@ import org.apache.activemq.core.buffers.impl.ChannelBufferWrapper; public final class ActiveMQBuffers { /** - * Creates a <em>self-expanding</em> HornetQBuffer with the given initial size + * Creates a <em>self-expanding</em> ActiveMQBuffer with the given initial size * - * @param size the initial size of the created HornetQBuffer - * @return a self-expanding HornetQBuffer starting with the given size + * @param size the initial size of the created ActiveMQBuffer + * @return a self-expanding ActiveMQBuffer starting with the given size */ public static ActiveMQBuffer dynamicBuffer(final int size) { @@ -36,10 +36,10 @@ public final class ActiveMQBuffers } /** - * Creates a <em>self-expanding</em> HornetQBuffer filled with the given byte array + * Creates a <em>self-expanding</em> ActiveMQBuffer filled with the given byte array * * @param bytes the created buffer will be initially filled with this byte array - * @return a self-expanding HornetQBuffer filled with the given byte array + * @return a self-expanding ActiveMQBuffer filled with the given byte array */ public static ActiveMQBuffer dynamicBuffer(final byte[] bytes) { @@ -51,12 +51,12 @@ public final class ActiveMQBuffers } /** - * Creates a HornetQBuffer wrapping an underlying NIO ByteBuffer + * Creates a ActiveMQBuffer wrapping an underlying NIO ByteBuffer * * The position on this buffer won't affect the position on the inner buffer * * @param underlying the underlying NIO ByteBuffer - * @return a HornetQBuffer wrapping the underlying NIO ByteBuffer + * @return a ActiveMQBuffer wrapping the underlying NIO ByteBuffer */ public static ActiveMQBuffer wrappedBuffer(final ByteBuffer underlying) { @@ -68,10 +68,10 @@ public final class ActiveMQBuffers } /** - * Creates a HornetQBuffer wrapping an underlying byte array + * Creates a ActiveMQBuffer wrapping an underlying byte array * * @param underlying the underlying byte array - * @return a HornetQBuffer wrapping the underlying byte array + * @return a ActiveMQBuffer wrapping the underlying byte array */ public static ActiveMQBuffer wrappedBuffer(final byte[] underlying) { @@ -79,10 +79,10 @@ public final class ActiveMQBuffers } /** - * Creates a <em>fixed</em> HornetQBuffer of the given size + * Creates a <em>fixed</em> ActiveMQBuffer of the given size * - * @param size the size of the created HornetQBuffer - * @return a fixed HornetQBuffer with the given size + * @param size the size of the created ActiveMQBuffer + * @return a fixed ActiveMQBuffer with the given size */ public static ActiveMQBuffer fixedBuffer(final int size) { http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQConnectionTimedOutException.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQConnectionTimedOutException.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQConnectionTimedOutException.java index 88c39c3..fb691b0 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQConnectionTimedOutException.java +++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQConnectionTimedOutException.java @@ -16,7 +16,7 @@ package org.apache.activemq.api.core; import static org.apache.activemq.api.core.ActiveMQExceptionType.CONNECTION_TIMEDOUT; /** - * A client timed out will connecting to HornetQ server. + * A client timed out will connecting to ActiveMQ server. * @author <a href="mailto:andy.tay...@jboss.org">Andy Taylor</a> 4/30/12 */ public final class ActiveMQConnectionTimedOutException extends ActiveMQException http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQDisconnectedException.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQDisconnectedException.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQDisconnectedException.java index 038472c..44aa176 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQDisconnectedException.java +++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQDisconnectedException.java @@ -16,7 +16,7 @@ package org.apache.activemq.api.core; import static org.apache.activemq.api.core.ActiveMQExceptionType.DISCONNECTED; /** - * A client was disconnected from HornetQ server when the server has shut down. + * A client was disconnected from ActiveMQ server when the server has shut down. * @author <a href="mailto:andy.tay...@jboss.org">Andy Taylor</a> 4/30/12 */ public final class ActiveMQDisconnectedException extends ActiveMQException http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQIllegalStateException.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQIllegalStateException.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQIllegalStateException.java index 2dd437f..123b672 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQIllegalStateException.java +++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQIllegalStateException.java @@ -16,7 +16,7 @@ package org.apache.activemq.api.core; import static org.apache.activemq.api.core.ActiveMQExceptionType.ILLEGAL_STATE; /** - * A HornetQ resource is not in a legal state (e.g. calling ClientConsumer.receive() if a + * A ActiveMQ resource is not in a legal state (e.g. calling ClientConsumer.receive() if a * MessageHandler is set). * @author <a href="mailto:andy.tay...@jboss.org">Andy Taylor</a> 5/2/12 */ http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQInternalErrorException.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQInternalErrorException.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQInternalErrorException.java index 691b288..f334780 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQInternalErrorException.java +++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQInternalErrorException.java @@ -16,7 +16,7 @@ package org.apache.activemq.api.core; import static org.apache.activemq.api.core.ActiveMQExceptionType.INTERNAL_ERROR; /** - * Internal error which prevented HornetQ from performing an important operation. + * Internal error which prevented ActiveMQ from performing an important operation. * @author <a href="mailto:andy.tay...@jboss.org">Andy Taylor</a> 4/30/12 */ public final class ActiveMQInternalErrorException extends ActiveMQException http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNativeIOError.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNativeIOError.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNativeIOError.java index c1697df..0848626 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNativeIOError.java +++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNativeIOError.java @@ -15,7 +15,7 @@ package org.apache.activemq.api.core; /** - * An error has happened at HornetQ's native (non-Java) code used in reading and writing data. + * An error has happened at ActiveMQ's native (non-Java) code used in reading and writing data. * @author <a href="mailto:andy.tay...@jboss.org">Andy Taylor</a> 5/4/12 */ // XXX http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNotConnectedException.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNotConnectedException.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNotConnectedException.java index 0b6e99c..5fd1d3a 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNotConnectedException.java +++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQNotConnectedException.java @@ -16,7 +16,7 @@ package org.apache.activemq.api.core; import static org.apache.activemq.api.core.ActiveMQExceptionType.NOT_CONNECTED; /** - * A client is not able to connect to HornetQ server. + * A client is not able to connect to ActiveMQ server. * @author <a href="mailto:andy.tay...@jboss.org">Andy Taylor</a> 4/30/12 */ public final class ActiveMQNotConnectedException extends ActiveMQException http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQUnsupportedPacketException.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQUnsupportedPacketException.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQUnsupportedPacketException.java index 0403bbe..2bb5bfd 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQUnsupportedPacketException.java +++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/ActiveMQUnsupportedPacketException.java @@ -16,7 +16,7 @@ package org.apache.activemq.api.core; import static org.apache.activemq.api.core.ActiveMQExceptionType.UNSUPPORTED_PACKET; /** - * A packet of unsupported type was received by HornetQ PacketHandler. + * A packet of unsupported type was received by ActiveMQ PacketHandler. * @author <a href="mailto:andy.tay...@jboss.org">Andy Taylor</a> 4/30/12 */ public final class ActiveMQUnsupportedPacketException extends ActiveMQException http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/api/core/SimpleString.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/api/core/SimpleString.java b/activemq-commons/src/main/java/org/apache/activemq/api/core/SimpleString.java index e1740e8..e0d3087 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/api/core/SimpleString.java +++ b/activemq-commons/src/main/java/org/apache/activemq/api/core/SimpleString.java @@ -23,7 +23,7 @@ import org.apache.activemq.utils.DataConstants; * A simple String class that can store all characters, and stores as simple {@code byte[]}, this * minimises expensive copying between String objects. * <p> - * This object is used heavily throughout HornetQ for performance reasons. + * This object is used heavily throughout ActiveMQ for performance reasons. * * @author <a href="mailto:tim....@jboss.com">Tim Fox</a> */ http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/core/server/ActiveMQComponent.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/core/server/ActiveMQComponent.java b/activemq-commons/src/main/java/org/apache/activemq/core/server/ActiveMQComponent.java new file mode 100644 index 0000000..f2dd86f --- /dev/null +++ b/activemq-commons/src/main/java/org/apache/activemq/core/server/ActiveMQComponent.java @@ -0,0 +1,31 @@ +/* + * 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.server; + +/** + * A ActiveMQComponent + * + * @author <a href="mailto:tim....@jboss.com">Tim Fox</a> + * @version <tt>$Revision: 2796 $</tt> + * + * + */ +public interface ActiveMQComponent +{ + void start() throws Exception; + + void stop() throws Exception; + + boolean isStarted(); +} http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/core/server/HornetQComponent.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/core/server/HornetQComponent.java b/activemq-commons/src/main/java/org/apache/activemq/core/server/HornetQComponent.java deleted file mode 100644 index 5633bb6..0000000 --- a/activemq-commons/src/main/java/org/apache/activemq/core/server/HornetQComponent.java +++ /dev/null @@ -1,31 +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.server; - -/** - * A HornetQComponent - * - * @author <a href="mailto:tim....@jboss.com">Tim Fox</a> - * @version <tt>$Revision: 2796 $</tt> - * - * - */ -public interface HornetQComponent -{ - void start() throws Exception; - - void stop() throws Exception; - - boolean isStarted(); -} http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQThreadFactory.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQThreadFactory.java b/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQThreadFactory.java new file mode 100644 index 0000000..36e4c64 --- /dev/null +++ b/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQThreadFactory.java @@ -0,0 +1,68 @@ +/* + * 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.utils; + +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * + * A ActiveMQThreadFactory + * + * @author <a href="mailto:tim....@jboss.com">Tim Fox</a> + * + */ +public final class ActiveMQThreadFactory implements ThreadFactory +{ + private final ThreadGroup group; + + private final AtomicInteger threadCount = new AtomicInteger(0); + + private final int threadPriority; + + private final boolean daemon; + + private final ClassLoader tccl; + + public ActiveMQThreadFactory(final String groupName, final boolean daemon, final ClassLoader tccl) + { + group = new ThreadGroup(groupName + "-" + System.identityHashCode(this)); + + this.threadPriority = Thread.NORM_PRIORITY; + + this.tccl = tccl; + + this.daemon = daemon; + } + + public Thread newThread(final Runnable command) + { + // always create a thread in a privileged block. + return AccessController.doPrivileged(new PrivilegedAction<Thread>() + { + @Override + public Thread run() + { + final Thread t = new Thread(group, command, "Thread-" + threadCount.getAndIncrement() + " (" + group.getName() + ")"); + t.setDaemon(daemon); + t.setPriority(threadPriority); + t.setContextClassLoader(tccl); + + return t; + } + }); + } + +} http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilBundle.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilBundle.java b/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilBundle.java new file mode 100644 index 0000000..45fd45e --- /dev/null +++ b/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilBundle.java @@ -0,0 +1,48 @@ +/* + * 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.utils; + + +import org.apache.activemq.api.core.ActiveMQIllegalStateException; +import org.jboss.logging.annotations.Cause; +import org.jboss.logging.annotations.Message; +import org.jboss.logging.annotations.MessageBundle; +import org.jboss.logging.Messages; + +/** + * @author <a href="mailto:andy.tay...@jboss.org">Andy Taylor</a> + * 3/12/12 + * + * Logger Code 20 + * + * each message id must be 6 digits long starting with 20, the 3rd digit should be 9 + * + * so 209000 to 209999 + */ +@MessageBundle(projectCode = "AMQ") +public interface ActiveMQUtilBundle +{ + ActiveMQUtilBundle BUNDLE = Messages.getBundle(ActiveMQUtilBundle.class); + + @Message(id = 209000, value = "invalid property: {0}" , format = Message.Format.MESSAGE_FORMAT) + ActiveMQIllegalStateException invalidProperty(String part); + + @Message(id = 209001, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT) + IllegalStateException invalidType(Byte type); + + @Message(id = 209002, value = "the specified string is too long ({0})", format = Message.Format.MESSAGE_FORMAT) + IllegalStateException stringTooLong(Integer length); + + @Message(id = 209003, value = "Error instantiating codec {0}", format = Message.Format.MESSAGE_FORMAT) + IllegalArgumentException errorCreatingCodec(@Cause Exception e, String codecClassName); +} http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilLogger.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilLogger.java b/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilLogger.java new file mode 100644 index 0000000..bb6bb68 --- /dev/null +++ b/activemq-commons/src/main/java/org/apache/activemq/utils/ActiveMQUtilLogger.java @@ -0,0 +1,50 @@ +/* + * 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.utils; + +import org.jboss.logging.BasicLogger; +import org.jboss.logging.Logger; +import org.jboss.logging.annotations.LogMessage; +import org.jboss.logging.annotations.Message; +import org.jboss.logging.annotations.MessageLogger; + +/** + * @author <a href="mailto:andy.tay...@jboss.org">Andy Taylor</a> + * 3/15/12 + * + * Logger Code 20 + * + * each message id must be 6 digits long starting with 20, the 3rd digit donates the level so + * + * INF0 1 + * WARN 2 + * DEBUG 3 + * ERROR 4 + * TRACE 5 + * FATAL 6 + * + * so an INFO message would be 201000 to 201999 + */ +@MessageLogger(projectCode = "AMQ") +public interface ActiveMQUtilLogger extends BasicLogger +{ + /** + * The default logger. + */ + ActiveMQUtilLogger LOGGER = Logger.getMessageLogger(ActiveMQUtilLogger.class, ActiveMQUtilLogger.class.getPackage().getName()); + + @LogMessage(level = Logger.Level.WARN) + @Message(id = 202000, value = "Missing privileges to set Thread Context Class Loader on Thread Factory. Using current Thread Context Class Loader", + format = Message.Format.MESSAGE_FORMAT) + void missingPrivsForClassloader(); +} http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/ClassloadingUtil.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/ClassloadingUtil.java b/activemq-commons/src/main/java/org/apache/activemq/utils/ClassloadingUtil.java index dffb37f..bf0442b 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/utils/ClassloadingUtil.java +++ b/activemq-commons/src/main/java/org/apache/activemq/utils/ClassloadingUtil.java @@ -16,7 +16,7 @@ import java.net.URL; /** * This class will be used to perform generic class-loader operations, - * such as load a class first using TCCL, and then the classLoader used by HornetQ (ClassloadingUtil.getClass().getClassLoader()). + * such as load a class first using TCCL, and then the classLoader used by ActiveMQ (ClassloadingUtil.getClass().getClassLoader()). * <p> * Is't required to use a Security Block on any calls to this class. * http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQThreadFactory.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQThreadFactory.java b/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQThreadFactory.java deleted file mode 100644 index f9a42df..0000000 --- a/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQThreadFactory.java +++ /dev/null @@ -1,68 +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.utils; - -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * - * A HornetQThreadFactory - * - * @author <a href="mailto:tim....@jboss.com">Tim Fox</a> - * - */ -public final class HornetQThreadFactory implements ThreadFactory -{ - private final ThreadGroup group; - - private final AtomicInteger threadCount = new AtomicInteger(0); - - private final int threadPriority; - - private final boolean daemon; - - private final ClassLoader tccl; - - public HornetQThreadFactory(final String groupName, final boolean daemon, final ClassLoader tccl) - { - group = new ThreadGroup(groupName + "-" + System.identityHashCode(this)); - - this.threadPriority = Thread.NORM_PRIORITY; - - this.tccl = tccl; - - this.daemon = daemon; - } - - public Thread newThread(final Runnable command) - { - // always create a thread in a privileged block. - return AccessController.doPrivileged(new PrivilegedAction<Thread>() - { - @Override - public Thread run() - { - final Thread t = new Thread(group, command, "Thread-" + threadCount.getAndIncrement() + " (" + group.getName() + ")"); - t.setDaemon(daemon); - t.setPriority(threadPriority); - t.setContextClassLoader(tccl); - - return t; - } - }); - } - -} http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilBundle.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilBundle.java b/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilBundle.java deleted file mode 100644 index 6fdd103..0000000 --- a/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilBundle.java +++ /dev/null @@ -1,48 +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.utils; - - -import org.apache.activemq.api.core.ActiveMQIllegalStateException; -import org.jboss.logging.annotations.Cause; -import org.jboss.logging.annotations.Message; -import org.jboss.logging.annotations.MessageBundle; -import org.jboss.logging.Messages; - -/** - * @author <a href="mailto:andy.tay...@jboss.org">Andy Taylor</a> - * 3/12/12 - * - * Logger Code 20 - * - * each message id must be 6 digits long starting with 20, the 3rd digit should be 9 - * - * so 209000 to 209999 - */ -@MessageBundle(projectCode = "HQ") -public interface HornetQUtilBundle -{ - HornetQUtilBundle BUNDLE = Messages.getBundle(HornetQUtilBundle.class); - - @Message(id = 209000, value = "invalid property: {0}" , format = Message.Format.MESSAGE_FORMAT) - ActiveMQIllegalStateException invalidProperty(String part); - - @Message(id = 209001, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT) - IllegalStateException invalidType(Byte type); - - @Message(id = 209002, value = "the specified string is too long ({0})", format = Message.Format.MESSAGE_FORMAT) - IllegalStateException stringTooLong(Integer length); - - @Message(id = 209003, value = "Error instantiating codec {0}", format = Message.Format.MESSAGE_FORMAT) - IllegalArgumentException errorCreatingCodec(@Cause Exception e, String codecClassName); -} http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilLogger.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilLogger.java b/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilLogger.java deleted file mode 100644 index 8d711a6..0000000 --- a/activemq-commons/src/main/java/org/apache/activemq/utils/HornetQUtilLogger.java +++ /dev/null @@ -1,50 +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.utils; - -import org.jboss.logging.BasicLogger; -import org.jboss.logging.Logger; -import org.jboss.logging.annotations.LogMessage; -import org.jboss.logging.annotations.Message; -import org.jboss.logging.annotations.MessageLogger; - -/** - * @author <a href="mailto:andy.tay...@jboss.org">Andy Taylor</a> - * 3/15/12 - * - * Logger Code 20 - * - * each message id must be 6 digits long starting with 20, the 3rd digit donates the level so - * - * INF0 1 - * WARN 2 - * DEBUG 3 - * ERROR 4 - * TRACE 5 - * FATAL 6 - * - * so an INFO message would be 201000 to 201999 - */ -@MessageLogger(projectCode = "HQ") -public interface HornetQUtilLogger extends BasicLogger -{ - /** - * The default logger. - */ - HornetQUtilLogger LOGGER = Logger.getMessageLogger(HornetQUtilLogger.class, HornetQUtilLogger.class.getPackage().getName()); - - @LogMessage(level = Logger.Level.WARN) - @Message(id = 202000, value = "Missing privileges to set Thread Context Class Loader on Thread Factory. Using current Thread Context Class Loader", - format = Message.Format.MESSAGE_FORMAT) - void missingPrivsForClassloader(); -} http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/PasswordMaskingUtil.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/PasswordMaskingUtil.java b/activemq-commons/src/main/java/org/apache/activemq/utils/PasswordMaskingUtil.java index 472d216..8dade13 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/utils/PasswordMaskingUtil.java +++ b/activemq-commons/src/main/java/org/apache/activemq/utils/PasswordMaskingUtil.java @@ -63,7 +63,7 @@ public class PasswordMaskingUtil } catch (Exception e) { - throw HornetQUtilBundle.BUNDLE.errorCreatingCodec(e, codecClassName); + throw ActiveMQUtilBundle.BUNDLE.errorCreatingCodec(e, codecClassName); } } }); @@ -76,7 +76,7 @@ public class PasswordMaskingUtil { String[] keyVal = parts[i].split("="); if (keyVal.length != 2) - throw HornetQUtilBundle.BUNDLE.invalidProperty(parts[i]); + throw ActiveMQUtilBundle.BUNDLE.invalidProperty(parts[i]); props.put(keyVal[0], keyVal[1]); } codecInstance.init(props); http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/ReusableLatch.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/ReusableLatch.java b/activemq-commons/src/main/java/org/apache/activemq/utils/ReusableLatch.java index b1b4b12..04d5dc2 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/utils/ReusableLatch.java +++ b/activemq-commons/src/main/java/org/apache/activemq/utils/ReusableLatch.java @@ -24,7 +24,7 @@ import java.util.concurrent.locks.AbstractQueuedSynchronizer; * * <p>It could be used for sync points when one process is feeding the latch while another will wait when everything is done. (e.g. waiting IO completions to finish)</p> * - * <p>On HornetQ we have the requirement of increment and decrement a counter until the user fires a ready event (commit). At that point we just act as a regular countDown.</p> + * <p>On ActiveMQ we have the requirement of increment and decrement a counter until the user fires a ready event (commit). At that point we just act as a regular countDown.</p> * * <p>Note: This latch is reusable. Once it reaches zero, you can call up again, and reuse it on further waits.</p> * http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/TypedProperties.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/TypedProperties.java b/activemq-commons/src/main/java/org/apache/activemq/utils/TypedProperties.java index 8760f5f..c080413 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/utils/TypedProperties.java +++ b/activemq-commons/src/main/java/org/apache/activemq/utils/TypedProperties.java @@ -547,7 +547,7 @@ public final class TypedProperties } default: { - throw HornetQUtilBundle.BUNDLE.invalidType(type); + throw ActiveMQUtilBundle.BUNDLE.invalidType(type); } } } http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/UTF8Util.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/UTF8Util.java b/activemq-commons/src/main/java/org/apache/activemq/utils/UTF8Util.java index a11b0c2..3f32568 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/utils/UTF8Util.java +++ b/activemq-commons/src/main/java/org/apache/activemq/utils/UTF8Util.java @@ -35,7 +35,7 @@ public final class UTF8Util // utility class } - private static final boolean isTrace = HornetQUtilLogger.LOGGER.isTraceEnabled(); + private static final boolean isTrace = ActiveMQUtilLogger.LOGGER.isTraceEnabled(); private static final ThreadLocal<SoftReference<StringUtilBuffer>> currenBuffer = new ThreadLocal<SoftReference<StringUtilBuffer>>(); @@ -46,14 +46,14 @@ public final class UTF8Util if (str.length() > 0xffff) { - throw HornetQUtilBundle.BUNDLE.stringTooLong(str.length()); + throw ActiveMQUtilBundle.BUNDLE.stringTooLong(str.length()); } final int len = UTF8Util.calculateUTFSize(str, buffer); if (len > 0xffff) { - throw HornetQUtilBundle.BUNDLE.stringTooLong(len); + throw ActiveMQUtilBundle.BUNDLE.stringTooLong(len); } out.writeShort((short)len); @@ -76,7 +76,7 @@ public final class UTF8Util if (UTF8Util.isTrace) { // This message is too verbose for debug, that's why we are using trace here - HornetQUtilLogger.LOGGER.trace("Saving string with utfSize=" + len + " stringSize=" + str.length()); + ActiveMQUtilLogger.LOGGER.trace("Saving string with utfSize=" + len + " stringSize=" + str.length()); } int stringLength = str.length(); @@ -125,7 +125,7 @@ public final class UTF8Util if (UTF8Util.isTrace) { // This message is too verbose for debug, that's why we are using trace here - HornetQUtilLogger.LOGGER.trace("Reading string with utfSize=" + size); + ActiveMQUtilLogger.LOGGER.trace("Reading string with utfSize=" + size); } int count = 0; http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-commons/src/main/java/org/apache/activemq/utils/UUIDGenerator.java ---------------------------------------------------------------------- diff --git a/activemq-commons/src/main/java/org/apache/activemq/utils/UUIDGenerator.java b/activemq-commons/src/main/java/org/apache/activemq/utils/UUIDGenerator.java index 693b821..0bfc218 100644 --- a/activemq-commons/src/main/java/org/apache/activemq/utils/UUIDGenerator.java +++ b/activemq-commons/src/main/java/org/apache/activemq/utils/UUIDGenerator.java @@ -124,9 +124,9 @@ public final class UUIDGenerator */ dummy[0] |= (byte) 0x01; - if (HornetQUtilLogger.LOGGER.isDebugEnabled()) + if (ActiveMQUtilLogger.LOGGER.isDebugEnabled()) { - HornetQUtilLogger.LOGGER.debug("using dummy address " + UUIDGenerator.asString(dummy)); + ActiveMQUtilLogger.LOGGER.debug("using dummy address " + UUIDGenerator.asString(dummy)); } return dummy; } @@ -173,9 +173,9 @@ public final class UUIDGenerator isVirtualMethod); if (address != null) { - if (HornetQUtilLogger.LOGGER.isDebugEnabled()) + if (ActiveMQUtilLogger.LOGGER.isDebugEnabled()) { - HornetQUtilLogger.LOGGER.debug("using hardware address " + UUIDGenerator.asString(address)); + ActiveMQUtilLogger.LOGGER.debug("using hardware address " + UUIDGenerator.asString(address)); } return address; } http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/DiscoveryGroupConfiguration.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/DiscoveryGroupConfiguration.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/DiscoveryGroupConfiguration.java index 053760c..02361ea 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/DiscoveryGroupConfiguration.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/DiscoveryGroupConfiguration.java @@ -17,7 +17,7 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; -import org.apache.activemq.api.core.client.HornetQClient; +import org.apache.activemq.api.core.client.ActiveMQClient; import org.apache.activemq.utils.UUIDGenerator; /** @@ -39,9 +39,9 @@ public final class DiscoveryGroupConfiguration implements Serializable private String name = UUIDGenerator.getInstance().generateStringUUID(); - private long refreshTimeout = HornetQClient.DEFAULT_DISCOVERY_REFRESH_TIMEOUT; + private long refreshTimeout = ActiveMQClient.DEFAULT_DISCOVERY_REFRESH_TIMEOUT; - private long discoveryInitialWaitTimeout = HornetQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT; + private long discoveryInitialWaitTimeout = ActiveMQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT; /* * The localBindAddress is needed so we can be backward compatible with 2.2 clients http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/FilterConstants.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/FilterConstants.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/FilterConstants.java index 3571e10..3cd2cb8 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/FilterConstants.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/FilterConstants.java @@ -13,26 +13,26 @@ package org.apache.activemq.api.core; /** - * Constants representing pre-defined message attributes that can be referenced in HornetQ core + * Constants representing pre-defined message attributes that can be referenced in ActiveMQ core * filter expressions. * @author <a href="mailto:tim....@jboss.com">Tim Fox</a> */ public final class FilterConstants { /** - * Name of the HornetQ UserID header. + * Name of the ActiveMQ UserID header. */ - public static final SimpleString HORNETQ_USERID = new SimpleString("HQUserID"); + public static final SimpleString ACTIVEMQ_USERID = new SimpleString("HQUserID"); /** - * Name of the HornetQ Message expiration header. + * Name of the ActiveMQ Message expiration header. */ - public static final SimpleString HORNETQ_EXPIRATION = new SimpleString("HQExpiration"); + public static final SimpleString ACTIVEMQ_EXPIRATION = new SimpleString("HQExpiration"); /** - * Name of the HornetQ Message durable header. + * Name of the ActiveMQ Message durable header. */ - public static final SimpleString HORNETQ_DURABLE = new SimpleString("HQDurable"); + public static final SimpleString ACTIVEMQ_DURABLE = new SimpleString("HQDurable"); /** * Value for the Durable header when the message is non-durable. @@ -45,24 +45,24 @@ public final class FilterConstants public static final SimpleString DURABLE = new SimpleString("DURABLE"); /** - * Name of the HornetQ Message timestamp header. + * Name of the ActiveMQ Message timestamp header. */ - public static final SimpleString HORNETQ_TIMESTAMP = new SimpleString("HQTimestamp"); + public static final SimpleString ACTIVEMQ_TIMESTAMP = new SimpleString("HQTimestamp"); /** - * Name of the HornetQ Message priority header. + * Name of the ActiveMQ Message priority header. */ - public static final SimpleString HORNETQ_PRIORITY = new SimpleString("HQPriority"); + public static final SimpleString ACTIVEMQ_PRIORITY = new SimpleString("HQPriority"); /** - * Name of the HornetQ Message size header. + * Name of the ActiveMQ Message size header. */ - public static final SimpleString HORNETQ_SIZE = new SimpleString("HQSize"); + public static final SimpleString ACTIVEMQ_SIZE = new SimpleString("HQSize"); /** - * All HornetQ headers are prepended by this prefix. + * All ActiveMQ headers are prepended by this prefix. */ - public static final SimpleString HORNETQ_PREFIX = new SimpleString("HQ"); + public static final SimpleString ACTIVEMQ_PREFIX = new SimpleString("HQ"); private FilterConstants() { http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/Interceptor.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/Interceptor.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/Interceptor.java index ca7a72e..e6d0627 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/Interceptor.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/Interceptor.java @@ -16,10 +16,10 @@ import org.apache.activemq.core.protocol.core.Packet; import org.apache.activemq.spi.core.protocol.RemotingConnection; /** - * This is class is a simple way to intercepting calls on HornetQ client and servers. + * This is class is a simple way to intercepting calls on ActiveMQ client and servers. * <p> - * To add an interceptor to HornetQ server, you have to modify the server configuration file - * {@literal hornetq-configuration.xml}.<br> + * To add an interceptor to ActiveMQ server, you have to modify the server configuration file + * {@literal activemq-configuration.xml}.<br> * To add it to a client, use {@link org.apache.activemq.api.core.client.ServerLocator#addIncomingInterceptor(Interceptor)} * * @author clebert.suco...@jboss.com http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/JGroupsBroadcastGroupConfiguration.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/JGroupsBroadcastGroupConfiguration.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/JGroupsBroadcastGroupConfiguration.java index 19cd7cf..5a6a709 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/JGroupsBroadcastGroupConfiguration.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/JGroupsBroadcastGroupConfiguration.java @@ -31,11 +31,11 @@ import org.jgroups.conf.PlainConfigurator; * There are two ways to constructing a JGroups channel (JChannel): * <ol> * <li> by passing in a JGroups configuration file<br> - * The file must exists in the hornetq classpath. HornetQ creates a JChannel with the + * The file must exists in the activemq classpath. ActiveMQ creates a JChannel with the * configuration file and use it for broadcasting and discovery. In standalone server - * mode HornetQ uses this way for constructing JChannels.</li> + * mode ActiveMQ uses this way for constructing JChannels.</li> * <li> by passing in a JChannel instance<br> - * This is useful when HornetQ needs to get a JChannel from a running JGroups service as in the + * This is useful when ActiveMQ needs to get a JChannel from a running JGroups service as in the * case of AS7 integration.</li> * </ol> * <p> @@ -118,7 +118,7 @@ public final class JGroupsBroadcastGroupConfiguration implements BroadcastEndpoi } /** - * This class is the implementation of HornetQ members discovery that will use JGroups. + * This class is the implementation of ActiveMQ members discovery that will use JGroups. * * @author Howard Gao */ http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/Message.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/Message.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/Message.java index cfabd21..7c83187 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/Message.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/Message.java @@ -158,7 +158,7 @@ public interface Message * Returns the message timestamp. * <br> * The timestamp corresponds to the time this message - * was handled by a HornetQ server. + * was handled by a ActiveMQ server. */ long getTimestamp(); @@ -196,22 +196,22 @@ public interface Message boolean isLargeMessage(); /** - * Returns the message body as a HornetQBuffer + * Returns the message body as a ActiveMQBuffer */ ActiveMQBuffer getBodyBuffer(); /** - * Writes the input byte array to the message body HornetQBuffer + * Writes the input byte array to the message body ActiveMQBuffer */ Message writeBodyBufferBytes(byte[] bytes); /** - * Writes the input String to the message body HornetQBuffer + * Writes the input String to the message body ActiveMQBuffer */ Message writeBodyBufferString(String string); /** - * Returns a <em>copy</em> of the message body as a HornetQBuffer. Any modification + * Returns a <em>copy</em> of the message body as a ActiveMQBuffer. Any modification * of this buffer should not impact the underlying buffer. */ ActiveMQBuffer getBodyBufferCopy(); http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/TransportConfiguration.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/TransportConfiguration.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/TransportConfiguration.java index 812e2d0..0fc578e 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/TransportConfiguration.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/TransportConfiguration.java @@ -16,7 +16,7 @@ import java.io.Serializable; import java.util.HashMap; import java.util.Map; -import org.apache.activemq.core.client.HornetQClientMessageBundle; +import org.apache.activemq.core.client.ActiveMQClientMessageBundle; import org.apache.activemq.core.remoting.impl.TransportConfigurationUtil; import org.apache.activemq.core.remoting.impl.netty.TransportConstants; import org.apache.activemq.utils.UUIDGenerator; @@ -290,7 +290,7 @@ public class TransportConfiguration implements Serializable /** * Encodes this TransportConfiguration into a buffer. * <p> - * Note that this is only used internally HornetQ. + * Note that this is only used internally ActiveMQ. * * @param buffer the buffer to encode into */ @@ -331,7 +331,7 @@ public class TransportConfiguration implements Serializable } else { - throw HornetQClientMessageBundle.BUNDLE.invalidEncodeType(val); + throw ActiveMQClientMessageBundle.BUNDLE.invalidEncodeType(val); } } } @@ -340,7 +340,7 @@ public class TransportConfiguration implements Serializable /** * Decodes this TransportConfiguration from a buffer. * <p> - * Note this is only used internally by HornetQ + * Note this is only used internally by ActiveMQ * * @param buffer the buffer to decode from */ @@ -399,7 +399,7 @@ public class TransportConfiguration implements Serializable } default: { - throw HornetQClientMessageBundle.BUNDLE.invalidType(type); + throw ActiveMQClientMessageBundle.BUNDLE.invalidType(type); } } http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/UDPBroadcastGroupConfiguration.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/UDPBroadcastGroupConfiguration.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/UDPBroadcastGroupConfiguration.java index 6c16ab6..1b00b2c 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/UDPBroadcastGroupConfiguration.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/UDPBroadcastGroupConfiguration.java @@ -22,7 +22,7 @@ import java.net.InetSocketAddress; import java.net.MulticastSocket; import java.util.concurrent.TimeUnit; -import org.apache.activemq.core.client.HornetQClientLogger; +import org.apache.activemq.core.client.ActiveMQClientLogger; /** @@ -189,7 +189,7 @@ public final class UDPBroadcastGroupConfiguration implements BroadcastEndpointFa { if (open) { - HornetQClientLogger.LOGGER.warn(this + " getting exception when receiving broadcasting.", e); + ActiveMQClientLogger.LOGGER.warn(this + " getting exception when receiving broadcasting.", e); } } break; @@ -214,7 +214,7 @@ public final class UDPBroadcastGroupConfiguration implements BroadcastEndpointFa { if (localAddress != null) { - HornetQClientLogger.LOGGER.broadcastGroupBindError(); + ActiveMQClientLogger.LOGGER.broadcastGroupBindError(); } broadcastingSocket = new DatagramSocket(); } @@ -233,7 +233,7 @@ public final class UDPBroadcastGroupConfiguration implements BroadcastEndpointFa } catch (IOException e) { - HornetQClientLogger.LOGGER.ioDiscoveryError(groupAddress.getHostAddress(), groupAddress instanceof Inet4Address ? "IPv4" : "IPv6"); + ActiveMQClientLogger.LOGGER.ioDiscoveryError(groupAddress.getHostAddress(), groupAddress instanceof Inet4Address ? "IPv4" : "IPv6"); receivingSocket = new MulticastSocket(groupPort); } http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ActiveMQClient.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ActiveMQClient.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ActiveMQClient.java new file mode 100644 index 0000000..14a2bcb --- /dev/null +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ActiveMQClient.java @@ -0,0 +1,209 @@ +/* + * 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.api.core.client; + +import org.apache.activemq.api.config.ActiveMQDefaultConfiguration; +import org.apache.activemq.api.core.DiscoveryGroupConfiguration; +import org.apache.activemq.api.core.TransportConfiguration; +import org.apache.activemq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy; +import org.apache.activemq.core.client.impl.ServerLocatorImpl; + +/** + * Utility class for creating ActiveMQ {@link ClientSessionFactory} objects. + * <p> + * Once a {@link ClientSessionFactory} has been created, it can be further configured using its + * setter methods before creating the sessions. Once a session is created, the factory can no longer + * be modified (its setter methods will throw a {@link IllegalStateException}. + * @author <a href="mailto:andy.tay...@jboss.org">Andy Taylor</a> + */ +public final class ActiveMQClient +{ + public static final String DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME = RoundRobinConnectionLoadBalancingPolicy.class.getCanonicalName(); + + public static final long DEFAULT_CLIENT_FAILURE_CHECK_PERIOD = ActiveMQDefaultConfiguration.getDefaultClientFailureCheckPeriod(); + + public static final long DEFAULT_CLIENT_FAILURE_CHECK_PERIOD_INVM = -1; + + // 1 minute - this should be higher than ping period + + public static final long DEFAULT_CONNECTION_TTL = ActiveMQDefaultConfiguration.getDefaultConnectionTtl(); + + public static final long DEFAULT_CONNECTION_TTL_INVM = -1; + + // Any message beyond this size is considered a large message (to be sent in chunks) + + public static final int DEFAULT_MIN_LARGE_MESSAGE_SIZE = 100 * 1024; + + public static final boolean DEFAULT_COMPRESS_LARGE_MESSAGES = false; + + public static final int DEFAULT_CONSUMER_WINDOW_SIZE = 1024 * 1024; + + public static final int DEFAULT_CONSUMER_MAX_RATE = -1; + + public static final int DEFAULT_CONFIRMATION_WINDOW_SIZE = -1; + + public static final int DEFAULT_PRODUCER_WINDOW_SIZE = 64 * 1024; + + public static final int DEFAULT_PRODUCER_MAX_RATE = -1; + + public static final boolean DEFAULT_BLOCK_ON_ACKNOWLEDGE = false; + + public static final boolean DEFAULT_BLOCK_ON_DURABLE_SEND = true; + + public static final boolean DEFAULT_BLOCK_ON_NON_DURABLE_SEND = false; + + public static final boolean DEFAULT_AUTO_GROUP = false; + + public static final long DEFAULT_CALL_TIMEOUT = 30000; + + public static final long DEFAULT_CALL_FAILOVER_TIMEOUT = -1; + + public static final int DEFAULT_ACK_BATCH_SIZE = 1024 * 1024; + + public static final boolean DEFAULT_PRE_ACKNOWLEDGE = false; + + public static final long DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT = 10000; + + public static final long DEFAULT_DISCOVERY_REFRESH_TIMEOUT = 10000; + + public static final int DEFAULT_DISCOVERY_PORT = 9876; + + public static final long DEFAULT_RETRY_INTERVAL = 2000; + + public static final double DEFAULT_RETRY_INTERVAL_MULTIPLIER = ActiveMQDefaultConfiguration.getDefaultRetryIntervalMultiplier(); + + public static final long DEFAULT_MAX_RETRY_INTERVAL = ActiveMQDefaultConfiguration.getDefaultMaxRetryInterval(); + + public static final int DEFAULT_RECONNECT_ATTEMPTS = 0; + + public static final int INITIAL_CONNECT_ATTEMPTS = 1; + + public static final boolean DEFAULT_FAILOVER_ON_INITIAL_CONNECTION = false; + + public static final boolean DEFAULT_IS_HA = false; + + public static final boolean DEFAULT_USE_GLOBAL_POOLS = true; + + public static final int DEFAULT_THREAD_POOL_MAX_SIZE = -1; + + public static final int DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE = 5; + + public static final boolean DEFAULT_CACHE_LARGE_MESSAGE_CLIENT = false; + + public static final int DEFAULT_INITIAL_MESSAGE_PACKET_SIZE = 1500; + + public static final boolean DEFAULT_XA = false; + + public static final boolean DEFAULT_HA = false; + + public static final String DEFAULT_CORE_PROTOCOL = "CORE"; + + /** + * Create a ServerLocator which creates session factories using a static list of transportConfigurations, the ServerLocator is not updated automatically + * as the cluster topology changes, and no HA backup information is propagated to the client + * + * @param transportConfigurations + * @return the ServerLocator + */ + public static ServerLocator createServerLocatorWithoutHA(TransportConfiguration... transportConfigurations) + { + return new ServerLocatorImpl(false, transportConfigurations); + } + + /** + * Create a ServerLocator which creates session factories using a static list of transportConfigurations, the ServerLocator is not updated automatically + * as the cluster topology changes, and no HA backup information is propagated to the client + * + * @param ha The Locator will support topology updates and ha (this required the server to be clustered, otherwise the first connection will timeout) + * @param transportConfigurations + * @return the ServerLocator + */ + public static ServerLocator createServerLocator(final boolean ha, TransportConfiguration... transportConfigurations) + { + return new ServerLocatorImpl(ha, transportConfigurations); + } + + /** + * Create a ServerLocator which creates session factories from a set of live servers, no HA + * backup information is propagated to the client + * <p> + * The UDP address and port are used to listen for live servers in the cluster + * @param groupConfiguration + * @return the ServerLocator + */ + public static ServerLocator createServerLocatorWithoutHA(final DiscoveryGroupConfiguration groupConfiguration) + { + return new ServerLocatorImpl(false, groupConfiguration); + } + + + /** + * Create a ServerLocator which creates session factories from a set of live servers, no HA + * backup information is propagated to the client The UDP address and port are used to listen for + * live servers in the cluster + * @param ha The Locator will support topology updates and ha (this required the server to be + * clustered, otherwise the first connection will timeout) + * @param groupConfiguration + * @return the ServerLocator + */ + public static ServerLocator createServerLocator(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration) + { + return new ServerLocatorImpl(ha, groupConfiguration); + } + + /** + * Create a ServerLocator which will receive cluster topology updates from the cluster as servers + * leave or join and new backups are appointed or removed. + * <p> + * The initial list of servers supplied in this method is simply to make an initial connection to + * the cluster, once that connection is made, up to date cluster topology information is + * downloaded and automatically updated whenever the cluster topology changes. + * <p> + * If the topology includes backup servers that information is also propagated to the client so + * that it can know which server to failover onto in case of live server failure. + * @param initialServers The initial set of servers used to make a connection to the cluster. + * Each one is tried in turn until a successful connection is made. Once a connection + * is made, the cluster topology is downloaded and the rest of the list is ignored. + * @return the ServerLocator + */ + public static ServerLocator createServerLocatorWithHA(TransportConfiguration... initialServers) + { + return new ServerLocatorImpl(true, initialServers); + } + + /** + * Create a ServerLocator which will receive cluster topology updates from the cluster as servers + * leave or join and new backups are appointed or removed. + * <p> + * The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP + * broadcasts which contain connection information for members of the cluster. The broadcasted + * connection information is simply used to make an initial connection to the cluster, once that + * connection is made, up to date cluster topology information is downloaded and automatically + * updated whenever the cluster topology changes. + * <p> + * If the topology includes backup servers that information is also propagated to the client so + * that it can know which server to failover onto in case of live server failure. + * @param groupConfiguration + * @return the ServerLocator + */ + public static ServerLocator createServerLocatorWithHA(final DiscoveryGroupConfiguration groupConfiguration) + { + return new ServerLocatorImpl(true, groupConfiguration); + } + + + private ActiveMQClient() + { + // Utility class + } +} http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientConsumer.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientConsumer.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientConsumer.java index e652579..f3cf549 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientConsumer.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientConsumer.java @@ -16,7 +16,7 @@ import org.apache.activemq.api.core.ActiveMQException; import org.apache.activemq.spi.core.remoting.ConsumerContext; /** - * A ClientConsumer receives messages from HornetQ queues. + * A ClientConsumer receives messages from ActiveMQ queues. * <br> * Messages can be consumed synchronously by using the <code>receive()</code> methods * which will block until a message is received (or a timeout expires) or asynchronously @@ -36,7 +36,7 @@ public interface ClientConsumer extends AutoCloseable /** * The server's ID associated with this consumer. - * HornetQ implements this as a long but this could be protocol dependent. + * ActiveMQ implements this as a long but this could be protocol dependent. * @return */ ConsumerContext getConsumerContext(); @@ -65,7 +65,7 @@ public interface ClientConsumer extends AutoCloseable ClientMessage receive(long timeout) throws ActiveMQException; /** - * Receives a message from a queue. This call will force a network trip to HornetQ server to + * Receives a message from a queue. This call will force a network trip to ActiveMQ server to * ensure that there are no messages in the queue which can be delivered to this consumer. * <p> * This call will never wait indefinitely for a message, it will return {@code null} if no http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientMessage.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientMessage.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientMessage.java index bdfabd6..90bfa6d 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientMessage.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientMessage.java @@ -21,7 +21,7 @@ import org.apache.activemq.api.core.SimpleString; /** * - * A ClientMessage represents a message sent and/or received by HornetQ. + * A ClientMessage represents a message sent and/or received by ActiveMQ. * * @author <a href="mailto:tim....@jboss.com">Tim Fox</a> * @author <a href="mailto:clebert.suco...@jboss.com">Clebert Suconic</a> @@ -37,7 +37,7 @@ public interface ClientMessage extends Message /** * Sets the delivery count for this message. * <p> - * This method is not meant to be called by HornetQ clients. + * This method is not meant to be called by ActiveMQ clients. * @param deliveryCount message delivery count * @return this ClientMessage */ http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientSessionFactory.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientSessionFactory.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientSessionFactory.java index f15061f..5983b7a 100644 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientSessionFactory.java +++ b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/ClientSessionFactory.java @@ -18,7 +18,7 @@ import org.apache.activemq.spi.core.protocol.RemotingConnection; /** - * A ClientSessionFactory is the entry point to create and configure HornetQ resources to produce and consume messages. + * A ClientSessionFactory is the entry point to create and configure ActiveMQ resources to produce and consume messages. * <br> * It is possible to configure a factory using the setter methods only if no session has been created. * Once a session is created, the configuration is fixed and any call to a setter method will throw a IllegalStateException. http://git-wip-us.apache.org/repos/asf/activemq-6/blob/034adfbf/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/HornetQClient.java ---------------------------------------------------------------------- diff --git a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/HornetQClient.java b/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/HornetQClient.java deleted file mode 100644 index 1eef77f..0000000 --- a/activemq-core-client/src/main/java/org/apache/activemq/api/core/client/HornetQClient.java +++ /dev/null @@ -1,209 +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.api.core.client; - -import org.apache.activemq.api.config.ActiveMQDefaultConfiguration; -import org.apache.activemq.api.core.DiscoveryGroupConfiguration; -import org.apache.activemq.api.core.TransportConfiguration; -import org.apache.activemq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy; -import org.apache.activemq.core.client.impl.ServerLocatorImpl; - -/** - * Utility class for creating HornetQ {@link ClientSessionFactory} objects. - * <p> - * Once a {@link ClientSessionFactory} has been created, it can be further configured using its - * setter methods before creating the sessions. Once a session is created, the factory can no longer - * be modified (its setter methods will throw a {@link IllegalStateException}. - * @author <a href="mailto:andy.tay...@jboss.org">Andy Taylor</a> - */ -public final class HornetQClient -{ - public static final String DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME = RoundRobinConnectionLoadBalancingPolicy.class.getCanonicalName(); - - public static final long DEFAULT_CLIENT_FAILURE_CHECK_PERIOD = ActiveMQDefaultConfiguration.getDefaultClientFailureCheckPeriod(); - - public static final long DEFAULT_CLIENT_FAILURE_CHECK_PERIOD_INVM = -1; - - // 1 minute - this should be higher than ping period - - public static final long DEFAULT_CONNECTION_TTL = ActiveMQDefaultConfiguration.getDefaultConnectionTtl(); - - public static final long DEFAULT_CONNECTION_TTL_INVM = -1; - - // Any message beyond this size is considered a large message (to be sent in chunks) - - public static final int DEFAULT_MIN_LARGE_MESSAGE_SIZE = 100 * 1024; - - public static final boolean DEFAULT_COMPRESS_LARGE_MESSAGES = false; - - public static final int DEFAULT_CONSUMER_WINDOW_SIZE = 1024 * 1024; - - public static final int DEFAULT_CONSUMER_MAX_RATE = -1; - - public static final int DEFAULT_CONFIRMATION_WINDOW_SIZE = -1; - - public static final int DEFAULT_PRODUCER_WINDOW_SIZE = 64 * 1024; - - public static final int DEFAULT_PRODUCER_MAX_RATE = -1; - - public static final boolean DEFAULT_BLOCK_ON_ACKNOWLEDGE = false; - - public static final boolean DEFAULT_BLOCK_ON_DURABLE_SEND = true; - - public static final boolean DEFAULT_BLOCK_ON_NON_DURABLE_SEND = false; - - public static final boolean DEFAULT_AUTO_GROUP = false; - - public static final long DEFAULT_CALL_TIMEOUT = 30000; - - public static final long DEFAULT_CALL_FAILOVER_TIMEOUT = -1; - - public static final int DEFAULT_ACK_BATCH_SIZE = 1024 * 1024; - - public static final boolean DEFAULT_PRE_ACKNOWLEDGE = false; - - public static final long DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT = 10000; - - public static final long DEFAULT_DISCOVERY_REFRESH_TIMEOUT = 10000; - - public static final int DEFAULT_DISCOVERY_PORT = 9876; - - public static final long DEFAULT_RETRY_INTERVAL = 2000; - - public static final double DEFAULT_RETRY_INTERVAL_MULTIPLIER = ActiveMQDefaultConfiguration.getDefaultRetryIntervalMultiplier(); - - public static final long DEFAULT_MAX_RETRY_INTERVAL = ActiveMQDefaultConfiguration.getDefaultMaxRetryInterval(); - - public static final int DEFAULT_RECONNECT_ATTEMPTS = 0; - - public static final int INITIAL_CONNECT_ATTEMPTS = 1; - - public static final boolean DEFAULT_FAILOVER_ON_INITIAL_CONNECTION = false; - - public static final boolean DEFAULT_IS_HA = false; - - public static final boolean DEFAULT_USE_GLOBAL_POOLS = true; - - public static final int DEFAULT_THREAD_POOL_MAX_SIZE = -1; - - public static final int DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE = 5; - - public static final boolean DEFAULT_CACHE_LARGE_MESSAGE_CLIENT = false; - - public static final int DEFAULT_INITIAL_MESSAGE_PACKET_SIZE = 1500; - - public static final boolean DEFAULT_XA = false; - - public static final boolean DEFAULT_HA = false; - - public static final String DEFAULT_CORE_PROTOCOL = "CORE"; - - /** - * Create a ServerLocator which creates session factories using a static list of transportConfigurations, the ServerLocator is not updated automatically - * as the cluster topology changes, and no HA backup information is propagated to the client - * - * @param transportConfigurations - * @return the ServerLocator - */ - public static ServerLocator createServerLocatorWithoutHA(TransportConfiguration... transportConfigurations) - { - return new ServerLocatorImpl(false, transportConfigurations); - } - - /** - * Create a ServerLocator which creates session factories using a static list of transportConfigurations, the ServerLocator is not updated automatically - * as the cluster topology changes, and no HA backup information is propagated to the client - * - * @param ha The Locator will support topology updates and ha (this required the server to be clustered, otherwise the first connection will timeout) - * @param transportConfigurations - * @return the ServerLocator - */ - public static ServerLocator createServerLocator(final boolean ha, TransportConfiguration... transportConfigurations) - { - return new ServerLocatorImpl(ha, transportConfigurations); - } - - /** - * Create a ServerLocator which creates session factories from a set of live servers, no HA - * backup information is propagated to the client - * <p> - * The UDP address and port are used to listen for live servers in the cluster - * @param groupConfiguration - * @return the ServerLocator - */ - public static ServerLocator createServerLocatorWithoutHA(final DiscoveryGroupConfiguration groupConfiguration) - { - return new ServerLocatorImpl(false, groupConfiguration); - } - - - /** - * Create a ServerLocator which creates session factories from a set of live servers, no HA - * backup information is propagated to the client The UDP address and port are used to listen for - * live servers in the cluster - * @param ha The Locator will support topology updates and ha (this required the server to be - * clustered, otherwise the first connection will timeout) - * @param groupConfiguration - * @return the ServerLocator - */ - public static ServerLocator createServerLocator(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration) - { - return new ServerLocatorImpl(ha, groupConfiguration); - } - - /** - * Create a ServerLocator which will receive cluster topology updates from the cluster as servers - * leave or join and new backups are appointed or removed. - * <p> - * The initial list of servers supplied in this method is simply to make an initial connection to - * the cluster, once that connection is made, up to date cluster topology information is - * downloaded and automatically updated whenever the cluster topology changes. - * <p> - * If the topology includes backup servers that information is also propagated to the client so - * that it can know which server to failover onto in case of live server failure. - * @param initialServers The initial set of servers used to make a connection to the cluster. - * Each one is tried in turn until a successful connection is made. Once a connection - * is made, the cluster topology is downloaded and the rest of the list is ignored. - * @return the ServerLocator - */ - public static ServerLocator createServerLocatorWithHA(TransportConfiguration... initialServers) - { - return new ServerLocatorImpl(true, initialServers); - } - - /** - * Create a ServerLocator which will receive cluster topology updates from the cluster as servers - * leave or join and new backups are appointed or removed. - * <p> - * The discoveryAddress and discoveryPort parameters in this method are used to listen for UDP - * broadcasts which contain connection information for members of the cluster. The broadcasted - * connection information is simply used to make an initial connection to the cluster, once that - * connection is made, up to date cluster topology information is downloaded and automatically - * updated whenever the cluster topology changes. - * <p> - * If the topology includes backup servers that information is also propagated to the client so - * that it can know which server to failover onto in case of live server failure. - * @param groupConfiguration - * @return the ServerLocator - */ - public static ServerLocator createServerLocatorWithHA(final DiscoveryGroupConfiguration groupConfiguration) - { - return new ServerLocatorImpl(true, groupConfiguration); - } - - - private HornetQClient() - { - // Utility class - } -}