JBoss hornetq SVN: r10727 - in branches/HORNETQ-698_SplitJournal: hornetq-commons and 34 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-05-25 13:30:36 -0400 (Wed, 25 May 2011)
New Revision: 10727
Added:
branches/HORNETQ-698_SplitJournal/hornetq-commons/
branches/HORNETQ-698_SplitJournal/hornetq-commons/.project
branches/HORNETQ-698_SplitJournal/hornetq-commons/hornetq-logging.iml
branches/HORNETQ-698_SplitJournal/hornetq-commons/pom.xml
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/HornetQBuffer.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/HornetQBuffers.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/Pair.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/SimpleString.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/buffers/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/buffers/impl/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/buffers/impl/ChannelBufferWrapper.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/logging/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/logging/Logger.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/logging/impl/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/logging/impl/JULLogDelegate.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/logging/impl/JULLogDelegateFactory.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/integration/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/integration/logging/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/integration/logging/HornetQLoggerFormatter.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/integration/logging/Log4jLogDelegate.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/integration/logging/Log4jLogDelegateFactory.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/core/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/core/logging/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/core/logging/LogDelegate.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/core/logging/LogDelegateFactory.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/core/logging/package-info.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/utils/
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/utils/DataConstants.java
branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/utils/UTF8Util.java
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/message/BodyEncoder.java
Removed:
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/HornetQBuffer.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/HornetQBuffers.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/Pair.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/SimpleString.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/buffers/impl/ChannelBufferWrapper.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/Logger.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/impl/JULLogDelegate.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/impl/JULLogDelegateFactory.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/message/BodyEncoder.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/LogDelegate.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/LogDelegateFactory.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/package-info.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/utils/DataConstants.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/utils/UTF8Util.java
branches/HORNETQ-698_SplitJournal/hornetq-logging/hornetq-logging.iml
branches/HORNETQ-698_SplitJournal/hornetq-logging/pom.xml
branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/HornetQLoggerFormatter.java
branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/Log4jLogDelegate.java
branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/Log4jLogDelegateFactory.java
Modified:
branches/HORNETQ-698_SplitJournal/hornetq-core/pom.xml
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/XmlDeployer.java
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicatedJournal.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/pom.xml
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/ImportJournal.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SyncSpeedTest.java
branches/HORNETQ-698_SplitJournal/pom.xml
Log:
Rename logging project into commons, move loads of files into it.
Added: branches/HORNETQ-698_SplitJournal/hornetq-commons/.project
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/.project (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/.project 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>hornetq-commons</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/hornetq-logging.iml (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-logging/hornetq-logging.iml)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/hornetq-logging.iml (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/hornetq-logging.iml 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="hornetq-core" />
+ <orderEntry type="library" name="Maven: org.jboss.netty:netty:3.2.3.Final" level="project" />
+ <orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
+ </component>
+</module>
+
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/pom.xml (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-logging/pom.xml)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/pom.xml (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/pom.xml 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,27 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-pom</artifactId>
+ <version>2.2.3-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>hornetq-commons</artifactId>
+ <packaging>jar</packaging>
+ <name>HornetQ Utilities</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.netty</groupId>
+ <artifactId>netty</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ </dependencies>
+
+
+</project>
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/HornetQBuffer.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/HornetQBuffer.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/HornetQBuffer.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/HornetQBuffer.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,1086 @@
+/*
+ * Copyright 2009 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.hornetq.api.core;
+
+import java.nio.ByteBuffer;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+
+/**
+ *
+ * A HornetQBuffer wraps a Netty's ChannelBuffer and is used throughout HornetQ code base.
+ *
+ * Much of it derived from Netty ChannelBuffer by Trustin Lee
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @see HornetQBuffers
+ *
+ */
+public interface HornetQBuffer
+{
+ /**
+ * Returns the underlying Netty's ChannelBuffer
+ *
+ * @return the underlying Netty's ChannelBuffer
+ */
+ ChannelBuffer channelBuffer();
+
+ /**
+ * Returns the number of bytes this buffer can contain.
+ */
+ int capacity();
+
+ /**
+ * Returns the {@code readerIndex} of this buffer.
+ */
+ int readerIndex();
+
+ /**
+ * Sets the {@code readerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code readerIndex} is
+ * less than {@code 0} or
+ * greater than {@code this.writerIndex}
+ */
+ void readerIndex(int readerIndex);
+
+ /**
+ * Returns the {@code writerIndex} of this buffer.
+ */
+ int writerIndex();
+
+ /**
+ * Sets the {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code writerIndex} is
+ * less than {@code this.readerIndex} or
+ * greater than {@code this.capacity}
+ */
+ void writerIndex(int writerIndex);
+
+ /**
+ * Sets the {@code readerIndex} and {@code writerIndex} of this buffer
+ * in one shot. This method is useful when you have to worry about the
+ * invocation order of {@link #readerIndex(int)} and {@link #writerIndex(int)}
+ * methods. For example, the following code will fail:
+ *
+ * <pre>
+ * // Create a buffer whose readerIndex, writerIndex and capacity are
+ * // 0, 0 and 8 respectively.
+ * ChannelBuffer buf = ChannelBuffers.buffer(8);
+ *
+ * // IndexOutOfBoundsException is thrown because the specified
+ * // readerIndex (2) cannot be greater than the current writerIndex (0).
+ * buf.readerIndex(2);
+ * buf.writerIndex(4);
+ * </pre>
+ *
+ * The following code will also fail:
+ *
+ * <pre>
+ * // Create a buffer whose readerIndex, writerIndex and capacity are
+ * // 0, 8 and 8 respectively.
+ * ChannelBuffer buf = ChannelBuffers.wrappedBuffer(new byte[8]);
+ *
+ * // readerIndex becomes 8.
+ * buf.readLong();
+ *
+ * // IndexOutOfBoundsException is thrown because the specified
+ * // writerIndex (4) cannot be less than the current readerIndex (8).
+ * buf.writerIndex(4);
+ * buf.readerIndex(2);
+ * </pre>
+ *
+ * By contrast, {@link #setIndex(int, int)} guarantees that it never
+ * throws an {@link IndexOutOfBoundsException} as long as the specified
+ * indexes meet basic constraints, regardless what the current index
+ * values of the buffer are:
+ *
+ * <pre>
+ * // No matter what the current state of the buffer is, the following
+ * // call always succeeds as long as the capacity of the buffer is not
+ * // less than 4.
+ * buf.setIndex(2, 4);
+ * </pre>
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code readerIndex} is less than 0,
+ * if the specified {@code writerIndex} is less than the specified
+ * {@code readerIndex} or if the specified {@code writerIndex} is
+ * greater than {@code this.capacity}
+ */
+ void setIndex(int readerIndex, int writerIndex);
+
+ /**
+ * Returns the number of readable bytes which is equal to
+ * {@code (this.writerIndex - this.readerIndex)}.
+ */
+ int readableBytes();
+
+ /**
+ * Returns the number of writable bytes which is equal to
+ * {@code (this.capacity - this.writerIndex)}.
+ */
+ int writableBytes();
+
+ /**
+ * Returns {@code true}
+ * if and only if {@code (this.writerIndex - this.readerIndex)} is greater
+ * than {@code 0}.
+ */
+ boolean readable();
+
+ /**
+ * Returns {@code true}
+ * if and only if {@code (this.capacity - this.writerIndex)} is greater
+ * than {@code 0}.
+ */
+ boolean writable();
+
+ /**
+ * Sets the {@code readerIndex} and {@code writerIndex} of this buffer to
+ * {@code 0}.
+ * This method is identical to {@link #setIndex(int, int) setIndex(0, 0)}.
+ * <p>
+ * Please note that the behavior of this method is different
+ * from that of NIO buffer, which sets the {@code limit} to
+ * the {@code capacity} of the buffer.
+ */
+ void clear();
+
+ /**
+ * Marks the current {@code readerIndex} in this buffer. You can
+ * reposition the current {@code readerIndex} to the marked
+ * {@code readerIndex} by calling {@link #resetReaderIndex()}.
+ * The initial value of the marked {@code readerIndex} is {@code 0}.
+ */
+ void markReaderIndex();
+
+ /**
+ * Repositions the current {@code readerIndex} to the marked
+ * {@code readerIndex} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the current {@code writerIndex} is less than the marked
+ * {@code readerIndex}
+ */
+ void resetReaderIndex();
+
+ /**
+ * Marks the current {@code writerIndex} in this buffer. You can
+ * reposition the current {@code writerIndex} to the marked
+ * {@code writerIndex} by calling {@link #resetWriterIndex()}.
+ * The initial value of the marked {@code writerIndex} is {@code 0}.
+ */
+ void markWriterIndex();
+
+ /**
+ * Repositions the current {@code writerIndex} to the marked
+ * {@code writerIndex} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the current {@code readerIndex} is greater than the marked
+ * {@code writerIndex}
+ */
+ void resetWriterIndex();
+
+ /**
+ * Discards the bytes between the 0th index and {@code readerIndex}.
+ * It moves the bytes between {@code readerIndex} and {@code writerIndex}
+ * to the 0th index, and sets {@code readerIndex} and {@code writerIndex}
+ * to {@code 0} and {@code oldWriterIndex - oldReaderIndex} respectively.
+ * <p>
+ * Please refer to the class documentation for more detailed explanation.
+ */
+ void discardReadBytes();
+
+ /**
+ * Gets a byte at the specified absolute {@code index} in this buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 1} is greater than {@code this.capacity}
+ */
+ byte getByte(int index);
+
+ /**
+ * Gets an unsigned byte at the specified absolute {@code index} in this
+ * buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 1} is greater than {@code this.capacity}
+ */
+ short getUnsignedByte(int index);
+
+ /**
+ * Gets a 16-bit short integer at the specified absolute {@code index} in
+ * this buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 2} is greater than {@code this.capacity}
+ */
+ short getShort(int index);
+
+ /**
+ * Gets an unsigned 16-bit short integer at the specified absolute
+ * {@code index} in this buffer. This method does not modify
+ * {@code readerIndex} or {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 2} is greater than {@code this.capacity}
+ */
+ int getUnsignedShort(int index);
+
+ /**
+ * Gets a 32-bit integer at the specified absolute {@code index} in
+ * this buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 4} is greater than {@code this.capacity}
+ */
+ int getInt(int index);
+
+ /**
+ * Gets an unsigned 32-bit integer at the specified absolute {@code index}
+ * in this buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 4} is greater than {@code this.capacity}
+ */
+ long getUnsignedInt(int index);
+
+ /**
+ * Gets a 64-bit long integer at the specified absolute {@code index} in
+ * this buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 8} is greater than {@code this.capacity}
+ */
+ long getLong(int index);
+
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the specified absolute {@code index} until the destination becomes
+ * non-writable. This method is basically same with
+ * {@link #getBytes(int, HornetQBuffer, int, int)}, except that this
+ * method increases the {@code writerIndex} of the destination by the
+ * number of the transferred bytes while
+ * {@link #getBytes(int, HornetQBuffer, int, int)} does not.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * the source buffer (i.e. {@code this}).
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * if {@code index + dst.writableBytes} is greater than
+ * {@code this.capacity}
+ */
+ void getBytes(int index, HornetQBuffer dst);
+
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the specified absolute {@code index}. This method is basically same
+ * with {@link #getBytes(int, HornetQBuffer, int, int)}, except that this
+ * method increases the {@code writerIndex} of the destination by the
+ * number of the transferred bytes while
+ * {@link #getBytes(int, HornetQBuffer, int, int)} does not.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * the source buffer (i.e. {@code this}).
+ *
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0},
+ * if {@code index + length} is greater than
+ * {@code this.capacity}, or
+ * if {@code length} is greater than {@code dst.writableBytes}
+ */
+ void getBytes(int index, HornetQBuffer dst, int length);
+
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the specified absolute {@code index}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex}
+ * of both the source (i.e. {@code this}) and the destination.
+ *
+ * @param dstIndex the first index of the destination
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0},
+ * if the specified {@code dstIndex} is less than {@code 0},
+ * if {@code index + length} is greater than
+ * {@code this.capacity}, or
+ * if {@code dstIndex + length} is greater than
+ * {@code dst.capacity}
+ */
+ void getBytes(int index, HornetQBuffer dst, int dstIndex, int length);
+
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the specified absolute {@code index}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * if {@code index + dst.length} is greater than
+ * {@code this.capacity}
+ */
+ void getBytes(int index, byte[] dst);
+
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the specified absolute {@code index}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex}
+ * of this buffer.
+ *
+ * @param dstIndex the first index of the destination
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0},
+ * if the specified {@code dstIndex} is less than {@code 0},
+ * if {@code index + length} is greater than
+ * {@code this.capacity}, or
+ * if {@code dstIndex + length} is greater than
+ * {@code dst.length}
+ */
+ void getBytes(int index, byte[] dst, int dstIndex, int length);
+
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the specified absolute {@code index} until the destination's position
+ * reaches its limit.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer while the destination's {@code position} will be increased.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * if {@code index + dst.remaining()} is greater than
+ * {@code this.capacity}
+ */
+ void getBytes(int index, ByteBuffer dst);
+
+ /**
+ * Gets a char at the specified absolute {@code index} in
+ * this buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 2} is greater than {@code this.capacity}
+ */
+ char getChar(int index);
+
+ /**
+ * Gets a float at the specified absolute {@code index} in
+ * this buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 4} is greater than {@code this.capacity}
+ */
+ float getFloat(int index);
+
+ /**
+ * Gets a double at the specified absolute {@code index} in
+ * this buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 8} is greater than {@code this.capacity}
+ */
+ double getDouble(int index);
+
+ /**
+ * Sets the specified byte at the specified absolute {@code index} in this
+ * buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 1} is greater than {@code this.capacity}
+ */
+ void setByte(int index, byte value);
+
+ /**
+ * Sets the specified 16-bit short integer at the specified absolute
+ * {@code index} in this buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 2} is greater than {@code this.capacity}
+ */
+ void setShort(int index, short value);
+
+ /**
+ * Sets the specified 32-bit integer at the specified absolute
+ * {@code index} in this buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 4} is greater than {@code this.capacity}
+ */
+ void setInt(int index, int value);
+
+ /**
+ * Sets the specified 64-bit long integer at the specified absolute
+ * {@code index} in this buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 8} is greater than {@code this.capacity}
+ */
+ void setLong(int index, long value);
+
+ /**
+ * Transfers the specified source buffer's data to this buffer starting at
+ * the specified absolute {@code index} until the destination becomes
+ * unreadable. This method is basically same with
+ * {@link #setBytes(int, HornetQBuffer, int, int)}, except that this
+ * method increases the {@code readerIndex} of the source buffer by
+ * the number of the transferred bytes while
+ * {@link #getBytes(int, HornetQBuffer, int, int)} does not.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * the source buffer (i.e. {@code this}).
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * if {@code index + src.readableBytes} is greater than
+ * {@code this.capacity}
+ */
+ void setBytes(int index, HornetQBuffer src);
+
+ /**
+ * Transfers the specified source buffer's data to this buffer starting at
+ * the specified absolute {@code index}. This method is basically same
+ * with {@link #setBytes(int, HornetQBuffer, int, int)}, except that this
+ * method increases the {@code readerIndex} of the source buffer by
+ * the number of the transferred bytes while
+ * {@link #getBytes(int, HornetQBuffer, int, int)} does not.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * the source buffer (i.e. {@code this}).
+ *
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0},
+ * if {@code index + length} is greater than
+ * {@code this.capacity}, or
+ * if {@code length} is greater than {@code src.readableBytes}
+ */
+ void setBytes(int index, HornetQBuffer src, int length);
+
+ /**
+ * Transfers the specified source buffer's data to this buffer starting at
+ * the specified absolute {@code index}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex}
+ * of both the source (i.e. {@code this}) and the destination.
+ *
+ * @param srcIndex the first index of the source
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0},
+ * if the specified {@code srcIndex} is less than {@code 0},
+ * if {@code index + length} is greater than
+ * {@code this.capacity}, or
+ * if {@code srcIndex + length} is greater than
+ * {@code src.capacity}
+ */
+ void setBytes(int index, HornetQBuffer src, int srcIndex, int length);
+
+ /**
+ * Transfers the specified source array's data to this buffer starting at
+ * the specified absolute {@code index}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * if {@code index + src.length} is greater than
+ * {@code this.capacity}
+ */
+ void setBytes(int index, byte[] src);
+
+ /**
+ * Transfers the specified source array's data to this buffer starting at
+ * the specified absolute {@code index}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0},
+ * if the specified {@code srcIndex} is less than {@code 0},
+ * if {@code index + length} is greater than
+ * {@code this.capacity}, or
+ * if {@code srcIndex + length} is greater than {@code src.length}
+ */
+ void setBytes(int index, byte[] src, int srcIndex, int length);
+
+ /**
+ * Transfers the specified source buffer's data to this buffer starting at
+ * the specified absolute {@code index} until the source buffer's position
+ * reaches its limit.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * if {@code index + src.remaining()} is greater than
+ * {@code this.capacity}
+ */
+ void setBytes(int index, ByteBuffer src);
+
+ /**
+ * Sets the specified char at the specified absolute
+ * {@code index} in this buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 2} is greater than {@code this.capacity}
+ */
+ void setChar(int index, char value);
+
+ /**
+ * Sets the specified float at the specified absolute
+ * {@code index} in this buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 4} is greater than {@code this.capacity}
+ */
+ void setFloat(int index, float value);
+
+ /**
+ * Sets the specified double at the specified absolute
+ * {@code index} in this buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 8} is greater than {@code this.capacity}
+ */
+ void setDouble(int index, double value);
+
+ /**
+ * Gets a byte at the current {@code readerIndex} and increases
+ * the {@code readerIndex} by {@code 1} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 1}
+ */
+ byte readByte();
+
+ /**
+ * Gets an unsigned byte at the current {@code readerIndex} and increases
+ * the {@code readerIndex} by {@code 1} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 1}
+ */
+ short readUnsignedByte();
+
+ /**
+ * Gets a 16-bit short integer at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 2} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 2}
+ */
+ short readShort();
+
+ /**
+ * Gets an unsigned 16-bit short integer at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 2} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 2}
+ */
+ int readUnsignedShort();
+
+ /**
+ * Gets a 32-bit integer at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 4} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 4}
+ */
+ int readInt();
+
+ /**
+ * Gets an unsigned 32-bit integer at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 4} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 4}
+ */
+ long readUnsignedInt();
+
+ /**
+ * Gets a 64-bit integer at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 8} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 8}
+ */
+ long readLong();
+
+ /**
+ * Gets a char at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 2} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 2}
+ */
+ char readChar();
+
+ /**
+ * Gets a float at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 4} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 4}
+ */
+ float readFloat();
+
+ /**
+ * Gets a double at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 8} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 8}
+ */
+ double readDouble();
+
+ /**
+ * Gets a boolean at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 1} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 1}
+ */
+ boolean readBoolean();
+
+ /**
+ * Gets a SimpleString (potentially {@code null}) at the current {@code readerIndex}
+ */
+ SimpleString readNullableSimpleString();
+
+ /**
+ * Gets a String (potentially {@code null}) at the current {@code readerIndex}
+ */
+ String readNullableString();
+
+ /**
+ * Gets a non-null SimpleString at the current {@code readerIndex}
+ */
+ SimpleString readSimpleString();
+
+ /**
+ * Gets a non-null String at the current {@code readerIndex}
+ */
+ String readString();
+
+ /**
+ * Gets a UTF-8 String at the current {@code readerIndex}
+ */
+ String readUTF();
+
+ /**
+ * Transfers this buffer's data to a newly created buffer starting at
+ * the current {@code readerIndex} and increases the {@code readerIndex}
+ * by the number of the transferred bytes (= {@code length}).
+ * The returned buffer's {@code readerIndex} and {@code writerIndex} are
+ * {@code 0} and {@code length} respectively.
+ *
+ * @param length the number of bytes to transfer
+ *
+ * @return the newly created buffer which contains the transferred bytes
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code length} is greater than {@code this.readableBytes}
+ */
+ HornetQBuffer readBytes(int length);
+
+ /**
+ * Returns a new slice of this buffer's sub-region starting at the current
+ * {@code readerIndex} and increases the {@code readerIndex} by the size
+ * of the new slice (= {@code length}).
+ *
+ * @param length the size of the new slice
+ *
+ * @return the newly created slice
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code length} is greater than {@code this.readableBytes}
+ */
+ HornetQBuffer readSlice(int length);
+
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the current {@code readerIndex} until the destination becomes
+ * non-writable, and increases the {@code readerIndex} by the number of the
+ * transferred bytes. This method is basically same with
+ * {@link #readBytes(HornetQBuffer, int, int)}, except that this method
+ * increases the {@code writerIndex} of the destination by the number of
+ * the transferred bytes while {@link #readBytes(HornetQBuffer, int, int)}
+ * does not.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code dst.writableBytes} is greater than
+ * {@code this.readableBytes}
+ */
+ void readBytes(HornetQBuffer dst);
+
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the current {@code readerIndex} and increases the {@code readerIndex}
+ * by the number of the transferred bytes (= {@code length}). This method
+ * is basically same with {@link #readBytes(HornetQBuffer, int, int)},
+ * except that this method increases the {@code writerIndex} of the
+ * destination by the number of the transferred bytes (= {@code length})
+ * while {@link #readBytes(HornetQBuffer, int, int)} does not.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code length} is greater than {@code this.readableBytes} or
+ * if {@code length} is greater than {@code dst.writableBytes}
+ */
+ void readBytes(HornetQBuffer dst, int length);
+
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the current {@code readerIndex} and increases the {@code readerIndex}
+ * by the number of the transferred bytes (= {@code length}).
+ *
+ * @param dstIndex the first index of the destination
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code dstIndex} is less than {@code 0},
+ * if {@code length} is greater than {@code this.readableBytes}, or
+ * if {@code dstIndex + length} is greater than
+ * {@code dst.capacity}
+ */
+ void readBytes(HornetQBuffer dst, int dstIndex, int length);
+
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the current {@code readerIndex} and increases the {@code readerIndex}
+ * by the number of the transferred bytes (= {@code dst.length}).
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code dst.length} is greater than {@code this.readableBytes}
+ */
+ void readBytes(byte[] dst);
+
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the current {@code readerIndex} and increases the {@code readerIndex}
+ * by the number of the transferred bytes (= {@code length}).
+ *
+ * @param dstIndex the first index of the destination
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code dstIndex} is less than {@code 0},
+ * if {@code length} is greater than {@code this.readableBytes}, or
+ * if {@code dstIndex + length} is greater than {@code dst.length}
+ */
+ void readBytes(byte[] dst, int dstIndex, int length);
+
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the current {@code readerIndex} until the destination's position
+ * reaches its limit, and increases the {@code readerIndex} by the
+ * number of the transferred bytes.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code dst.remaining()} is greater than
+ * {@code this.readableBytes}
+ */
+ void readBytes(ByteBuffer dst);
+
+ /**
+ * Increases the current {@code readerIndex} by the specified
+ * {@code length} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code length} is greater than {@code this.readableBytes}
+ */
+ void skipBytes(int length);
+
+ /**
+ * Sets the specified byte at the current {@code writerIndex}
+ * and increases the {@code writerIndex} by {@code 1} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.writableBytes} is less than {@code 1}
+ */
+ void writeByte(byte value);
+
+ /**
+ * Sets the specified 16-bit short integer at the current
+ * {@code writerIndex} and increases the {@code writerIndex} by {@code 2}
+ * in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.writableBytes} is less than {@code 2}
+ */
+ void writeShort(short value);
+
+ /**
+ * Sets the specified 32-bit integer at the current {@code writerIndex}
+ * and increases the {@code writerIndex} by {@code 4} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.writableBytes} is less than {@code 4}
+ */
+ void writeInt(int value);
+
+ /**
+ * Sets the specified 64-bit long integer at the current
+ * {@code writerIndex} and increases the {@code writerIndex} by {@code 8}
+ * in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.writableBytes} is less than {@code 8}
+ */
+ void writeLong(long value);
+
+ /**
+ * Sets the specified char at the current {@code writerIndex}
+ * and increases the {@code writerIndex} by {@code 2} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.writableBytes} is less than {@code 2}
+ */
+ void writeChar(char chr);
+
+ /**
+ * Sets the specified float at the current {@code writerIndex}
+ * and increases the {@code writerIndex} by {@code 4} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.writableBytes} is less than {@code 4}
+ */
+ void writeFloat(float value);
+
+ /**
+ * Sets the specified double at the current {@code writerIndex}
+ * and increases the {@code writerIndex} by {@code 8} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.writableBytes} is less than {@code 8}
+ */
+ void writeDouble(double value);
+
+ /**
+ * Sets the specified boolean at the current {@code writerIndex}
+ */
+ void writeBoolean(boolean val);
+
+ /**
+ * Sets the specified SimpleString (potentially {@code null}) at the current {@code writerIndex}
+ */
+ void writeNullableSimpleString(SimpleString val);
+
+ /**
+ * Sets the specified String (potentially {@code null}) at the current {@code writerIndex}
+ */
+ void writeNullableString(String val);
+
+ /**
+ * Sets the specified non-null SimpleString at the current {@code writerIndex}
+ */
+ void writeSimpleString(SimpleString val);
+
+ /**
+ * Sets the specified non-null String at the current {@code writerIndex}
+ */
+ void writeString(String val);
+
+ /**
+ * Sets the specified UTF-8 String at the current {@code writerIndex}
+ */
+
+ void writeUTF(String utf);
+
+ /**
+ * Transfers the specified source buffer's data to this buffer starting at
+ * the current {@code writerIndex} and increases the {@code writerIndex}
+ * by the number of the transferred bytes (= {@code length}). This method
+ * is basically same with {@link #writeBytes(HornetQBuffer, int, int)},
+ * except that this method increases the {@code readerIndex} of the source
+ * buffer by the number of the transferred bytes (= {@code length}) while
+ * {@link #writeBytes(HornetQBuffer, int, int)} does not.
+ *
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code length} is greater than {@code this.writableBytes} or
+ * if {@code length} is greater then {@code src.readableBytes}
+ */
+ void writeBytes(HornetQBuffer src, int length);
+
+ /**
+ * Transfers the specified source buffer's data to this buffer starting at
+ * the current {@code writerIndex} and increases the {@code writerIndex}
+ * by the number of the transferred bytes (= {@code length}).
+ *
+ * @param srcIndex the first index of the source
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code srcIndex} is less than {@code 0},
+ * if {@code srcIndex + length} is greater than
+ * {@code src.capacity}, or
+ * if {@code length} is greater than {@code this.writableBytes}
+ */
+ void writeBytes(HornetQBuffer src, int srcIndex, int length);
+
+ /**
+ * Transfers the specified source array's data to this buffer starting at
+ * the current {@code writerIndex} and increases the {@code writerIndex}
+ * by the number of the transferred bytes (= {@code src.length}).
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code src.length} is greater than {@code this.writableBytes}
+ */
+ void writeBytes(byte[] src);
+
+ /**
+ * Transfers the specified source array's data to this buffer starting at
+ * the current {@code writerIndex} and increases the {@code writerIndex}
+ * by the number of the transferred bytes (= {@code length}).
+ *
+ * @param srcIndex the first index of the source
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code srcIndex} is less than {@code 0},
+ * if {@code srcIndex + length} is greater than
+ * {@code src.length}, or
+ * if {@code length} is greater than {@code this.writableBytes}
+ */
+ void writeBytes(byte[] src, int srcIndex, int length);
+
+ /**
+ * Transfers the specified source buffer's data to this buffer starting at
+ * the current {@code writerIndex} until the source buffer's position
+ * reaches its limit, and increases the {@code writerIndex} by the
+ * number of the transferred bytes.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code src.remaining()} is greater than
+ * {@code this.writableBytes}
+ */
+ void writeBytes(ByteBuffer src);
+
+ /**
+ * Returns a copy of this buffer's readable bytes. Modifying the content
+ * of the returned buffer or this buffer does not affect each other at all.
+ * This method is identical to {@code buf.copy(buf.readerIndex(), buf.readableBytes())}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ */
+ HornetQBuffer copy();
+
+ /**
+ * Returns a copy of this buffer's sub-region. Modifying the content of
+ * the returned buffer or this buffer does not affect each other at all.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ */
+ HornetQBuffer copy(int index, int length);
+
+ /**
+ * Returns a slice of this buffer's readable bytes. Modifying the content
+ * of the returned buffer or this buffer affects each other's content
+ * while they maintain separate indexes and marks. This method is
+ * identical to {@code buf.slice(buf.readerIndex(), buf.readableBytes())}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ */
+ HornetQBuffer slice();
+
+ /**
+ * Returns a slice of this buffer's sub-region. Modifying the content of
+ * the returned buffer or this buffer affects each other's content while
+ * they maintain separate indexes and marks.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ */
+ HornetQBuffer slice(int index, int length);
+
+ /**
+ * Returns a buffer which shares the whole region of this buffer.
+ * Modifying the content of the returned buffer or this buffer affects
+ * each other's content while they maintain separate indexes and marks.
+ * This method is identical to {@code buf.slice(0, buf.capacity())}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ */
+ HornetQBuffer duplicate();
+
+ /**
+ * Converts this buffer's readable bytes into a NIO buffer. The returned
+ * buffer might or might not share the content with this buffer, while
+ * they have separate indexes and marks. This method is identical to
+ * {@code buf.toByteBuffer(buf.readerIndex(), buf.readableBytes())}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ */
+ ByteBuffer toByteBuffer();
+
+ /**
+ * Converts this buffer's sub-region into a NIO buffer. The returned
+ * buffer might or might not share the content with this buffer, while
+ * they have separate indexes and marks.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ */
+ ByteBuffer toByteBuffer(int index, int length);
+}
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/HornetQBuffers.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/HornetQBuffers.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/HornetQBuffers.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/HornetQBuffers.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2009 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.hornetq.api.core;
+
+import java.nio.ByteBuffer;
+
+import org.hornetq.core.buffers.impl.ChannelBufferWrapper;
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+
+/**
+ * Factory class to create HornetQBuffers
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ */
+public final class HornetQBuffers
+{
+ /**
+ * Creates a <em>self-expanding</em> HornetQBuffer with the given initial size
+ *
+ * @param size the initial size of the created HornetQBuffer
+ * @return a self-expanding HornetQBuffer starting with the given size
+ */
+ public static HornetQBuffer dynamicBuffer(final int size)
+ {
+ return new ChannelBufferWrapper(ChannelBuffers.dynamicBuffer(size));
+ }
+
+ /**
+ * Creates a <em>self-expanding</em> HornetQBuffer 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
+ */
+ public static HornetQBuffer dynamicBuffer(final byte[] bytes)
+ {
+ ChannelBuffer buff = ChannelBuffers.dynamicBuffer(bytes.length);
+
+ buff.writeBytes(bytes);
+
+ return new ChannelBufferWrapper(buff);
+ }
+
+ /**
+ * Creates a HornetQBuffer 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
+ */
+ public static HornetQBuffer wrappedBuffer(final ByteBuffer underlying)
+ {
+ HornetQBuffer buff = new ChannelBufferWrapper(ChannelBuffers.wrappedBuffer(underlying));
+
+ buff.clear();
+
+ return buff;
+ }
+
+ /**
+ * Creates a HornetQBuffer wrapping an underlying byte array
+ *
+ * @param underlying the underlying byte array
+ * @return a HornetQBuffer wrapping the underlying byte array
+ */
+ public static HornetQBuffer wrappedBuffer(final byte[] underlying)
+ {
+ return new ChannelBufferWrapper(ChannelBuffers.wrappedBuffer(underlying));
+ }
+
+ /**
+ * Creates a <em>fixed</em> HornetQBuffer of the given size
+ *
+ * @param size the size of the created HornetQBuffer
+ * @return a fixed HornetQBuffer with the given size
+ */
+ public static HornetQBuffer fixedBuffer(final int size)
+ {
+ return new ChannelBufferWrapper(ChannelBuffers.buffer(size));
+ }
+
+ private HornetQBuffers()
+ {
+ }
+}
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/Pair.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/Pair.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/Pair.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/Pair.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2009 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.hornetq.api.core;
+
+import java.io.Serializable;
+
+/**
+ *
+ * A Pair is a holder for 2 objects.
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class Pair<A, B> implements Serializable
+{
+ private static final long serialVersionUID = -2496357457812368127L;
+
+ public Pair(final A a, final B b)
+ {
+ this.a = a;
+
+ this.b = b;
+ }
+
+ public A a;
+
+ public B b;
+
+ private int hash = -1;
+
+ @Override
+ public int hashCode()
+ {
+ if (hash == -1)
+ {
+ if (a == null && b == null)
+ {
+ return super.hashCode();
+ }
+ else
+ {
+ hash = (a == null ? 0 : a.hashCode()) + 37 * (b == null ? 0 : b.hashCode());
+ }
+ }
+
+ return hash;
+ }
+
+ @Override
+ public boolean equals(final Object other)
+ {
+ if (other == this)
+ {
+ return true;
+ }
+
+ if (other instanceof Pair == false)
+ {
+ return false;
+ }
+
+ Pair<A, B> pother = (Pair<A, B>)other;
+
+ return (pother.a == null ? a == null : pother.a.equals(a)) && (pother.b == null ? b == null : pother.b.equals(b));
+
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Pair[a=" + a + ", b=" + b + "]";
+ }
+}
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/SimpleString.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/SimpleString.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/SimpleString.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/api/core/SimpleString.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,373 @@
+/*
+ * Copyright 2009 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.hornetq.api.core;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hornetq.utils.DataConstants;
+
+/**
+ * A simple String class that can store all characters, and stores as simple
+ * byte[], this minimises expensive copying between String objects.
+ *
+ * This object is used heavily throughout HornetQ for performance reasons.
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+
+public final class SimpleString implements CharSequence, Serializable, Comparable<SimpleString>
+{
+ private static final long serialVersionUID = 4204223851422244307L;
+
+ // Attributes
+ // ------------------------------------------------------------------------
+ private final byte[] data;
+
+ private transient int hash;
+
+ // Cache the string
+ private transient String str;
+
+ // Static
+ // ----------------------------------------------------------------------
+
+ /**
+ * Returns a SimpleString constructed from the <code>string</code> parameter.
+ * If <code>string</code> is <code>null</code>, the return value will be
+ * <code>null</code> too.
+ */
+ public static SimpleString toSimpleString(final String string) {
+ if (string == null) {
+ return null;
+ }
+ return new SimpleString(string);
+ }
+
+ // Constructors
+ // ----------------------------------------------------------------------
+ /**
+ * creates a SimpleString from a conventional String
+ * @param string the string to transform
+ */
+ public SimpleString(final String string) {
+ int len = string.length();
+
+ data = new byte[len << 1];
+
+ int j = 0;
+
+ for (int i = 0; i < len; i++) {
+ char c = string.charAt(i);
+
+ byte low = (byte) (c & 0xFF); // low byte
+
+ data[j++] = low;
+
+ byte high = (byte) (c >> 8 & 0xFF); // high byte
+
+ data[j++] = high;
+ }
+
+ str = string;
+ }
+
+ /**
+ * creates a SimpleString from a byte array
+ * @param data the byte array to use
+ */
+ public SimpleString(final byte[] data) {
+ this.data = data;
+ }
+
+ // CharSequence implementation
+ // ---------------------------------------------------------------------------
+
+ public int length() {
+ return data.length >> 1;
+ }
+
+ public char charAt(int pos) {
+ if (pos < 0 || pos >= data.length >> 1) {
+ throw new IndexOutOfBoundsException();
+ }
+ pos <<= 1;
+
+ return (char) (data[pos] | data[pos + 1] << 8);
+ }
+
+ public CharSequence subSequence(final int start, final int end) {
+ int len = data.length >> 1;
+
+ if (end < start || start < 0 || end > len) {
+ throw new IndexOutOfBoundsException();
+ } else {
+ int newlen = end - start << 1;
+ byte[] bytes = new byte[newlen];
+
+ System.arraycopy(data, start << 1, bytes, 0, newlen);
+
+ return new SimpleString(bytes);
+ }
+ }
+
+ // Comparable implementation -------------------------------------
+
+ public int compareTo(final SimpleString o) {
+ return toString().compareTo(o.toString());
+ }
+
+ // Public
+ // ---------------------------------------------------------------------------
+
+ /**
+ * returns the underlying byte array of this SimpleString
+ * @return the byte array
+ */
+ public byte[] getData() {
+ return data;
+ }
+
+ /**
+ * returns true if the SimpleString parameter starts with the same data as
+ * this one. false if not.
+ * @param other the SimpelString to look for
+ * @return true if this SimpleString starts with the same data
+ */
+ public boolean startsWith(final SimpleString other) {
+ byte[] otherdata = other.data;
+
+ if (otherdata.length > data.length) {
+ return false;
+ }
+
+ for (int i = 0; i < otherdata.length; i++) {
+ if (data[i] != otherdata[i]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ if (str == null) {
+ int len = data.length >> 1;
+
+ char[] chars = new char[len];
+
+ int j = 0;
+
+ for (int i = 0; i < len; i++) {
+ int low = data[j++] & 0xFF;
+
+ int high = data[j++] << 8 & 0xFF00;
+
+ chars[i] = (char) (low | high);
+ }
+
+ str = new String(chars);
+ }
+
+ return str;
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (this == other) {
+ return true;
+ }
+
+ if (other instanceof SimpleString) {
+ SimpleString s = (SimpleString) other;
+
+ if (data.length != s.data.length) {
+ return false;
+ }
+
+ for (int i = 0; i < data.length; i++) {
+ if (data[i] != s.data[i]) {
+ return false;
+ }
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ if (hash == 0) {
+ int tmphash = 0;
+ for (byte element : data) {
+ tmphash = (tmphash << 5) - tmphash + element; // (hash << 5) - hash is
+ // same as hash * 31
+ }
+ hash = tmphash;
+ }
+
+ return hash;
+ }
+
+ /**
+ * splits this SimpleString into an array of SimpleString using the char param
+ * as the delimeter.
+ *
+ * i.e. "a.b" would return "a" and "b" if . was the delimeter
+ * @param delim
+ */
+ public SimpleString[] split(final char delim) {
+ if (!contains(delim)) {
+ return new SimpleString[] { this };
+ } else {
+ List<SimpleString> all = new ArrayList<SimpleString>();
+ int lasPos = 0;
+ for (int i = 0; i < data.length; i += 2) {
+ byte low = (byte) (delim & 0xFF); // low byte
+ byte high = (byte) (delim >> 8 & 0xFF); // high byte
+ if (data[i] == low && data[i + 1] == high) {
+ byte[] bytes = new byte[i - lasPos];
+ System.arraycopy(data, lasPos, bytes, 0, bytes.length);
+ lasPos = i + 2;
+ all.add(new SimpleString(bytes));
+ }
+ }
+ byte[] bytes = new byte[data.length - lasPos];
+ System.arraycopy(data, lasPos, bytes, 0, bytes.length);
+ all.add(new SimpleString(bytes));
+ SimpleString[] parts = new SimpleString[all.size()];
+ return all.toArray(parts);
+ }
+ }
+
+ /**
+ * checks to see if this SimpleString contains the char parameter passed in
+ *
+ * @param c the char to check for
+ * @return true if the char is found, false otherwise.
+ */
+ public boolean contains(final char c) {
+ for (int i = 0; i < data.length; i += 2) {
+ byte low = (byte) (c & 0xFF); // low byte
+ byte high = (byte) (c >> 8 & 0xFF); // high byte
+ if (data[i] == low && data[i + 1] == high) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * concatanates a SimpleString and a String
+ *
+ * @param toAdd the String to concate with.
+ * @return the concatanated SimpleString
+ */
+ public SimpleString concat(final String toAdd) {
+ return concat(new SimpleString(toAdd));
+ }
+
+ /**
+ * concatanates 2 SimpleString's
+ *
+ * @param toAdd the SimpleString to concate with.
+ * @return the concatanated SimpleString
+ */
+ public SimpleString concat(final SimpleString toAdd) {
+ byte[] bytes = new byte[data.length + toAdd.getData().length];
+ System.arraycopy(data, 0, bytes, 0, data.length);
+ System.arraycopy(toAdd.getData(), 0, bytes, data.length, toAdd.getData().length);
+ return new SimpleString(bytes);
+ }
+
+ /**
+ * concatanates a SimpleString and a char
+ *
+ * @param c the char to concate with.
+ * @return the concatanated SimpleString
+ */
+ public SimpleString concat(final char c) {
+ byte[] bytes = new byte[data.length + 2];
+ System.arraycopy(data, 0, bytes, 0, data.length);
+ bytes[data.length] = (byte) (c & 0xFF);
+ bytes[data.length + 1] = (byte) (c >> 8 & 0xFF);
+ return new SimpleString(bytes);
+ }
+
+ /**
+ * returns the size of this SimpleString
+ * @return the size
+ */
+ public int sizeof() {
+ return DataConstants.SIZE_INT + data.length;
+ }
+
+ /**
+ * returns the size of a SimpleString
+ * @param str the SimpleString to check
+ * @return the size
+ */
+ public static int sizeofString(final SimpleString str) {
+ return str.sizeof();
+ }
+
+ /**
+ * returns the size of a SimpleString which could be null
+ * @param str the SimpleString to check
+ * @return the size
+ */
+ public static int sizeofNullableString(final SimpleString str) {
+ if (str == null) {
+ return 1;
+ } else {
+ return 1 + str.sizeof();
+ }
+ }
+
+ /**
+ *
+ * @param srcBegin
+ * @param srcEnd
+ * @param dst
+ * @param dstBegin
+ */
+ public void getChars(final int srcBegin, final int srcEnd, final char dst[],
+ final int dstBegin) {
+ if (srcBegin < 0) {
+ throw new StringIndexOutOfBoundsException(srcBegin);
+ }
+ if (srcEnd > length()) {
+ throw new StringIndexOutOfBoundsException(srcEnd);
+ }
+ if (srcBegin > srcEnd) {
+ throw new StringIndexOutOfBoundsException(srcEnd - srcBegin);
+ }
+
+ int j = 0;
+
+ for (int i = srcBegin; i < srcEnd - srcBegin; i++) {
+ int low = data[j++] & 0xFF;
+
+ int high = data[j++] << 8 & 0xFF00;
+
+ dst[i] = (char) (low | high);
+ }
+ }
+
+}
\ No newline at end of file
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/buffers/impl/ChannelBufferWrapper.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/buffers/impl/ChannelBufferWrapper.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/buffers/impl/ChannelBufferWrapper.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/buffers/impl/ChannelBufferWrapper.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,620 @@
+/*
+ * Copyright 2009 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.hornetq.core.buffers.impl;
+
+import java.nio.ByteBuffer;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.utils.DataConstants;
+import org.hornetq.utils.UTF8Util;
+import org.jboss.netty.buffer.ChannelBuffer;
+
+/**
+ *
+ * A ChannelBufferWrapper
+ *
+ * @author Tim Fox
+ *
+ *
+ */
+public class ChannelBufferWrapper implements HornetQBuffer
+{
+ private static final Logger log = Logger.getLogger(ChannelBufferWrapper.class);
+
+ protected ChannelBuffer buffer;
+
+ public ChannelBufferWrapper(final ChannelBuffer buffer)
+ {
+ this.buffer = buffer;
+ }
+
+ public boolean readBoolean()
+ {
+ return readByte() != 0;
+ }
+
+ public SimpleString readNullableSimpleString()
+ {
+ int b = buffer.readByte();
+ if (b == DataConstants.NULL)
+ {
+ return null;
+ }
+ else
+ {
+ return readSimpleStringInternal();
+ }
+ }
+
+ public String readNullableString()
+ {
+ int b = buffer.readByte();
+ if (b == DataConstants.NULL)
+ {
+ return null;
+ }
+ else
+ {
+ return readStringInternal();
+ }
+ }
+
+ public SimpleString readSimpleString()
+ {
+ return readSimpleStringInternal();
+ }
+
+ private SimpleString readSimpleStringInternal()
+ {
+ int len = buffer.readInt();
+ byte[] data = new byte[len];
+ buffer.readBytes(data);
+ return new SimpleString(data);
+ }
+
+ public String readString()
+ {
+ return readStringInternal();
+ }
+
+ private String readStringInternal()
+ {
+ int len = buffer.readInt();
+
+ if (len < 9)
+ {
+ char[] chars = new char[len];
+ for (int i = 0; i < len; i++)
+ {
+ chars[i] = (char)buffer.readShort();
+ }
+ return new String(chars);
+ }
+ else if (len < 0xfff)
+ {
+ return readUTF();
+ }
+ else
+ {
+ return readSimpleStringInternal().toString();
+ }
+ }
+
+ public String readUTF()
+ {
+ return UTF8Util.readUTF(this);
+ }
+
+ public void writeBoolean(final boolean val)
+ {
+ buffer.writeByte((byte)(val ? -1 : 0));
+ }
+
+ public void writeNullableSimpleString(final SimpleString val)
+ {
+ if (val == null)
+ {
+ buffer.writeByte(DataConstants.NULL);
+ }
+ else
+ {
+ buffer.writeByte(DataConstants.NOT_NULL);
+ writeSimpleStringInternal(val);
+ }
+ }
+
+ public void writeNullableString(final String val)
+ {
+ if (val == null)
+ {
+ buffer.writeByte(DataConstants.NULL);
+ }
+ else
+ {
+ buffer.writeByte(DataConstants.NOT_NULL);
+ writeStringInternal(val);
+ }
+ }
+
+ public void writeSimpleString(final SimpleString val)
+ {
+ writeSimpleStringInternal(val);
+ }
+
+ private void writeSimpleStringInternal(final SimpleString val)
+ {
+ byte[] data = val.getData();
+ buffer.writeInt(data.length);
+ buffer.writeBytes(data);
+ }
+
+ public void writeString(final String val)
+ {
+ writeStringInternal(val);
+ }
+
+ private void writeStringInternal(final String val)
+ {
+ int length = val.length();
+
+ buffer.writeInt(length);
+
+ if (length < 9)
+ {
+ // If very small it's more performant to store char by char
+ for (int i = 0; i < val.length(); i++)
+ {
+ buffer.writeShort((short)val.charAt(i));
+ }
+ }
+ else if (length < 0xfff)
+ {
+ // Store as UTF - this is quicker than char by char for most strings
+ writeUTF(val);
+ }
+ else
+ {
+ // Store as SimpleString, since can't store utf > 0xffff in length
+ writeSimpleStringInternal(new SimpleString(val));
+ }
+ }
+
+ public void writeUTF(final String utf)
+ {
+ UTF8Util.saveUTF(this, utf);
+ }
+
+ public int capacity()
+ {
+ return buffer.capacity();
+ }
+
+ public ChannelBuffer channelBuffer()
+ {
+ return buffer;
+ }
+
+ public void clear()
+ {
+ buffer.clear();
+ }
+
+ public HornetQBuffer copy()
+ {
+ return new ChannelBufferWrapper(buffer.copy());
+ }
+
+ public HornetQBuffer copy(final int index, final int length)
+ {
+ return new ChannelBufferWrapper(buffer.copy(index, length));
+ }
+
+ public void discardReadBytes()
+ {
+ buffer.discardReadBytes();
+ }
+
+ public HornetQBuffer duplicate()
+ {
+ return new ChannelBufferWrapper(buffer.duplicate());
+ }
+
+ public byte getByte(final int index)
+ {
+ return buffer.getByte(index);
+ }
+
+ public void getBytes(final int index, final byte[] dst, final int dstIndex, final int length)
+ {
+ buffer.getBytes(index, dst, dstIndex, length);
+ }
+
+ public void getBytes(final int index, final byte[] dst)
+ {
+ buffer.getBytes(index, dst);
+ }
+
+ public void getBytes(final int index, final ByteBuffer dst)
+ {
+ buffer.getBytes(index, dst);
+ }
+
+ public void getBytes(final int index, final HornetQBuffer dst, final int dstIndex, final int length)
+ {
+ buffer.getBytes(index, dst.channelBuffer(), dstIndex, length);
+ }
+
+ public void getBytes(final int index, final HornetQBuffer dst, final int length)
+ {
+ buffer.getBytes(index, dst.channelBuffer(), length);
+ }
+
+ public void getBytes(final int index, final HornetQBuffer dst)
+ {
+ buffer.getBytes(index, dst.channelBuffer());
+ }
+
+ public char getChar(final int index)
+ {
+ return (char)buffer.getShort(index);
+ }
+
+ public double getDouble(final int index)
+ {
+ return Double.longBitsToDouble(buffer.getLong(index));
+ }
+
+ public float getFloat(final int index)
+ {
+ return Float.intBitsToFloat(buffer.getInt(index));
+ }
+
+ public int getInt(final int index)
+ {
+ return buffer.getInt(index);
+ }
+
+ public long getLong(final int index)
+ {
+ return buffer.getLong(index);
+ }
+
+ public short getShort(final int index)
+ {
+ return buffer.getShort(index);
+ }
+
+ public short getUnsignedByte(final int index)
+ {
+ return buffer.getUnsignedByte(index);
+ }
+
+ public long getUnsignedInt(final int index)
+ {
+ return buffer.getUnsignedInt(index);
+ }
+
+ public int getUnsignedShort(final int index)
+ {
+ return buffer.getUnsignedShort(index);
+ }
+
+ public void markReaderIndex()
+ {
+ buffer.markReaderIndex();
+ }
+
+ public void markWriterIndex()
+ {
+ buffer.markWriterIndex();
+ }
+
+ public boolean readable()
+ {
+ return buffer.readable();
+ }
+
+ public int readableBytes()
+ {
+ return buffer.readableBytes();
+ }
+
+ public byte readByte()
+ {
+ return buffer.readByte();
+ }
+
+ public void readBytes(final byte[] dst, final int dstIndex, final int length)
+ {
+ buffer.readBytes(dst, dstIndex, length);
+ }
+
+ public void readBytes(final byte[] dst)
+ {
+ buffer.readBytes(dst);
+ }
+
+ public void readBytes(final ByteBuffer dst)
+ {
+ buffer.readBytes(dst);
+ }
+
+ public void readBytes(final HornetQBuffer dst, final int dstIndex, final int length)
+ {
+ buffer.readBytes(dst.channelBuffer(), dstIndex, length);
+ }
+
+ public void readBytes(final HornetQBuffer dst, final int length)
+ {
+ buffer.readBytes(dst.channelBuffer(), length);
+ }
+
+ public void readBytes(final HornetQBuffer dst)
+ {
+ buffer.readBytes(dst.channelBuffer());
+ }
+
+ public HornetQBuffer readBytes(final int length)
+ {
+ return new ChannelBufferWrapper(buffer.readBytes(length));
+ }
+
+ public char readChar()
+ {
+ return (char)buffer.readShort();
+ }
+
+ public double readDouble()
+ {
+ return Double.longBitsToDouble(buffer.readLong());
+ }
+
+ public int readerIndex()
+ {
+ return buffer.readerIndex();
+ }
+
+ public void readerIndex(final int readerIndex)
+ {
+ buffer.readerIndex(readerIndex);
+ }
+
+ public float readFloat()
+ {
+ return Float.intBitsToFloat(buffer.readInt());
+ }
+
+ public int readInt()
+ {
+ return buffer.readInt();
+ }
+
+ public long readLong()
+ {
+ return buffer.readLong();
+ }
+
+ public short readShort()
+ {
+ return buffer.readShort();
+ }
+
+ public HornetQBuffer readSlice(final int length)
+ {
+ return new ChannelBufferWrapper(buffer.readSlice(length));
+ }
+
+ public short readUnsignedByte()
+ {
+ return buffer.readUnsignedByte();
+ }
+
+ public long readUnsignedInt()
+ {
+ return buffer.readUnsignedInt();
+ }
+
+ public int readUnsignedShort()
+ {
+ return buffer.readUnsignedShort();
+ }
+
+ public void resetReaderIndex()
+ {
+ buffer.resetReaderIndex();
+ }
+
+ public void resetWriterIndex()
+ {
+ buffer.resetWriterIndex();
+ }
+
+ public void setByte(final int index, final byte value)
+ {
+ buffer.setByte(index, value);
+ }
+
+ public void setBytes(final int index, final byte[] src, final int srcIndex, final int length)
+ {
+ buffer.setBytes(index, src, srcIndex, length);
+ }
+
+ public void setBytes(final int index, final byte[] src)
+ {
+ buffer.setBytes(index, src);
+ }
+
+ public void setBytes(final int index, final ByteBuffer src)
+ {
+ buffer.setBytes(index, src);
+ }
+
+ public void setBytes(final int index, final HornetQBuffer src, final int srcIndex, final int length)
+ {
+ buffer.setBytes(index, src.channelBuffer(), srcIndex, length);
+ }
+
+ public void setBytes(final int index, final HornetQBuffer src, final int length)
+ {
+ buffer.setBytes(index, src.channelBuffer(), length);
+ }
+
+ public void setBytes(final int index, final HornetQBuffer src)
+ {
+ buffer.setBytes(index, src.channelBuffer());
+ }
+
+ public void setChar(final int index, final char value)
+ {
+ buffer.setShort(index, (short)value);
+ }
+
+ public void setDouble(final int index, final double value)
+ {
+ buffer.setLong(index, Double.doubleToLongBits(value));
+ }
+
+ public void setFloat(final int index, final float value)
+ {
+ buffer.setInt(index, Float.floatToIntBits(value));
+ }
+
+ public void setIndex(final int readerIndex, final int writerIndex)
+ {
+ buffer.setIndex(readerIndex, writerIndex);
+ }
+
+ public void setInt(final int index, final int value)
+ {
+ buffer.setInt(index, value);
+ }
+
+ public void setLong(final int index, final long value)
+ {
+ buffer.setLong(index, value);
+ }
+
+ public void setShort(final int index, final short value)
+ {
+ buffer.setShort(index, value);
+ }
+
+ public void skipBytes(final int length)
+ {
+ buffer.skipBytes(length);
+ }
+
+ public HornetQBuffer slice()
+ {
+ return new ChannelBufferWrapper(buffer.slice());
+ }
+
+ public HornetQBuffer slice(final int index, final int length)
+ {
+ return new ChannelBufferWrapper(buffer.slice(index, length));
+ }
+
+ public ByteBuffer toByteBuffer()
+ {
+ return buffer.toByteBuffer();
+ }
+
+ public ByteBuffer toByteBuffer(final int index, final int length)
+ {
+ return buffer.toByteBuffer(index, length);
+ }
+
+ public boolean writable()
+ {
+ return buffer.writable();
+ }
+
+ public int writableBytes()
+ {
+ return buffer.writableBytes();
+ }
+
+ public void writeByte(final byte value)
+ {
+ buffer.writeByte(value);
+ }
+
+ public void writeBytes(final byte[] src, final int srcIndex, final int length)
+ {
+ buffer.writeBytes(src, srcIndex, length);
+ }
+
+ public void writeBytes(final byte[] src)
+ {
+ buffer.writeBytes(src);
+ }
+
+ public void writeBytes(final ByteBuffer src)
+ {
+ buffer.writeBytes(src);
+ }
+
+ public void writeBytes(final HornetQBuffer src, final int srcIndex, final int length)
+ {
+ buffer.writeBytes(src.channelBuffer(), srcIndex, length);
+ }
+
+ public void writeBytes(final HornetQBuffer src, final int length)
+ {
+ buffer.writeBytes(src.channelBuffer(), length);
+ }
+
+ public void writeChar(final char chr)
+ {
+ buffer.writeShort((short)chr);
+ }
+
+ public void writeDouble(final double value)
+ {
+ buffer.writeLong(Double.doubleToLongBits(value));
+ }
+
+ public void writeFloat(final float value)
+ {
+ buffer.writeInt(Float.floatToIntBits(value));
+ }
+
+ public void writeInt(final int value)
+ {
+ buffer.writeInt(value);
+ }
+
+ public void writeLong(final long value)
+ {
+ buffer.writeLong(value);
+ }
+
+ public int writerIndex()
+ {
+ return buffer.writerIndex();
+ }
+
+ public void writerIndex(final int writerIndex)
+ {
+ buffer.writerIndex(writerIndex);
+ }
+
+ public void writeShort(final short value)
+ {
+ buffer.writeShort(value);
+ }
+
+}
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/logging/Logger.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/Logger.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/logging/Logger.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/logging/Logger.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,212 @@
+/*
+ * Copyright 2009 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.hornetq.core.logging;
+
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+import org.hornetq.core.logging.impl.JULLogDelegateFactory;
+import org.hornetq.spi.core.logging.LogDelegate;
+import org.hornetq.spi.core.logging.LogDelegateFactory;
+
+/**
+ *
+ * A Logger
+ *
+ * This class allows us to isolate all our logging dependencies in one place
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class Logger
+{
+ public static final String LOGGER_DELEGATE_FACTORY_CLASS_NAME = "org.hornetq.logger-delegate-factory-class-name";
+
+ private static volatile LogDelegateFactory delegateFactory;
+
+ private static final ConcurrentMap<Class<?>, Logger> loggers = new ConcurrentHashMap<Class<?>, Logger>();
+
+ static
+ {
+ Logger.initialise();
+ }
+
+ public static synchronized void setDelegateFactory(final LogDelegateFactory delegateFactory)
+ {
+ Logger.clear();
+
+ Logger.delegateFactory = delegateFactory;
+ }
+
+ private static void clear()
+ {
+ Logger.loggers.clear();
+ }
+
+ public static synchronized void reset()
+ {
+ Logger.clear();
+
+ Logger.initialise();
+ }
+
+ public static synchronized void initialise()
+ {
+ LogDelegateFactory delegateFactory;
+
+ // If a system property is specified then this overrides any delegate factory which is set
+ // programmatically - this is primarily of use so we can configure the logger delegate on the client side.
+ // call to System.getProperty is wrapped in a try block as it will fail if the client runs in a secured
+ // environment
+ String className = JULLogDelegateFactory.class.getName();
+ try
+ {
+ className = System.getProperty(Logger.LOGGER_DELEGATE_FACTORY_CLASS_NAME);
+ }
+ catch (Exception e)
+ {
+ }
+
+ if (className != null)
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Class<?> clz = loader.loadClass(className);
+ delegateFactory = (LogDelegateFactory)clz.newInstance();
+ }
+ catch (Exception e)
+ {
+ throw new IllegalArgumentException("Error instantiating transformer class \"" + className + "\"", e);
+ }
+ }
+ else
+ {
+ delegateFactory = new JULLogDelegateFactory();
+ }
+
+ Logger.delegateFactory = delegateFactory;
+
+ Logger.loggers.clear();
+ }
+
+ public static Logger getLogger(final Class<?> clazz)
+ {
+ Logger logger = Logger.loggers.get(clazz);
+
+ if (logger == null)
+ {
+ LogDelegate delegate = Logger.delegateFactory.createDelegate(clazz);
+
+ logger = new Logger(delegate);
+
+ Logger oldLogger = Logger.loggers.putIfAbsent(clazz, logger);
+
+ if (oldLogger != null)
+ {
+ logger = oldLogger;
+ }
+ }
+
+ return logger;
+ }
+
+ private final LogDelegate delegate;
+
+ Logger(final LogDelegate delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ public LogDelegate getDelegate()
+ {
+ return delegate;
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return delegate.isInfoEnabled();
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return delegate.isDebugEnabled();
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return delegate.isTraceEnabled();
+ }
+
+ public void fatal(final Object message)
+ {
+ delegate.fatal(message);
+ }
+
+ public void fatal(final Object message, final Throwable t)
+ {
+ delegate.fatal(message, t);
+ }
+
+ public void error(final Object message)
+ {
+ delegate.error(message);
+ }
+
+ public void error(final Object message, final Throwable t)
+ {
+ delegate.error(message, t);
+ }
+
+ public void warn(final Object message)
+ {
+ delegate.warn(message);
+ }
+
+ public void warn(final Object message, final Throwable t)
+ {
+ delegate.warn(message, t);
+ }
+
+ public void info(final Object message)
+ {
+ delegate.info(message);
+ }
+
+ public void info(final Object message, final Throwable t)
+ {
+ delegate.info(message, t);
+ }
+
+ public void debug(final Object message)
+ {
+ delegate.debug(message);
+ }
+
+ public void debug(final Object message, final Throwable t)
+ {
+ delegate.debug(message, t);
+ }
+
+ public void trace(final Object message)
+ {
+ delegate.trace(message);
+ }
+
+ public void trace(final Object message, final Throwable t)
+ {
+ delegate.trace(message, t);
+ }
+
+}
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/logging/impl/JULLogDelegate.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/impl/JULLogDelegate.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/logging/impl/JULLogDelegate.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/logging/impl/JULLogDelegate.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2009 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.hornetq.core.logging.impl;
+
+import java.util.logging.Level;
+
+import org.hornetq.spi.core.logging.LogDelegate;
+
+/**
+ *
+ * A {@link LogDelegate} which delegates to java.util.logging
+ *
+ * @author <a href="kenny.macleod(a)kizoom.com">Kenny MacLeod</a>
+ *
+ */
+public class JULLogDelegate implements LogDelegate
+{
+ private final java.util.logging.Logger logger;
+
+ JULLogDelegate(final Class<?> clazz)
+ {
+ logger = java.util.logging.Logger.getLogger(clazz.getName());
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return logger.isLoggable(Level.INFO);
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return logger.isLoggable(Level.FINE);
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return logger.isLoggable(Level.FINEST);
+ }
+
+ public void fatal(final Object message)
+ {
+ logger.log(Level.SEVERE, message == null ? "NULL" : message.toString());
+ }
+
+ public void fatal(final Object message, final Throwable t)
+ {
+ logger.log(Level.SEVERE, message == null ? "NULL" : message.toString(), t);
+ }
+
+ public void error(final Object message)
+ {
+ logger.log(Level.SEVERE, message == null ? "NULL" : message.toString());
+ }
+
+ public void error(final Object message, final Throwable t)
+ {
+ logger.log(Level.SEVERE, message == null ? "NULL" : message.toString(), t);
+ }
+
+ public void warn(final Object message)
+ {
+ logger.log(Level.WARNING, message == null ? "NULL" : message.toString());
+ }
+
+ public void warn(final Object message, final Throwable t)
+ {
+ logger.log(Level.WARNING, message == null ? "NULL" : message.toString(), t);
+ }
+
+ public void info(final Object message)
+ {
+ logger.log(Level.INFO, message == null ? "NULL" : message.toString());
+ }
+
+ public void info(final Object message, final Throwable t)
+ {
+ logger.log(Level.INFO, message == null ? "NULL" : message.toString(), t);
+ }
+
+ public void debug(final Object message)
+ {
+ logger.log(Level.FINE, message == null ? "NULL" : message.toString());
+ }
+
+ public void debug(final Object message, final Throwable t)
+ {
+ logger.log(Level.FINE, message == null ? "NULL" : message.toString(), t);
+ }
+
+ public void trace(final Object message)
+ {
+ logger.log(Level.FINEST, message == null ? "NULL" : message.toString());
+ }
+
+ public void trace(final Object message, final Throwable t)
+ {
+ logger.log(Level.FINEST, message == null ? "NULL" : message.toString(), t);
+ }
+
+}
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/logging/impl/JULLogDelegateFactory.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/impl/JULLogDelegateFactory.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/logging/impl/JULLogDelegateFactory.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/core/logging/impl/JULLogDelegateFactory.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2009 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.hornetq.core.logging.impl;
+
+import org.hornetq.spi.core.logging.LogDelegate;
+import org.hornetq.spi.core.logging.LogDelegateFactory;
+
+/**
+ * A {@link LogDelegateFactory} which creates {@link JULLogDelegate} instances.
+ *
+ * @author <a href="kenny.macleod(a)kizoom.com">Kenny MacLeod</a>
+ *
+ *
+ */
+public class JULLogDelegateFactory implements LogDelegateFactory
+{
+ public LogDelegate createDelegate(final Class<?> clazz)
+ {
+ return new JULLogDelegate(clazz);
+ }
+}
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/integration/logging/HornetQLoggerFormatter.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/HornetQLoggerFormatter.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/integration/logging/HornetQLoggerFormatter.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/integration/logging/HornetQLoggerFormatter.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2009 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.hornetq.integration.logging;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.logging.LogRecord;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public class HornetQLoggerFormatter extends java.util.logging.Formatter
+{
+ private static String LINE_SEPARATOR = System.getProperty("line.separator");
+
+ @Override
+ public String format(final LogRecord record)
+ {
+ Date date = new Date();
+ SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss,SSS");
+ StringBuffer sb = new StringBuffer();
+ // Minimize memory allocations here.
+ date.setTime(record.getMillis());
+ sb.append("[").append(Thread.currentThread().getName()).append("] ");
+ sb.append(dateFormat.format(date)).append(" ");
+ sb.append(record.getLevel()).append(" [");
+ sb.append(record.getLoggerName()).append("]").append(" ");
+ sb.append(record.getMessage());
+
+ sb.append(HornetQLoggerFormatter.LINE_SEPARATOR);
+ if (record.getThrown() != null)
+ {
+ try
+ {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ record.getThrown().printStackTrace(pw);
+ pw.close();
+ sb.append(sw.toString());
+ }
+ catch (Exception ex)
+ {
+ }
+ }
+ return sb.toString();
+ }
+
+}
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/integration/logging/Log4jLogDelegate.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/Log4jLogDelegate.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/integration/logging/Log4jLogDelegate.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/integration/logging/Log4jLogDelegate.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2009 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.hornetq.integration.logging;
+
+import org.hornetq.spi.core.logging.LogDelegate;
+
+/**
+ *
+ * A {@link LogDelegate} which delegates to Apache Log4j
+ *
+ * @author <a href="kenny.macleod(a)kizoom.com">Kenny MacLeod</a>
+ *
+ */
+public class Log4jLogDelegate implements LogDelegate
+{
+ private final org.apache.log4j.Logger logger;
+
+ Log4jLogDelegate(final Class<?> clazz)
+ {
+ logger = org.apache.log4j.Logger.getLogger(clazz);
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return logger.isInfoEnabled();
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return logger.isDebugEnabled();
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return logger.isTraceEnabled();
+ }
+
+ public void fatal(final Object message)
+ {
+ logger.fatal(message);
+ }
+
+ public void fatal(final Object message, final Throwable t)
+ {
+ logger.fatal(message, t);
+ }
+
+ public void error(final Object message)
+ {
+ logger.error(message);
+ }
+
+ public void error(final Object message, final Throwable t)
+ {
+ logger.error(message, t);
+ }
+
+ public void warn(final Object message)
+ {
+ logger.warn(message);
+ }
+
+ public void warn(final Object message, final Throwable t)
+ {
+ logger.warn(message, t);
+ }
+
+ public void info(final Object message)
+ {
+ logger.info(message);
+ }
+
+ public void info(final Object message, final Throwable t)
+ {
+ logger.info(message, t);
+ }
+
+ public void debug(final Object message)
+ {
+ logger.debug(message);
+ }
+
+ public void debug(final Object message, final Throwable t)
+ {
+ logger.debug(message, t);
+ }
+
+ public void trace(final Object message)
+ {
+ logger.trace(message);
+ }
+
+ public void trace(final Object message, final Throwable t)
+ {
+ logger.trace(message, t);
+ }
+
+}
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/integration/logging/Log4jLogDelegateFactory.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/Log4jLogDelegateFactory.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/integration/logging/Log4jLogDelegateFactory.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/integration/logging/Log4jLogDelegateFactory.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2009 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.hornetq.integration.logging;
+
+import org.hornetq.spi.core.logging.LogDelegate;
+import org.hornetq.spi.core.logging.LogDelegateFactory;
+
+/**
+ * A {@link LogDelegateFactory} which creates {@link Log4jLogDelegate} instances.
+ *
+ * @author <a href="kenny.macleod(a)kizoom.com">Kenny MacLeod</a>
+ *
+ *
+ */
+public class Log4jLogDelegateFactory implements LogDelegateFactory
+{
+ /* (non-Javadoc)
+ * @see org.hornetq.core.logging.LogDelegateFactory#getLogDelegate(java.lang.Class)
+ */
+ public LogDelegate createDelegate(final Class<?> clazz)
+ {
+ return new Log4jLogDelegate(clazz);
+ }
+
+}
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/core/logging/LogDelegate.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/LogDelegate.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/core/logging/LogDelegate.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/core/logging/LogDelegate.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2009 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.hornetq.spi.core.logging;
+
+/**
+ * I represent operations that are delegated to underlying logging frameworks.
+ *
+ * @author <a href="kenny.macleod(a)kizoom.com">Kenny MacLeod</a>
+ *
+ *
+ */
+public interface LogDelegate
+{
+ boolean isInfoEnabled();
+
+ boolean isDebugEnabled();
+
+ boolean isTraceEnabled();
+
+ void fatal(Object message);
+
+ void fatal(Object message, Throwable t);
+
+ void error(Object message);
+
+ void error(Object message, Throwable t);
+
+ void warn(Object message);
+
+ void warn(Object message, Throwable t);
+
+ void info(Object message);
+
+ void info(Object message, Throwable t);
+
+ void debug(Object message);
+
+ void debug(Object message, Throwable t);
+
+ void trace(Object message);
+
+ void trace(Object message, Throwable t);
+}
\ No newline at end of file
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/core/logging/LogDelegateFactory.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/LogDelegateFactory.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/core/logging/LogDelegateFactory.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/core/logging/LogDelegateFactory.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2009 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.hornetq.spi.core.logging;
+
+/**
+ * I am responsible for creating {@link LogDelegate} instances.
+ *
+ * @author <a href="kenny.macleod(a)kizoom.com">Kenny MacLeod</a>
+ *
+ *
+ */
+public interface LogDelegateFactory
+{
+ LogDelegate createDelegate(Class<?> clazz);
+}
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/core/logging/package-info.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/package-info.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/core/logging/package-info.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/spi/core/logging/package-info.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2009 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.
+ */
+
+/**
+ * Logging SPI.
+ * <br>
+ * This package defines the Service Provide Interface to
+ * support different logging implementation.
+ */
+package org.hornetq.spi.core.logging;
+
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/utils/DataConstants.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/utils/DataConstants.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/utils/DataConstants.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/utils/DataConstants.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2009 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.hornetq.utils;
+
+/**
+ *
+ * A DataConstants
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ */
+public class DataConstants
+{
+ public static final int SIZE_INT = 4;
+
+ public static final int SIZE_BOOLEAN = 1;
+
+ public static final int SIZE_LONG = 8;
+
+ public static final int SIZE_BYTE = 1;
+
+ public static final int SIZE_SHORT = 2;
+
+ public static final int SIZE_DOUBLE = 8;
+
+ public static final int SIZE_FLOAT = 4;
+
+ public static final int SIZE_CHAR = 2;
+
+ public static final byte TRUE = 1;
+
+ public static final byte FALSE = 0;
+
+ public static final byte NULL = 0;
+
+ public static final byte NOT_NULL = 1;
+
+ public static final byte BOOLEAN = 2;
+
+ public static final byte BYTE = 3;
+
+ public static final byte BYTES = 4;
+
+ public static final byte SHORT = 5;
+
+ public static final byte INT = 6;
+
+ public static final byte LONG = 7;
+
+ public static final byte FLOAT = 8;
+
+ public static final byte DOUBLE = 9;
+
+ public static final byte STRING = 10;
+
+ public static final byte CHAR = 11;
+}
Copied: branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/utils/UTF8Util.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/utils/UTF8Util.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/utils/UTF8Util.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-commons/src/main/java/org/hornetq/utils/UTF8Util.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,272 @@
+/*
+ * Copyright 2009 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.hornetq.utils;
+
+import java.lang.ref.SoftReference;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.logging.Logger;
+
+/**
+ *
+ * A UTF8Util
+ *
+ * This class will write UTFs directly to the ByteOutput (through the MessageBuffer interface)
+ *
+ * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ * Created Feb 20, 2009 1:37:18 PM
+ *
+ *
+ */
+public class UTF8Util
+{
+ static boolean optimizeStrings = true;
+
+ private static final Logger log = Logger.getLogger(UTF8Util.class);
+
+ private static final boolean isTrace = UTF8Util.log.isTraceEnabled();
+
+ private static ThreadLocal<SoftReference<StringUtilBuffer>> currenBuffer = new ThreadLocal<SoftReference<StringUtilBuffer>>();
+
+ public static void saveUTF(final HornetQBuffer out, final String str)
+ {
+ StringUtilBuffer buffer = UTF8Util.getThreadLocalBuffer();
+
+ if (str.length() > 0xffff)
+ {
+ throw new IllegalArgumentException("the specified string is too long (" + str.length() + ")");
+ }
+
+ final int len = UTF8Util.calculateUTFSize(str, buffer);
+
+ if (len > 0xffff)
+ {
+ throw new IllegalArgumentException("the encoded string is too long (" + len + ")");
+ }
+
+ out.writeShort((short)len);
+
+ if (len > buffer.byteBuffer.length)
+ {
+ buffer.resizeByteBuffer(len);
+ }
+
+ if (len == (long)str.length())
+ {
+ for (int byteLocation = 0; byteLocation < len; byteLocation++)
+ {
+ buffer.byteBuffer[byteLocation] = (byte)buffer.charBuffer[byteLocation];
+ }
+ out.writeBytes(buffer.byteBuffer, 0, len);
+ }
+ else
+ {
+ if (UTF8Util.isTrace)
+ {
+ // This message is too verbose for debug, that's why we are using trace here
+ UTF8Util.log.trace("Saving string with utfSize=" + len + " stringSize=" + str.length());
+ }
+
+ int stringLength = str.length();
+
+ int charCount = 0;
+
+ for (int i = 0; i < stringLength; i++)
+ {
+ char charAtPos = buffer.charBuffer[i];
+ if (charAtPos >= 1 && charAtPos < 0x7f)
+ {
+ buffer.byteBuffer[charCount++] = (byte)charAtPos;
+ }
+ else if (charAtPos >= 0x800)
+ {
+ buffer.byteBuffer[charCount++] = (byte)(0xE0 | charAtPos >> 12 & 0x0F);
+ buffer.byteBuffer[charCount++] = (byte)(0x80 | charAtPos >> 6 & 0x3F);
+ buffer.byteBuffer[charCount++] = (byte)(0x80 | charAtPos >> 0 & 0x3F);
+ }
+ else
+ {
+ buffer.byteBuffer[charCount++] = (byte)(0xC0 | charAtPos >> 6 & 0x1F);
+ buffer.byteBuffer[charCount++] = (byte)(0x80 | charAtPos >> 0 & 0x3F);
+
+ }
+ }
+ out.writeBytes(buffer.byteBuffer, 0, len);
+ }
+ }
+
+ public static String readUTF(final HornetQBuffer input)
+ {
+ StringUtilBuffer buffer = UTF8Util.getThreadLocalBuffer();
+
+ final int size = input.readUnsignedShort();
+
+ if (size > buffer.byteBuffer.length)
+ {
+ buffer.resizeByteBuffer(size);
+ }
+
+ if (size > buffer.charBuffer.length)
+ {
+ buffer.resizeCharBuffer(size);
+ }
+
+ if (UTF8Util.isTrace)
+ {
+ // This message is too verbose for debug, that's why we are using trace here
+ UTF8Util.log.trace("Reading string with utfSize=" + size);
+ }
+
+ int count = 0;
+ int byte1, byte2, byte3;
+ int charCount = 0;
+
+ input.readBytes(buffer.byteBuffer, 0, size);
+
+ while (count < size)
+ {
+ byte1 = buffer.byteBuffer[count++];
+
+ if (byte1 > 0 && byte1 <= 0x7F)
+ {
+ buffer.charBuffer[charCount++] = (char)byte1;
+ }
+ else
+ {
+ int c = byte1 & 0xff;
+ switch (c >> 4)
+ {
+ case 0xc:
+ case 0xd:
+ byte2 = buffer.byteBuffer[count++];
+ buffer.charBuffer[charCount++] = (char)((c & 0x1F) << 6 | byte2 & 0x3F);
+ break;
+ case 0xe:
+ byte2 = buffer.byteBuffer[count++];
+ byte3 = buffer.byteBuffer[count++];
+ buffer.charBuffer[charCount++] = (char)((c & 0x0F) << 12 | (byte2 & 0x3F) << 6 | (byte3 & 0x3F) << 0);
+ break;
+ }
+ }
+ }
+
+ return new String(buffer.charBuffer, 0, charCount);
+
+ }
+
+ private static StringUtilBuffer getThreadLocalBuffer()
+ {
+ SoftReference<StringUtilBuffer> softReference = UTF8Util.currenBuffer.get();
+ StringUtilBuffer value;
+ if (softReference == null)
+ {
+ value = new StringUtilBuffer();
+ softReference = new SoftReference<StringUtilBuffer>(value);
+ UTF8Util.currenBuffer.set(softReference);
+ }
+ else
+ {
+ value = softReference.get();
+ }
+
+ if (value == null)
+ {
+ value = new StringUtilBuffer();
+ softReference = new SoftReference<StringUtilBuffer>(value);
+ UTF8Util.currenBuffer.set(softReference);
+ }
+
+ return value;
+ }
+
+ public static void clearBuffer()
+ {
+ SoftReference<StringUtilBuffer> ref = UTF8Util.currenBuffer.get();
+ if (ref.get() != null)
+ {
+ ref.clear();
+ }
+ }
+
+ public static int calculateUTFSize(final String str, final StringUtilBuffer stringBuffer)
+ {
+ int calculatedLen = 0;
+
+ int stringLength = str.length();
+
+ if (stringLength > stringBuffer.charBuffer.length)
+ {
+ stringBuffer.resizeCharBuffer(stringLength);
+ }
+
+ str.getChars(0, stringLength, stringBuffer.charBuffer, 0);
+
+ for (int i = 0; i < stringLength; i++)
+ {
+ char c = stringBuffer.charBuffer[i];
+
+ if (c >= 1 && c < 0x7f)
+ {
+ calculatedLen++;
+ }
+ else if (c >= 0x800)
+ {
+ calculatedLen += 3;
+ }
+ else
+ {
+ calculatedLen += 2;
+ }
+ }
+ return calculatedLen;
+ }
+
+ private static class StringUtilBuffer
+ {
+
+ public char charBuffer[];
+
+ public byte byteBuffer[];
+
+ public void resizeCharBuffer(final int newSize)
+ {
+ if (newSize > charBuffer.length)
+ {
+ charBuffer = new char[newSize];
+ }
+ }
+
+ public void resizeByteBuffer(final int newSize)
+ {
+ if (newSize > byteBuffer.length)
+ {
+ byteBuffer = new byte[newSize];
+ }
+ }
+
+ public StringUtilBuffer()
+ {
+ this(1024, 1024);
+ }
+
+ public StringUtilBuffer(final int sizeChar, final int sizeByte)
+ {
+ charBuffer = new char[sizeChar];
+ byteBuffer = new byte[sizeByte];
+ }
+
+ }
+
+}
Modified: branches/HORNETQ-698_SplitJournal/hornetq-core/pom.xml
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-core/pom.xml 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-core/pom.xml 2011-05-25 17:30:36 UTC (rev 10727)
@@ -22,6 +22,11 @@
<artifactId>hornetq-journal</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-commons</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
<profiles>
Modified: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/XmlDeployer.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/XmlDeployer.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/XmlDeployer.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -271,12 +271,12 @@
public abstract void deploy(final Node node) throws Exception;
/**
- * Validate the DOM
+ * Validate the DOM
*/
public abstract void validate(final Node rootNode) throws Exception;
/**
- * undeploys an element
+ * Undeploys an element.
* @param node the element to undeploy
* @throws Exception .
*/
Copied: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/message/BodyEncoder.java (from rev 10726, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/message/BodyEncoder.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/message/BodyEncoder.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/message/BodyEncoder.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2009 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.hornetq.core.message;
+
+import java.nio.ByteBuffer;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.HornetQException;
+
+/**
+ * Class used to encode message body into buffers.
+ * <br>
+ * Used to send large streams over the wire
+ *
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ */
+public interface BodyEncoder
+{
+ /**
+ * This method must not be called directly by HornetQ clients.
+ */
+ void open() throws HornetQException;
+
+ /**
+ * This method must not be called directly by HornetQ clients.
+ */
+ void close() throws HornetQException;
+
+ /**
+ * This method must not be called directly by HornetQ clients.
+ */
+ int encode(ByteBuffer bufferRead) throws HornetQException;
+
+ /**
+ * This method must not be called directly by HornetQ clients.
+ */
+ int encode(HornetQBuffer bufferOut, int size) throws HornetQException;
+
+ /**
+ * This method must not be called directly by HornetQ clients.
+ */
+ long getLargeBodySize();
+}
Modified: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -518,7 +518,7 @@
getContext(syncNonTransactional));
}
- public void storeCursorAcknowledge(long queueID, PagePosition position) throws Exception
+ public void storeCursorAcknowledge(final long queueID, final PagePosition position) throws Exception
{
long ackID = idGenerator.generateID();
position.setRecordID(ackID);
@@ -639,7 +639,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#storeCursorAcknowledgeTransactional(long, long, org.hornetq.core.paging.cursor.PagePosition)
*/
- public void storeCursorAcknowledgeTransactional(long txID, long queueID, PagePosition position) throws Exception
+ public void storeCursorAcknowledgeTransactional(final long txID, final long queueID, final PagePosition position) throws Exception
{
long ackID = idGenerator.generateID();
position.setRecordID(ackID);
@@ -652,7 +652,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#deleteCursorAcknowledgeTransactional(long, long)
*/
- public void deleteCursorAcknowledgeTransactional(long txID, long ackID) throws Exception
+ public void deleteCursorAcknowledgeTransactional(final long txID, final long ackID) throws Exception
{
messageJournal.appendDeleteRecordTransactional(txID, ackID);
}
@@ -767,7 +767,7 @@
}
- public void storeAddressSetting(PersistedAddressSetting addressSetting) throws Exception
+ public void storeAddressSetting(final PersistedAddressSetting addressSetting) throws Exception
{
deleteAddressSetting(addressSetting.getAddressMatch());
long id = idGenerator.generateID();
@@ -796,7 +796,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#storeSecurityRoles(org.hornetq.core.persistconfig.PersistedRoles)
*/
- public void storeSecurityRoles(PersistedRoles persistedRoles) throws Exception
+ public void storeSecurityRoles(final PersistedRoles persistedRoles) throws Exception
{
deleteSecurityRoles(persistedRoles.getAddressMatch());
@@ -806,7 +806,7 @@
mapPersistedRoles.put(persistedRoles.getAddressMatch(), persistedRoles);
}
- public void deleteAddressSetting(SimpleString addressMatch) throws Exception
+ public void deleteAddressSetting(final SimpleString addressMatch) throws Exception
{
PersistedAddressSetting oldSetting = mapPersistedAddressSettings.remove(addressMatch);
if (oldSetting != null)
@@ -816,7 +816,7 @@
}
- public void deleteSecurityRoles(SimpleString addressMatch) throws Exception
+ public void deleteSecurityRoles(final SimpleString addressMatch) throws Exception
{
PersistedRoles oldRoles = mapPersistedRoles.remove(addressMatch);
if (oldRoles != null)
@@ -829,7 +829,7 @@
final PagingManager pagingManager,
final ResourceManager resourceManager,
final Map<Long, Queue> queues,
- Map<Long, QueueBindingInfo> queueInfos,
+ final Map<Long, QueueBindingInfo> queueInfos,
final Map<SimpleString, List<Pair<byte[], Long>>> duplicateIDMap) throws Exception
{
List<RecordInfo> records = new ArrayList<RecordInfo>();
@@ -1309,7 +1309,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#storePageCounterAdd(long, long, int)
*/
- public long storePageCounterInc(long txID, long queueID, int value) throws Exception
+ public long storePageCounterInc(final long txID, final long queueID, final int value) throws Exception
{
long recordID = idGenerator.generateID();
messageJournal.appendAddRecordTransactional(txID,
@@ -1322,7 +1322,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#storePageCounterAdd(long, long, int)
*/
- public long storePageCounterInc(long queueID, int value) throws Exception
+ public long storePageCounterInc(final long queueID, final int value) throws Exception
{
long recordID = idGenerator.generateID();
messageJournal.appendAddRecord(recordID,
@@ -1336,7 +1336,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#storePageCounter(long, long, long)
*/
- public long storePageCounter(long txID, long queueID, long value) throws Exception
+ public long storePageCounter(final long txID, final long queueID, final long value) throws Exception
{
long recordID = idGenerator.generateID();
messageJournal.appendAddRecordTransactional(txID,
@@ -1349,7 +1349,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#deleteIncrementRecord(long, long)
*/
- public void deleteIncrementRecord(long txID, long recordID) throws Exception
+ public void deleteIncrementRecord(final long txID, final long recordID) throws Exception
{
messageJournal.appendDeleteRecordTransactional(txID, recordID);
}
@@ -1357,7 +1357,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#deletePageCounter(long, long)
*/
- public void deletePageCounter(long txID, long recordID) throws Exception
+ public void deletePageCounter(final long txID, final long recordID) throws Exception
{
messageJournal.appendDeleteRecordTransactional(txID, recordID);
}
@@ -2425,19 +2425,19 @@
public PageUpdateTXEncoding(final long pageTX, final int records)
{
this.pageTX = pageTX;
- this.recods = records;
+ recods = records;
}
- public void decode(HornetQBuffer buffer)
+ public void decode(final HornetQBuffer buffer)
{
- this.pageTX = buffer.readLong();
- this.recods = buffer.readInt();
+ pageTX = buffer.readLong();
+ recods = buffer.readInt();
}
/* (non-Javadoc)
* @see org.hornetq.core.journal.EncodingSupport#encode(org.hornetq.api.core.HornetQBuffer)
*/
- public void encode(HornetQBuffer buffer)
+ public void encode(final HornetQBuffer buffer)
{
buffer.writeLong(pageTX);
buffer.writeInt(recods);
@@ -2621,7 +2621,7 @@
}
- PageCountRecord(long queueID, long value)
+ PageCountRecord(final long queueID, final long value)
{
this.queueID = queueID;
this.value = value;
@@ -2642,7 +2642,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.journal.EncodingSupport#encode(org.hornetq.api.core.HornetQBuffer)
*/
- public void encode(HornetQBuffer buffer)
+ public void encode(final HornetQBuffer buffer)
{
buffer.writeLong(queueID);
buffer.writeLong(value);
@@ -2651,7 +2651,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.journal.EncodingSupport#decode(org.hornetq.api.core.HornetQBuffer)
*/
- public void decode(HornetQBuffer buffer)
+ public void decode(final HornetQBuffer buffer)
{
queueID = buffer.readLong();
value = buffer.readLong();
@@ -2676,7 +2676,7 @@
}
- PageCountRecordInc(long queueID, int value)
+ PageCountRecordInc(final long queueID, final int value)
{
this.queueID = queueID;
this.value = value;
@@ -2697,7 +2697,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.journal.EncodingSupport#encode(org.hornetq.api.core.HornetQBuffer)
*/
- public void encode(HornetQBuffer buffer)
+ public void encode(final HornetQBuffer buffer)
{
buffer.writeLong(queueID);
buffer.writeInt(value);
@@ -2706,7 +2706,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.journal.EncodingSupport#decode(org.hornetq.api.core.HornetQBuffer)
*/
- public void decode(HornetQBuffer buffer)
+ public void decode(final HornetQBuffer buffer)
{
queueID = buffer.readLong();
value = buffer.readInt();
@@ -2738,7 +2738,7 @@
public CursorAckRecordEncoding()
{
- this.position = new PagePositionImpl();
+ position = new PagePositionImpl();
}
/* (non-Javadoc)
@@ -2765,7 +2765,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.journal.EncodingSupport#encode(org.hornetq.api.core.HornetQBuffer)
*/
- public void encode(HornetQBuffer buffer)
+ public void encode(final HornetQBuffer buffer)
{
buffer.writeLong(queueID);
buffer.writeLong(position.getPageNr());
@@ -2775,12 +2775,12 @@
/* (non-Javadoc)
* @see org.hornetq.core.journal.EncodingSupport#decode(org.hornetq.api.core.HornetQBuffer)
*/
- public void decode(HornetQBuffer buffer)
+ public void decode(final HornetQBuffer buffer)
{
queueID = buffer.readLong();
long pageNR = buffer.readLong();
int messageNR = buffer.readInt();
- this.position = new PagePositionImpl(pageNR, messageNR);
+ position = new PagePositionImpl(pageNR, messageNR);
}
}
@@ -2821,7 +2821,7 @@
}
- private static String describeRecord(RecordInfo info)
+ private static String describeRecord(final RecordInfo info)
{
return "recordID=" + info.id +
";userRecordType=" +
@@ -2832,14 +2832,14 @@
newObjectEncoding(info);
}
- private static String describeRecord(RecordInfo info, Object o)
+ private static String describeRecord(final RecordInfo info, final Object o)
{
return "recordID=" + info.id + ";userRecordType=" + info.userRecordType + ";isUpdate=" + info.isUpdate + ";" + o;
}
// Encoding functions for binding Journal
- private static Object newObjectEncoding(RecordInfo info)
+ private static Object newObjectEncoding(final RecordInfo info)
{
HornetQBuffer buffer = HornetQBuffers.wrappedBuffer(info.data);
long id = info.id;
@@ -2985,7 +2985,7 @@
{
RefEncoding refEncoding;
- public ReferenceDescribe(RefEncoding refEncoding)
+ public ReferenceDescribe(final RefEncoding refEncoding)
{
this.refEncoding = refEncoding;
}
@@ -3001,7 +3001,7 @@
{
RefEncoding refEncoding;
- public AckDescribe(RefEncoding refEncoding)
+ public AckDescribe(final RefEncoding refEncoding)
{
this.refEncoding = refEncoding;
}
@@ -3015,7 +3015,7 @@
private static class MessageDescribe
{
- public MessageDescribe(Message msg)
+ public MessageDescribe(final Message msg)
{
this.msg = msg;
}
@@ -3061,7 +3061,7 @@
* @param buffer
* @return
*/
- protected static PersistedRoles newSecurityRecord(long id, HornetQBuffer buffer)
+ protected static PersistedRoles newSecurityRecord(final long id, final HornetQBuffer buffer)
{
PersistedRoles roles = new PersistedRoles();
roles.decode(buffer);
@@ -3074,7 +3074,7 @@
* @param buffer
* @return
*/
- protected static PersistedAddressSetting newAddressEncoding(long id, HornetQBuffer buffer)
+ protected static PersistedAddressSetting newAddressEncoding(final long id, final HornetQBuffer buffer)
{
PersistedAddressSetting setting = new PersistedAddressSetting();
setting.decode(buffer);
@@ -3087,7 +3087,7 @@
* @param buffer
* @return
*/
- protected static GroupingEncoding newGroupEncoding(long id, HornetQBuffer buffer)
+ protected static GroupingEncoding newGroupEncoding(final long id, final HornetQBuffer buffer)
{
GroupingEncoding encoding = new GroupingEncoding();
encoding.decode(buffer);
@@ -3100,7 +3100,7 @@
* @param buffer
* @return
*/
- protected static PersistentQueueBindingEncoding newBindingEncoding(long id, HornetQBuffer buffer)
+ protected static PersistentQueueBindingEncoding newBindingEncoding(final long id, final HornetQBuffer buffer)
{
PersistentQueueBindingEncoding bindingEncoding = new PersistentQueueBindingEncoding();
@@ -3120,7 +3120,7 @@
* @param journal
* @throws Exception
*/
- protected static void describeJournal(SequentialFileFactory fileFactory, JournalImpl journal) throws Exception
+ protected static void describeJournal(final SequentialFileFactory fileFactory, final JournalImpl journal) throws Exception
{
List<JournalFile> files = journal.orderFiles();
@@ -3206,7 +3206,7 @@
journal.load(records, preparedTransactions, new TransactionFailureCallback()
{
- public void failedTransaction(long transactionID, List<RecordInfo> records, List<RecordInfo> recordsToDelete)
+ public void failedTransaction(final long transactionID, final List<RecordInfo> records, final List<RecordInfo> recordsToDelete)
{
bufferFailingTransactions.append("Transaction " + transactionID + " failed with these records:\n");
for (RecordInfo info : records)
Modified: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicatedJournal.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicatedJournal.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicatedJournal.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -28,9 +28,10 @@
import org.hornetq.core.persistence.OperationContext;
import org.hornetq.core.persistence.impl.journal.JournalStorageManager;
import org.hornetq.core.replication.ReplicationManager;
+import org.hornetq.core.server.HornetQComponent;
/**
- * Used by the {@link JournalStorageManager} to replicate journal calls.
+ * Used by the {@link JournalStorageManager} to replicate journal calls.
*
* @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
*
@@ -193,7 +194,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.journal.Journal#appendCommitRecord(long, boolean, org.hornetq.core.journal.IOCompletion, boolean)
*/
- public void appendCommitRecord(long txID, boolean sync, IOCompletion callback, boolean lineUpContext) throws Exception
+ public void appendCommitRecord(final long txID, final boolean sync, final IOCompletion callback, final boolean lineUpContext) throws Exception
{
if (ReplicatedJournal.trace)
{
@@ -201,10 +202,10 @@
}
replicationManager.appendCommitRecord(journalID, txID, lineUpContext);
localJournal.appendCommitRecord(txID, sync, callback, lineUpContext);
-
+
}
-
+
/**
* @param id
* @param sync
@@ -563,7 +564,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.journal.Journal#lineUpContex(org.hornetq.core.journal.IOCompletion)
*/
- public void lineUpContex(IOCompletion callback)
+ public void lineUpContex(final IOCompletion callback)
{
((OperationContext)callback).replicationLineUp();
localJournal.lineUpContex(callback);
Modified: branches/HORNETQ-698_SplitJournal/hornetq-journal/pom.xml
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/pom.xml 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/pom.xml 2011-05-25 17:30:36 UTC (rev 10727)
@@ -17,6 +17,12 @@
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-commons</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<profiles>
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/HornetQBuffer.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/HornetQBuffer.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/HornetQBuffer.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,1086 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.api.core;
-
-import java.nio.ByteBuffer;
-
-import org.jboss.netty.buffer.ChannelBuffer;
-
-/**
- *
- * A HornetQBuffer wraps a Netty's ChannelBuffer and is used throughout HornetQ code base.
- *
- * Much of it derived from Netty ChannelBuffer by Trustin Lee
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @see HornetQBuffers
- *
- */
-public interface HornetQBuffer
-{
- /**
- * Returns the underlying Netty's ChannelBuffer
- *
- * @return the underlying Netty's ChannelBuffer
- */
- ChannelBuffer channelBuffer();
-
- /**
- * Returns the number of bytes this buffer can contain.
- */
- int capacity();
-
- /**
- * Returns the {@code readerIndex} of this buffer.
- */
- int readerIndex();
-
- /**
- * Sets the {@code readerIndex} of this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code readerIndex} is
- * less than {@code 0} or
- * greater than {@code this.writerIndex}
- */
- void readerIndex(int readerIndex);
-
- /**
- * Returns the {@code writerIndex} of this buffer.
- */
- int writerIndex();
-
- /**
- * Sets the {@code writerIndex} of this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code writerIndex} is
- * less than {@code this.readerIndex} or
- * greater than {@code this.capacity}
- */
- void writerIndex(int writerIndex);
-
- /**
- * Sets the {@code readerIndex} and {@code writerIndex} of this buffer
- * in one shot. This method is useful when you have to worry about the
- * invocation order of {@link #readerIndex(int)} and {@link #writerIndex(int)}
- * methods. For example, the following code will fail:
- *
- * <pre>
- * // Create a buffer whose readerIndex, writerIndex and capacity are
- * // 0, 0 and 8 respectively.
- * ChannelBuffer buf = ChannelBuffers.buffer(8);
- *
- * // IndexOutOfBoundsException is thrown because the specified
- * // readerIndex (2) cannot be greater than the current writerIndex (0).
- * buf.readerIndex(2);
- * buf.writerIndex(4);
- * </pre>
- *
- * The following code will also fail:
- *
- * <pre>
- * // Create a buffer whose readerIndex, writerIndex and capacity are
- * // 0, 8 and 8 respectively.
- * ChannelBuffer buf = ChannelBuffers.wrappedBuffer(new byte[8]);
- *
- * // readerIndex becomes 8.
- * buf.readLong();
- *
- * // IndexOutOfBoundsException is thrown because the specified
- * // writerIndex (4) cannot be less than the current readerIndex (8).
- * buf.writerIndex(4);
- * buf.readerIndex(2);
- * </pre>
- *
- * By contrast, {@link #setIndex(int, int)} guarantees that it never
- * throws an {@link IndexOutOfBoundsException} as long as the specified
- * indexes meet basic constraints, regardless what the current index
- * values of the buffer are:
- *
- * <pre>
- * // No matter what the current state of the buffer is, the following
- * // call always succeeds as long as the capacity of the buffer is not
- * // less than 4.
- * buf.setIndex(2, 4);
- * </pre>
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code readerIndex} is less than 0,
- * if the specified {@code writerIndex} is less than the specified
- * {@code readerIndex} or if the specified {@code writerIndex} is
- * greater than {@code this.capacity}
- */
- void setIndex(int readerIndex, int writerIndex);
-
- /**
- * Returns the number of readable bytes which is equal to
- * {@code (this.writerIndex - this.readerIndex)}.
- */
- int readableBytes();
-
- /**
- * Returns the number of writable bytes which is equal to
- * {@code (this.capacity - this.writerIndex)}.
- */
- int writableBytes();
-
- /**
- * Returns {@code true}
- * if and only if {@code (this.writerIndex - this.readerIndex)} is greater
- * than {@code 0}.
- */
- boolean readable();
-
- /**
- * Returns {@code true}
- * if and only if {@code (this.capacity - this.writerIndex)} is greater
- * than {@code 0}.
- */
- boolean writable();
-
- /**
- * Sets the {@code readerIndex} and {@code writerIndex} of this buffer to
- * {@code 0}.
- * This method is identical to {@link #setIndex(int, int) setIndex(0, 0)}.
- * <p>
- * Please note that the behavior of this method is different
- * from that of NIO buffer, which sets the {@code limit} to
- * the {@code capacity} of the buffer.
- */
- void clear();
-
- /**
- * Marks the current {@code readerIndex} in this buffer. You can
- * reposition the current {@code readerIndex} to the marked
- * {@code readerIndex} by calling {@link #resetReaderIndex()}.
- * The initial value of the marked {@code readerIndex} is {@code 0}.
- */
- void markReaderIndex();
-
- /**
- * Repositions the current {@code readerIndex} to the marked
- * {@code readerIndex} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the current {@code writerIndex} is less than the marked
- * {@code readerIndex}
- */
- void resetReaderIndex();
-
- /**
- * Marks the current {@code writerIndex} in this buffer. You can
- * reposition the current {@code writerIndex} to the marked
- * {@code writerIndex} by calling {@link #resetWriterIndex()}.
- * The initial value of the marked {@code writerIndex} is {@code 0}.
- */
- void markWriterIndex();
-
- /**
- * Repositions the current {@code writerIndex} to the marked
- * {@code writerIndex} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the current {@code readerIndex} is greater than the marked
- * {@code writerIndex}
- */
- void resetWriterIndex();
-
- /**
- * Discards the bytes between the 0th index and {@code readerIndex}.
- * It moves the bytes between {@code readerIndex} and {@code writerIndex}
- * to the 0th index, and sets {@code readerIndex} and {@code writerIndex}
- * to {@code 0} and {@code oldWriterIndex - oldReaderIndex} respectively.
- * <p>
- * Please refer to the class documentation for more detailed explanation.
- */
- void discardReadBytes();
-
- /**
- * Gets a byte at the specified absolute {@code index} in this buffer.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 1} is greater than {@code this.capacity}
- */
- byte getByte(int index);
-
- /**
- * Gets an unsigned byte at the specified absolute {@code index} in this
- * buffer. This method does not modify {@code readerIndex} or
- * {@code writerIndex} of this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 1} is greater than {@code this.capacity}
- */
- short getUnsignedByte(int index);
-
- /**
- * Gets a 16-bit short integer at the specified absolute {@code index} in
- * this buffer. This method does not modify {@code readerIndex} or
- * {@code writerIndex} of this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 2} is greater than {@code this.capacity}
- */
- short getShort(int index);
-
- /**
- * Gets an unsigned 16-bit short integer at the specified absolute
- * {@code index} in this buffer. This method does not modify
- * {@code readerIndex} or {@code writerIndex} of this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 2} is greater than {@code this.capacity}
- */
- int getUnsignedShort(int index);
-
- /**
- * Gets a 32-bit integer at the specified absolute {@code index} in
- * this buffer. This method does not modify {@code readerIndex} or
- * {@code writerIndex} of this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 4} is greater than {@code this.capacity}
- */
- int getInt(int index);
-
- /**
- * Gets an unsigned 32-bit integer at the specified absolute {@code index}
- * in this buffer. This method does not modify {@code readerIndex} or
- * {@code writerIndex} of this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 4} is greater than {@code this.capacity}
- */
- long getUnsignedInt(int index);
-
- /**
- * Gets a 64-bit long integer at the specified absolute {@code index} in
- * this buffer. This method does not modify {@code readerIndex} or
- * {@code writerIndex} of this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 8} is greater than {@code this.capacity}
- */
- long getLong(int index);
-
- /**
- * Transfers this buffer's data to the specified destination starting at
- * the specified absolute {@code index} until the destination becomes
- * non-writable. This method is basically same with
- * {@link #getBytes(int, HornetQBuffer, int, int)}, except that this
- * method increases the {@code writerIndex} of the destination by the
- * number of the transferred bytes while
- * {@link #getBytes(int, HornetQBuffer, int, int)} does not.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * the source buffer (i.e. {@code this}).
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * if {@code index + dst.writableBytes} is greater than
- * {@code this.capacity}
- */
- void getBytes(int index, HornetQBuffer dst);
-
- /**
- * Transfers this buffer's data to the specified destination starting at
- * the specified absolute {@code index}. This method is basically same
- * with {@link #getBytes(int, HornetQBuffer, int, int)}, except that this
- * method increases the {@code writerIndex} of the destination by the
- * number of the transferred bytes while
- * {@link #getBytes(int, HornetQBuffer, int, int)} does not.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * the source buffer (i.e. {@code this}).
- *
- * @param length the number of bytes to transfer
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0},
- * if {@code index + length} is greater than
- * {@code this.capacity}, or
- * if {@code length} is greater than {@code dst.writableBytes}
- */
- void getBytes(int index, HornetQBuffer dst, int length);
-
- /**
- * Transfers this buffer's data to the specified destination starting at
- * the specified absolute {@code index}.
- * This method does not modify {@code readerIndex} or {@code writerIndex}
- * of both the source (i.e. {@code this}) and the destination.
- *
- * @param dstIndex the first index of the destination
- * @param length the number of bytes to transfer
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0},
- * if the specified {@code dstIndex} is less than {@code 0},
- * if {@code index + length} is greater than
- * {@code this.capacity}, or
- * if {@code dstIndex + length} is greater than
- * {@code dst.capacity}
- */
- void getBytes(int index, HornetQBuffer dst, int dstIndex, int length);
-
- /**
- * Transfers this buffer's data to the specified destination starting at
- * the specified absolute {@code index}.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * if {@code index + dst.length} is greater than
- * {@code this.capacity}
- */
- void getBytes(int index, byte[] dst);
-
- /**
- * Transfers this buffer's data to the specified destination starting at
- * the specified absolute {@code index}.
- * This method does not modify {@code readerIndex} or {@code writerIndex}
- * of this buffer.
- *
- * @param dstIndex the first index of the destination
- * @param length the number of bytes to transfer
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0},
- * if the specified {@code dstIndex} is less than {@code 0},
- * if {@code index + length} is greater than
- * {@code this.capacity}, or
- * if {@code dstIndex + length} is greater than
- * {@code dst.length}
- */
- void getBytes(int index, byte[] dst, int dstIndex, int length);
-
- /**
- * Transfers this buffer's data to the specified destination starting at
- * the specified absolute {@code index} until the destination's position
- * reaches its limit.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer while the destination's {@code position} will be increased.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * if {@code index + dst.remaining()} is greater than
- * {@code this.capacity}
- */
- void getBytes(int index, ByteBuffer dst);
-
- /**
- * Gets a char at the specified absolute {@code index} in
- * this buffer. This method does not modify {@code readerIndex} or
- * {@code writerIndex} of this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 2} is greater than {@code this.capacity}
- */
- char getChar(int index);
-
- /**
- * Gets a float at the specified absolute {@code index} in
- * this buffer. This method does not modify {@code readerIndex} or
- * {@code writerIndex} of this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 4} is greater than {@code this.capacity}
- */
- float getFloat(int index);
-
- /**
- * Gets a double at the specified absolute {@code index} in
- * this buffer. This method does not modify {@code readerIndex} or
- * {@code writerIndex} of this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 8} is greater than {@code this.capacity}
- */
- double getDouble(int index);
-
- /**
- * Sets the specified byte at the specified absolute {@code index} in this
- * buffer.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 1} is greater than {@code this.capacity}
- */
- void setByte(int index, byte value);
-
- /**
- * Sets the specified 16-bit short integer at the specified absolute
- * {@code index} in this buffer.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 2} is greater than {@code this.capacity}
- */
- void setShort(int index, short value);
-
- /**
- * Sets the specified 32-bit integer at the specified absolute
- * {@code index} in this buffer.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 4} is greater than {@code this.capacity}
- */
- void setInt(int index, int value);
-
- /**
- * Sets the specified 64-bit long integer at the specified absolute
- * {@code index} in this buffer.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 8} is greater than {@code this.capacity}
- */
- void setLong(int index, long value);
-
- /**
- * Transfers the specified source buffer's data to this buffer starting at
- * the specified absolute {@code index} until the destination becomes
- * unreadable. This method is basically same with
- * {@link #setBytes(int, HornetQBuffer, int, int)}, except that this
- * method increases the {@code readerIndex} of the source buffer by
- * the number of the transferred bytes while
- * {@link #getBytes(int, HornetQBuffer, int, int)} does not.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * the source buffer (i.e. {@code this}).
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * if {@code index + src.readableBytes} is greater than
- * {@code this.capacity}
- */
- void setBytes(int index, HornetQBuffer src);
-
- /**
- * Transfers the specified source buffer's data to this buffer starting at
- * the specified absolute {@code index}. This method is basically same
- * with {@link #setBytes(int, HornetQBuffer, int, int)}, except that this
- * method increases the {@code readerIndex} of the source buffer by
- * the number of the transferred bytes while
- * {@link #getBytes(int, HornetQBuffer, int, int)} does not.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * the source buffer (i.e. {@code this}).
- *
- * @param length the number of bytes to transfer
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0},
- * if {@code index + length} is greater than
- * {@code this.capacity}, or
- * if {@code length} is greater than {@code src.readableBytes}
- */
- void setBytes(int index, HornetQBuffer src, int length);
-
- /**
- * Transfers the specified source buffer's data to this buffer starting at
- * the specified absolute {@code index}.
- * This method does not modify {@code readerIndex} or {@code writerIndex}
- * of both the source (i.e. {@code this}) and the destination.
- *
- * @param srcIndex the first index of the source
- * @param length the number of bytes to transfer
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0},
- * if the specified {@code srcIndex} is less than {@code 0},
- * if {@code index + length} is greater than
- * {@code this.capacity}, or
- * if {@code srcIndex + length} is greater than
- * {@code src.capacity}
- */
- void setBytes(int index, HornetQBuffer src, int srcIndex, int length);
-
- /**
- * Transfers the specified source array's data to this buffer starting at
- * the specified absolute {@code index}.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * if {@code index + src.length} is greater than
- * {@code this.capacity}
- */
- void setBytes(int index, byte[] src);
-
- /**
- * Transfers the specified source array's data to this buffer starting at
- * the specified absolute {@code index}.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0},
- * if the specified {@code srcIndex} is less than {@code 0},
- * if {@code index + length} is greater than
- * {@code this.capacity}, or
- * if {@code srcIndex + length} is greater than {@code src.length}
- */
- void setBytes(int index, byte[] src, int srcIndex, int length);
-
- /**
- * Transfers the specified source buffer's data to this buffer starting at
- * the specified absolute {@code index} until the source buffer's position
- * reaches its limit.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * if {@code index + src.remaining()} is greater than
- * {@code this.capacity}
- */
- void setBytes(int index, ByteBuffer src);
-
- /**
- * Sets the specified char at the specified absolute
- * {@code index} in this buffer.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 2} is greater than {@code this.capacity}
- */
- void setChar(int index, char value);
-
- /**
- * Sets the specified float at the specified absolute
- * {@code index} in this buffer.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 4} is greater than {@code this.capacity}
- */
- void setFloat(int index, float value);
-
- /**
- * Sets the specified double at the specified absolute
- * {@code index} in this buffer.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code index} is less than {@code 0} or
- * {@code index + 8} is greater than {@code this.capacity}
- */
- void setDouble(int index, double value);
-
- /**
- * Gets a byte at the current {@code readerIndex} and increases
- * the {@code readerIndex} by {@code 1} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.readableBytes} is less than {@code 1}
- */
- byte readByte();
-
- /**
- * Gets an unsigned byte at the current {@code readerIndex} and increases
- * the {@code readerIndex} by {@code 1} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.readableBytes} is less than {@code 1}
- */
- short readUnsignedByte();
-
- /**
- * Gets a 16-bit short integer at the current {@code readerIndex}
- * and increases the {@code readerIndex} by {@code 2} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.readableBytes} is less than {@code 2}
- */
- short readShort();
-
- /**
- * Gets an unsigned 16-bit short integer at the current {@code readerIndex}
- * and increases the {@code readerIndex} by {@code 2} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.readableBytes} is less than {@code 2}
- */
- int readUnsignedShort();
-
- /**
- * Gets a 32-bit integer at the current {@code readerIndex}
- * and increases the {@code readerIndex} by {@code 4} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.readableBytes} is less than {@code 4}
- */
- int readInt();
-
- /**
- * Gets an unsigned 32-bit integer at the current {@code readerIndex}
- * and increases the {@code readerIndex} by {@code 4} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.readableBytes} is less than {@code 4}
- */
- long readUnsignedInt();
-
- /**
- * Gets a 64-bit integer at the current {@code readerIndex}
- * and increases the {@code readerIndex} by {@code 8} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.readableBytes} is less than {@code 8}
- */
- long readLong();
-
- /**
- * Gets a char at the current {@code readerIndex}
- * and increases the {@code readerIndex} by {@code 2} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.readableBytes} is less than {@code 2}
- */
- char readChar();
-
- /**
- * Gets a float at the current {@code readerIndex}
- * and increases the {@code readerIndex} by {@code 4} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.readableBytes} is less than {@code 4}
- */
- float readFloat();
-
- /**
- * Gets a double at the current {@code readerIndex}
- * and increases the {@code readerIndex} by {@code 8} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.readableBytes} is less than {@code 8}
- */
- double readDouble();
-
- /**
- * Gets a boolean at the current {@code readerIndex}
- * and increases the {@code readerIndex} by {@code 1} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.readableBytes} is less than {@code 1}
- */
- boolean readBoolean();
-
- /**
- * Gets a SimpleString (potentially {@code null}) at the current {@code readerIndex}
- */
- SimpleString readNullableSimpleString();
-
- /**
- * Gets a String (potentially {@code null}) at the current {@code readerIndex}
- */
- String readNullableString();
-
- /**
- * Gets a non-null SimpleString at the current {@code readerIndex}
- */
- SimpleString readSimpleString();
-
- /**
- * Gets a non-null String at the current {@code readerIndex}
- */
- String readString();
-
- /**
- * Gets a UTF-8 String at the current {@code readerIndex}
- */
- String readUTF();
-
- /**
- * Transfers this buffer's data to a newly created buffer starting at
- * the current {@code readerIndex} and increases the {@code readerIndex}
- * by the number of the transferred bytes (= {@code length}).
- * The returned buffer's {@code readerIndex} and {@code writerIndex} are
- * {@code 0} and {@code length} respectively.
- *
- * @param length the number of bytes to transfer
- *
- * @return the newly created buffer which contains the transferred bytes
- *
- * @throws IndexOutOfBoundsException
- * if {@code length} is greater than {@code this.readableBytes}
- */
- HornetQBuffer readBytes(int length);
-
- /**
- * Returns a new slice of this buffer's sub-region starting at the current
- * {@code readerIndex} and increases the {@code readerIndex} by the size
- * of the new slice (= {@code length}).
- *
- * @param length the size of the new slice
- *
- * @return the newly created slice
- *
- * @throws IndexOutOfBoundsException
- * if {@code length} is greater than {@code this.readableBytes}
- */
- HornetQBuffer readSlice(int length);
-
- /**
- * Transfers this buffer's data to the specified destination starting at
- * the current {@code readerIndex} until the destination becomes
- * non-writable, and increases the {@code readerIndex} by the number of the
- * transferred bytes. This method is basically same with
- * {@link #readBytes(HornetQBuffer, int, int)}, except that this method
- * increases the {@code writerIndex} of the destination by the number of
- * the transferred bytes while {@link #readBytes(HornetQBuffer, int, int)}
- * does not.
- *
- * @throws IndexOutOfBoundsException
- * if {@code dst.writableBytes} is greater than
- * {@code this.readableBytes}
- */
- void readBytes(HornetQBuffer dst);
-
- /**
- * Transfers this buffer's data to the specified destination starting at
- * the current {@code readerIndex} and increases the {@code readerIndex}
- * by the number of the transferred bytes (= {@code length}). This method
- * is basically same with {@link #readBytes(HornetQBuffer, int, int)},
- * except that this method increases the {@code writerIndex} of the
- * destination by the number of the transferred bytes (= {@code length})
- * while {@link #readBytes(HornetQBuffer, int, int)} does not.
- *
- * @throws IndexOutOfBoundsException
- * if {@code length} is greater than {@code this.readableBytes} or
- * if {@code length} is greater than {@code dst.writableBytes}
- */
- void readBytes(HornetQBuffer dst, int length);
-
- /**
- * Transfers this buffer's data to the specified destination starting at
- * the current {@code readerIndex} and increases the {@code readerIndex}
- * by the number of the transferred bytes (= {@code length}).
- *
- * @param dstIndex the first index of the destination
- * @param length the number of bytes to transfer
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code dstIndex} is less than {@code 0},
- * if {@code length} is greater than {@code this.readableBytes}, or
- * if {@code dstIndex + length} is greater than
- * {@code dst.capacity}
- */
- void readBytes(HornetQBuffer dst, int dstIndex, int length);
-
- /**
- * Transfers this buffer's data to the specified destination starting at
- * the current {@code readerIndex} and increases the {@code readerIndex}
- * by the number of the transferred bytes (= {@code dst.length}).
- *
- * @throws IndexOutOfBoundsException
- * if {@code dst.length} is greater than {@code this.readableBytes}
- */
- void readBytes(byte[] dst);
-
- /**
- * Transfers this buffer's data to the specified destination starting at
- * the current {@code readerIndex} and increases the {@code readerIndex}
- * by the number of the transferred bytes (= {@code length}).
- *
- * @param dstIndex the first index of the destination
- * @param length the number of bytes to transfer
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code dstIndex} is less than {@code 0},
- * if {@code length} is greater than {@code this.readableBytes}, or
- * if {@code dstIndex + length} is greater than {@code dst.length}
- */
- void readBytes(byte[] dst, int dstIndex, int length);
-
- /**
- * Transfers this buffer's data to the specified destination starting at
- * the current {@code readerIndex} until the destination's position
- * reaches its limit, and increases the {@code readerIndex} by the
- * number of the transferred bytes.
- *
- * @throws IndexOutOfBoundsException
- * if {@code dst.remaining()} is greater than
- * {@code this.readableBytes}
- */
- void readBytes(ByteBuffer dst);
-
- /**
- * Increases the current {@code readerIndex} by the specified
- * {@code length} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code length} is greater than {@code this.readableBytes}
- */
- void skipBytes(int length);
-
- /**
- * Sets the specified byte at the current {@code writerIndex}
- * and increases the {@code writerIndex} by {@code 1} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.writableBytes} is less than {@code 1}
- */
- void writeByte(byte value);
-
- /**
- * Sets the specified 16-bit short integer at the current
- * {@code writerIndex} and increases the {@code writerIndex} by {@code 2}
- * in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.writableBytes} is less than {@code 2}
- */
- void writeShort(short value);
-
- /**
- * Sets the specified 32-bit integer at the current {@code writerIndex}
- * and increases the {@code writerIndex} by {@code 4} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.writableBytes} is less than {@code 4}
- */
- void writeInt(int value);
-
- /**
- * Sets the specified 64-bit long integer at the current
- * {@code writerIndex} and increases the {@code writerIndex} by {@code 8}
- * in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.writableBytes} is less than {@code 8}
- */
- void writeLong(long value);
-
- /**
- * Sets the specified char at the current {@code writerIndex}
- * and increases the {@code writerIndex} by {@code 2} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.writableBytes} is less than {@code 2}
- */
- void writeChar(char chr);
-
- /**
- * Sets the specified float at the current {@code writerIndex}
- * and increases the {@code writerIndex} by {@code 4} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.writableBytes} is less than {@code 4}
- */
- void writeFloat(float value);
-
- /**
- * Sets the specified double at the current {@code writerIndex}
- * and increases the {@code writerIndex} by {@code 8} in this buffer.
- *
- * @throws IndexOutOfBoundsException
- * if {@code this.writableBytes} is less than {@code 8}
- */
- void writeDouble(double value);
-
- /**
- * Sets the specified boolean at the current {@code writerIndex}
- */
- void writeBoolean(boolean val);
-
- /**
- * Sets the specified SimpleString (potentially {@code null}) at the current {@code writerIndex}
- */
- void writeNullableSimpleString(SimpleString val);
-
- /**
- * Sets the specified String (potentially {@code null}) at the current {@code writerIndex}
- */
- void writeNullableString(String val);
-
- /**
- * Sets the specified non-null SimpleString at the current {@code writerIndex}
- */
- void writeSimpleString(SimpleString val);
-
- /**
- * Sets the specified non-null String at the current {@code writerIndex}
- */
- void writeString(String val);
-
- /**
- * Sets the specified UTF-8 String at the current {@code writerIndex}
- */
-
- void writeUTF(String utf);
-
- /**
- * Transfers the specified source buffer's data to this buffer starting at
- * the current {@code writerIndex} and increases the {@code writerIndex}
- * by the number of the transferred bytes (= {@code length}). This method
- * is basically same with {@link #writeBytes(HornetQBuffer, int, int)},
- * except that this method increases the {@code readerIndex} of the source
- * buffer by the number of the transferred bytes (= {@code length}) while
- * {@link #writeBytes(HornetQBuffer, int, int)} does not.
- *
- * @param length the number of bytes to transfer
- *
- * @throws IndexOutOfBoundsException
- * if {@code length} is greater than {@code this.writableBytes} or
- * if {@code length} is greater then {@code src.readableBytes}
- */
- void writeBytes(HornetQBuffer src, int length);
-
- /**
- * Transfers the specified source buffer's data to this buffer starting at
- * the current {@code writerIndex} and increases the {@code writerIndex}
- * by the number of the transferred bytes (= {@code length}).
- *
- * @param srcIndex the first index of the source
- * @param length the number of bytes to transfer
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code srcIndex} is less than {@code 0},
- * if {@code srcIndex + length} is greater than
- * {@code src.capacity}, or
- * if {@code length} is greater than {@code this.writableBytes}
- */
- void writeBytes(HornetQBuffer src, int srcIndex, int length);
-
- /**
- * Transfers the specified source array's data to this buffer starting at
- * the current {@code writerIndex} and increases the {@code writerIndex}
- * by the number of the transferred bytes (= {@code src.length}).
- *
- * @throws IndexOutOfBoundsException
- * if {@code src.length} is greater than {@code this.writableBytes}
- */
- void writeBytes(byte[] src);
-
- /**
- * Transfers the specified source array's data to this buffer starting at
- * the current {@code writerIndex} and increases the {@code writerIndex}
- * by the number of the transferred bytes (= {@code length}).
- *
- * @param srcIndex the first index of the source
- * @param length the number of bytes to transfer
- *
- * @throws IndexOutOfBoundsException
- * if the specified {@code srcIndex} is less than {@code 0},
- * if {@code srcIndex + length} is greater than
- * {@code src.length}, or
- * if {@code length} is greater than {@code this.writableBytes}
- */
- void writeBytes(byte[] src, int srcIndex, int length);
-
- /**
- * Transfers the specified source buffer's data to this buffer starting at
- * the current {@code writerIndex} until the source buffer's position
- * reaches its limit, and increases the {@code writerIndex} by the
- * number of the transferred bytes.
- *
- * @throws IndexOutOfBoundsException
- * if {@code src.remaining()} is greater than
- * {@code this.writableBytes}
- */
- void writeBytes(ByteBuffer src);
-
- /**
- * Returns a copy of this buffer's readable bytes. Modifying the content
- * of the returned buffer or this buffer does not affect each other at all.
- * This method is identical to {@code buf.copy(buf.readerIndex(), buf.readableBytes())}.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- *
- */
- HornetQBuffer copy();
-
- /**
- * Returns a copy of this buffer's sub-region. Modifying the content of
- * the returned buffer or this buffer does not affect each other at all.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- */
- HornetQBuffer copy(int index, int length);
-
- /**
- * Returns a slice of this buffer's readable bytes. Modifying the content
- * of the returned buffer or this buffer affects each other's content
- * while they maintain separate indexes and marks. This method is
- * identical to {@code buf.slice(buf.readerIndex(), buf.readableBytes())}.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- */
- HornetQBuffer slice();
-
- /**
- * Returns a slice of this buffer's sub-region. Modifying the content of
- * the returned buffer or this buffer affects each other's content while
- * they maintain separate indexes and marks.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- */
- HornetQBuffer slice(int index, int length);
-
- /**
- * Returns a buffer which shares the whole region of this buffer.
- * Modifying the content of the returned buffer or this buffer affects
- * each other's content while they maintain separate indexes and marks.
- * This method is identical to {@code buf.slice(0, buf.capacity())}.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- */
- HornetQBuffer duplicate();
-
- /**
- * Converts this buffer's readable bytes into a NIO buffer. The returned
- * buffer might or might not share the content with this buffer, while
- * they have separate indexes and marks. This method is identical to
- * {@code buf.toByteBuffer(buf.readerIndex(), buf.readableBytes())}.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- */
- ByteBuffer toByteBuffer();
-
- /**
- * Converts this buffer's sub-region into a NIO buffer. The returned
- * buffer might or might not share the content with this buffer, while
- * they have separate indexes and marks.
- * This method does not modify {@code readerIndex} or {@code writerIndex} of
- * this buffer.
- */
- ByteBuffer toByteBuffer(int index, int length);
-}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/HornetQBuffers.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/HornetQBuffers.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/HornetQBuffers.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,97 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.api.core;
-
-import java.nio.ByteBuffer;
-
-import org.hornetq.core.buffers.impl.ChannelBufferWrapper;
-import org.jboss.netty.buffer.ChannelBuffer;
-import org.jboss.netty.buffer.ChannelBuffers;
-
-/**
- * Factory class to create HornetQBuffers
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- */
-public class HornetQBuffers
-{
- /**
- * Creates a <em>self-expanding</em> HornetQBuffer with the given initial size
- *
- * @param size the initial size of the created HornetQBuffer
- * @return a self-expanding HornetQBuffer starting with the given size
- */
- public static HornetQBuffer dynamicBuffer(final int size)
- {
- return new ChannelBufferWrapper(ChannelBuffers.dynamicBuffer(size));
- }
-
- /**
- * Creates a <em>self-expanding</em> HornetQBuffer 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
- */
- public static HornetQBuffer dynamicBuffer(final byte[] bytes)
- {
- ChannelBuffer buff = ChannelBuffers.dynamicBuffer(bytes.length);
-
- buff.writeBytes(bytes);
-
- return new ChannelBufferWrapper(buff);
- }
-
- /**
- * Creates a HornetQBuffer 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
- */
- public static HornetQBuffer wrappedBuffer(final ByteBuffer underlying)
- {
- HornetQBuffer buff = new ChannelBufferWrapper(ChannelBuffers.wrappedBuffer(underlying));
-
- buff.clear();
-
- return buff;
- }
-
- /**
- * Creates a HornetQBuffer wrapping an underlying byte array
- *
- * @param underlying the underlying byte array
- * @return a HornetQBuffer wrapping the underlying byte array
- */
- public static HornetQBuffer wrappedBuffer(final byte[] underlying)
- {
- return new ChannelBufferWrapper(ChannelBuffers.wrappedBuffer(underlying));
- }
-
- /**
- * Creates a <em>fixed</em> HornetQBuffer of the given size
- *
- * @param size the size of the created HornetQBuffer
- * @return a fixed HornetQBuffer with the given size
- */
- public static HornetQBuffer fixedBuffer(final int size)
- {
- return new ChannelBufferWrapper(ChannelBuffers.buffer(size));
- }
-
- private HornetQBuffers()
- {
- }
-}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/Pair.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/Pair.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/Pair.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,84 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.api.core;
-
-import java.io.Serializable;
-
-/**
- *
- * A Pair is a holder for 2 objects.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class Pair<A, B> implements Serializable
-{
- private static final long serialVersionUID = -2496357457812368127L;
-
- public Pair(final A a, final B b)
- {
- this.a = a;
-
- this.b = b;
- }
-
- public A a;
-
- public B b;
-
- private int hash = -1;
-
- @Override
- public int hashCode()
- {
- if (hash == -1)
- {
- if (a == null && b == null)
- {
- return super.hashCode();
- }
- else
- {
- hash = (a == null ? 0 : a.hashCode()) + 37 * (b == null ? 0 : b.hashCode());
- }
- }
-
- return hash;
- }
-
- @Override
- public boolean equals(final Object other)
- {
- if (other == this)
- {
- return true;
- }
-
- if (other instanceof Pair == false)
- {
- return false;
- }
-
- Pair<A, B> pother = (Pair<A, B>)other;
-
- return (pother.a == null ? a == null : pother.a.equals(a)) && (pother.b == null ? b == null : pother.b.equals(b));
-
- }
-
- @Override
- public String toString()
- {
- return "Pair[a=" + a + ", b=" + b + "]";
- }
-}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/SimpleString.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/SimpleString.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/SimpleString.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,372 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.api.core;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hornetq.utils.DataConstants;
-
-/**
- * A simple String class that can store all characters, and stores as simple
- * byte[], this minimises expensive copying between String objects.
- *
- * This object is used heavily throughout HornetQ for performance reasons.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-
-public class SimpleString implements CharSequence, Serializable, Comparable<SimpleString> {
- private static final long serialVersionUID = 4204223851422244307L;
-
- // Attributes
- // ------------------------------------------------------------------------
- private final byte[] data;
-
- private transient int hash;
-
- // Cache the string
- private transient String str;
-
- // Static
- // ----------------------------------------------------------------------
-
- /**
- * Returns a SimpleString constructed from the <code>string</code> parameter.
- * If <code>string</code> is <code>null</code>, the return value will be
- * <code>null</code> too.
- */
- public static SimpleString toSimpleString(final String string) {
- if (string == null) {
- return null;
- }
- return new SimpleString(string);
- }
-
- // Constructors
- // ----------------------------------------------------------------------
- /**
- * creates a SimpleString from a conventional String
- * @param string the string to transform
- */
- public SimpleString(final String string) {
- int len = string.length();
-
- data = new byte[len << 1];
-
- int j = 0;
-
- for (int i = 0; i < len; i++) {
- char c = string.charAt(i);
-
- byte low = (byte) (c & 0xFF); // low byte
-
- data[j++] = low;
-
- byte high = (byte) (c >> 8 & 0xFF); // high byte
-
- data[j++] = high;
- }
-
- str = string;
- }
-
- /**
- * creates a SimpleString from a byte array
- * @param data the byte array to use
- */
- public SimpleString(final byte[] data) {
- this.data = data;
- }
-
- // CharSequence implementation
- // ---------------------------------------------------------------------------
-
- public int length() {
- return data.length >> 1;
- }
-
- public char charAt(int pos) {
- if (pos < 0 || pos >= data.length >> 1) {
- throw new IndexOutOfBoundsException();
- }
- pos <<= 1;
-
- return (char) (data[pos] | data[pos + 1] << 8);
- }
-
- public CharSequence subSequence(final int start, final int end) {
- int len = data.length >> 1;
-
- if (end < start || start < 0 || end > len) {
- throw new IndexOutOfBoundsException();
- } else {
- int newlen = end - start << 1;
- byte[] bytes = new byte[newlen];
-
- System.arraycopy(data, start << 1, bytes, 0, newlen);
-
- return new SimpleString(bytes);
- }
- }
-
- // Comparable implementation -------------------------------------
-
- public int compareTo(final SimpleString o) {
- return toString().compareTo(o.toString());
- }
-
- // Public
- // ---------------------------------------------------------------------------
-
- /**
- * returns the underlying byte array of this SimpleString
- * @return the byte array
- */
- public byte[] getData() {
- return data;
- }
-
- /**
- * returns true if the SimpleString parameter starts with the same data as
- * this one. false if not.
- * @param other the SimpelString to look for
- * @return true if this SimpleString starts with the same data
- */
- public boolean startsWith(final SimpleString other) {
- byte[] otherdata = other.data;
-
- if (otherdata.length > data.length) {
- return false;
- }
-
- for (int i = 0; i < otherdata.length; i++) {
- if (data[i] != otherdata[i]) {
- return false;
- }
- }
-
- return true;
- }
-
- @Override
- public String toString() {
- if (str == null) {
- int len = data.length >> 1;
-
- char[] chars = new char[len];
-
- int j = 0;
-
- for (int i = 0; i < len; i++) {
- int low = data[j++] & 0xFF;
-
- int high = data[j++] << 8 & 0xFF00;
-
- chars[i] = (char) (low | high);
- }
-
- str = new String(chars);
- }
-
- return str;
- }
-
- @Override
- public boolean equals(final Object other) {
- if (this == other) {
- return true;
- }
-
- if (other instanceof SimpleString) {
- SimpleString s = (SimpleString) other;
-
- if (data.length != s.data.length) {
- return false;
- }
-
- for (int i = 0; i < data.length; i++) {
- if (data[i] != s.data[i]) {
- return false;
- }
- }
-
- return true;
- } else {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- if (hash == 0) {
- int tmphash = 0;
- for (byte element : data) {
- tmphash = (tmphash << 5) - tmphash + element; // (hash << 5) - hash is
- // same as hash * 31
- }
- hash = tmphash;
- }
-
- return hash;
- }
-
- /**
- * splits this SimpleString into an array of SimpleString using the char param
- * as the delimeter.
- *
- * i.e. "a.b" would return "a" and "b" if . was the delimeter
- * @param delim
- */
- public SimpleString[] split(final char delim) {
- if (!contains(delim)) {
- return new SimpleString[] { this };
- } else {
- List<SimpleString> all = new ArrayList<SimpleString>();
- int lasPos = 0;
- for (int i = 0; i < data.length; i += 2) {
- byte low = (byte) (delim & 0xFF); // low byte
- byte high = (byte) (delim >> 8 & 0xFF); // high byte
- if (data[i] == low && data[i + 1] == high) {
- byte[] bytes = new byte[i - lasPos];
- System.arraycopy(data, lasPos, bytes, 0, bytes.length);
- lasPos = i + 2;
- all.add(new SimpleString(bytes));
- }
- }
- byte[] bytes = new byte[data.length - lasPos];
- System.arraycopy(data, lasPos, bytes, 0, bytes.length);
- all.add(new SimpleString(bytes));
- SimpleString[] parts = new SimpleString[all.size()];
- return all.toArray(parts);
- }
- }
-
- /**
- * checks to see if this SimpleString contains the char parameter passed in
- *
- * @param c the char to check for
- * @return true if the char is found, false otherwise.
- */
- public boolean contains(final char c) {
- for (int i = 0; i < data.length; i += 2) {
- byte low = (byte) (c & 0xFF); // low byte
- byte high = (byte) (c >> 8 & 0xFF); // high byte
- if (data[i] == low && data[i + 1] == high) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * concatanates a SimpleString and a String
- *
- * @param toAdd the String to concate with.
- * @return the concatanated SimpleString
- */
- public SimpleString concat(final String toAdd) {
- return concat(new SimpleString(toAdd));
- }
-
- /**
- * concatanates 2 SimpleString's
- *
- * @param toAdd the SimpleString to concate with.
- * @return the concatanated SimpleString
- */
- public SimpleString concat(final SimpleString toAdd) {
- byte[] bytes = new byte[data.length + toAdd.getData().length];
- System.arraycopy(data, 0, bytes, 0, data.length);
- System.arraycopy(toAdd.getData(), 0, bytes, data.length, toAdd.getData().length);
- return new SimpleString(bytes);
- }
-
- /**
- * concatanates a SimpleString and a char
- *
- * @param c the char to concate with.
- * @return the concatanated SimpleString
- */
- public SimpleString concat(final char c) {
- byte[] bytes = new byte[data.length + 2];
- System.arraycopy(data, 0, bytes, 0, data.length);
- bytes[data.length] = (byte) (c & 0xFF);
- bytes[data.length + 1] = (byte) (c >> 8 & 0xFF);
- return new SimpleString(bytes);
- }
-
- /**
- * returns the size of this SimpleString
- * @return the size
- */
- public int sizeof() {
- return DataConstants.SIZE_INT + data.length;
- }
-
- /**
- * returns the size of a SimpleString
- * @param str the SimpleString to check
- * @return the size
- */
- public static int sizeofString(final SimpleString str) {
- return str.sizeof();
- }
-
- /**
- * returns the size of a SimpleString which could be null
- * @param str the SimpleString to check
- * @return the size
- */
- public static int sizeofNullableString(final SimpleString str) {
- if (str == null) {
- return 1;
- } else {
- return 1 + str.sizeof();
- }
- }
-
- /**
- *
- * @param srcBegin
- * @param srcEnd
- * @param dst
- * @param dstBegin
- */
- public void getChars(final int srcBegin, final int srcEnd, final char dst[],
- final int dstBegin) {
- if (srcBegin < 0) {
- throw new StringIndexOutOfBoundsException(srcBegin);
- }
- if (srcEnd > length()) {
- throw new StringIndexOutOfBoundsException(srcEnd);
- }
- if (srcBegin > srcEnd) {
- throw new StringIndexOutOfBoundsException(srcEnd - srcBegin);
- }
-
- int j = 0;
-
- for (int i = srcBegin; i < srcEnd - srcBegin; i++) {
- int low = data[j++] & 0xFF;
-
- int high = data[j++] << 8 & 0xFF00;
-
- dst[i] = (char) (low | high);
- }
- }
-
-}
\ No newline at end of file
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/buffers/impl/ChannelBufferWrapper.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/buffers/impl/ChannelBufferWrapper.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/buffers/impl/ChannelBufferWrapper.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,620 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.core.buffers.impl;
-
-import java.nio.ByteBuffer;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.utils.DataConstants;
-import org.hornetq.utils.UTF8Util;
-import org.jboss.netty.buffer.ChannelBuffer;
-
-/**
- *
- * A ChannelBufferWrapper
- *
- * @author Tim Fox
- *
- *
- */
-public class ChannelBufferWrapper implements HornetQBuffer
-{
- private static final Logger log = Logger.getLogger(ChannelBufferWrapper.class);
-
- protected ChannelBuffer buffer;
-
- public ChannelBufferWrapper(final ChannelBuffer buffer)
- {
- this.buffer = buffer;
- }
-
- public boolean readBoolean()
- {
- return readByte() != 0;
- }
-
- public SimpleString readNullableSimpleString()
- {
- int b = buffer.readByte();
- if (b == DataConstants.NULL)
- {
- return null;
- }
- else
- {
- return readSimpleStringInternal();
- }
- }
-
- public String readNullableString()
- {
- int b = buffer.readByte();
- if (b == DataConstants.NULL)
- {
- return null;
- }
- else
- {
- return readStringInternal();
- }
- }
-
- public SimpleString readSimpleString()
- {
- return readSimpleStringInternal();
- }
-
- private SimpleString readSimpleStringInternal()
- {
- int len = buffer.readInt();
- byte[] data = new byte[len];
- buffer.readBytes(data);
- return new SimpleString(data);
- }
-
- public String readString()
- {
- return readStringInternal();
- }
-
- private String readStringInternal()
- {
- int len = buffer.readInt();
-
- if (len < 9)
- {
- char[] chars = new char[len];
- for (int i = 0; i < len; i++)
- {
- chars[i] = (char)buffer.readShort();
- }
- return new String(chars);
- }
- else if (len < 0xfff)
- {
- return readUTF();
- }
- else
- {
- return readSimpleStringInternal().toString();
- }
- }
-
- public String readUTF()
- {
- return UTF8Util.readUTF(this);
- }
-
- public void writeBoolean(final boolean val)
- {
- buffer.writeByte((byte)(val ? -1 : 0));
- }
-
- public void writeNullableSimpleString(final SimpleString val)
- {
- if (val == null)
- {
- buffer.writeByte(DataConstants.NULL);
- }
- else
- {
- buffer.writeByte(DataConstants.NOT_NULL);
- writeSimpleStringInternal(val);
- }
- }
-
- public void writeNullableString(final String val)
- {
- if (val == null)
- {
- buffer.writeByte(DataConstants.NULL);
- }
- else
- {
- buffer.writeByte(DataConstants.NOT_NULL);
- writeStringInternal(val);
- }
- }
-
- public void writeSimpleString(final SimpleString val)
- {
- writeSimpleStringInternal(val);
- }
-
- private void writeSimpleStringInternal(final SimpleString val)
- {
- byte[] data = val.getData();
- buffer.writeInt(data.length);
- buffer.writeBytes(data);
- }
-
- public void writeString(final String val)
- {
- writeStringInternal(val);
- }
-
- private void writeStringInternal(final String val)
- {
- int length = val.length();
-
- buffer.writeInt(length);
-
- if (length < 9)
- {
- // If very small it's more performant to store char by char
- for (int i = 0; i < val.length(); i++)
- {
- buffer.writeShort((short)val.charAt(i));
- }
- }
- else if (length < 0xfff)
- {
- // Store as UTF - this is quicker than char by char for most strings
- writeUTF(val);
- }
- else
- {
- // Store as SimpleString, since can't store utf > 0xffff in length
- writeSimpleStringInternal(new SimpleString(val));
- }
- }
-
- public void writeUTF(final String utf)
- {
- UTF8Util.saveUTF(this, utf);
- }
-
- public int capacity()
- {
- return buffer.capacity();
- }
-
- public ChannelBuffer channelBuffer()
- {
- return buffer;
- }
-
- public void clear()
- {
- buffer.clear();
- }
-
- public HornetQBuffer copy()
- {
- return new ChannelBufferWrapper(buffer.copy());
- }
-
- public HornetQBuffer copy(final int index, final int length)
- {
- return new ChannelBufferWrapper(buffer.copy(index, length));
- }
-
- public void discardReadBytes()
- {
- buffer.discardReadBytes();
- }
-
- public HornetQBuffer duplicate()
- {
- return new ChannelBufferWrapper(buffer.duplicate());
- }
-
- public byte getByte(final int index)
- {
- return buffer.getByte(index);
- }
-
- public void getBytes(final int index, final byte[] dst, final int dstIndex, final int length)
- {
- buffer.getBytes(index, dst, dstIndex, length);
- }
-
- public void getBytes(final int index, final byte[] dst)
- {
- buffer.getBytes(index, dst);
- }
-
- public void getBytes(final int index, final ByteBuffer dst)
- {
- buffer.getBytes(index, dst);
- }
-
- public void getBytes(final int index, final HornetQBuffer dst, final int dstIndex, final int length)
- {
- buffer.getBytes(index, dst.channelBuffer(), dstIndex, length);
- }
-
- public void getBytes(final int index, final HornetQBuffer dst, final int length)
- {
- buffer.getBytes(index, dst.channelBuffer(), length);
- }
-
- public void getBytes(final int index, final HornetQBuffer dst)
- {
- buffer.getBytes(index, dst.channelBuffer());
- }
-
- public char getChar(final int index)
- {
- return (char)buffer.getShort(index);
- }
-
- public double getDouble(final int index)
- {
- return Double.longBitsToDouble(buffer.getLong(index));
- }
-
- public float getFloat(final int index)
- {
- return Float.intBitsToFloat(buffer.getInt(index));
- }
-
- public int getInt(final int index)
- {
- return buffer.getInt(index);
- }
-
- public long getLong(final int index)
- {
- return buffer.getLong(index);
- }
-
- public short getShort(final int index)
- {
- return buffer.getShort(index);
- }
-
- public short getUnsignedByte(final int index)
- {
- return buffer.getUnsignedByte(index);
- }
-
- public long getUnsignedInt(final int index)
- {
- return buffer.getUnsignedInt(index);
- }
-
- public int getUnsignedShort(final int index)
- {
- return buffer.getUnsignedShort(index);
- }
-
- public void markReaderIndex()
- {
- buffer.markReaderIndex();
- }
-
- public void markWriterIndex()
- {
- buffer.markWriterIndex();
- }
-
- public boolean readable()
- {
- return buffer.readable();
- }
-
- public int readableBytes()
- {
- return buffer.readableBytes();
- }
-
- public byte readByte()
- {
- return buffer.readByte();
- }
-
- public void readBytes(final byte[] dst, final int dstIndex, final int length)
- {
- buffer.readBytes(dst, dstIndex, length);
- }
-
- public void readBytes(final byte[] dst)
- {
- buffer.readBytes(dst);
- }
-
- public void readBytes(final ByteBuffer dst)
- {
- buffer.readBytes(dst);
- }
-
- public void readBytes(final HornetQBuffer dst, final int dstIndex, final int length)
- {
- buffer.readBytes(dst.channelBuffer(), dstIndex, length);
- }
-
- public void readBytes(final HornetQBuffer dst, final int length)
- {
- buffer.readBytes(dst.channelBuffer(), length);
- }
-
- public void readBytes(final HornetQBuffer dst)
- {
- buffer.readBytes(dst.channelBuffer());
- }
-
- public HornetQBuffer readBytes(final int length)
- {
- return new ChannelBufferWrapper(buffer.readBytes(length));
- }
-
- public char readChar()
- {
- return (char)buffer.readShort();
- }
-
- public double readDouble()
- {
- return Double.longBitsToDouble(buffer.readLong());
- }
-
- public int readerIndex()
- {
- return buffer.readerIndex();
- }
-
- public void readerIndex(final int readerIndex)
- {
- buffer.readerIndex(readerIndex);
- }
-
- public float readFloat()
- {
- return Float.intBitsToFloat(buffer.readInt());
- }
-
- public int readInt()
- {
- return buffer.readInt();
- }
-
- public long readLong()
- {
- return buffer.readLong();
- }
-
- public short readShort()
- {
- return buffer.readShort();
- }
-
- public HornetQBuffer readSlice(final int length)
- {
- return new ChannelBufferWrapper(buffer.readSlice(length));
- }
-
- public short readUnsignedByte()
- {
- return buffer.readUnsignedByte();
- }
-
- public long readUnsignedInt()
- {
- return buffer.readUnsignedInt();
- }
-
- public int readUnsignedShort()
- {
- return buffer.readUnsignedShort();
- }
-
- public void resetReaderIndex()
- {
- buffer.resetReaderIndex();
- }
-
- public void resetWriterIndex()
- {
- buffer.resetWriterIndex();
- }
-
- public void setByte(final int index, final byte value)
- {
- buffer.setByte(index, value);
- }
-
- public void setBytes(final int index, final byte[] src, final int srcIndex, final int length)
- {
- buffer.setBytes(index, src, srcIndex, length);
- }
-
- public void setBytes(final int index, final byte[] src)
- {
- buffer.setBytes(index, src);
- }
-
- public void setBytes(final int index, final ByteBuffer src)
- {
- buffer.setBytes(index, src);
- }
-
- public void setBytes(final int index, final HornetQBuffer src, final int srcIndex, final int length)
- {
- buffer.setBytes(index, src.channelBuffer(), srcIndex, length);
- }
-
- public void setBytes(final int index, final HornetQBuffer src, final int length)
- {
- buffer.setBytes(index, src.channelBuffer(), length);
- }
-
- public void setBytes(final int index, final HornetQBuffer src)
- {
- buffer.setBytes(index, src.channelBuffer());
- }
-
- public void setChar(final int index, final char value)
- {
- buffer.setShort(index, (short)value);
- }
-
- public void setDouble(final int index, final double value)
- {
- buffer.setLong(index, Double.doubleToLongBits(value));
- }
-
- public void setFloat(final int index, final float value)
- {
- buffer.setInt(index, Float.floatToIntBits(value));
- }
-
- public void setIndex(final int readerIndex, final int writerIndex)
- {
- buffer.setIndex(readerIndex, writerIndex);
- }
-
- public void setInt(final int index, final int value)
- {
- buffer.setInt(index, value);
- }
-
- public void setLong(final int index, final long value)
- {
- buffer.setLong(index, value);
- }
-
- public void setShort(final int index, final short value)
- {
- buffer.setShort(index, value);
- }
-
- public void skipBytes(final int length)
- {
- buffer.skipBytes(length);
- }
-
- public HornetQBuffer slice()
- {
- return new ChannelBufferWrapper(buffer.slice());
- }
-
- public HornetQBuffer slice(final int index, final int length)
- {
- return new ChannelBufferWrapper(buffer.slice(index, length));
- }
-
- public ByteBuffer toByteBuffer()
- {
- return buffer.toByteBuffer();
- }
-
- public ByteBuffer toByteBuffer(final int index, final int length)
- {
- return buffer.toByteBuffer(index, length);
- }
-
- public boolean writable()
- {
- return buffer.writable();
- }
-
- public int writableBytes()
- {
- return buffer.writableBytes();
- }
-
- public void writeByte(final byte value)
- {
- buffer.writeByte(value);
- }
-
- public void writeBytes(final byte[] src, final int srcIndex, final int length)
- {
- buffer.writeBytes(src, srcIndex, length);
- }
-
- public void writeBytes(final byte[] src)
- {
- buffer.writeBytes(src);
- }
-
- public void writeBytes(final ByteBuffer src)
- {
- buffer.writeBytes(src);
- }
-
- public void writeBytes(final HornetQBuffer src, final int srcIndex, final int length)
- {
- buffer.writeBytes(src.channelBuffer(), srcIndex, length);
- }
-
- public void writeBytes(final HornetQBuffer src, final int length)
- {
- buffer.writeBytes(src.channelBuffer(), length);
- }
-
- public void writeChar(final char chr)
- {
- buffer.writeShort((short)chr);
- }
-
- public void writeDouble(final double value)
- {
- buffer.writeLong(Double.doubleToLongBits(value));
- }
-
- public void writeFloat(final float value)
- {
- buffer.writeInt(Float.floatToIntBits(value));
- }
-
- public void writeInt(final int value)
- {
- buffer.writeInt(value);
- }
-
- public void writeLong(final long value)
- {
- buffer.writeLong(value);
- }
-
- public int writerIndex()
- {
- return buffer.writerIndex();
- }
-
- public void writerIndex(final int writerIndex)
- {
- buffer.writerIndex(writerIndex);
- }
-
- public void writeShort(final short value)
- {
- buffer.writeShort(value);
- }
-
-}
Modified: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/ImportJournal.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/ImportJournal.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/ImportJournal.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -29,11 +29,12 @@
/**
* Use this class to import the journal data from a listed file. You can use it as a main class or through its native method {@link ImportJournal#importJournal(String, String, String, int, int, String)}
- *
+ *
* If you use the main method, use it as <JournalDirectory> <JournalPrefix> <FileExtension> <MinFiles> <FileSize> <FileOutput>
- *
- * Example: java -cp hornetq-core.jar org.hornetq.core.journal.impl.ExportJournal /journalDir hornetq-data hq 2 10485760 /tmp/export.dat
*
+ * Example:<pre>
+ * java -cp hornetq-core.jar org.hornetq.core.journal.impl.ExportJournal /journalDir hornetq-data hq 2 10485760 /tmp/export.dat
+ *</pre>
* @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
*
*
Modified: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SyncSpeedTest.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SyncSpeedTest.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SyncSpeedTest.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -27,10 +27,8 @@
import org.hornetq.core.logging.Logger;
/**
- * A SyncSpeedTest
- *
- * This class just provides some diagnostics on how fast your disk can sync
- * Useful when determining performance issues
+ * SyncSpeedTest provides diagnostics on how fast your disk can sync.<p>
+ * It is used to investigate performance issues.
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a> fox
*
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/Logger.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/Logger.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/Logger.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,212 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.core.logging;
-
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.hornetq.core.logging.impl.JULLogDelegateFactory;
-import org.hornetq.spi.core.logging.LogDelegate;
-import org.hornetq.spi.core.logging.LogDelegateFactory;
-
-/**
- *
- * A Logger
- *
- * This class allows us to isolate all our logging dependencies in one place
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class Logger
-{
- public static final String LOGGER_DELEGATE_FACTORY_CLASS_NAME = "org.hornetq.logger-delegate-factory-class-name";
-
- private static volatile LogDelegateFactory delegateFactory;
-
- private static final ConcurrentMap<Class<?>, Logger> loggers = new ConcurrentHashMap<Class<?>, Logger>();
-
- static
- {
- Logger.initialise();
- }
-
- public static synchronized void setDelegateFactory(final LogDelegateFactory delegateFactory)
- {
- Logger.clear();
-
- Logger.delegateFactory = delegateFactory;
- }
-
- private static void clear()
- {
- Logger.loggers.clear();
- }
-
- public static synchronized void reset()
- {
- Logger.clear();
-
- Logger.initialise();
- }
-
- public static synchronized void initialise()
- {
- LogDelegateFactory delegateFactory;
-
- // If a system property is specified then this overrides any delegate factory which is set
- // programmatically - this is primarily of use so we can configure the logger delegate on the client side.
- // call to System.getProperty is wrapped in a try block as it will fail if the client runs in a secured
- // environment
- String className = JULLogDelegateFactory.class.getName();
- try
- {
- className = System.getProperty(Logger.LOGGER_DELEGATE_FACTORY_CLASS_NAME);
- }
- catch (Exception e)
- {
- }
-
- if (className != null)
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- try
- {
- Class<?> clz = loader.loadClass(className);
- delegateFactory = (LogDelegateFactory)clz.newInstance();
- }
- catch (Exception e)
- {
- throw new IllegalArgumentException("Error instantiating transformer class \"" + className + "\"", e);
- }
- }
- else
- {
- delegateFactory = new JULLogDelegateFactory();
- }
-
- Logger.delegateFactory = delegateFactory;
-
- Logger.loggers.clear();
- }
-
- public static Logger getLogger(final Class<?> clazz)
- {
- Logger logger = Logger.loggers.get(clazz);
-
- if (logger == null)
- {
- LogDelegate delegate = Logger.delegateFactory.createDelegate(clazz);
-
- logger = new Logger(delegate);
-
- Logger oldLogger = Logger.loggers.putIfAbsent(clazz, logger);
-
- if (oldLogger != null)
- {
- logger = oldLogger;
- }
- }
-
- return logger;
- }
-
- private final LogDelegate delegate;
-
- Logger(final LogDelegate delegate)
- {
- this.delegate = delegate;
- }
-
- public LogDelegate getDelegate()
- {
- return delegate;
- }
-
- public boolean isInfoEnabled()
- {
- return delegate.isInfoEnabled();
- }
-
- public boolean isDebugEnabled()
- {
- return delegate.isDebugEnabled();
- }
-
- public boolean isTraceEnabled()
- {
- return delegate.isTraceEnabled();
- }
-
- public void fatal(final Object message)
- {
- delegate.fatal(message);
- }
-
- public void fatal(final Object message, final Throwable t)
- {
- delegate.fatal(message, t);
- }
-
- public void error(final Object message)
- {
- delegate.error(message);
- }
-
- public void error(final Object message, final Throwable t)
- {
- delegate.error(message, t);
- }
-
- public void warn(final Object message)
- {
- delegate.warn(message);
- }
-
- public void warn(final Object message, final Throwable t)
- {
- delegate.warn(message, t);
- }
-
- public void info(final Object message)
- {
- delegate.info(message);
- }
-
- public void info(final Object message, final Throwable t)
- {
- delegate.info(message, t);
- }
-
- public void debug(final Object message)
- {
- delegate.debug(message);
- }
-
- public void debug(final Object message, final Throwable t)
- {
- delegate.debug(message, t);
- }
-
- public void trace(final Object message)
- {
- delegate.trace(message);
- }
-
- public void trace(final Object message, final Throwable t)
- {
- delegate.trace(message, t);
- }
-
-}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/impl/JULLogDelegate.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/impl/JULLogDelegate.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/impl/JULLogDelegate.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,111 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.core.logging.impl;
-
-import java.util.logging.Level;
-
-import org.hornetq.spi.core.logging.LogDelegate;
-
-/**
- *
- * A {@link LogDelegate} which delegates to java.util.logging
- *
- * @author <a href="kenny.macleod(a)kizoom.com">Kenny MacLeod</a>
- *
- */
-public class JULLogDelegate implements LogDelegate
-{
- private final java.util.logging.Logger logger;
-
- JULLogDelegate(final Class<?> clazz)
- {
- logger = java.util.logging.Logger.getLogger(clazz.getName());
- }
-
- public boolean isInfoEnabled()
- {
- return logger.isLoggable(Level.INFO);
- }
-
- public boolean isDebugEnabled()
- {
- return logger.isLoggable(Level.FINE);
- }
-
- public boolean isTraceEnabled()
- {
- return logger.isLoggable(Level.FINEST);
- }
-
- public void fatal(final Object message)
- {
- logger.log(Level.SEVERE, message == null ? "NULL" : message.toString());
- }
-
- public void fatal(final Object message, final Throwable t)
- {
- logger.log(Level.SEVERE, message == null ? "NULL" : message.toString(), t);
- }
-
- public void error(final Object message)
- {
- logger.log(Level.SEVERE, message == null ? "NULL" : message.toString());
- }
-
- public void error(final Object message, final Throwable t)
- {
- logger.log(Level.SEVERE, message == null ? "NULL" : message.toString(), t);
- }
-
- public void warn(final Object message)
- {
- logger.log(Level.WARNING, message == null ? "NULL" : message.toString());
- }
-
- public void warn(final Object message, final Throwable t)
- {
- logger.log(Level.WARNING, message == null ? "NULL" : message.toString(), t);
- }
-
- public void info(final Object message)
- {
- logger.log(Level.INFO, message == null ? "NULL" : message.toString());
- }
-
- public void info(final Object message, final Throwable t)
- {
- logger.log(Level.INFO, message == null ? "NULL" : message.toString(), t);
- }
-
- public void debug(final Object message)
- {
- logger.log(Level.FINE, message == null ? "NULL" : message.toString());
- }
-
- public void debug(final Object message, final Throwable t)
- {
- logger.log(Level.FINE, message == null ? "NULL" : message.toString(), t);
- }
-
- public void trace(final Object message)
- {
- logger.log(Level.FINEST, message == null ? "NULL" : message.toString());
- }
-
- public void trace(final Object message, final Throwable t)
- {
- logger.log(Level.FINEST, message == null ? "NULL" : message.toString(), t);
- }
-
-}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/impl/JULLogDelegateFactory.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/impl/JULLogDelegateFactory.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/logging/impl/JULLogDelegateFactory.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,32 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.core.logging.impl;
-
-import org.hornetq.spi.core.logging.LogDelegate;
-import org.hornetq.spi.core.logging.LogDelegateFactory;
-
-/**
- * A {@link LogDelegateFactory} which creates {@link JULLogDelegate} instances.
- *
- * @author <a href="kenny.macleod(a)kizoom.com">Kenny MacLeod</a>
- *
- *
- */
-public class JULLogDelegateFactory implements LogDelegateFactory
-{
- public LogDelegate createDelegate(final Class<?> clazz)
- {
- return new JULLogDelegate(clazz);
- }
-}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/message/BodyEncoder.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/message/BodyEncoder.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/message/BodyEncoder.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,55 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.core.message;
-
-import java.nio.ByteBuffer;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQException;
-
-/**
- * Class used to encode message body into buffers.
- * <br>
- * Used to send large streams over the wire
- *
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- */
-public interface BodyEncoder
-{
- /**
- * This method must not be called directly by HornetQ clients.
- */
- void open() throws HornetQException;
-
- /**
- * This method must not be called directly by HornetQ clients.
- */
- void close() throws HornetQException;
-
- /**
- * This method must not be called directly by HornetQ clients.
- */
- int encode(ByteBuffer bufferRead) throws HornetQException;
-
- /**
- * This method must not be called directly by HornetQ clients.
- */
- int encode(HornetQBuffer bufferOut, int size) throws HornetQException;
-
- /**
- * This method must not be called directly by HornetQ clients.
- */
- long getLargeBodySize();
-}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/LogDelegate.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/LogDelegate.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/LogDelegate.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,54 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.spi.core.logging;
-
-/**
- * I represent operations that are delegated to underlying logging frameworks.
- *
- * @author <a href="kenny.macleod(a)kizoom.com">Kenny MacLeod</a>
- *
- *
- */
-public interface LogDelegate
-{
- boolean isInfoEnabled();
-
- boolean isDebugEnabled();
-
- boolean isTraceEnabled();
-
- void fatal(Object message);
-
- void fatal(Object message, Throwable t);
-
- void error(Object message);
-
- void error(Object message, Throwable t);
-
- void warn(Object message);
-
- void warn(Object message, Throwable t);
-
- void info(Object message);
-
- void info(Object message, Throwable t);
-
- void debug(Object message);
-
- void debug(Object message, Throwable t);
-
- void trace(Object message);
-
- void trace(Object message, Throwable t);
-}
\ No newline at end of file
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/LogDelegateFactory.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/LogDelegateFactory.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/LogDelegateFactory.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,26 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.spi.core.logging;
-
-/**
- * I am responsible for creating {@link LogDelegate} instances.
- *
- * @author <a href="kenny.macleod(a)kizoom.com">Kenny MacLeod</a>
- *
- *
- */
-public interface LogDelegateFactory
-{
- LogDelegate createDelegate(Class<?> clazz);
-}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/package-info.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/package-info.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/spi/core/logging/package-info.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,21 +0,0 @@
-/*
- * Copyright 2009 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.
- */
-
-/**
- * Logging SPI.
- * <br>
- * This package defines the Service Provide Interface to
- * support different logging implementation.
- */
-package org.hornetq.spi.core.logging;
-
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/utils/DataConstants.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/utils/DataConstants.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/utils/DataConstants.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,68 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.utils;
-
-/**
- *
- * A DataConstants
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- */
-public class DataConstants
-{
- public static final int SIZE_INT = 4;
-
- public static final int SIZE_BOOLEAN = 1;
-
- public static final int SIZE_LONG = 8;
-
- public static final int SIZE_BYTE = 1;
-
- public static final int SIZE_SHORT = 2;
-
- public static final int SIZE_DOUBLE = 8;
-
- public static final int SIZE_FLOAT = 4;
-
- public static final int SIZE_CHAR = 2;
-
- public static final byte TRUE = 1;
-
- public static final byte FALSE = 0;
-
- public static final byte NULL = 0;
-
- public static final byte NOT_NULL = 1;
-
- public static final byte BOOLEAN = 2;
-
- public static final byte BYTE = 3;
-
- public static final byte BYTES = 4;
-
- public static final byte SHORT = 5;
-
- public static final byte INT = 6;
-
- public static final byte LONG = 7;
-
- public static final byte FLOAT = 8;
-
- public static final byte DOUBLE = 9;
-
- public static final byte STRING = 10;
-
- public static final byte CHAR = 11;
-}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/utils/UTF8Util.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/utils/UTF8Util.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/utils/UTF8Util.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,272 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.utils;
-
-import java.lang.ref.SoftReference;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.core.logging.Logger;
-
-/**
- *
- * A UTF8Util
- *
- * This class will write UTFs directly to the ByteOutput (through the MessageBuffer interface)
- *
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- * Created Feb 20, 2009 1:37:18 PM
- *
- *
- */
-public class UTF8Util
-{
- static boolean optimizeStrings = true;
-
- private static final Logger log = Logger.getLogger(UTF8Util.class);
-
- private static final boolean isTrace = UTF8Util.log.isTraceEnabled();
-
- private static ThreadLocal<SoftReference<StringUtilBuffer>> currenBuffer = new ThreadLocal<SoftReference<StringUtilBuffer>>();
-
- public static void saveUTF(final HornetQBuffer out, final String str)
- {
- StringUtilBuffer buffer = UTF8Util.getThreadLocalBuffer();
-
- if (str.length() > 0xffff)
- {
- throw new IllegalArgumentException("the specified string is too long (" + str.length() + ")");
- }
-
- final int len = UTF8Util.calculateUTFSize(str, buffer);
-
- if (len > 0xffff)
- {
- throw new IllegalArgumentException("the encoded string is too long (" + len + ")");
- }
-
- out.writeShort((short)len);
-
- if (len > buffer.byteBuffer.length)
- {
- buffer.resizeByteBuffer(len);
- }
-
- if (len == (long)str.length())
- {
- for (int byteLocation = 0; byteLocation < len; byteLocation++)
- {
- buffer.byteBuffer[byteLocation] = (byte)buffer.charBuffer[byteLocation];
- }
- out.writeBytes(buffer.byteBuffer, 0, len);
- }
- else
- {
- if (UTF8Util.isTrace)
- {
- // This message is too verbose for debug, that's why we are using trace here
- UTF8Util.log.trace("Saving string with utfSize=" + len + " stringSize=" + str.length());
- }
-
- int stringLength = str.length();
-
- int charCount = 0;
-
- for (int i = 0; i < stringLength; i++)
- {
- char charAtPos = buffer.charBuffer[i];
- if (charAtPos >= 1 && charAtPos < 0x7f)
- {
- buffer.byteBuffer[charCount++] = (byte)charAtPos;
- }
- else if (charAtPos >= 0x800)
- {
- buffer.byteBuffer[charCount++] = (byte)(0xE0 | charAtPos >> 12 & 0x0F);
- buffer.byteBuffer[charCount++] = (byte)(0x80 | charAtPos >> 6 & 0x3F);
- buffer.byteBuffer[charCount++] = (byte)(0x80 | charAtPos >> 0 & 0x3F);
- }
- else
- {
- buffer.byteBuffer[charCount++] = (byte)(0xC0 | charAtPos >> 6 & 0x1F);
- buffer.byteBuffer[charCount++] = (byte)(0x80 | charAtPos >> 0 & 0x3F);
-
- }
- }
- out.writeBytes(buffer.byteBuffer, 0, len);
- }
- }
-
- public static String readUTF(final HornetQBuffer input)
- {
- StringUtilBuffer buffer = UTF8Util.getThreadLocalBuffer();
-
- final int size = input.readUnsignedShort();
-
- if (size > buffer.byteBuffer.length)
- {
- buffer.resizeByteBuffer(size);
- }
-
- if (size > buffer.charBuffer.length)
- {
- buffer.resizeCharBuffer(size);
- }
-
- if (UTF8Util.isTrace)
- {
- // This message is too verbose for debug, that's why we are using trace here
- UTF8Util.log.trace("Reading string with utfSize=" + size);
- }
-
- int count = 0;
- int byte1, byte2, byte3;
- int charCount = 0;
-
- input.readBytes(buffer.byteBuffer, 0, size);
-
- while (count < size)
- {
- byte1 = buffer.byteBuffer[count++];
-
- if (byte1 > 0 && byte1 <= 0x7F)
- {
- buffer.charBuffer[charCount++] = (char)byte1;
- }
- else
- {
- int c = byte1 & 0xff;
- switch (c >> 4)
- {
- case 0xc:
- case 0xd:
- byte2 = buffer.byteBuffer[count++];
- buffer.charBuffer[charCount++] = (char)((c & 0x1F) << 6 | byte2 & 0x3F);
- break;
- case 0xe:
- byte2 = buffer.byteBuffer[count++];
- byte3 = buffer.byteBuffer[count++];
- buffer.charBuffer[charCount++] = (char)((c & 0x0F) << 12 | (byte2 & 0x3F) << 6 | (byte3 & 0x3F) << 0);
- break;
- }
- }
- }
-
- return new String(buffer.charBuffer, 0, charCount);
-
- }
-
- private static StringUtilBuffer getThreadLocalBuffer()
- {
- SoftReference<StringUtilBuffer> softReference = UTF8Util.currenBuffer.get();
- StringUtilBuffer value;
- if (softReference == null)
- {
- value = new StringUtilBuffer();
- softReference = new SoftReference<StringUtilBuffer>(value);
- UTF8Util.currenBuffer.set(softReference);
- }
- else
- {
- value = softReference.get();
- }
-
- if (value == null)
- {
- value = new StringUtilBuffer();
- softReference = new SoftReference<StringUtilBuffer>(value);
- UTF8Util.currenBuffer.set(softReference);
- }
-
- return value;
- }
-
- public static void clearBuffer()
- {
- SoftReference<StringUtilBuffer> ref = UTF8Util.currenBuffer.get();
- if (ref.get() != null)
- {
- ref.clear();
- }
- }
-
- public static int calculateUTFSize(final String str, final StringUtilBuffer stringBuffer)
- {
- int calculatedLen = 0;
-
- int stringLength = str.length();
-
- if (stringLength > stringBuffer.charBuffer.length)
- {
- stringBuffer.resizeCharBuffer(stringLength);
- }
-
- str.getChars(0, stringLength, stringBuffer.charBuffer, 0);
-
- for (int i = 0; i < stringLength; i++)
- {
- char c = stringBuffer.charBuffer[i];
-
- if (c >= 1 && c < 0x7f)
- {
- calculatedLen++;
- }
- else if (c >= 0x800)
- {
- calculatedLen += 3;
- }
- else
- {
- calculatedLen += 2;
- }
- }
- return calculatedLen;
- }
-
- private static class StringUtilBuffer
- {
-
- public char charBuffer[];
-
- public byte byteBuffer[];
-
- public void resizeCharBuffer(final int newSize)
- {
- if (newSize > charBuffer.length)
- {
- charBuffer = new char[newSize];
- }
- }
-
- public void resizeByteBuffer(final int newSize)
- {
- if (newSize > byteBuffer.length)
- {
- byteBuffer = new byte[newSize];
- }
- }
-
- public StringUtilBuffer()
- {
- this(1024, 1024);
- }
-
- public StringUtilBuffer(final int sizeChar, final int sizeByte)
- {
- charBuffer = new char[sizeChar];
- byteBuffer = new byte[sizeByte];
- }
-
- }
-
-}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-logging/hornetq-logging.iml
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-logging/hornetq-logging.iml 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-logging/hornetq-logging.iml 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
- <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
- <output url="file://$MODULE_DIR$/target/classes" />
- <output-test url="file://$MODULE_DIR$/target/test-classes" />
- <content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
- <excludeFolder url="file://$MODULE_DIR$/target" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="hornetq-core" />
- <orderEntry type="library" name="Maven: org.jboss.netty:netty:3.2.3.Final" level="project" />
- <orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
- </component>
-</module>
-
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-logging/pom.xml
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-logging/pom.xml 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-logging/pom.xml 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,28 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.hornetq</groupId>
- <artifactId>hornetq-pom</artifactId>
- <version>2.2.3-SNAPSHOT</version>
- </parent>
-
- <artifactId>hornetq-logging</artifactId>
- <packaging>jar</packaging>
- <name>HornetQ Logging</name>
-
- <dependencies>
- <dependency>
- <groupId>org.hornetq</groupId>
- <artifactId>hornetq-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
- </dependencies>
-
-
-</project>
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/HornetQLoggerFormatter.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/HornetQLoggerFormatter.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/HornetQLoggerFormatter.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,60 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.integration.logging;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.logging.LogRecord;
-
-/**
- * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
- */
-public class HornetQLoggerFormatter extends java.util.logging.Formatter
-{
- private static String LINE_SEPARATOR = System.getProperty("line.separator");
-
- @Override
- public String format(final LogRecord record)
- {
- Date date = new Date();
- SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss,SSS");
- StringBuffer sb = new StringBuffer();
- // Minimize memory allocations here.
- date.setTime(record.getMillis());
- sb.append("[").append(Thread.currentThread().getName()).append("] ");
- sb.append(dateFormat.format(date)).append(" ");
- sb.append(record.getLevel()).append(" [");
- sb.append(record.getLoggerName()).append("]").append(" ");
- sb.append(record.getMessage());
-
- sb.append(HornetQLoggerFormatter.LINE_SEPARATOR);
- if (record.getThrown() != null)
- {
- try
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- record.getThrown().printStackTrace(pw);
- pw.close();
- sb.append(sw.toString());
- }
- catch (Exception ex)
- {
- }
- }
- return sb.toString();
- }
-
-}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/Log4jLogDelegate.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/Log4jLogDelegate.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/Log4jLogDelegate.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,109 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.integration.logging;
-
-import org.hornetq.spi.core.logging.LogDelegate;
-
-/**
- *
- * A {@link LogDelegate} which delegates to Apache Log4j
- *
- * @author <a href="kenny.macleod(a)kizoom.com">Kenny MacLeod</a>
- *
- */
-public class Log4jLogDelegate implements LogDelegate
-{
- private final org.apache.log4j.Logger logger;
-
- Log4jLogDelegate(final Class<?> clazz)
- {
- logger = org.apache.log4j.Logger.getLogger(clazz);
- }
-
- public boolean isInfoEnabled()
- {
- return logger.isInfoEnabled();
- }
-
- public boolean isDebugEnabled()
- {
- return logger.isDebugEnabled();
- }
-
- public boolean isTraceEnabled()
- {
- return logger.isTraceEnabled();
- }
-
- public void fatal(final Object message)
- {
- logger.fatal(message);
- }
-
- public void fatal(final Object message, final Throwable t)
- {
- logger.fatal(message, t);
- }
-
- public void error(final Object message)
- {
- logger.error(message);
- }
-
- public void error(final Object message, final Throwable t)
- {
- logger.error(message, t);
- }
-
- public void warn(final Object message)
- {
- logger.warn(message);
- }
-
- public void warn(final Object message, final Throwable t)
- {
- logger.warn(message, t);
- }
-
- public void info(final Object message)
- {
- logger.info(message);
- }
-
- public void info(final Object message, final Throwable t)
- {
- logger.info(message, t);
- }
-
- public void debug(final Object message)
- {
- logger.debug(message);
- }
-
- public void debug(final Object message, final Throwable t)
- {
- logger.debug(message, t);
- }
-
- public void trace(final Object message)
- {
- logger.trace(message);
- }
-
- public void trace(final Object message, final Throwable t)
- {
- logger.trace(message, t);
- }
-
-}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/Log4jLogDelegateFactory.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/Log4jLogDelegateFactory.java 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/hornetq-logging/src/main/java/org/hornetq/integration/logging/Log4jLogDelegateFactory.java 2011-05-25 17:30:36 UTC (rev 10727)
@@ -1,36 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.integration.logging;
-
-import org.hornetq.spi.core.logging.LogDelegate;
-import org.hornetq.spi.core.logging.LogDelegateFactory;
-
-/**
- * A {@link LogDelegateFactory} which creates {@link Log4jLogDelegate} instances.
- *
- * @author <a href="kenny.macleod(a)kizoom.com">Kenny MacLeod</a>
- *
- *
- */
-public class Log4jLogDelegateFactory implements LogDelegateFactory
-{
- /* (non-Javadoc)
- * @see org.hornetq.core.logging.LogDelegateFactory#getLogDelegate(java.lang.Class)
- */
- public LogDelegate createDelegate(final Class<?> clazz)
- {
- return new Log4jLogDelegate(clazz);
- }
-
-}
Modified: branches/HORNETQ-698_SplitJournal/pom.xml
===================================================================
--- branches/HORNETQ-698_SplitJournal/pom.xml 2011-05-25 17:25:44 UTC (rev 10726)
+++ branches/HORNETQ-698_SplitJournal/pom.xml 2011-05-25 17:30:36 UTC (rev 10727)
@@ -126,7 +126,7 @@
<module>hornetq-jms-client</module>
<module>hornetq-journal</module>
<module>hornetq-ra</module>
- <module>hornetq-logging</module>
+ <module>hornetq-commons</module>
<module>hornetq-bootstrap</module>
<module>hornetq-jboss-as-integration</module>
<module>hornetq-twitter-integration</module>
13 years, 7 months
JBoss hornetq SVN: r10726 - in branches/HORNETQ-698_SplitJournal: hornetq-core/src/main/java/org/hornetq/core/buffers/impl and 4 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-05-25 13:25:44 -0400 (Wed, 25 May 2011)
New Revision: 10726
Added:
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/api/core/Message.java
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/message/impl/MessageInternal.java
Removed:
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/Message.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/message/impl/MessageInternal.java
Log:
Move back message classes
Copied: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/api/core/Message.java (from rev 10725, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/Message.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/api/core/Message.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/api/core/Message.java 2011-05-25 17:25:44 UTC (rev 10726)
@@ -0,0 +1,520 @@
+/*
+ * Copyright 2009 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.hornetq.api.core;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.hornetq.utils.UUID;
+
+
+/**
+ * A Message is a routable instance that has a payload.
+ * <br/>
+ * The payload (the "body") is opaque to the messaging system.
+ * A Message also has a fixed set of headers (required by the messaging system)
+ * and properties (defined by the users) that can be used by the messaging system
+ * to route the message (e.g. to ensure it matches a queue filter).
+ * <br>
+ * <h2>Message Properties</h2>
+ *
+ * Message can contain properties specified by the users.
+ * It is possible to convert from some types to other types as specified
+ * by the following table:
+ * <pre>
+ * | | boolean byte short int long float double String byte[]
+ * |----------------------------------------------------------------
+ * |boolean | X X
+ * |byte | X X X X X
+ * |short | X X X X
+ * |int | X X X
+ * |long | X X
+ * |float | X X X
+ * |double | X X
+ * |String | X X X X X X X X
+ * |byte[] | X
+ * |-----------------------------------------------------------------
+ * </pre>
+ * <br>
+ * If conversion is not allowed (for example calling {@code getFloatProperty} on a property set a {@code boolean}),
+ * a PropertyConversionException will be thrown.
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ * @author <a href="mailto:clebert.suconic@jboss.com">ClebertSuconic</a>
+ * @version <tt>$Revision: 3341 $</tt>
+ *
+ * $Id: Message.java 3341 2007-11-19 14:34:57Z timfox $
+ */
+public interface Message
+{
+ public static final SimpleString HDR_ACTUAL_EXPIRY_TIME = new SimpleString("_HQ_ACTUAL_EXPIRY");
+
+ public static final SimpleString HDR_ORIGINAL_ADDRESS = new SimpleString("_HQ_ORIG_ADDRESS");
+
+ public static final SimpleString HDR_ORIG_MESSAGE_ID = new SimpleString("_HQ_ORIG_MESSAGE_ID");
+
+ public static final SimpleString HDR_GROUP_ID = new SimpleString("_HQ_GROUP_ID");
+
+ public static final SimpleString HDR_LARGE_COMPRESSED = new SimpleString("_HQ_LARGE_COMPRESSED");
+
+ public static final SimpleString HDR_LARGE_BODY_SIZE = new SimpleString("_HQ_LARGE_SIZE");
+
+ public static final SimpleString HDR_SCHEDULED_DELIVERY_TIME = new SimpleString("_HQ_SCHED_DELIVERY");
+
+ public static final SimpleString HDR_DUPLICATE_DETECTION_ID = new SimpleString("_HQ_DUPL_ID");
+
+ public static final SimpleString HDR_LAST_VALUE_NAME = new SimpleString("_HQ_LVQ_NAME");
+
+ public static final byte DEFAULT_TYPE = 0;
+
+ public static final byte OBJECT_TYPE = 2;
+
+ public static final byte TEXT_TYPE = 3;
+
+ public static final byte BYTES_TYPE = 4;
+
+ public static final byte MAP_TYPE = 5;
+
+ public static final byte STREAM_TYPE = 6;
+
+ /**
+ * Returns the messageID.
+ * <br>
+ * The messageID is set when the message is handled by the server.
+ */
+ long getMessageID();
+
+ /**
+ * Returns the userID - this is an optional user specified UUID that can be set to identify the message
+ * and will be passed around with the message
+ * @return the user id
+ */
+ UUID getUserID();
+
+ /**
+ * Sets the user ID
+ * @param userID
+ */
+ void setUserID(UUID userID);
+
+ /**
+ * Returns the address this message is sent to.
+ */
+ SimpleString getAddress();
+
+ /**
+ * Sets the address to send this message to.
+ *
+ * @param address address to send the message to
+ */
+ void setAddress(SimpleString address);
+
+ /**
+ * Returns this message type.
+ */
+ byte getType();
+
+ /**
+ * Returns whether this message is durable or not.
+ */
+ boolean isDurable();
+
+ /**
+ * Sets whether this message is durable or not.
+ *
+ * @param durable {@code true} to flag this message as durable, {@code false} else
+ */
+ void setDurable(boolean durable);
+
+ /**
+ * Returns the expiration time of this message.
+ */
+ long getExpiration();
+
+ /**
+ * Returns whether this message is expired or not.
+ */
+ boolean isExpired();
+
+ /**
+ * Sets the expiration of this message.
+ *
+ * @param expiration expiration time
+ */
+ void setExpiration(long expiration);
+
+ /**
+ * Returns the message timestamp.
+ * <br>
+ * The timestamp corresponds to the time this message
+ * was handled by a HornetQ server.
+ */
+ long getTimestamp();
+
+ /**
+ * Sets the message timestamp.
+ *
+ * @param timestamp timestamp
+ */
+ void setTimestamp(long timestamp);
+
+ /**
+ * Returns the message priority.
+ *
+ * Values range from 0 (less priority) to 9 (more priority) inclusive.
+ */
+ byte getPriority();
+
+ /**
+ * Sets the message priority.
+ *
+ * Value must be between 0 and 9 inclusive.
+ *
+ * @param priority the new message priority
+ */
+ void setPriority(byte priority);
+
+ /**
+ * Returns the size of the <em>encoded</em> message.
+ */
+ int getEncodeSize();
+
+ /**
+ * Returns whether this message is a <em>large message</em> or a regular message.
+ */
+ boolean isLargeMessage();
+
+ /**
+ * Returns the message body as a HornetQBuffer
+ */
+ HornetQBuffer getBodyBuffer();
+
+ // Properties
+ // -----------------------------------------------------------------
+
+ /**
+ * Puts a boolean property in this message.
+ *
+ * @param key property name
+ * @param value property value
+ */
+ void putBooleanProperty(SimpleString key, boolean value);
+
+ /**
+ * @see #putBooleanProperty(SimpleString, boolean)
+ */
+ void putBooleanProperty(String key, boolean value);
+
+ /**
+ * Puts a byte property in this message.
+ *
+ * @param key property name
+ * @param value property value
+ */
+ void putByteProperty(SimpleString key, byte value);
+
+ /**
+ * @see #putByteProperty(SimpleString, byte)
+ */
+ void putByteProperty(String key, byte value);
+
+ /**
+ * Puts a byte[] property in this message.
+ *
+ * @param key property name
+ * @param value property value
+ */
+ void putBytesProperty(SimpleString key, byte[] value);
+
+ /**
+ * @see #putBytesProperty(SimpleString, byte[])
+ */
+ void putBytesProperty(String key, byte[] value);
+
+ /**
+ * Puts a short property in this message.
+ *
+ * @param key property name
+ * @param value property value
+ */
+ void putShortProperty(SimpleString key, short value);
+
+ /**
+ * @see #putShortProperty(SimpleString, short)
+ */
+ void putShortProperty(String key, short value);
+
+ /**
+ * Puts a int property in this message.
+ *
+ * @param key property name
+ * @param value property value
+ */
+ void putIntProperty(SimpleString key, int value);
+
+ /**
+ * @see #putIntProperty(SimpleString, int)
+ */
+ void putIntProperty(String key, int value);
+
+ /**
+ * Puts a long property in this message.
+ *
+ * @param key property name
+ * @param value property value
+ */
+ void putLongProperty(SimpleString key, long value);
+
+ /**
+ * @see #putLongProperty(SimpleString, long)
+ */
+ void putLongProperty(String key, long value);
+
+ /**
+ * Puts a float property in this message.
+ *
+ * @param key property name
+ * @param value property value
+ */
+ void putFloatProperty(SimpleString key, float value);
+
+ /**
+ * @see #putFloatProperty(SimpleString, float)
+ */
+ void putFloatProperty(String key, float value);
+
+ /**
+ * Puts a double property in this message.
+ *
+ * @param key property name
+ * @param value property value
+ */
+ void putDoubleProperty(SimpleString key, double value);
+
+ /**
+ * @see #putDoubleProperty(SimpleString, double)
+ */
+ void putDoubleProperty(String key, double value);
+
+ /**
+ * Puts a SimpleString property in this message.
+ *
+ * @param key property name
+ * @param value property value
+ */
+ void putStringProperty(SimpleString key, SimpleString value);
+
+ /**
+ * Puts a String property in this message.
+ *
+ * @param key property name
+ * @param value property value
+ */
+ void putStringProperty(String key, String value);
+
+ /**
+ * Puts an Object property in this message.
+ * <br>
+ * Accepted types are:
+ * <ul>
+ * <li>Boolean</li>
+ * <li>Byte</li>
+ * <li>Short</li>
+ * <li>Integer</li>
+ * <li>Long</li>
+ * <li>Float</li>
+ * <li>Double</li>
+ * <li>String</li>
+ * <li>SimpleString</li>
+ * </ul>
+ *
+ * Using any other type will throw a PropertyConversionException.
+ *
+ * @param key property name
+ * @param value property value
+ *
+ * @throws PropertyConversionException if the value is not one of the accepted property types.
+ */
+ void putObjectProperty(SimpleString key, Object value) throws PropertyConversionException;
+
+ /**
+ * @see #putObjectProperty(SimpleString, Object)
+ */
+ void putObjectProperty(String key, Object value) throws PropertyConversionException;
+
+ /**
+ * Removes the property corresponding to the specified key.
+ * @param key property name
+ * @return the value corresponding to the specified key or @{code null}
+ */
+ Object removeProperty(SimpleString key);
+
+
+ /**
+ * @see #removeProperty(SimpleString)
+ */
+ Object removeProperty(String key);
+
+ /**
+ * Returns {@code true} if this message contains a property with the given key, {@code false} else.
+ *
+ * @param key property name
+ */
+ boolean containsProperty(SimpleString key);
+
+ /**
+ * @see #containsProperty(SimpleString)
+ */
+ boolean containsProperty(String key);
+
+ /**
+ * Returns the property corresponding to the specified key as a Boolean.
+ *
+ * @throws PropertyConversionException if the value can not be converted to a Boolean
+ */
+ Boolean getBooleanProperty(SimpleString key) throws PropertyConversionException;
+
+ /**
+ * @see #getBooleanProperty(SimpleString)
+ */
+ Boolean getBooleanProperty(String key) throws PropertyConversionException;
+
+ /**
+ * Returns the property corresponding to the specified key as a Byte.
+ *
+ * @throws PropertyConversionException if the value can not be converted to a Byte
+ */
+ Byte getByteProperty(SimpleString key) throws PropertyConversionException;
+
+ /**
+ * @see #getByteProperty(SimpleString)
+ */
+ Byte getByteProperty(String key) throws PropertyConversionException;
+
+ /**
+ * Returns the property corresponding to the specified key as a Double.
+ *
+ * @throws PropertyConversionException if the value can not be converted to a Double
+ */
+ Double getDoubleProperty(SimpleString key) throws PropertyConversionException;
+
+ /**
+ * @see #getDoubleProperty(SimpleString)
+ */
+ Double getDoubleProperty(String key) throws PropertyConversionException;
+
+ /**
+ * Returns the property corresponding to the specified key as an Integer.
+ *
+ * @throws PropertyConversionException if the value can not be converted to an Integer
+ */
+ Integer getIntProperty(SimpleString key) throws PropertyConversionException;
+
+ /**
+ * @see #getIntProperty(SimpleString)
+ */
+ Integer getIntProperty(String key) throws PropertyConversionException;
+
+ /**
+ * Returns the property corresponding to the specified key as a Long.
+ *
+ * @throws PropertyConversionException if the value can not be converted to a Long
+ */
+ Long getLongProperty(SimpleString key) throws PropertyConversionException;
+
+ /**
+ * @see #getLongProperty(SimpleString)
+ */
+ Long getLongProperty(String key) throws PropertyConversionException;
+
+ /**
+ * Returns the property corresponding to the specified key
+ */
+ Object getObjectProperty(SimpleString key);
+
+ /**
+ * @see #getBooleanProperty(SimpleString)
+ */
+ Object getObjectProperty(String key);
+
+ /**
+ * Returns the property corresponding to the specified key as a Short.
+ *
+ * @throws PropertyConversionException if the value can not be converted to a Short
+ */
+ Short getShortProperty(SimpleString key) throws PropertyConversionException;
+
+ /**
+ * @see #getShortProperty(SimpleString)
+ */
+ Short getShortProperty(String key) throws PropertyConversionException;
+
+ /**
+ * Returns the property corresponding to the specified key as a Float.
+ *
+ * @throws PropertyConversionException if the value can not be converted to a Float
+ */
+ Float getFloatProperty(SimpleString key) throws PropertyConversionException;
+
+ /**
+ * @see #getFloatProperty(SimpleString)
+ */
+ Float getFloatProperty(String key) throws PropertyConversionException;
+
+ /**
+ * Returns the property corresponding to the specified key as a String.
+ *
+ * @throws PropertyConversionException if the value can not be converted to a String
+ */
+ String getStringProperty(SimpleString key) throws PropertyConversionException;
+
+ /**
+ * @see #getStringProperty(SimpleString)
+ */
+ String getStringProperty(String key) throws PropertyConversionException;
+
+ /**
+ * Returns the property corresponding to the specified key as a SimpleString.
+ *
+ * @throws PropertyConversionException if the value can not be converted to a SimpleString
+ */
+ SimpleString getSimpleStringProperty(SimpleString key) throws PropertyConversionException;
+
+ /**
+ * @see #getSimpleStringProperty(SimpleString)
+ */
+ SimpleString getSimpleStringProperty(String key) throws PropertyConversionException;
+
+ /**
+ * Returns the property corresponding to the specified key as a byte[].
+ *
+ * @throws PropertyConversionException if the value can not be converted to a byte[]
+ */
+ byte[] getBytesProperty(SimpleString key) throws PropertyConversionException;
+
+ /**
+ * @see #getBytesProperty(SimpleString)
+ */
+ byte[] getBytesProperty(String key) throws PropertyConversionException;
+
+ /**
+ * Returns all the names of the properties for this message.
+ */
+ Set<SimpleString> getPropertyNames();
+
+ /**
+ * @return Returns the message in Map form, useful when encoding to JSON
+ */
+ Map<String, Object> toMap();
+}
Copied: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java (from rev 10725, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java 2011-05-25 17:25:44 UTC (rev 10726)
@@ -0,0 +1,379 @@
+/*
+ * Copyright 2009 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.hornetq.core.buffers.impl;
+
+import java.nio.ByteBuffer;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.message.impl.MessageInternal;
+
+/**
+ * A ResetLimitWrappedHornetQBuffer
+ *
+ * @author Tim Fox
+ *
+ */
+public class ResetLimitWrappedHornetQBuffer extends ChannelBufferWrapper
+{
+ private static final Logger log = Logger.getLogger(ResetLimitWrappedHornetQBuffer.class);
+
+ private final int limit;
+
+ private final MessageInternal message;
+
+ public ResetLimitWrappedHornetQBuffer(final int limit, final HornetQBuffer buffer, final MessageInternal message)
+ {
+ super(buffer.channelBuffer());
+
+ this.limit = limit;
+
+ if (writerIndex() < limit)
+ {
+ writerIndex(limit);
+ }
+
+ buffer.readerIndex(limit);
+
+ this.message = message;
+ }
+
+ private void changed()
+ {
+ message.bodyChanged();
+ }
+
+ public void setBuffer(final HornetQBuffer buffer)
+ {
+ this.buffer = buffer.channelBuffer();
+ }
+
+ @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 HornetQBuffer src, final int srcIndex, final int length)
+ {
+ changed();
+
+ super.setBytes(index, src, srcIndex, length);
+ }
+
+ @Override
+ public void setBytes(final int index, final HornetQBuffer src, final int length)
+ {
+ changed();
+
+ super.setBytes(index, src, length);
+ }
+
+ @Override
+ public void setBytes(final int index, final HornetQBuffer 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 HornetQBuffer src, final int srcIndex, final int length)
+ {
+ changed();
+
+ super.writeBytes(src, srcIndex, length);
+ }
+
+ @Override
+ public void writeBytes(final HornetQBuffer 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);
+ }
+}
Copied: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/message/impl/MessageInternal.java (from rev 10725, branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/message/impl/MessageInternal.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/message/impl/MessageInternal.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/message/impl/MessageInternal.java 2011-05-25 17:25:44 UTC (rev 10726)
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2009 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.hornetq.core.message.impl;
+
+import java.io.InputStream;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.HornetQException;
+import org.hornetq.api.core.Message;
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.message.BodyEncoder;
+import org.hornetq.utils.TypedProperties;
+
+/**
+ * A MessageInternal
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * TODO - this can be refactored further to separate out large message specific stuff
+ *
+ *
+ */
+public interface MessageInternal extends Message
+{
+ void decodeFromBuffer(HornetQBuffer buffer);
+
+ int getEndOfMessagePosition();
+
+ int getEndOfBodyPosition();
+
+ void checkCopy();
+
+ void bodyChanged();
+
+ void resetCopied();
+
+ boolean isServerMessage();
+
+ HornetQBuffer getEncodedBuffer();
+
+ int getHeadersAndPropertiesEncodeSize();
+
+ HornetQBuffer getWholeBuffer();
+
+ void encodeHeadersAndProperties(HornetQBuffer buffer);
+
+ void decodeHeadersAndProperties(HornetQBuffer buffer);
+
+ BodyEncoder getBodyEncoder() throws HornetQException;
+
+ InputStream getBodyInputStream();
+
+ void setAddressTransient(SimpleString address);
+
+ TypedProperties getTypedProperties();
+}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/Message.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/Message.java 2011-05-25 17:24:27 UTC (rev 10725)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/api/core/Message.java 2011-05-25 17:25:44 UTC (rev 10726)
@@ -1,520 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.api.core;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.hornetq.utils.UUID;
-
-
-/**
- * A Message is a routable instance that has a payload.
- * <br/>
- * The payload (the "body") is opaque to the messaging system.
- * A Message also has a fixed set of headers (required by the messaging system)
- * and properties (defined by the users) that can be used by the messaging system
- * to route the message (e.g. to ensure it matches a queue filter).
- * <br>
- * <h2>Message Properties</h2>
- *
- * Message can contain properties specified by the users.
- * It is possible to convert from some types to other types as specified
- * by the following table:
- * <pre>
- * | | boolean byte short int long float double String byte[]
- * |----------------------------------------------------------------
- * |boolean | X X
- * |byte | X X X X X
- * |short | X X X X
- * |int | X X X
- * |long | X X
- * |float | X X X
- * |double | X X
- * |String | X X X X X X X X
- * |byte[] | X
- * |-----------------------------------------------------------------
- * </pre>
- * <br>
- * If conversion is not allowed (for example calling {@code getFloatProperty} on a property set a {@code boolean}),
- * a PropertyConversionException will be thrown.
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- * @author <a href="mailto:clebert.suconic@jboss.com">ClebertSuconic</a>
- * @version <tt>$Revision: 3341 $</tt>
- *
- * $Id: Message.java 3341 2007-11-19 14:34:57Z timfox $
- */
-public interface Message
-{
- public static final SimpleString HDR_ACTUAL_EXPIRY_TIME = new SimpleString("_HQ_ACTUAL_EXPIRY");
-
- public static final SimpleString HDR_ORIGINAL_ADDRESS = new SimpleString("_HQ_ORIG_ADDRESS");
-
- public static final SimpleString HDR_ORIG_MESSAGE_ID = new SimpleString("_HQ_ORIG_MESSAGE_ID");
-
- public static final SimpleString HDR_GROUP_ID = new SimpleString("_HQ_GROUP_ID");
-
- public static final SimpleString HDR_LARGE_COMPRESSED = new SimpleString("_HQ_LARGE_COMPRESSED");
-
- public static final SimpleString HDR_LARGE_BODY_SIZE = new SimpleString("_HQ_LARGE_SIZE");
-
- public static final SimpleString HDR_SCHEDULED_DELIVERY_TIME = new SimpleString("_HQ_SCHED_DELIVERY");
-
- public static final SimpleString HDR_DUPLICATE_DETECTION_ID = new SimpleString("_HQ_DUPL_ID");
-
- public static final SimpleString HDR_LAST_VALUE_NAME = new SimpleString("_HQ_LVQ_NAME");
-
- public static final byte DEFAULT_TYPE = 0;
-
- public static final byte OBJECT_TYPE = 2;
-
- public static final byte TEXT_TYPE = 3;
-
- public static final byte BYTES_TYPE = 4;
-
- public static final byte MAP_TYPE = 5;
-
- public static final byte STREAM_TYPE = 6;
-
- /**
- * Returns the messageID.
- * <br>
- * The messageID is set when the message is handled by the server.
- */
- long getMessageID();
-
- /**
- * Returns the userID - this is an optional user specified UUID that can be set to identify the message
- * and will be passed around with the message
- * @return the user id
- */
- UUID getUserID();
-
- /**
- * Sets the user ID
- * @param userID
- */
- void setUserID(UUID userID);
-
- /**
- * Returns the address this message is sent to.
- */
- SimpleString getAddress();
-
- /**
- * Sets the address to send this message to.
- *
- * @param address address to send the message to
- */
- void setAddress(SimpleString address);
-
- /**
- * Returns this message type.
- */
- byte getType();
-
- /**
- * Returns whether this message is durable or not.
- */
- boolean isDurable();
-
- /**
- * Sets whether this message is durable or not.
- *
- * @param durable {@code true} to flag this message as durable, {@code false} else
- */
- void setDurable(boolean durable);
-
- /**
- * Returns the expiration time of this message.
- */
- long getExpiration();
-
- /**
- * Returns whether this message is expired or not.
- */
- boolean isExpired();
-
- /**
- * Sets the expiration of this message.
- *
- * @param expiration expiration time
- */
- void setExpiration(long expiration);
-
- /**
- * Returns the message timestamp.
- * <br>
- * The timestamp corresponds to the time this message
- * was handled by a HornetQ server.
- */
- long getTimestamp();
-
- /**
- * Sets the message timestamp.
- *
- * @param timestamp timestamp
- */
- void setTimestamp(long timestamp);
-
- /**
- * Returns the message priority.
- *
- * Values range from 0 (less priority) to 9 (more priority) inclusive.
- */
- byte getPriority();
-
- /**
- * Sets the message priority.
- *
- * Value must be between 0 and 9 inclusive.
- *
- * @param priority the new message priority
- */
- void setPriority(byte priority);
-
- /**
- * Returns the size of the <em>encoded</em> message.
- */
- int getEncodeSize();
-
- /**
- * Returns whether this message is a <em>large message</em> or a regular message.
- */
- boolean isLargeMessage();
-
- /**
- * Returns the message body as a HornetQBuffer
- */
- HornetQBuffer getBodyBuffer();
-
- // Properties
- // -----------------------------------------------------------------
-
- /**
- * Puts a boolean property in this message.
- *
- * @param key property name
- * @param value property value
- */
- void putBooleanProperty(SimpleString key, boolean value);
-
- /**
- * @see #putBooleanProperty(SimpleString, boolean)
- */
- void putBooleanProperty(String key, boolean value);
-
- /**
- * Puts a byte property in this message.
- *
- * @param key property name
- * @param value property value
- */
- void putByteProperty(SimpleString key, byte value);
-
- /**
- * @see #putByteProperty(SimpleString, byte)
- */
- void putByteProperty(String key, byte value);
-
- /**
- * Puts a byte[] property in this message.
- *
- * @param key property name
- * @param value property value
- */
- void putBytesProperty(SimpleString key, byte[] value);
-
- /**
- * @see #putBytesProperty(SimpleString, byte[])
- */
- void putBytesProperty(String key, byte[] value);
-
- /**
- * Puts a short property in this message.
- *
- * @param key property name
- * @param value property value
- */
- void putShortProperty(SimpleString key, short value);
-
- /**
- * @see #putShortProperty(SimpleString, short)
- */
- void putShortProperty(String key, short value);
-
- /**
- * Puts a int property in this message.
- *
- * @param key property name
- * @param value property value
- */
- void putIntProperty(SimpleString key, int value);
-
- /**
- * @see #putIntProperty(SimpleString, int)
- */
- void putIntProperty(String key, int value);
-
- /**
- * Puts a long property in this message.
- *
- * @param key property name
- * @param value property value
- */
- void putLongProperty(SimpleString key, long value);
-
- /**
- * @see #putLongProperty(SimpleString, long)
- */
- void putLongProperty(String key, long value);
-
- /**
- * Puts a float property in this message.
- *
- * @param key property name
- * @param value property value
- */
- void putFloatProperty(SimpleString key, float value);
-
- /**
- * @see #putFloatProperty(SimpleString, float)
- */
- void putFloatProperty(String key, float value);
-
- /**
- * Puts a double property in this message.
- *
- * @param key property name
- * @param value property value
- */
- void putDoubleProperty(SimpleString key, double value);
-
- /**
- * @see #putDoubleProperty(SimpleString, double)
- */
- void putDoubleProperty(String key, double value);
-
- /**
- * Puts a SimpleString property in this message.
- *
- * @param key property name
- * @param value property value
- */
- void putStringProperty(SimpleString key, SimpleString value);
-
- /**
- * Puts a String property in this message.
- *
- * @param key property name
- * @param value property value
- */
- void putStringProperty(String key, String value);
-
- /**
- * Puts an Object property in this message.
- * <br>
- * Accepted types are:
- * <ul>
- * <li>Boolean</li>
- * <li>Byte</li>
- * <li>Short</li>
- * <li>Integer</li>
- * <li>Long</li>
- * <li>Float</li>
- * <li>Double</li>
- * <li>String</li>
- * <li>SimpleString</li>
- * </ul>
- *
- * Using any other type will throw a PropertyConversionException.
- *
- * @param key property name
- * @param value property value
- *
- * @throws PropertyConversionException if the value is not one of the accepted property types.
- */
- void putObjectProperty(SimpleString key, Object value) throws PropertyConversionException;
-
- /**
- * @see #putObjectProperty(SimpleString, Object)
- */
- void putObjectProperty(String key, Object value) throws PropertyConversionException;
-
- /**
- * Removes the property corresponding to the specified key.
- * @param key property name
- * @return the value corresponding to the specified key or @{code null}
- */
- Object removeProperty(SimpleString key);
-
-
- /**
- * @see #removeProperty(SimpleString)
- */
- Object removeProperty(String key);
-
- /**
- * Returns {@code true} if this message contains a property with the given key, {@code false} else.
- *
- * @param key property name
- */
- boolean containsProperty(SimpleString key);
-
- /**
- * @see #containsProperty(SimpleString)
- */
- boolean containsProperty(String key);
-
- /**
- * Returns the property corresponding to the specified key as a Boolean.
- *
- * @throws PropertyConversionException if the value can not be converted to a Boolean
- */
- Boolean getBooleanProperty(SimpleString key) throws PropertyConversionException;
-
- /**
- * @see #getBooleanProperty(SimpleString)
- */
- Boolean getBooleanProperty(String key) throws PropertyConversionException;
-
- /**
- * Returns the property corresponding to the specified key as a Byte.
- *
- * @throws PropertyConversionException if the value can not be converted to a Byte
- */
- Byte getByteProperty(SimpleString key) throws PropertyConversionException;
-
- /**
- * @see #getByteProperty(SimpleString)
- */
- Byte getByteProperty(String key) throws PropertyConversionException;
-
- /**
- * Returns the property corresponding to the specified key as a Double.
- *
- * @throws PropertyConversionException if the value can not be converted to a Double
- */
- Double getDoubleProperty(SimpleString key) throws PropertyConversionException;
-
- /**
- * @see #getDoubleProperty(SimpleString)
- */
- Double getDoubleProperty(String key) throws PropertyConversionException;
-
- /**
- * Returns the property corresponding to the specified key as an Integer.
- *
- * @throws PropertyConversionException if the value can not be converted to an Integer
- */
- Integer getIntProperty(SimpleString key) throws PropertyConversionException;
-
- /**
- * @see #getIntProperty(SimpleString)
- */
- Integer getIntProperty(String key) throws PropertyConversionException;
-
- /**
- * Returns the property corresponding to the specified key as a Long.
- *
- * @throws PropertyConversionException if the value can not be converted to a Long
- */
- Long getLongProperty(SimpleString key) throws PropertyConversionException;
-
- /**
- * @see #getLongProperty(SimpleString)
- */
- Long getLongProperty(String key) throws PropertyConversionException;
-
- /**
- * Returns the property corresponding to the specified key
- */
- Object getObjectProperty(SimpleString key);
-
- /**
- * @see #getBooleanProperty(SimpleString)
- */
- Object getObjectProperty(String key);
-
- /**
- * Returns the property corresponding to the specified key as a Short.
- *
- * @throws PropertyConversionException if the value can not be converted to a Short
- */
- Short getShortProperty(SimpleString key) throws PropertyConversionException;
-
- /**
- * @see #getShortProperty(SimpleString)
- */
- Short getShortProperty(String key) throws PropertyConversionException;
-
- /**
- * Returns the property corresponding to the specified key as a Float.
- *
- * @throws PropertyConversionException if the value can not be converted to a Float
- */
- Float getFloatProperty(SimpleString key) throws PropertyConversionException;
-
- /**
- * @see #getFloatProperty(SimpleString)
- */
- Float getFloatProperty(String key) throws PropertyConversionException;
-
- /**
- * Returns the property corresponding to the specified key as a String.
- *
- * @throws PropertyConversionException if the value can not be converted to a String
- */
- String getStringProperty(SimpleString key) throws PropertyConversionException;
-
- /**
- * @see #getStringProperty(SimpleString)
- */
- String getStringProperty(String key) throws PropertyConversionException;
-
- /**
- * Returns the property corresponding to the specified key as a SimpleString.
- *
- * @throws PropertyConversionException if the value can not be converted to a SimpleString
- */
- SimpleString getSimpleStringProperty(SimpleString key) throws PropertyConversionException;
-
- /**
- * @see #getSimpleStringProperty(SimpleString)
- */
- SimpleString getSimpleStringProperty(String key) throws PropertyConversionException;
-
- /**
- * Returns the property corresponding to the specified key as a byte[].
- *
- * @throws PropertyConversionException if the value can not be converted to a byte[]
- */
- byte[] getBytesProperty(SimpleString key) throws PropertyConversionException;
-
- /**
- * @see #getBytesProperty(SimpleString)
- */
- byte[] getBytesProperty(String key) throws PropertyConversionException;
-
- /**
- * Returns all the names of the properties for this message.
- */
- Set<SimpleString> getPropertyNames();
-
- /**
- * @return Returns the message in Map form, useful when encoding to JSON
- */
- Map<String, Object> toMap();
-}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java 2011-05-25 17:24:27 UTC (rev 10725)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/buffers/impl/ResetLimitWrappedHornetQBuffer.java 2011-05-25 17:25:44 UTC (rev 10726)
@@ -1,379 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.core.buffers.impl;
-
-import java.nio.ByteBuffer;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.message.impl.MessageInternal;
-
-/**
- * A ResetLimitWrappedHornetQBuffer
- *
- * @author Tim Fox
- *
- */
-public class ResetLimitWrappedHornetQBuffer extends ChannelBufferWrapper
-{
- private static final Logger log = Logger.getLogger(ResetLimitWrappedHornetQBuffer.class);
-
- private final int limit;
-
- private final MessageInternal message;
-
- public ResetLimitWrappedHornetQBuffer(final int limit, final HornetQBuffer buffer, final MessageInternal message)
- {
- super(buffer.channelBuffer());
-
- this.limit = limit;
-
- if (writerIndex() < limit)
- {
- writerIndex(limit);
- }
-
- buffer.readerIndex(limit);
-
- this.message = message;
- }
-
- private void changed()
- {
- message.bodyChanged();
- }
-
- public void setBuffer(final HornetQBuffer buffer)
- {
- this.buffer = buffer.channelBuffer();
- }
-
- @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 HornetQBuffer src, final int srcIndex, final int length)
- {
- changed();
-
- super.setBytes(index, src, srcIndex, length);
- }
-
- @Override
- public void setBytes(final int index, final HornetQBuffer src, final int length)
- {
- changed();
-
- super.setBytes(index, src, length);
- }
-
- @Override
- public void setBytes(final int index, final HornetQBuffer 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 HornetQBuffer src, final int srcIndex, final int length)
- {
- changed();
-
- super.writeBytes(src, srcIndex, length);
- }
-
- @Override
- public void writeBytes(final HornetQBuffer 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);
- }
-}
Deleted: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/message/impl/MessageInternal.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/message/impl/MessageInternal.java 2011-05-25 17:24:27 UTC (rev 10725)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/message/impl/MessageInternal.java 2011-05-25 17:25:44 UTC (rev 10726)
@@ -1,67 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.core.message.impl;
-
-import java.io.InputStream;
-
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQException;
-import org.hornetq.api.core.Message;
-import org.hornetq.api.core.SimpleString;
-import org.hornetq.core.message.BodyEncoder;
-import org.hornetq.utils.TypedProperties;
-
-/**
- * A MessageInternal
- *
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * TODO - this can be refactored further to separate out large message specific stuff
- *
- *
- */
-public interface MessageInternal extends Message
-{
- void decodeFromBuffer(HornetQBuffer buffer);
-
- int getEndOfMessagePosition();
-
- int getEndOfBodyPosition();
-
- void checkCopy();
-
- void bodyChanged();
-
- void resetCopied();
-
- boolean isServerMessage();
-
- HornetQBuffer getEncodedBuffer();
-
- int getHeadersAndPropertiesEncodeSize();
-
- HornetQBuffer getWholeBuffer();
-
- void encodeHeadersAndProperties(HornetQBuffer buffer);
-
- void decodeHeadersAndProperties(HornetQBuffer buffer);
-
- BodyEncoder getBodyEncoder() throws HornetQException;
-
- InputStream getBodyInputStream();
-
- void setAddressTransient(SimpleString address);
-
- TypedProperties getTypedProperties();
-}
13 years, 7 months
JBoss hornetq SVN: r10725 - branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal.
by do-not-reply@jboss.org
Author: borges
Date: 2011-05-25 13:24:27 -0400 (Wed, 25 May 2011)
New Revision: 10725
Modified:
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/Journal.java
Log:
remove trailing whitespace
Modified: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/Journal.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/Journal.java 2011-05-25 17:24:00 UTC (rev 10724)
+++ branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/Journal.java 2011-05-25 17:24:27 UTC (rev 10725)
@@ -18,11 +18,11 @@
import org.hornetq.core.server.HornetQComponent;
/**
- *
+ *
* Most methods on the journal provide a blocking version where you select the sync mode and a non blocking mode where you pass a completion callback as a parameter.
- *
+ *
* Notice also that even on the callback methods it's possible to pass the sync mode. That will only make sense on the NIO operations.
- *
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:clebert.suconic@jboss.com">Clebert Suconic</a>
*
@@ -84,13 +84,13 @@
*/
void appendCommitRecord(long txID, boolean sync, IOCompletion callback, boolean lineUpContext) throws Exception;
- /**
- *
- * <p>If the system crashed after a prepare was called, it should store information that is required to bring the transaction
+ /**
+ *
+ * <p>If the system crashed after a prepare was called, it should store information that is required to bring the transaction
* back to a state it could be committed. </p>
- *
+ *
* <p> transactionData allows you to store any other supporting user-data related to the transaction</p>
- *
+ *
* @param txID
* @param transactionData - extra user data for the prepare
* @throws Exception
@@ -115,7 +115,7 @@
* This is only useful if you're using the journal but not interested on the current data.
* Useful in situations where the journal is being replicated, copied... etc. */
JournalLoadInformation loadInternalOnly() throws Exception;
-
+
void lineUpContex(IOCompletion callback);
JournalLoadInformation load(List<RecordInfo> committedRecords,
@@ -125,7 +125,7 @@
int getAlignment() throws Exception;
int getNumberOfRecords();
-
+
int getUserVersion();
void perfBlast(int pages) throws Exception;
13 years, 7 months
JBoss hornetq SVN: r10724 - branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/config.
by do-not-reply@jboss.org
Author: borges
Date: 2011-05-25 13:24:00 -0400 (Wed, 25 May 2011)
New Revision: 10724
Modified:
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/config/Configuration.java
Log:
Adjust javadoc references.
Modified: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/config/Configuration.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/config/Configuration.java 2011-05-24 15:04:43 UTC (rev 10723)
+++ branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/config/Configuration.java 2011-05-25 17:24:00 UTC (rev 10724)
@@ -29,20 +29,20 @@
import org.hornetq.spi.core.logging.LogDelegateFactory;
/**
- *
+ *
* A Configuration is used to configure HornetQ servers.
- *
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*
*/
public interface Configuration extends Serializable
{
// General attributes -------------------------------------------------------------------
-
-
+
+
/** To be used on dependency management on the application server */
String getName();
-
+
/** To be used on dependency management on the application server */
void setName(String name);
@@ -204,7 +204,7 @@
* Sets whether this server is manageable using JMX or not.
*/
void setJMXManagementEnabled(boolean enabled);
-
+
/**
* Returns the domain used by JMX MBeans (provided JMX management is enabled).
* <br>
@@ -214,7 +214,7 @@
/**
* Sets the domain used by JMX MBeans (provided JMX management is enabled).
- *
+ *
* Changing this JMX domain is required if multiple HornetQ servers are run inside
* the same JVM and all servers are using the same MBeanServer.
*/
@@ -280,7 +280,7 @@
/**
* Returns the name of the connector used to connect to the live node - only used when using shared nothing (shared store = false).
- * <br>
+ * <br>
*/
String getLiveConnectorName();
@@ -599,7 +599,7 @@
/**
* Returns the buffer size (in bytes) for AIO.
* <br>
- * Default value is {@value org.hornetq.core.config.impl.ConfigurationImpl#DEFAULT_JOURNAL_BUFFER_SIZE_AIO}.
+ * Default value is {@value org.hornetq.core.journal.impl.JournalConstants#DEFAULT_JOURNAL_BUFFER_SIZE_AIO}.
*/
int getJournalBufferSize_AIO();
@@ -611,7 +611,7 @@
/**
* Returns the maximum number of write requests for NIO journal.
* <br>
- * Default value is {@value org.hornetq.core.config.impl.ConfigurationImpl#DEFAULT_JOURNAL_MAX_IO_NIO}.
+ * Default value is {@value org.hornetq.core.journal.impl.JournalConstants#DEFAULT_JOURNAL_MAX_IO_NIO}.
*/
int getJournalMaxIO_NIO();
@@ -623,7 +623,7 @@
/**
* Returns the timeout (in nanoseconds) used to flush buffers in the NIO.
* <br>
- * Default value is {@value org.hornetq.core.config.impl.ConfigurationImpl#DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO}.
+ * Default value is {@value org.hornetq.core.journal.impl.JournalConstants#DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO}.
*/
int getJournalBufferTimeout_NIO();
@@ -635,7 +635,7 @@
/**
* Returns the buffer size (in bytes) for NIO.
* <br>
- * Default value is {@value org.hornetq.core.config.impl.ConfigurationImpl#DEFAULT_JOURNAL_BUFFER_SIZE_NIO}.
+ * Default value is {@value org.hornetq.core.journal.impl.JournalConstants#DEFAULT_JOURNAL_BUFFER_SIZE_NIO}.
*/
int getJournalBufferSize_NIO();
@@ -737,7 +737,7 @@
void setWildcardRoutingEnabled(boolean enabled);
/**
- * Returns the timeout (in milliseconds) after which transactions is removed
+ * Returns the timeout (in milliseconds) after which transactions is removed
* from the resource manager after it was created.
* <br>
* Default value is {@value org.hornetq.core.config.impl.ConfigurationImpl#DEFAULT_TRANSACTION_TIMEOUT}.
@@ -745,7 +745,7 @@
long getTransactionTimeout();
/**
- * Sets the timeout (in milliseconds) after which transactions is removed
+ * Sets the timeout (in milliseconds) after which transactions is removed
* from the resource manager after it was created.
*/
void setTransactionTimeout(long timeout);
@@ -771,7 +771,7 @@
/**
* Sets the sample period to take message counter snapshot.
- *
+ *
* @param period value must be greater than 1000ms
*/
void setMessageCounterSamplePeriod(long period);
@@ -785,13 +785,13 @@
/**
* Sets the maximum number of days kept in memory for message counter.
- *
+ *
* @param maxDayHistory value must be greater than 0
*/
void setMessageCounterMaxDayHistory(int maxDayHistory);
/**
- * Returns the frequency (in milliseconds) to scan transactions to detect which transactions
+ * Returns the frequency (in milliseconds) to scan transactions to detect which transactions
* have timed out.
* <br>
* Default value is {@value org.hornetq.core.config.impl.ConfigurationImpl#DEFAULT_TRANSACTION_TIMEOUT_SCAN_PERIOD}.
@@ -799,13 +799,13 @@
long getTransactionTimeoutScanPeriod();
/**
- * Sets the frequency (in milliseconds) to scan transactions to detect which transactions
+ * Sets the frequency (in milliseconds) to scan transactions to detect which transactions
* have timed out.
*/
void setTransactionTimeoutScanPeriod(long period);
/**
- * Returns the frequency (in milliseconds) to scan messages to detect which messages
+ * Returns the frequency (in milliseconds) to scan messages to detect which messages
* have expired.
* <br>
* Default value is {@value org.hornetq.core.config.impl.ConfigurationImpl#DEFAULT_MESSAGE_EXPIRY_SCAN_PERIOD}.
@@ -813,7 +813,7 @@
long getMessageExpiryScanPeriod();
/**
- * Sets the frequency (in milliseconds) to scan messages to detect which messages
+ * Sets the frequency (in milliseconds) to scan messages to detect which messages
* have expired.
*/
void setMessageExpiryScanPeriod(long messageExpiryScanPeriod);
@@ -831,7 +831,7 @@
void setMessageExpiryThreadPriority(int messageExpiryThreadPriority);
/**
- *
+ *
* @return A list of AddressSettings per matching to be deployed to the address settings repository
*/
Map<String, AddressSettings> getAddressesSettings();
@@ -842,25 +842,25 @@
void setAddressesSettings(Map<String, AddressSettings> addressesSettings);
/**
- *
+ *
* @param roles a list of roles per matching
*/
void setSecurityRoles(Map<String, Set<Role>> roles);
/**
- *
+ *
* @return a list of roles per matching
*/
Map<String, Set<Role>> getSecurityRoles();
/**
- *
- * @param
+ *
+ * @param
*/
void setConnectorServiceConfigurations(List<ConnectorServiceConfiguration> configs);
/**
- *
- * @return
+ *
+ * @return
*/
List<ConnectorServiceConfiguration> getConnectorServiceConfigurations();
13 years, 7 months
JBoss hornetq SVN: r10723 - in branches/HORNETQ-698_SplitJournal: tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal and 2 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-05-24 11:04:43 -0400 (Tue, 24 May 2011)
New Revision: 10723
Modified:
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileConfigurationParser.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/AIOJournalCompactTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/AIOJournalImplTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/ValidateTransactionHealthTest.java
branches/HORNETQ-698_SplitJournal/tests/stress-tests/src/test/java/org/hornetq/tests/stress/journal/AIOAllPossibilitiesCompactStressTest.java
branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/config/impl/ConfigurationImplTest.java
branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java
Log:
Fix references to constants
Modified: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileConfigurationParser.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2011-05-24 12:02:21 UTC (rev 10722)
+++ branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2011-05-24 15:04:43 UTC (rev 10723)
@@ -33,6 +33,7 @@
import org.hornetq.core.config.impl.FileConfiguration;
import org.hornetq.core.config.impl.Validators;
import org.hornetq.core.journal.impl.AIOSequentialFileFactory;
+import org.hornetq.core.journal.impl.JournalConstants;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.security.Role;
import org.hornetq.core.server.JournalType;
@@ -139,7 +140,7 @@
/**
* @param validateAIO the validateAIO to set
*/
- public void setValidateAIO(boolean validateAIO)
+ public void setValidateAIO(final boolean validateAIO)
{
this.validateAIO = validateAIO;
}
@@ -479,14 +480,14 @@
int journalBufferTimeout = XMLConfigurationUtil.getInteger(e,
"journal-buffer-timeout",
- config.getJournalType() == JournalType.ASYNCIO ? ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO
- : ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO,
+ config.getJournalType() == JournalType.ASYNCIO ? JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO
+ : JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO,
Validators.GT_ZERO);
int journalBufferSize = XMLConfigurationUtil.getInteger(e,
"journal-buffer-size",
- config.getJournalType() == JournalType.ASYNCIO ? ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_SIZE_AIO
- : ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_SIZE_NIO,
+ config.getJournalType() == JournalType.ASYNCIO ? JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO
+ : JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO,
Validators.GT_ZERO);
int journalMaxIO = XMLConfigurationUtil.getInteger(e,
@@ -1206,7 +1207,7 @@
mainConfig.getBridgeConfigurations().add(config);
}
- private void getStaticConnectors(List<String> staticConnectorNames, Node child)
+ private void getStaticConnectors(final List<String> staticConnectorNames, final Node child)
{
NodeList children2 = ((Element)child).getElementsByTagName("connector-ref");
Modified: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/AIOJournalCompactTest.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/AIOJournalCompactTest.java 2011-05-24 12:02:21 UTC (rev 10722)
+++ branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/AIOJournalCompactTest.java 2011-05-24 15:04:43 UTC (rev 10723)
@@ -17,9 +17,9 @@
import junit.framework.TestSuite;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.journal.SequentialFileFactory;
import org.hornetq.core.journal.impl.AIOSequentialFileFactory;
+import org.hornetq.core.journal.impl.JournalConstants;
import org.hornetq.tests.util.UnitTestCase;
/**
@@ -60,7 +60,7 @@
file.mkdir();
return new AIOSequentialFileFactory(getTestDir(),
- ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_SIZE_AIO,
+ JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO,
1000000,
false);
}
Modified: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/AIOJournalImplTest.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/AIOJournalImplTest.java 2011-05-24 12:02:21 UTC (rev 10722)
+++ branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/AIOJournalImplTest.java 2011-05-24 15:04:43 UTC (rev 10723)
@@ -19,20 +19,20 @@
import junit.framework.TestSuite;
import org.hornetq.core.asyncio.impl.AsynchronousFileImpl;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.journal.SequentialFileFactory;
import org.hornetq.core.journal.impl.AIOSequentialFileFactory;
+import org.hornetq.core.journal.impl.JournalConstants;
import org.hornetq.core.logging.Logger;
import org.hornetq.tests.unit.core.journal.impl.JournalImplTestUnit;
import org.hornetq.tests.util.UnitTestCase;
/**
- *
+ *
* A RealJournalImplTest
* you need to define -Djava.library.path=${project-root}/native/src/.libs when calling the JVM
* If you are running this test in eclipse you should do:
* I - Run->Open Run Dialog
- * II - Find the class on the list (you will find it if you already tried running this testcase before)
+ * II - Find the class on the list (you will find it if you already tried running this testcase before)
* III - Add -Djava.library.path=<your project place>/native/src/.libs
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
@@ -72,7 +72,7 @@
file.mkdir();
return new AIOSequentialFileFactory(getTestDir(),
- ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_SIZE_AIO,
+ JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO,
1000000,
false);
}
Modified: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/ValidateTransactionHealthTest.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/ValidateTransactionHealthTest.java 2011-05-24 12:02:21 UTC (rev 10722)
+++ branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/ValidateTransactionHealthTest.java 2011-05-24 15:04:43 UTC (rev 10723)
@@ -21,13 +21,13 @@
import junit.framework.Assert;
import org.hornetq.core.asyncio.impl.AsynchronousFileImpl;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.journal.Journal;
import org.hornetq.core.journal.LoaderCallback;
import org.hornetq.core.journal.PreparedTransactionInfo;
import org.hornetq.core.journal.RecordInfo;
import org.hornetq.core.journal.SequentialFileFactory;
import org.hornetq.core.journal.impl.AIOSequentialFileFactory;
+import org.hornetq.core.journal.impl.JournalConstants;
import org.hornetq.core.journal.impl.JournalImpl;
import org.hornetq.core.journal.impl.NIOSequentialFileFactory;
import org.hornetq.core.logging.Logger;
@@ -35,9 +35,9 @@
import org.hornetq.tests.util.UnitTestCase;
/**
- *
+ *
* This test spawns a remote VM, as we want to "crash" the VM right after the journal is filled with data
- *
+ *
* @author <a href="mailto:clebert.suconic@jboss.com">Clebert Suconic</a>
*
*/
@@ -400,8 +400,8 @@
if (factoryType.equals("aio"))
{
return new AIOSequentialFileFactory(directory,
- ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_SIZE_AIO,
- ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO,
+ JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO,
+ JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO,
false);
}
else if (factoryType.equals("nio2"))
Modified: branches/HORNETQ-698_SplitJournal/tests/stress-tests/src/test/java/org/hornetq/tests/stress/journal/AIOAllPossibilitiesCompactStressTest.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/tests/stress-tests/src/test/java/org/hornetq/tests/stress/journal/AIOAllPossibilitiesCompactStressTest.java 2011-05-24 12:02:21 UTC (rev 10722)
+++ branches/HORNETQ-698_SplitJournal/tests/stress-tests/src/test/java/org/hornetq/tests/stress/journal/AIOAllPossibilitiesCompactStressTest.java 2011-05-24 15:04:43 UTC (rev 10723)
@@ -15,9 +15,9 @@
import java.io.File;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.journal.SequentialFileFactory;
import org.hornetq.core.journal.impl.AIOSequentialFileFactory;
+import org.hornetq.core.journal.impl.JournalConstants;
/**
* A NIOAllPossibilitiesCompactStressTest
@@ -56,7 +56,7 @@
file.mkdir();
return new AIOSequentialFileFactory(getTestDir(),
- ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_SIZE_AIO,
+ JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO,
1000000,
false);
}
Modified: branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/config/impl/ConfigurationImplTest.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/config/impl/ConfigurationImplTest.java 2011-05-24 12:02:21 UTC (rev 10722)
+++ branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/config/impl/ConfigurationImplTest.java 2011-05-24 15:04:43 UTC (rev 10723)
@@ -23,6 +23,7 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
+import org.hornetq.core.journal.impl.JournalConstants;
import org.hornetq.core.server.JournalType;
import org.hornetq.tests.util.RandomUtil;
import org.hornetq.tests.util.UnitTestCase;
@@ -87,10 +88,10 @@
Assert.assertEquals(ConfigurationImpl.DEFAULT_PAGING_DIR, conf.getPagingDirectory());
Assert.assertEquals(ConfigurationImpl.DEFAULT_LARGE_MESSAGES_DIR, conf.getLargeMessagesDirectory());
Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_COMPACT_PERCENTAGE, conf.getJournalCompactPercentage());
- Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, conf.getJournalBufferTimeout_AIO());
- Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, conf.getJournalBufferTimeout_NIO());
- Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, conf.getJournalBufferSize_AIO());
- Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, conf.getJournalBufferSize_NIO());
+ Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, conf.getJournalBufferTimeout_AIO());
+ Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, conf.getJournalBufferTimeout_NIO());
+ Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, conf.getJournalBufferSize_AIO());
+ Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, conf.getJournalBufferSize_NIO());
Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_LOG_WRITE_RATE, conf.isLogJournalWriteRate());
Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_PERF_BLAST_PAGES, conf.getJournalPerfBlastPages());
Assert.assertEquals(ConfigurationImpl.DEFAULT_MESSAGE_COUNTER_ENABLED, conf.isMessageCounterEnabled());
Modified: branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java 2011-05-24 12:02:21 UTC (rev 10722)
+++ branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java 2011-05-24 15:04:43 UTC (rev 10723)
@@ -20,6 +20,7 @@
import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.config.impl.FileConfiguration;
+import org.hornetq.core.journal.impl.JournalConstants;
/**
*
@@ -109,16 +110,13 @@
Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_MAX_IO_AIO, conf.getJournalMaxIO_AIO());
- Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, conf.getJournalBufferTimeout_AIO());
+ Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, conf.getJournalBufferTimeout_AIO());
- Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, conf.getJournalBufferSize_AIO());
-
+ Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, conf.getJournalBufferSize_AIO());
Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_MAX_IO_NIO, conf.getJournalMaxIO_NIO());
+ Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, conf.getJournalBufferTimeout_NIO());
+ Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, conf.getJournalBufferSize_NIO());
- Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, conf.getJournalBufferTimeout_NIO());
-
- Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, conf.getJournalBufferSize_NIO());
-
Assert.assertEquals(ConfigurationImpl.DEFAULT_CREATE_BINDINGS_DIR, conf.isCreateBindingsDir());
Assert.assertEquals(ConfigurationImpl.DEFAULT_CREATE_JOURNAL_DIR, conf.isCreateJournalDir());
13 years, 7 months
JBoss hornetq SVN: r10722 - in branches/HORNETQ-698_SplitJournal: examples/common/config and 47 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-05-24 08:02:21 -0400 (Tue, 24 May 2011)
New Revision: 10722
Added:
branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMContext.java
branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMNameParser.java
branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/NonSerializableFactory.java
Removed:
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/main/java/
branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/main/java/
branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMContext.java
branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMNameParser.java
branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/util/NonSerializableFactory.java
Modified:
branches/HORNETQ-698_SplitJournal/
branches/HORNETQ-698_SplitJournal/examples/common/config/hornetq-example-beans.xml
branches/HORNETQ-698_SplitJournal/examples/common/src/org/hornetq/common/example/SpawnedVMSupport.java
branches/HORNETQ-698_SplitJournal/examples/core/microcontainer/
branches/HORNETQ-698_SplitJournal/examples/javaee/common/config/ant.properties
branches/HORNETQ-698_SplitJournal/examples/javaee/ejb-jms-transaction/build.xml
branches/HORNETQ-698_SplitJournal/examples/javaee/jca-remote/server0/hornetq-jms.xml
branches/HORNETQ-698_SplitJournal/examples/javaee/jca-remote/server0/hornetq-users.xml
branches/HORNETQ-698_SplitJournal/examples/javaee/mdb-cmt-setrollbackonly/readme.html
branches/HORNETQ-698_SplitJournal/examples/javaee/mdb-cmt-tx-required/readme.html
branches/HORNETQ-698_SplitJournal/examples/jms/browser/server0/hornetq-beans.xml
branches/HORNETQ-698_SplitJournal/examples/jms/browser/server0/hornetq-jms.xml
branches/HORNETQ-698_SplitJournal/examples/jms/browser/server0/hornetq-users.xml
branches/HORNETQ-698_SplitJournal/examples/jms/dead-letter/server0/hornetq-users.xml
branches/HORNETQ-698_SplitJournal/examples/jms/durable-subscription/server0/hornetq-jms.xml
branches/HORNETQ-698_SplitJournal/examples/jms/durable-subscription/server0/hornetq-users.xml
branches/HORNETQ-698_SplitJournal/examples/jms/paging/server0/hornetq-jms.xml
branches/HORNETQ-698_SplitJournal/examples/jms/paging/server0/hornetq-users.xml
branches/HORNETQ-698_SplitJournal/examples/jms/queue-requestor/server0/hornetq-jms.xml
branches/HORNETQ-698_SplitJournal/examples/jms/queue-requestor/server0/hornetq-users.xml
branches/HORNETQ-698_SplitJournal/examples/jms/queue/server0/hornetq-jms.xml
branches/HORNETQ-698_SplitJournal/examples/jms/queue/server0/hornetq-users.xml
branches/HORNETQ-698_SplitJournal/examples/jms/request-reply/server0/hornetq-jms.xml
branches/HORNETQ-698_SplitJournal/examples/jms/request-reply/server0/hornetq-users.xml
branches/HORNETQ-698_SplitJournal/examples/jms/temp-queue/server0/hornetq-jms.xml
branches/HORNETQ-698_SplitJournal/examples/jms/temp-queue/server0/hornetq-users.xml
branches/HORNETQ-698_SplitJournal/examples/jms/topic-selector-example1/
branches/HORNETQ-698_SplitJournal/examples/jms/topic-selector-example2/
branches/HORNETQ-698_SplitJournal/examples/jms/topic/server0/hornetq-jms.xml
branches/HORNETQ-698_SplitJournal/examples/jms/topic/server0/hornetq-users.xml
branches/HORNETQ-698_SplitJournal/examples/jms/transactional/server0/hornetq-jms.xml
branches/HORNETQ-698_SplitJournal/examples/jms/xa-send/
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/buffers/
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/cluster/DiscoveryGroup.java
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/cluster/DiscoveryListener.java
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageLargeServerMessage.java
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/SessionContinuationMessage.java
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/server/management/ManagementService.java
branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/server/management/impl/ManagementServiceImpl.java
branches/HORNETQ-698_SplitJournal/hornetq-jms/src/main/java/org/hornetq/api/jms/management/SubscriptionInfo.java
branches/HORNETQ-698_SplitJournal/hornetq-jms/src/main/java/org/hornetq/jms/server/management/JMSManagementService.java
branches/HORNETQ-698_SplitJournal/hornetq-jms/src/main/java/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/LoaderCallback.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalReaderCallback.java
branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/utils/UTF8Util.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/AckBatchSizeTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/AcknowledgeTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/AutogroupIdTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/CommitRollbackTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerCloseTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerRoundRobinTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/DeliveryOrderTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/LargeMessageTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageCounterTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageHandlerTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageRateTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/PagingTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ProducerCloseTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/QueueBrowserTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ReceiveTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RequestorTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RoutingTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCloseTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateAndDeleteQueueTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateConsumerTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateProducerTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionFactoryTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionSendAcknowledgementHandlerTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionStopStartTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/TransactionalSendTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java
branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/SecurityManagementTestBase.java
branches/HORNETQ-698_SplitJournal/tests/jms-tests/src/test/resources/hornetq-beans.xml
branches/HORNETQ-698_SplitJournal/tests/jms-tests/src/test/resources/hornetq-configuration.xml
branches/HORNETQ-698_SplitJournal/tests/jms-tests/src/test/resources/hornetq-jms.xml
branches/HORNETQ-698_SplitJournal/tests/jms-tests/src/test/resources/hornetq-queues.xml
branches/HORNETQ-698_SplitJournal/tests/jms-tests/src/test/resources/hornetq-users.xml
branches/HORNETQ-698_SplitJournal/tests/jms-tests/src/test/resources/jndi.properties
branches/HORNETQ-698_SplitJournal/tests/stress-tests/src/test/java/org/hornetq/tests/stress/paging/PageStressTest.java
branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/asyncio/AsynchronousFileTest.java
branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java
branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java
branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingManagerImplTest.java
branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/resources/ConfigurationTest-defaults.xml
Log:
merge changes from trunk
Property changes on: branches/HORNETQ-698_SplitJournal
___________________________________________________________________
Modified: svnmerge-integrated
- /trunk:1-10718
+ /trunk:1-10721
Modified: svn:mergeinfo
- /trunk:10706-10717
+ /trunk:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/common/config/hornetq-example-beans.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/common/config/hornetq-example-beans.xml:10706-10717
+ /trunk/examples/common/config/hornetq-example-beans.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/common/src/org/hornetq/common/example/SpawnedVMSupport.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/common/src/org/hornetq/common/example/SpawnedVMSupport.java:10706-10717
+ /trunk/examples/common/src/org/hornetq/common/example/SpawnedVMSupport.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/core/microcontainer
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/core/microcontainer:10706-10717
+ /trunk/examples/core/microcontainer:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/javaee/common/config/ant.properties
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/javaee/common/config/ant.properties:10706-10717
+ /trunk/examples/javaee/common/config/ant.properties:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/javaee/ejb-jms-transaction/build.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/javaee/ejb-jms-transaction/build.xml:10706-10717
+ /trunk/examples/javaee/ejb-jms-transaction/build.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/javaee/jca-remote/server0/hornetq-jms.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/javaee/jca-remote/server0/hornetq-jms.xml:10706-10717
+ /trunk/examples/javaee/jca-remote/server0/hornetq-jms.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/javaee/jca-remote/server0/hornetq-users.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/javaee/jca-remote/server0/hornetq-users.xml:10706-10717
+ /trunk/examples/javaee/jca-remote/server0/hornetq-users.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/javaee/mdb-cmt-setrollbackonly/readme.html
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/javaee/mdb-cmt-setrollbackonly/readme.html:10706-10717
+ /trunk/examples/javaee/mdb-cmt-setrollbackonly/readme.html:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/javaee/mdb-cmt-tx-required/readme.html
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/javaee/mdb-cmt-tx-required/readme.html:10706-10717
+ /trunk/examples/javaee/mdb-cmt-tx-required/readme.html:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/browser/server0/hornetq-beans.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/browser/server0/hornetq-beans.xml:10706-10717
+ /trunk/examples/jms/browser/server0/hornetq-beans.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/browser/server0/hornetq-jms.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/browser/server0/hornetq-jms.xml:10706-10717
+ /trunk/examples/jms/browser/server0/hornetq-jms.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/browser/server0/hornetq-users.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/browser/server0/hornetq-users.xml:10706-10717
+ /trunk/examples/jms/browser/server0/hornetq-users.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/dead-letter/server0/hornetq-users.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/dead-letter/server0/hornetq-users.xml:10706-10717
+ /trunk/examples/jms/dead-letter/server0/hornetq-users.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/durable-subscription/server0/hornetq-jms.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/durable-subscription/server0/hornetq-jms.xml:10706-10717
+ /trunk/examples/jms/durable-subscription/server0/hornetq-jms.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/durable-subscription/server0/hornetq-users.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/durable-subscription/server0/hornetq-users.xml:10706-10717
+ /trunk/examples/jms/durable-subscription/server0/hornetq-users.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/paging/server0/hornetq-jms.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/paging/server0/hornetq-jms.xml:10706-10717
+ /trunk/examples/jms/paging/server0/hornetq-jms.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/paging/server0/hornetq-users.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/paging/server0/hornetq-users.xml:10706-10717
+ /trunk/examples/jms/paging/server0/hornetq-users.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/queue/server0/hornetq-jms.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/queue/server0/hornetq-jms.xml:10706-10717
+ /trunk/examples/jms/queue/server0/hornetq-jms.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/queue/server0/hornetq-users.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/queue/server0/hornetq-users.xml:10706-10717
+ /trunk/examples/jms/queue/server0/hornetq-users.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/queue-requestor/server0/hornetq-jms.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/queue-requestor/server0/hornetq-jms.xml:10706-10717
+ /trunk/examples/jms/queue-requestor/server0/hornetq-jms.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/queue-requestor/server0/hornetq-users.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/queue-requestor/server0/hornetq-users.xml:10706-10717
+ /trunk/examples/jms/queue-requestor/server0/hornetq-users.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/request-reply/server0/hornetq-jms.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/request-reply/server0/hornetq-jms.xml:10706-10717
+ /trunk/examples/jms/request-reply/server0/hornetq-jms.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/request-reply/server0/hornetq-users.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/request-reply/server0/hornetq-users.xml:10706-10717
+ /trunk/examples/jms/request-reply/server0/hornetq-users.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/temp-queue/server0/hornetq-jms.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/temp-queue/server0/hornetq-jms.xml:10706-10717
+ /trunk/examples/jms/temp-queue/server0/hornetq-jms.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/temp-queue/server0/hornetq-users.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/temp-queue/server0/hornetq-users.xml:10706-10717
+ /trunk/examples/jms/temp-queue/server0/hornetq-users.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/topic/server0/hornetq-jms.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/topic/server0/hornetq-jms.xml:10706-10717
+ /trunk/examples/jms/topic/server0/hornetq-jms.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/topic/server0/hornetq-users.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/topic/server0/hornetq-users.xml:10706-10717
+ /trunk/examples/jms/topic/server0/hornetq-users.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/topic-selector-example1
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/topic-selector-example1:10706-10717
+ /trunk/examples/jms/topic-selector-example1:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/topic-selector-example2
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/topic-selector-example2:10706-10717
+ /trunk/examples/jms/topic-selector-example2:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/transactional/server0/hornetq-jms.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/transactional/server0/hornetq-jms.xml:10706-10717
+ /trunk/examples/jms/transactional/server0/hornetq-jms.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/examples/jms/xa-send
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/examples/jms/xa-send:10706-10717
+ /trunk/examples/jms/xa-send:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/buffers
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-core/src/main/java/org/hornetq/core/buffers:10706-10717
+ /trunk/hornetq-core/src/main/java/org/hornetq/core/buffers:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/cluster/DiscoveryGroup.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-core/src/main/java/org/hornetq/core/cluster/DiscoveryGroup.java:10706-10717
+ /trunk/hornetq-core/src/main/java/org/hornetq/core/cluster/DiscoveryGroup.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/cluster/DiscoveryListener.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-core/src/main/java/org/hornetq/core/cluster/DiscoveryListener.java:10706-10717
+ /trunk/hornetq-core/src/main/java/org/hornetq/core/cluster/DiscoveryListener.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-core/src/main/java/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java:10706-10717
+ /trunk/hornetq-core/src/main/java/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java:10706-10717
+ /trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageLargeServerMessage.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageLargeServerMessage.java:10706-10717
+ /trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageLargeServerMessage.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/SessionContinuationMessage.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/SessionContinuationMessage.java:10706-10717
+ /trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/core/impl/wireformat/SessionContinuationMessage.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/server/management/ManagementService.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-core/src/main/java/org/hornetq/core/server/management/ManagementService.java:10706-10717
+ /trunk/hornetq-core/src/main/java/org/hornetq/core/server/management/ManagementService.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-core/src/main/java/org/hornetq/core/server/management/impl/ManagementServiceImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-core/src/main/java/org/hornetq/core/server/management/impl/ManagementServiceImpl.java:10706-10717
+ /trunk/hornetq-core/src/main/java/org/hornetq/core/server/management/impl/ManagementServiceImpl.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-jms/src/main/java/org/hornetq/api/jms/management/SubscriptionInfo.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-jms/src/main/java/org/hornetq/api/jms/management/SubscriptionInfo.java:10706-10717
+ /trunk/hornetq-jms/src/main/java/org/hornetq/api/jms/management/SubscriptionInfo.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-jms/src/main/java/org/hornetq/jms/server/management/JMSManagementService.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-jms/src/main/java/org/hornetq/jms/server/management/JMSManagementService.java:10706-10717
+ /trunk/hornetq-jms/src/main/java/org/hornetq/jms/server/management/JMSManagementService.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-jms/src/main/java/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-jms/src/main/java/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java:10706-10717
+ /trunk/hornetq-jms/src/main/java/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/LoaderCallback.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/LoaderCallback.java:10706-10717
+ /trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/LoaderCallback.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalReaderCallback.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalReaderCallback.java:10706-10717
+ /trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalReaderCallback.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/hornetq-journal/src/main/java/org/hornetq/utils/UTF8Util.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/hornetq-journal/src/main/java/org/hornetq/utils/UTF8Util.java:10706-10717
+ /trunk/hornetq-journal/src/main/java/org/hornetq/utils/UTF8Util.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/AckBatchSizeTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/AckBatchSizeTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/AckBatchSizeTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/AcknowledgeTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/AcknowledgeTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/AcknowledgeTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/AutogroupIdTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/AutogroupIdTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/AutogroupIdTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/CommitRollbackTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/CommitRollbackTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/CommitRollbackTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerCloseTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerCloseTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerCloseTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerRoundRobinTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerRoundRobinTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerRoundRobinTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ConsumerWindowSizeTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/DeliveryOrderTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/DeliveryOrderTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/DeliveryOrderTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/LargeMessageTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/LargeMessageTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/LargeMessageTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageCounterTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageCounterTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageCounterTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageHandlerTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageHandlerTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageHandlerTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageRateTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageRateTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/MessageRateTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/PagingTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/PagingTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/PagingTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ProducerCloseTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ProducerCloseTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ProducerCloseTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/QueueBrowserTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/QueueBrowserTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/QueueBrowserTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ReceiveTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ReceiveTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ReceiveTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RequestorTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RequestorTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RequestorTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RoutingTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RoutingTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/RoutingTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCloseTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCloseTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCloseTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateAndDeleteQueueTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateAndDeleteQueueTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateAndDeleteQueueTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateConsumerTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateConsumerTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateConsumerTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateProducerTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateProducerTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateProducerTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionFactoryTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionFactoryTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionFactoryTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionSendAcknowledgementHandlerTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionSendAcknowledgementHandlerTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionSendAcknowledgementHandlerTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionStopStartTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionStopStartTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionStopStartTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/TransactionalSendTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/TransactionalSendTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/TransactionalSendTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/journal/NIOJournalCompactTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/SecurityManagementTestBase.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/SecurityManagementTestBase.java:10706-10717
+ /trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/management/SecurityManagementTestBase.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/jms-tests/src/test/resources/hornetq-beans.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/jms-tests/src/test/resources/hornetq-beans.xml:10706-10717
+ /trunk/tests/jms-tests/src/test/resources/hornetq-beans.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/jms-tests/src/test/resources/hornetq-configuration.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/jms-tests/src/test/resources/hornetq-configuration.xml:10706-10717
+ /trunk/tests/jms-tests/src/test/resources/hornetq-configuration.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/jms-tests/src/test/resources/hornetq-jms.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/jms-tests/src/test/resources/hornetq-jms.xml:10706-10717
+ /trunk/tests/jms-tests/src/test/resources/hornetq-jms.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/jms-tests/src/test/resources/hornetq-queues.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/jms-tests/src/test/resources/hornetq-queues.xml:10706-10717
+ /trunk/tests/jms-tests/src/test/resources/hornetq-queues.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/jms-tests/src/test/resources/hornetq-users.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/jms-tests/src/test/resources/hornetq-users.xml:10706-10717
+ /trunk/tests/jms-tests/src/test/resources/hornetq-users.xml:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/jms-tests/src/test/resources/jndi.properties
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/jms-tests/src/test/resources/jndi.properties:10706-10717
+ /trunk/tests/jms-tests/src/test/resources/jndi.properties:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/stress-tests/src/test/java/org/hornetq/tests/stress/paging/PageStressTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/stress-tests/src/test/java/org/hornetq/tests/stress/paging/PageStressTest.java:10706-10717
+ /trunk/tests/stress-tests/src/test/java/org/hornetq/tests/stress/paging/PageStressTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/asyncio/AsynchronousFileTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/asyncio/AsynchronousFileTest.java:10706-10717
+ /trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/asyncio/AsynchronousFileTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java:10706-10717
+ /trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java:10706-10717
+ /trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java:10706-10717,10720-10721
Property changes on: branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingManagerImplTest.java
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingManagerImplTest.java:10706-10717
+ /trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/paging/impl/PagingManagerImplTest.java:10706-10717,10720-10721
Copied: branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMContext.java (from rev 10721, trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMContext.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMContext.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMContext.java 2011-05-24 12:02:21 UTC (rev 10722)
@@ -0,0 +1,377 @@
+/*
+ * Copyright 2009 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.hornetq.tests.unit.util;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.Binding;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NameAlreadyBoundException;
+import javax.naming.NameNotFoundException;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.RefAddr;
+import javax.naming.Reference;
+
+import org.hornetq.core.logging.Logger;
+
+/**
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+ *
+ * $Id: InVMContext.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+public class InVMContext implements Context, Serializable
+{
+ // Constants -----------------------------------------------------
+
+ private static final long serialVersionUID = 385743957345L;
+
+ private static final Logger log = Logger.getLogger(InVMContext.class);
+
+ // Static --------------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ protected Map map;
+
+ protected NameParser parser = new InVMNameParser();
+
+ private String nameInNamespace = "";
+
+ // Constructors --------------------------------------------------
+
+ public InVMContext()
+ {
+ map = Collections.synchronizedMap(new HashMap());
+ }
+
+ public InVMContext(final String nameInNamespace)
+ {
+ this();
+ this.nameInNamespace = nameInNamespace;
+ }
+
+ // Context implementation ----------------------------------------
+
+ public Object lookup(final Name name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object lookup(String name) throws NamingException
+ {
+ name = trimSlashes(name);
+ int i = name.indexOf("/");
+ String tok = i == -1 ? name : name.substring(0, i);
+ Object value = map.get(tok);
+ if (value == null)
+ {
+ throw new NameNotFoundException("Name not found: " + tok);
+ }
+ if (value instanceof InVMContext && i != -1)
+ {
+ return ((InVMContext)value).lookup(name.substring(i));
+ }
+ if (value instanceof Reference)
+ {
+ Reference ref = (Reference)value;
+ RefAddr refAddr = ref.get("nns");
+
+ // we only deal with references create by NonSerializableFactory
+ String key = (String)refAddr.getContent();
+ return NonSerializableFactory.lookup(key);
+ }
+ else
+ {
+ return value;
+ }
+ }
+
+ public void bind(final Name name, final Object obj) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void bind(final String name, final Object obj) throws NamingException
+ {
+ internalBind(name, obj, false);
+ }
+
+ public void rebind(final Name name, final Object obj) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void rebind(final String name, final Object obj) throws NamingException
+ {
+ internalBind(name, obj, true);
+ }
+
+ public void unbind(final Name name) throws NamingException
+ {
+ unbind(name.toString());
+ }
+
+ public void unbind(String name) throws NamingException
+ {
+ name = trimSlashes(name);
+ int i = name.indexOf("/");
+ boolean terminal = i == -1;
+ if (terminal)
+ {
+ map.remove(name);
+ }
+ else
+ {
+ String tok = name.substring(0, i);
+ InVMContext c = (InVMContext)map.get(tok);
+ if (c == null)
+ {
+ throw new NameNotFoundException("Context not found: " + tok);
+ }
+ c.unbind(name.substring(i));
+ }
+ }
+
+ public void rename(final Name oldName, final Name newName) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void rename(final String oldName, final String newName) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public NamingEnumeration list(final Name name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public NamingEnumeration list(final String name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public NamingEnumeration listBindings(final Name name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public NamingEnumeration listBindings(String contextName) throws NamingException
+ {
+ contextName = trimSlashes(contextName);
+ if (!"".equals(contextName) && !".".equals(contextName))
+ {
+ try
+ {
+ return ((InVMContext)lookup(contextName)).listBindings("");
+ }
+ catch (Throwable t)
+ {
+ throw new NamingException(t.getMessage());
+ }
+ }
+
+ List l = new ArrayList();
+ for (Iterator i = map.keySet().iterator(); i.hasNext();)
+ {
+ String name = (String)i.next();
+ Object object = map.get(name);
+ l.add(new Binding(name, object));
+ }
+ return new NamingEnumerationImpl(l.iterator());
+ }
+
+ public void destroySubcontext(final Name name) throws NamingException
+ {
+ destroySubcontext(name.toString());
+ }
+
+ public void destroySubcontext(final String name) throws NamingException
+ {
+ map.remove(trimSlashes(name));
+ }
+
+ public Context createSubcontext(final Name name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Context createSubcontext(String name) throws NamingException
+ {
+ name = trimSlashes(name);
+ if (map.get(name) != null)
+ {
+ throw new NameAlreadyBoundException(name);
+ }
+ InVMContext c = new InVMContext(getNameInNamespace());
+ map.put(name, c);
+ return c;
+ }
+
+ public Object lookupLink(final Name name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object lookupLink(final String name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public NameParser getNameParser(final Name name) throws NamingException
+ {
+ return getNameParser(name.toString());
+ }
+
+ public NameParser getNameParser(final String name) throws NamingException
+ {
+ return parser;
+ }
+
+ public Name composeName(final Name name, final Name prefix) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String composeName(final String name, final String prefix) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object addToEnvironment(final String propName, final Object propVal) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object removeFromEnvironment(final String propName) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Hashtable getEnvironment() throws NamingException
+ {
+ Hashtable env = new Hashtable();
+ env.put("java.naming.factory.initial", "org.hornetq.jms.tests.tools.container.InVMInitialContextFactory");
+ env.put("java.naming.provider.url", "org.jboss.naming:org.jnp.interface");
+ return env;
+ }
+
+ public void close() throws NamingException
+ {
+ }
+
+ public String getNameInNamespace() throws NamingException
+ {
+ return nameInNamespace;
+ }
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ private String trimSlashes(String s)
+ {
+ int i = 0;
+ while (true)
+ {
+ if (i == s.length() || s.charAt(i) != '/')
+ {
+ break;
+ }
+ i++;
+ }
+ s = s.substring(i);
+ i = s.length() - 1;
+ while (true)
+ {
+ if (i == -1 || s.charAt(i) != '/')
+ {
+ break;
+ }
+ i--;
+ }
+ return s.substring(0, i + 1);
+ }
+
+ private void internalBind(String name, final Object obj, final boolean rebind) throws NamingException
+ {
+ InVMContext.log.debug("Binding " + name + " obj " + obj + " rebind " + rebind);
+ name = trimSlashes(name);
+ int i = name.lastIndexOf("/");
+ InVMContext c = this;
+ if (i != -1)
+ {
+ String path = name.substring(0, i);
+ c = (InVMContext)lookup(path);
+ }
+ name = name.substring(i + 1);
+ if (!rebind && c.map.get(name) != null)
+ {
+ throw new NameAlreadyBoundException(name);
+ }
+ c.map.put(name, obj);
+ }
+
+ // Inner classes -------------------------------------------------
+
+ private class NamingEnumerationImpl implements NamingEnumeration
+ {
+ private final Iterator iterator;
+
+ NamingEnumerationImpl(final Iterator bindingIterator)
+ {
+ iterator = bindingIterator;
+ }
+
+ public void close() throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean hasMore() throws NamingException
+ {
+ return iterator.hasNext();
+ }
+
+ public Object next() throws NamingException
+ {
+ return iterator.next();
+ }
+
+ public boolean hasMoreElements()
+ {
+ return iterator.hasNext();
+ }
+
+ public Object nextElement()
+ {
+ return iterator.next();
+ }
+ }
+}
Copied: branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMNameParser.java (from rev 10721, trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMNameParser.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMNameParser.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMNameParser.java 2011-05-24 12:02:21 UTC (rev 10722)
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2009 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.hornetq.tests.unit.util;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+import javax.naming.CompoundName;
+import javax.naming.Name;
+import javax.naming.NameParser;
+import javax.naming.NamingException;
+
+/**
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+ *
+ * $Id: InVMNameParser.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+public class InVMNameParser implements NameParser, Serializable
+{
+ // Constants -----------------------------------------------------
+
+ private static final long serialVersionUID = 2925203703371001031L;
+
+ // Static --------------------------------------------------------
+
+ static Properties syntax;
+
+ static
+ {
+ InVMNameParser.syntax = new Properties();
+ InVMNameParser.syntax.put("jndi.syntax.direction", "left_to_right");
+ InVMNameParser.syntax.put("jndi.syntax.ignorecase", "false");
+ InVMNameParser.syntax.put("jndi.syntax.separator", "/");
+ }
+
+ // Attributes ----------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ public static Properties getSyntax()
+ {
+ return InVMNameParser.syntax;
+ }
+
+ public Name parse(final String name) throws NamingException
+ {
+ return new CompoundName(name, InVMNameParser.syntax);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Copied: branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/NonSerializableFactory.java (from rev 10721, trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/NonSerializableFactory.java)
===================================================================
--- branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/NonSerializableFactory.java (rev 0)
+++ branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/NonSerializableFactory.java 2011-05-24 12:02:21 UTC (rev 10722)
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2009 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.hornetq.tests.unit.util;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.RefAddr;
+import javax.naming.Reference;
+import javax.naming.StringRefAddr;
+import javax.naming.spi.ObjectFactory;
+
+import org.jboss.util.naming.Util;
+
+/**
+ * used by the default context when running in embedded local configuration
+ * @author <a href="ataylor(a)redhat.com">Andy Taylor</a>
+ */
+public class NonSerializableFactory implements ObjectFactory
+{
+
+ public NonSerializableFactory()
+ {
+ }
+
+ public static void unbind(final Context ctx, final String strName) throws NamingException
+ {
+ Name name = ctx.getNameParser("").parse(strName);
+ int size = name.size();
+ String atom = name.get(size - 1);
+ Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
+ String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
+ NonSerializableFactory.getWrapperMap().remove(key);
+ Util.unbind(ctx, strName);
+ }
+
+ public static void rebind(final Context ctx, final String strName, final Object value) throws NamingException
+ {
+ Name name = ctx.getNameParser("").parse(strName);
+ int size = name.size();
+ String atom = name.get(size - 1);
+ Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
+ String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
+ NonSerializableFactory.getWrapperMap().put(key, value);
+ String className = value.getClass().getName();
+ String factory = NonSerializableFactory.class.getName();
+ StringRefAddr addr = new StringRefAddr("nns", key);
+ Reference memoryRef = new Reference(className, addr, factory, null);
+ parentCtx.rebind(atom, memoryRef);
+ }
+
+ public static void bind(final Context ctx, final String strName, final Object value) throws NamingException
+ {
+ Name name = ctx.getNameParser("").parse(strName);
+ int size = name.size();
+ String atom = name.get(size - 1);
+ Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
+ String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
+ NonSerializableFactory.getWrapperMap().put(key, value);
+ String className = value.getClass().getName();
+ String factory = NonSerializableFactory.class.getName();
+ StringRefAddr addr = new StringRefAddr("nns", key);
+ Reference memoryRef = new Reference(className, addr, factory, null);
+
+ parentCtx.bind(atom, memoryRef);
+ }
+
+ public static Object lookup(final String name) throws NamingException
+ {
+ if (NonSerializableFactory.getWrapperMap().get(name) == null)
+ {
+ throw new NamingException(name + " not found");
+ }
+ return NonSerializableFactory.getWrapperMap().get(name);
+ }
+
+ public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable env) throws Exception
+ {
+ Reference ref = (Reference)obj;
+ RefAddr addr = ref.get("nns");
+ String key = (String)addr.getContent();
+ return NonSerializableFactory.getWrapperMap().get(key);
+ }
+
+ public static Map getWrapperMap()
+ {
+ return NonSerializableFactory.wrapperMap;
+ }
+
+ private static Map wrapperMap = Collections.synchronizedMap(new HashMap());
+}
\ No newline at end of file
Deleted: branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMContext.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMContext.java 2011-05-24 11:00:09 UTC (rev 10721)
+++ branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMContext.java 2011-05-24 12:02:21 UTC (rev 10722)
@@ -1,377 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.tests.unit.util;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.naming.Binding;
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NameAlreadyBoundException;
-import javax.naming.NameNotFoundException;
-import javax.naming.NameParser;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.RefAddr;
-import javax.naming.Reference;
-
-import org.hornetq.core.logging.Logger;
-
-/**
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision: 2868 $</tt>
- *
- * $Id: InVMContext.java 2868 2007-07-10 20:22:16Z timfox $
- */
-public class InVMContext implements Context, Serializable
-{
- // Constants -----------------------------------------------------
-
- private static final long serialVersionUID = 385743957345L;
-
- private static final Logger log = Logger.getLogger(InVMContext.class);
-
- // Static --------------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- protected Map map;
-
- protected NameParser parser = new InVMNameParser();
-
- private String nameInNamespace = "";
-
- // Constructors --------------------------------------------------
-
- public InVMContext()
- {
- map = Collections.synchronizedMap(new HashMap());
- }
-
- public InVMContext(final String nameInNamespace)
- {
- this();
- this.nameInNamespace = nameInNamespace;
- }
-
- // Context implementation ----------------------------------------
-
- public Object lookup(final Name name) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public Object lookup(String name) throws NamingException
- {
- name = trimSlashes(name);
- int i = name.indexOf("/");
- String tok = i == -1 ? name : name.substring(0, i);
- Object value = map.get(tok);
- if (value == null)
- {
- throw new NameNotFoundException("Name not found: " + tok);
- }
- if (value instanceof InVMContext && i != -1)
- {
- return ((InVMContext)value).lookup(name.substring(i));
- }
- if (value instanceof Reference)
- {
- Reference ref = (Reference)value;
- RefAddr refAddr = ref.get("nns");
-
- // we only deal with references create by NonSerializableFactory
- String key = (String)refAddr.getContent();
- return NonSerializableFactory.lookup(key);
- }
- else
- {
- return value;
- }
- }
-
- public void bind(final Name name, final Object obj) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public void bind(final String name, final Object obj) throws NamingException
- {
- internalBind(name, obj, false);
- }
-
- public void rebind(final Name name, final Object obj) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public void rebind(final String name, final Object obj) throws NamingException
- {
- internalBind(name, obj, true);
- }
-
- public void unbind(final Name name) throws NamingException
- {
- unbind(name.toString());
- }
-
- public void unbind(String name) throws NamingException
- {
- name = trimSlashes(name);
- int i = name.indexOf("/");
- boolean terminal = i == -1;
- if (terminal)
- {
- map.remove(name);
- }
- else
- {
- String tok = name.substring(0, i);
- InVMContext c = (InVMContext)map.get(tok);
- if (c == null)
- {
- throw new NameNotFoundException("Context not found: " + tok);
- }
- c.unbind(name.substring(i));
- }
- }
-
- public void rename(final Name oldName, final Name newName) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public void rename(final String oldName, final String newName) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public NamingEnumeration list(final Name name) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public NamingEnumeration list(final String name) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public NamingEnumeration listBindings(final Name name) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public NamingEnumeration listBindings(String contextName) throws NamingException
- {
- contextName = trimSlashes(contextName);
- if (!"".equals(contextName) && !".".equals(contextName))
- {
- try
- {
- return ((InVMContext)lookup(contextName)).listBindings("");
- }
- catch (Throwable t)
- {
- throw new NamingException(t.getMessage());
- }
- }
-
- List l = new ArrayList();
- for (Iterator i = map.keySet().iterator(); i.hasNext();)
- {
- String name = (String)i.next();
- Object object = map.get(name);
- l.add(new Binding(name, object));
- }
- return new NamingEnumerationImpl(l.iterator());
- }
-
- public void destroySubcontext(final Name name) throws NamingException
- {
- destroySubcontext(name.toString());
- }
-
- public void destroySubcontext(final String name) throws NamingException
- {
- map.remove(trimSlashes(name));
- }
-
- public Context createSubcontext(final Name name) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public Context createSubcontext(String name) throws NamingException
- {
- name = trimSlashes(name);
- if (map.get(name) != null)
- {
- throw new NameAlreadyBoundException(name);
- }
- InVMContext c = new InVMContext(getNameInNamespace());
- map.put(name, c);
- return c;
- }
-
- public Object lookupLink(final Name name) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public Object lookupLink(final String name) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public NameParser getNameParser(final Name name) throws NamingException
- {
- return getNameParser(name.toString());
- }
-
- public NameParser getNameParser(final String name) throws NamingException
- {
- return parser;
- }
-
- public Name composeName(final Name name, final Name prefix) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public String composeName(final String name, final String prefix) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public Object addToEnvironment(final String propName, final Object propVal) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public Object removeFromEnvironment(final String propName) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public Hashtable getEnvironment() throws NamingException
- {
- Hashtable env = new Hashtable();
- env.put("java.naming.factory.initial", "org.hornetq.jms.tests.tools.container.InVMInitialContextFactory");
- env.put("java.naming.provider.url", "org.jboss.naming:org.jnp.interface");
- return env;
- }
-
- public void close() throws NamingException
- {
- }
-
- public String getNameInNamespace() throws NamingException
- {
- return nameInNamespace;
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- private String trimSlashes(String s)
- {
- int i = 0;
- while (true)
- {
- if (i == s.length() || s.charAt(i) != '/')
- {
- break;
- }
- i++;
- }
- s = s.substring(i);
- i = s.length() - 1;
- while (true)
- {
- if (i == -1 || s.charAt(i) != '/')
- {
- break;
- }
- i--;
- }
- return s.substring(0, i + 1);
- }
-
- private void internalBind(String name, final Object obj, final boolean rebind) throws NamingException
- {
- InVMContext.log.debug("Binding " + name + " obj " + obj + " rebind " + rebind);
- name = trimSlashes(name);
- int i = name.lastIndexOf("/");
- InVMContext c = this;
- if (i != -1)
- {
- String path = name.substring(0, i);
- c = (InVMContext)lookup(path);
- }
- name = name.substring(i + 1);
- if (!rebind && c.map.get(name) != null)
- {
- throw new NameAlreadyBoundException(name);
- }
- c.map.put(name, obj);
- }
-
- // Inner classes -------------------------------------------------
-
- private class NamingEnumerationImpl implements NamingEnumeration
- {
- private final Iterator iterator;
-
- NamingEnumerationImpl(final Iterator bindingIterator)
- {
- iterator = bindingIterator;
- }
-
- public void close() throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean hasMore() throws NamingException
- {
- return iterator.hasNext();
- }
-
- public Object next() throws NamingException
- {
- return iterator.next();
- }
-
- public boolean hasMoreElements()
- {
- return iterator.hasNext();
- }
-
- public Object nextElement()
- {
- return iterator.next();
- }
- }
-}
Deleted: branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMNameParser.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMNameParser.java 2011-05-24 11:00:09 UTC (rev 10721)
+++ branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMNameParser.java 2011-05-24 12:02:21 UTC (rev 10722)
@@ -1,71 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.tests.unit.util;
-
-import java.io.Serializable;
-import java.util.Properties;
-
-import javax.naming.CompoundName;
-import javax.naming.Name;
-import javax.naming.NameParser;
-import javax.naming.NamingException;
-
-/**
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision: 2868 $</tt>
- *
- * $Id: InVMNameParser.java 2868 2007-07-10 20:22:16Z timfox $
- */
-public class InVMNameParser implements NameParser, Serializable
-{
- // Constants -----------------------------------------------------
-
- private static final long serialVersionUID = 2925203703371001031L;
-
- // Static --------------------------------------------------------
-
- static Properties syntax;
-
- static
- {
- InVMNameParser.syntax = new Properties();
- InVMNameParser.syntax.put("jndi.syntax.direction", "left_to_right");
- InVMNameParser.syntax.put("jndi.syntax.ignorecase", "false");
- InVMNameParser.syntax.put("jndi.syntax.separator", "/");
- }
-
- // Attributes ----------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- public static Properties getSyntax()
- {
- return InVMNameParser.syntax;
- }
-
- public Name parse(final String name) throws NamingException
- {
- return new CompoundName(name, InVMNameParser.syntax);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted: branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/util/NonSerializableFactory.java
===================================================================
--- branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/util/NonSerializableFactory.java 2011-05-24 11:00:09 UTC (rev 10721)
+++ branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/java/org/hornetq/tests/util/NonSerializableFactory.java 2011-05-24 12:02:21 UTC (rev 10722)
@@ -1,106 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.tests.unit.util;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NamingException;
-import javax.naming.RefAddr;
-import javax.naming.Reference;
-import javax.naming.StringRefAddr;
-import javax.naming.spi.ObjectFactory;
-
-import org.jboss.util.naming.Util;
-
-/**
- * used by the default context when running in embedded local configuration
- * @author <a href="ataylor(a)redhat.com">Andy Taylor</a>
- */
-public class NonSerializableFactory implements ObjectFactory
-{
-
- public NonSerializableFactory()
- {
- }
-
- public static void unbind(final Context ctx, final String strName) throws NamingException
- {
- Name name = ctx.getNameParser("").parse(strName);
- int size = name.size();
- String atom = name.get(size - 1);
- Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
- String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
- NonSerializableFactory.getWrapperMap().remove(key);
- Util.unbind(ctx, strName);
- }
-
- public static void rebind(final Context ctx, final String strName, final Object value) throws NamingException
- {
- Name name = ctx.getNameParser("").parse(strName);
- int size = name.size();
- String atom = name.get(size - 1);
- Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
- String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
- NonSerializableFactory.getWrapperMap().put(key, value);
- String className = value.getClass().getName();
- String factory = NonSerializableFactory.class.getName();
- StringRefAddr addr = new StringRefAddr("nns", key);
- Reference memoryRef = new Reference(className, addr, factory, null);
- parentCtx.rebind(atom, memoryRef);
- }
-
- public static void bind(final Context ctx, final String strName, final Object value) throws NamingException
- {
- Name name = ctx.getNameParser("").parse(strName);
- int size = name.size();
- String atom = name.get(size - 1);
- Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
- String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
- NonSerializableFactory.getWrapperMap().put(key, value);
- String className = value.getClass().getName();
- String factory = NonSerializableFactory.class.getName();
- StringRefAddr addr = new StringRefAddr("nns", key);
- Reference memoryRef = new Reference(className, addr, factory, null);
-
- parentCtx.bind(atom, memoryRef);
- }
-
- public static Object lookup(final String name) throws NamingException
- {
- if (NonSerializableFactory.getWrapperMap().get(name) == null)
- {
- throw new NamingException(name + " not found");
- }
- return NonSerializableFactory.getWrapperMap().get(name);
- }
-
- public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable env) throws Exception
- {
- Reference ref = (Reference)obj;
- RefAddr addr = ref.get("nns");
- String key = (String)addr.getContent();
- return NonSerializableFactory.getWrapperMap().get(key);
- }
-
- public static Map getWrapperMap()
- {
- return NonSerializableFactory.wrapperMap;
- }
-
- private static Map wrapperMap = Collections.synchronizedMap(new HashMap());
-}
\ No newline at end of file
Property changes on: branches/HORNETQ-698_SplitJournal/tests/unit-tests/src/test/resources/ConfigurationTest-defaults.xml
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/tests/unit-tests/src/test/resources/ConfigurationTest-defaults.xml:10706-10717
+ /trunk/tests/unit-tests/src/test/resources/ConfigurationTest-defaults.xml:10706-10717,10720-10721
13 years, 7 months
JBoss hornetq SVN: r10721 - in trunk/tests/unit-tests/src/test/java/org/hornetq/tests: util and 1 other directory.
by do-not-reply@jboss.org
Author: borges
Date: 2011-05-24 07:00:09 -0400 (Tue, 24 May 2011)
New Revision: 10721
Added:
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMContext.java
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMNameParser.java
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/NonSerializableFactory.java
Removed:
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMContext.java
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMNameParser.java
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/NonSerializableFactory.java
Log:
Move classes into correct package
Copied: trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMContext.java (from rev 10720, trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMContext.java)
===================================================================
--- trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMContext.java (rev 0)
+++ trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMContext.java 2011-05-24 11:00:09 UTC (rev 10721)
@@ -0,0 +1,377 @@
+/*
+ * Copyright 2009 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.hornetq.tests.unit.util;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.Binding;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NameAlreadyBoundException;
+import javax.naming.NameNotFoundException;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.RefAddr;
+import javax.naming.Reference;
+
+import org.hornetq.core.logging.Logger;
+
+/**
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+ *
+ * $Id: InVMContext.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+public class InVMContext implements Context, Serializable
+{
+ // Constants -----------------------------------------------------
+
+ private static final long serialVersionUID = 385743957345L;
+
+ private static final Logger log = Logger.getLogger(InVMContext.class);
+
+ // Static --------------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ protected Map map;
+
+ protected NameParser parser = new InVMNameParser();
+
+ private String nameInNamespace = "";
+
+ // Constructors --------------------------------------------------
+
+ public InVMContext()
+ {
+ map = Collections.synchronizedMap(new HashMap());
+ }
+
+ public InVMContext(final String nameInNamespace)
+ {
+ this();
+ this.nameInNamespace = nameInNamespace;
+ }
+
+ // Context implementation ----------------------------------------
+
+ public Object lookup(final Name name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object lookup(String name) throws NamingException
+ {
+ name = trimSlashes(name);
+ int i = name.indexOf("/");
+ String tok = i == -1 ? name : name.substring(0, i);
+ Object value = map.get(tok);
+ if (value == null)
+ {
+ throw new NameNotFoundException("Name not found: " + tok);
+ }
+ if (value instanceof InVMContext && i != -1)
+ {
+ return ((InVMContext)value).lookup(name.substring(i));
+ }
+ if (value instanceof Reference)
+ {
+ Reference ref = (Reference)value;
+ RefAddr refAddr = ref.get("nns");
+
+ // we only deal with references create by NonSerializableFactory
+ String key = (String)refAddr.getContent();
+ return NonSerializableFactory.lookup(key);
+ }
+ else
+ {
+ return value;
+ }
+ }
+
+ public void bind(final Name name, final Object obj) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void bind(final String name, final Object obj) throws NamingException
+ {
+ internalBind(name, obj, false);
+ }
+
+ public void rebind(final Name name, final Object obj) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void rebind(final String name, final Object obj) throws NamingException
+ {
+ internalBind(name, obj, true);
+ }
+
+ public void unbind(final Name name) throws NamingException
+ {
+ unbind(name.toString());
+ }
+
+ public void unbind(String name) throws NamingException
+ {
+ name = trimSlashes(name);
+ int i = name.indexOf("/");
+ boolean terminal = i == -1;
+ if (terminal)
+ {
+ map.remove(name);
+ }
+ else
+ {
+ String tok = name.substring(0, i);
+ InVMContext c = (InVMContext)map.get(tok);
+ if (c == null)
+ {
+ throw new NameNotFoundException("Context not found: " + tok);
+ }
+ c.unbind(name.substring(i));
+ }
+ }
+
+ public void rename(final Name oldName, final Name newName) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void rename(final String oldName, final String newName) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public NamingEnumeration list(final Name name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public NamingEnumeration list(final String name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public NamingEnumeration listBindings(final Name name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public NamingEnumeration listBindings(String contextName) throws NamingException
+ {
+ contextName = trimSlashes(contextName);
+ if (!"".equals(contextName) && !".".equals(contextName))
+ {
+ try
+ {
+ return ((InVMContext)lookup(contextName)).listBindings("");
+ }
+ catch (Throwable t)
+ {
+ throw new NamingException(t.getMessage());
+ }
+ }
+
+ List l = new ArrayList();
+ for (Iterator i = map.keySet().iterator(); i.hasNext();)
+ {
+ String name = (String)i.next();
+ Object object = map.get(name);
+ l.add(new Binding(name, object));
+ }
+ return new NamingEnumerationImpl(l.iterator());
+ }
+
+ public void destroySubcontext(final Name name) throws NamingException
+ {
+ destroySubcontext(name.toString());
+ }
+
+ public void destroySubcontext(final String name) throws NamingException
+ {
+ map.remove(trimSlashes(name));
+ }
+
+ public Context createSubcontext(final Name name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Context createSubcontext(String name) throws NamingException
+ {
+ name = trimSlashes(name);
+ if (map.get(name) != null)
+ {
+ throw new NameAlreadyBoundException(name);
+ }
+ InVMContext c = new InVMContext(getNameInNamespace());
+ map.put(name, c);
+ return c;
+ }
+
+ public Object lookupLink(final Name name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object lookupLink(final String name) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public NameParser getNameParser(final Name name) throws NamingException
+ {
+ return getNameParser(name.toString());
+ }
+
+ public NameParser getNameParser(final String name) throws NamingException
+ {
+ return parser;
+ }
+
+ public Name composeName(final Name name, final Name prefix) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String composeName(final String name, final String prefix) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object addToEnvironment(final String propName, final Object propVal) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object removeFromEnvironment(final String propName) throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Hashtable getEnvironment() throws NamingException
+ {
+ Hashtable env = new Hashtable();
+ env.put("java.naming.factory.initial", "org.hornetq.jms.tests.tools.container.InVMInitialContextFactory");
+ env.put("java.naming.provider.url", "org.jboss.naming:org.jnp.interface");
+ return env;
+ }
+
+ public void close() throws NamingException
+ {
+ }
+
+ public String getNameInNamespace() throws NamingException
+ {
+ return nameInNamespace;
+ }
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ private String trimSlashes(String s)
+ {
+ int i = 0;
+ while (true)
+ {
+ if (i == s.length() || s.charAt(i) != '/')
+ {
+ break;
+ }
+ i++;
+ }
+ s = s.substring(i);
+ i = s.length() - 1;
+ while (true)
+ {
+ if (i == -1 || s.charAt(i) != '/')
+ {
+ break;
+ }
+ i--;
+ }
+ return s.substring(0, i + 1);
+ }
+
+ private void internalBind(String name, final Object obj, final boolean rebind) throws NamingException
+ {
+ InVMContext.log.debug("Binding " + name + " obj " + obj + " rebind " + rebind);
+ name = trimSlashes(name);
+ int i = name.lastIndexOf("/");
+ InVMContext c = this;
+ if (i != -1)
+ {
+ String path = name.substring(0, i);
+ c = (InVMContext)lookup(path);
+ }
+ name = name.substring(i + 1);
+ if (!rebind && c.map.get(name) != null)
+ {
+ throw new NameAlreadyBoundException(name);
+ }
+ c.map.put(name, obj);
+ }
+
+ // Inner classes -------------------------------------------------
+
+ private class NamingEnumerationImpl implements NamingEnumeration
+ {
+ private final Iterator iterator;
+
+ NamingEnumerationImpl(final Iterator bindingIterator)
+ {
+ iterator = bindingIterator;
+ }
+
+ public void close() throws NamingException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean hasMore() throws NamingException
+ {
+ return iterator.hasNext();
+ }
+
+ public Object next() throws NamingException
+ {
+ return iterator.next();
+ }
+
+ public boolean hasMoreElements()
+ {
+ return iterator.hasNext();
+ }
+
+ public Object nextElement()
+ {
+ return iterator.next();
+ }
+ }
+}
Copied: trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMNameParser.java (from rev 10720, trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMNameParser.java)
===================================================================
--- trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMNameParser.java (rev 0)
+++ trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/InVMNameParser.java 2011-05-24 11:00:09 UTC (rev 10721)
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2009 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.hornetq.tests.unit.util;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+import javax.naming.CompoundName;
+import javax.naming.Name;
+import javax.naming.NameParser;
+import javax.naming.NamingException;
+
+/**
+ * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
+ * @version <tt>$Revision: 2868 $</tt>
+ *
+ * $Id: InVMNameParser.java 2868 2007-07-10 20:22:16Z timfox $
+ */
+public class InVMNameParser implements NameParser, Serializable
+{
+ // Constants -----------------------------------------------------
+
+ private static final long serialVersionUID = 2925203703371001031L;
+
+ // Static --------------------------------------------------------
+
+ static Properties syntax;
+
+ static
+ {
+ InVMNameParser.syntax = new Properties();
+ InVMNameParser.syntax.put("jndi.syntax.direction", "left_to_right");
+ InVMNameParser.syntax.put("jndi.syntax.ignorecase", "false");
+ InVMNameParser.syntax.put("jndi.syntax.separator", "/");
+ }
+
+ // Attributes ----------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ public static Properties getSyntax()
+ {
+ return InVMNameParser.syntax;
+ }
+
+ public Name parse(final String name) throws NamingException
+ {
+ return new CompoundName(name, InVMNameParser.syntax);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Copied: trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/NonSerializableFactory.java (from rev 10720, trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/NonSerializableFactory.java)
===================================================================
--- trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/NonSerializableFactory.java (rev 0)
+++ trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/util/NonSerializableFactory.java 2011-05-24 11:00:09 UTC (rev 10721)
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2009 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.hornetq.tests.unit.util;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.RefAddr;
+import javax.naming.Reference;
+import javax.naming.StringRefAddr;
+import javax.naming.spi.ObjectFactory;
+
+import org.jboss.util.naming.Util;
+
+/**
+ * used by the default context when running in embedded local configuration
+ * @author <a href="ataylor(a)redhat.com">Andy Taylor</a>
+ */
+public class NonSerializableFactory implements ObjectFactory
+{
+
+ public NonSerializableFactory()
+ {
+ }
+
+ public static void unbind(final Context ctx, final String strName) throws NamingException
+ {
+ Name name = ctx.getNameParser("").parse(strName);
+ int size = name.size();
+ String atom = name.get(size - 1);
+ Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
+ String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
+ NonSerializableFactory.getWrapperMap().remove(key);
+ Util.unbind(ctx, strName);
+ }
+
+ public static void rebind(final Context ctx, final String strName, final Object value) throws NamingException
+ {
+ Name name = ctx.getNameParser("").parse(strName);
+ int size = name.size();
+ String atom = name.get(size - 1);
+ Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
+ String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
+ NonSerializableFactory.getWrapperMap().put(key, value);
+ String className = value.getClass().getName();
+ String factory = NonSerializableFactory.class.getName();
+ StringRefAddr addr = new StringRefAddr("nns", key);
+ Reference memoryRef = new Reference(className, addr, factory, null);
+ parentCtx.rebind(atom, memoryRef);
+ }
+
+ public static void bind(final Context ctx, final String strName, final Object value) throws NamingException
+ {
+ Name name = ctx.getNameParser("").parse(strName);
+ int size = name.size();
+ String atom = name.get(size - 1);
+ Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
+ String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
+ NonSerializableFactory.getWrapperMap().put(key, value);
+ String className = value.getClass().getName();
+ String factory = NonSerializableFactory.class.getName();
+ StringRefAddr addr = new StringRefAddr("nns", key);
+ Reference memoryRef = new Reference(className, addr, factory, null);
+
+ parentCtx.bind(atom, memoryRef);
+ }
+
+ public static Object lookup(final String name) throws NamingException
+ {
+ if (NonSerializableFactory.getWrapperMap().get(name) == null)
+ {
+ throw new NamingException(name + " not found");
+ }
+ return NonSerializableFactory.getWrapperMap().get(name);
+ }
+
+ public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable env) throws Exception
+ {
+ Reference ref = (Reference)obj;
+ RefAddr addr = ref.get("nns");
+ String key = (String)addr.getContent();
+ return NonSerializableFactory.getWrapperMap().get(key);
+ }
+
+ public static Map getWrapperMap()
+ {
+ return NonSerializableFactory.wrapperMap;
+ }
+
+ private static Map wrapperMap = Collections.synchronizedMap(new HashMap());
+}
\ No newline at end of file
Deleted: trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMContext.java
===================================================================
--- trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMContext.java 2011-05-23 15:14:33 UTC (rev 10720)
+++ trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMContext.java 2011-05-24 11:00:09 UTC (rev 10721)
@@ -1,377 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.tests.unit.util;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.naming.Binding;
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NameAlreadyBoundException;
-import javax.naming.NameNotFoundException;
-import javax.naming.NameParser;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.RefAddr;
-import javax.naming.Reference;
-
-import org.hornetq.core.logging.Logger;
-
-/**
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision: 2868 $</tt>
- *
- * $Id: InVMContext.java 2868 2007-07-10 20:22:16Z timfox $
- */
-public class InVMContext implements Context, Serializable
-{
- // Constants -----------------------------------------------------
-
- private static final long serialVersionUID = 385743957345L;
-
- private static final Logger log = Logger.getLogger(InVMContext.class);
-
- // Static --------------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- protected Map map;
-
- protected NameParser parser = new InVMNameParser();
-
- private String nameInNamespace = "";
-
- // Constructors --------------------------------------------------
-
- public InVMContext()
- {
- map = Collections.synchronizedMap(new HashMap());
- }
-
- public InVMContext(final String nameInNamespace)
- {
- this();
- this.nameInNamespace = nameInNamespace;
- }
-
- // Context implementation ----------------------------------------
-
- public Object lookup(final Name name) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public Object lookup(String name) throws NamingException
- {
- name = trimSlashes(name);
- int i = name.indexOf("/");
- String tok = i == -1 ? name : name.substring(0, i);
- Object value = map.get(tok);
- if (value == null)
- {
- throw new NameNotFoundException("Name not found: " + tok);
- }
- if (value instanceof InVMContext && i != -1)
- {
- return ((InVMContext)value).lookup(name.substring(i));
- }
- if (value instanceof Reference)
- {
- Reference ref = (Reference)value;
- RefAddr refAddr = ref.get("nns");
-
- // we only deal with references create by NonSerializableFactory
- String key = (String)refAddr.getContent();
- return NonSerializableFactory.lookup(key);
- }
- else
- {
- return value;
- }
- }
-
- public void bind(final Name name, final Object obj) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public void bind(final String name, final Object obj) throws NamingException
- {
- internalBind(name, obj, false);
- }
-
- public void rebind(final Name name, final Object obj) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public void rebind(final String name, final Object obj) throws NamingException
- {
- internalBind(name, obj, true);
- }
-
- public void unbind(final Name name) throws NamingException
- {
- unbind(name.toString());
- }
-
- public void unbind(String name) throws NamingException
- {
- name = trimSlashes(name);
- int i = name.indexOf("/");
- boolean terminal = i == -1;
- if (terminal)
- {
- map.remove(name);
- }
- else
- {
- String tok = name.substring(0, i);
- InVMContext c = (InVMContext)map.get(tok);
- if (c == null)
- {
- throw new NameNotFoundException("Context not found: " + tok);
- }
- c.unbind(name.substring(i));
- }
- }
-
- public void rename(final Name oldName, final Name newName) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public void rename(final String oldName, final String newName) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public NamingEnumeration list(final Name name) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public NamingEnumeration list(final String name) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public NamingEnumeration listBindings(final Name name) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public NamingEnumeration listBindings(String contextName) throws NamingException
- {
- contextName = trimSlashes(contextName);
- if (!"".equals(contextName) && !".".equals(contextName))
- {
- try
- {
- return ((InVMContext)lookup(contextName)).listBindings("");
- }
- catch (Throwable t)
- {
- throw new NamingException(t.getMessage());
- }
- }
-
- List l = new ArrayList();
- for (Iterator i = map.keySet().iterator(); i.hasNext();)
- {
- String name = (String)i.next();
- Object object = map.get(name);
- l.add(new Binding(name, object));
- }
- return new NamingEnumerationImpl(l.iterator());
- }
-
- public void destroySubcontext(final Name name) throws NamingException
- {
- destroySubcontext(name.toString());
- }
-
- public void destroySubcontext(final String name) throws NamingException
- {
- map.remove(trimSlashes(name));
- }
-
- public Context createSubcontext(final Name name) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public Context createSubcontext(String name) throws NamingException
- {
- name = trimSlashes(name);
- if (map.get(name) != null)
- {
- throw new NameAlreadyBoundException(name);
- }
- InVMContext c = new InVMContext(getNameInNamespace());
- map.put(name, c);
- return c;
- }
-
- public Object lookupLink(final Name name) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public Object lookupLink(final String name) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public NameParser getNameParser(final Name name) throws NamingException
- {
- return getNameParser(name.toString());
- }
-
- public NameParser getNameParser(final String name) throws NamingException
- {
- return parser;
- }
-
- public Name composeName(final Name name, final Name prefix) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public String composeName(final String name, final String prefix) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public Object addToEnvironment(final String propName, final Object propVal) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public Object removeFromEnvironment(final String propName) throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public Hashtable getEnvironment() throws NamingException
- {
- Hashtable env = new Hashtable();
- env.put("java.naming.factory.initial", "org.hornetq.jms.tests.tools.container.InVMInitialContextFactory");
- env.put("java.naming.provider.url", "org.jboss.naming:org.jnp.interface");
- return env;
- }
-
- public void close() throws NamingException
- {
- }
-
- public String getNameInNamespace() throws NamingException
- {
- return nameInNamespace;
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- private String trimSlashes(String s)
- {
- int i = 0;
- while (true)
- {
- if (i == s.length() || s.charAt(i) != '/')
- {
- break;
- }
- i++;
- }
- s = s.substring(i);
- i = s.length() - 1;
- while (true)
- {
- if (i == -1 || s.charAt(i) != '/')
- {
- break;
- }
- i--;
- }
- return s.substring(0, i + 1);
- }
-
- private void internalBind(String name, final Object obj, final boolean rebind) throws NamingException
- {
- InVMContext.log.debug("Binding " + name + " obj " + obj + " rebind " + rebind);
- name = trimSlashes(name);
- int i = name.lastIndexOf("/");
- InVMContext c = this;
- if (i != -1)
- {
- String path = name.substring(0, i);
- c = (InVMContext)lookup(path);
- }
- name = name.substring(i + 1);
- if (!rebind && c.map.get(name) != null)
- {
- throw new NameAlreadyBoundException(name);
- }
- c.map.put(name, obj);
- }
-
- // Inner classes -------------------------------------------------
-
- private class NamingEnumerationImpl implements NamingEnumeration
- {
- private final Iterator iterator;
-
- NamingEnumerationImpl(final Iterator bindingIterator)
- {
- iterator = bindingIterator;
- }
-
- public void close() throws NamingException
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean hasMore() throws NamingException
- {
- return iterator.hasNext();
- }
-
- public Object next() throws NamingException
- {
- return iterator.next();
- }
-
- public boolean hasMoreElements()
- {
- return iterator.hasNext();
- }
-
- public Object nextElement()
- {
- return iterator.next();
- }
- }
-}
Deleted: trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMNameParser.java
===================================================================
--- trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMNameParser.java 2011-05-23 15:14:33 UTC (rev 10720)
+++ trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/InVMNameParser.java 2011-05-24 11:00:09 UTC (rev 10721)
@@ -1,71 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.tests.unit.util;
-
-import java.io.Serializable;
-import java.util.Properties;
-
-import javax.naming.CompoundName;
-import javax.naming.Name;
-import javax.naming.NameParser;
-import javax.naming.NamingException;
-
-/**
- * @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision: 2868 $</tt>
- *
- * $Id: InVMNameParser.java 2868 2007-07-10 20:22:16Z timfox $
- */
-public class InVMNameParser implements NameParser, Serializable
-{
- // Constants -----------------------------------------------------
-
- private static final long serialVersionUID = 2925203703371001031L;
-
- // Static --------------------------------------------------------
-
- static Properties syntax;
-
- static
- {
- InVMNameParser.syntax = new Properties();
- InVMNameParser.syntax.put("jndi.syntax.direction", "left_to_right");
- InVMNameParser.syntax.put("jndi.syntax.ignorecase", "false");
- InVMNameParser.syntax.put("jndi.syntax.separator", "/");
- }
-
- // Attributes ----------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- public static Properties getSyntax()
- {
- return InVMNameParser.syntax;
- }
-
- public Name parse(final String name) throws NamingException
- {
- return new CompoundName(name, InVMNameParser.syntax);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Deleted: trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/NonSerializableFactory.java
===================================================================
--- trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/NonSerializableFactory.java 2011-05-23 15:14:33 UTC (rev 10720)
+++ trunk/tests/unit-tests/src/test/java/org/hornetq/tests/util/NonSerializableFactory.java 2011-05-24 11:00:09 UTC (rev 10721)
@@ -1,106 +0,0 @@
-/*
- * Copyright 2009 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.hornetq.tests.unit.util;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NamingException;
-import javax.naming.RefAddr;
-import javax.naming.Reference;
-import javax.naming.StringRefAddr;
-import javax.naming.spi.ObjectFactory;
-
-import org.jboss.util.naming.Util;
-
-/**
- * used by the default context when running in embedded local configuration
- * @author <a href="ataylor(a)redhat.com">Andy Taylor</a>
- */
-public class NonSerializableFactory implements ObjectFactory
-{
-
- public NonSerializableFactory()
- {
- }
-
- public static void unbind(final Context ctx, final String strName) throws NamingException
- {
- Name name = ctx.getNameParser("").parse(strName);
- int size = name.size();
- String atom = name.get(size - 1);
- Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
- String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
- NonSerializableFactory.getWrapperMap().remove(key);
- Util.unbind(ctx, strName);
- }
-
- public static void rebind(final Context ctx, final String strName, final Object value) throws NamingException
- {
- Name name = ctx.getNameParser("").parse(strName);
- int size = name.size();
- String atom = name.get(size - 1);
- Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
- String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
- NonSerializableFactory.getWrapperMap().put(key, value);
- String className = value.getClass().getName();
- String factory = NonSerializableFactory.class.getName();
- StringRefAddr addr = new StringRefAddr("nns", key);
- Reference memoryRef = new Reference(className, addr, factory, null);
- parentCtx.rebind(atom, memoryRef);
- }
-
- public static void bind(final Context ctx, final String strName, final Object value) throws NamingException
- {
- Name name = ctx.getNameParser("").parse(strName);
- int size = name.size();
- String atom = name.get(size - 1);
- Context parentCtx = Util.createSubcontext(ctx, name.getPrefix(size - 1));
- String key = new StringBuilder().append(parentCtx.getNameInNamespace()).append("/").append(atom).toString();
- NonSerializableFactory.getWrapperMap().put(key, value);
- String className = value.getClass().getName();
- String factory = NonSerializableFactory.class.getName();
- StringRefAddr addr = new StringRefAddr("nns", key);
- Reference memoryRef = new Reference(className, addr, factory, null);
-
- parentCtx.bind(atom, memoryRef);
- }
-
- public static Object lookup(final String name) throws NamingException
- {
- if (NonSerializableFactory.getWrapperMap().get(name) == null)
- {
- throw new NamingException(name + " not found");
- }
- return NonSerializableFactory.getWrapperMap().get(name);
- }
-
- public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable env) throws Exception
- {
- Reference ref = (Reference)obj;
- RefAddr addr = ref.get("nns");
- String key = (String)addr.getContent();
- return NonSerializableFactory.getWrapperMap().get(key);
- }
-
- public static Map getWrapperMap()
- {
- return NonSerializableFactory.wrapperMap;
- }
-
- private static Map wrapperMap = Collections.synchronizedMap(new HashMap());
-}
\ No newline at end of file
13 years, 7 months
JBoss hornetq SVN: r10718 - branches/HORNETQ-698_SplitJournal.
by do-not-reply@jboss.org
Author: borges
Date: 2011-05-23 10:30:49 -0400 (Mon, 23 May 2011)
New Revision: 10718
Modified:
branches/HORNETQ-698_SplitJournal/
Log:
Using svnmerge to track changes from trunk
Property changes on: branches/HORNETQ-698_SplitJournal
___________________________________________________________________
Added: svnmerge-integrated
+ /trunk:1-10699
13 years, 7 months
JBoss hornetq SVN: r10717 - trunk.
by do-not-reply@jboss.org
Author: borges
Date: 2011-05-23 10:08:54 -0400 (Mon, 23 May 2011)
New Revision: 10717
Modified:
trunk/pom.xml
Log:
Test output to go to std out
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-05-23 13:48:37 UTC (rev 10716)
+++ trunk/pom.xml 2011-05-23 14:08:54 UTC (rev 10717)
@@ -469,7 +469,7 @@
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<runOrder>alphabetical</runOrder>
- <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <redirectTestOutputToFile>false</redirectTestOutputToFile>
</configuration>
</plugin>
<plugin>
13 years, 7 months