This commit is contained in:
Martyn Taylor 2014-11-18 09:23:13 +00:00
commit b5039ab8d5
537 changed files with 3736 additions and 3742 deletions

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.ADDRESS_EXISTS;
import static org.apache.activemq.api.core.ActiveMQExceptionType.ADDRESS_EXISTS;
/**
* An operation failed because an address exists on the server.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 5/2/12
*/
public final class HornetQAddressExistsException extends HornetQException
public final class ActiveMQAddressExistsException extends ActiveMQException
{
private static final long serialVersionUID = 3032730450033992367L;
public HornetQAddressExistsException()
public ActiveMQAddressExistsException()
{
super(ADDRESS_EXISTS);
}
public HornetQAddressExistsException(String msg)
public ActiveMQAddressExistsException(String msg)
{
super(ADDRESS_EXISTS, msg);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.ADDRESS_FULL;
import static org.apache.activemq.api.core.ActiveMQExceptionType.ADDRESS_FULL;
/**
* An address is full.
* @author Justin Bertram
*/
public final class HornetQAddressFullException extends HornetQException
public final class ActiveMQAddressFullException extends ActiveMQException
{
private static final long serialVersionUID = 0;
public HornetQAddressFullException(String message)
public ActiveMQAddressFullException(String message)
{
super(ADDRESS_FULL, message);
}
public HornetQAddressFullException()
public ActiveMQAddressFullException()
{
super(ADDRESS_FULL);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.ALREADY_REPLICATING;
import static org.apache.activemq.api.core.ActiveMQExceptionType.ALREADY_REPLICATING;
/**
* The server is already paired with a replicating backup.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 5/2/12
*/
public final class HornetQAlreadyReplicatingException extends HornetQException
public final class ActiveMQAlreadyReplicatingException extends ActiveMQException
{
private static final long serialVersionUID = -7352538521961996152L;
public HornetQAlreadyReplicatingException()
public ActiveMQAlreadyReplicatingException()
{
super(ALREADY_REPLICATING);
}
public HornetQAlreadyReplicatingException(String msg)
public ActiveMQAlreadyReplicatingException(String msg)
{
super(ALREADY_REPLICATING, msg);
}

View File

@ -20,13 +20,13 @@ import io.netty.buffer.ByteBuf;
/**
* A HornetQBuffer wraps a Netty's ChannelBuffer and is used throughout HornetQ code base.
* <p>
* Instances of it can be obtained from {@link HornetQBuffers} factory.
* Instances of it can be obtained from {@link ActiveMQBuffers} factory.
* <p>
* Much of it derived from Netty ChannelBuffer by Trustin Lee
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @see HornetQBuffers
* @see ActiveMQBuffers
*/
public interface HornetQBuffer
public interface ActiveMQBuffer
{
/**
* Returns the underlying Netty's ByteBuf
@ -287,10 +287,10 @@ public interface HornetQBuffer
* 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
* {@link #getBytes(int, ActiveMQBuffer, 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.
* {@link #getBytes(int, ActiveMQBuffer, int, int)} does not.
* This method does not modify {@code readerIndex} or {@code writerIndex} of
* the source buffer (i.e. {@code this}).
*
@ -299,15 +299,15 @@ public interface HornetQBuffer
* if {@code index + dst.writableBytes} is greater than
* {@code this.capacity}
*/
void getBytes(int index, HornetQBuffer dst);
void getBytes(int index, ActiveMQBuffer 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
* with {@link #getBytes(int, ActiveMQBuffer, 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.
* {@link #getBytes(int, ActiveMQBuffer, int, int)} does not.
* This method does not modify {@code readerIndex} or {@code writerIndex} of
* the source buffer (i.e. {@code this}).
*
@ -319,7 +319,7 @@ public interface HornetQBuffer
* {@code this.capacity}, or
* if {@code length} is greater than {@code dst.writableBytes}
*/
void getBytes(int index, HornetQBuffer dst, int length);
void getBytes(int index, ActiveMQBuffer dst, int length);
/**
* Transfers this buffer's data to the specified destination starting at
@ -338,7 +338,7 @@ public interface HornetQBuffer
* if {@code dstIndex + length} is greater than
* {@code dst.capacity}
*/
void getBytes(int index, HornetQBuffer dst, int dstIndex, int length);
void getBytes(int index, ActiveMQBuffer dst, int dstIndex, int length);
/**
* Transfers this buffer's data to the specified destination starting at
@ -471,10 +471,10 @@ public interface HornetQBuffer
* 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
* {@link #setBytes(int, ActiveMQBuffer, 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.
* {@link #getBytes(int, ActiveMQBuffer, int, int)} does not.
* This method does not modify {@code readerIndex} or {@code writerIndex} of
* the source buffer (i.e. {@code this}).
*
@ -483,15 +483,15 @@ public interface HornetQBuffer
* if {@code index + src.readableBytes} is greater than
* {@code this.capacity}
*/
void setBytes(int index, HornetQBuffer src);
void setBytes(int index, ActiveMQBuffer 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
* with {@link #setBytes(int, ActiveMQBuffer, 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.
* {@link #getBytes(int, ActiveMQBuffer, int, int)} does not.
* This method does not modify {@code readerIndex} or {@code writerIndex} of
* the source buffer (i.e. {@code this}).
*
@ -503,7 +503,7 @@ public interface HornetQBuffer
* {@code this.capacity}, or
* if {@code length} is greater than {@code src.readableBytes}
*/
void setBytes(int index, HornetQBuffer src, int length);
void setBytes(int index, ActiveMQBuffer src, int length);
/**
* Transfers the specified source buffer's data to this buffer starting at
@ -522,7 +522,7 @@ public interface HornetQBuffer
* if {@code srcIndex + length} is greater than
* {@code src.capacity}
*/
void setBytes(int index, HornetQBuffer src, int srcIndex, int length);
void setBytes(int index, ActiveMQBuffer src, int srcIndex, int length);
/**
* Transfers the specified source array's data to this buffer starting at
@ -740,7 +740,7 @@ public interface HornetQBuffer
* @throws IndexOutOfBoundsException
* if {@code length} is greater than {@code this.readableBytes}
*/
HornetQBuffer readBytes(int length);
ActiveMQBuffer readBytes(int length);
/**
* Returns a new slice of this buffer's sub-region starting at the current
@ -754,38 +754,38 @@ public interface HornetQBuffer
* @throws IndexOutOfBoundsException
* if {@code length} is greater than {@code this.readableBytes}
*/
HornetQBuffer readSlice(int length);
ActiveMQBuffer 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
* {@link #readBytes(ActiveMQBuffer, 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)}
* the transferred bytes while {@link #readBytes(ActiveMQBuffer, int, int)}
* does not.
*
* @throws IndexOutOfBoundsException
* if {@code dst.writableBytes} is greater than
* {@code this.readableBytes}
*/
void readBytes(HornetQBuffer dst);
void readBytes(ActiveMQBuffer 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)},
* is basically same with {@link #readBytes(ActiveMQBuffer, 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.
* while {@link #readBytes(ActiveMQBuffer, 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);
void readBytes(ActiveMQBuffer dst, int length);
/**
* Transfers this buffer's data to the specified destination starting at
@ -801,7 +801,7 @@ public interface HornetQBuffer
* if {@code dstIndex + length} is greater than
* {@code dst.capacity}
*/
void readBytes(HornetQBuffer dst, int dstIndex, int length);
void readBytes(ActiveMQBuffer dst, int dstIndex, int length);
/**
* Transfers this buffer's data to the specified destination starting at
@ -949,10 +949,10 @@ public interface HornetQBuffer
* 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)},
* is basically same with {@link #writeBytes(ActiveMQBuffer, 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.
* {@link #writeBytes(ActiveMQBuffer, int, int)} does not.
*
* @param length the number of bytes to transfer
*
@ -960,7 +960,7 @@ public interface HornetQBuffer
* 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);
void writeBytes(ActiveMQBuffer src, int length);
/**
* Transfers the specified source buffer's data to this buffer starting at
@ -976,7 +976,7 @@ public interface HornetQBuffer
* {@code src.capacity}, or
* if {@code length} is greater than {@code this.writableBytes}
*/
void writeBytes(HornetQBuffer src, int srcIndex, int length);
void writeBytes(ActiveMQBuffer src, int srcIndex, int length);
/**
* Transfers the specified source array's data to this buffer starting at
@ -1024,7 +1024,7 @@ public interface HornetQBuffer
* this buffer.
*
*/
HornetQBuffer copy();
ActiveMQBuffer copy();
/**
* Returns a copy of this buffer's sub-region. Modifying the content of
@ -1032,7 +1032,7 @@ public interface HornetQBuffer
* This method does not modify {@code readerIndex} or {@code writerIndex} of
* this buffer.
*/
HornetQBuffer copy(int index, int length);
ActiveMQBuffer copy(int index, int length);
/**
* Returns a slice of this buffer's readable bytes. Modifying the content
@ -1042,7 +1042,7 @@ public interface HornetQBuffer
* This method does not modify {@code readerIndex} or {@code writerIndex} of
* this buffer.
*/
HornetQBuffer slice();
ActiveMQBuffer slice();
/**
* Returns a slice of this buffer's sub-region. Modifying the content of
@ -1051,7 +1051,7 @@ public interface HornetQBuffer
* This method does not modify {@code readerIndex} or {@code writerIndex} of
* this buffer.
*/
HornetQBuffer slice(int index, int length);
ActiveMQBuffer slice(int index, int length);
/**
* Returns a buffer which shares the whole region of this buffer.
@ -1061,7 +1061,7 @@ public interface HornetQBuffer
* This method does not modify {@code readerIndex} or {@code writerIndex} of
* this buffer.
*/
HornetQBuffer duplicate();
ActiveMQBuffer duplicate();
/**
* Converts this buffer's readable bytes into a NIO buffer. The returned

View File

@ -19,10 +19,10 @@ import io.netty.buffer.Unpooled;
import org.apache.activemq.core.buffers.impl.ChannelBufferWrapper;
/**
* Factory class to create instances of {@link HornetQBuffer}.
* Factory class to create instances of {@link ActiveMQBuffer}.
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*/
public final class HornetQBuffers
public final class ActiveMQBuffers
{
/**
* Creates a <em>self-expanding</em> HornetQBuffer with the given initial size
@ -30,7 +30,7 @@ public final class HornetQBuffers
* @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)
public static ActiveMQBuffer dynamicBuffer(final int size)
{
return new ChannelBufferWrapper(Unpooled.buffer(size));
}
@ -41,9 +41,9 @@ public final class HornetQBuffers
* @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)
public static ActiveMQBuffer dynamicBuffer(final byte[] bytes)
{
HornetQBuffer buff = dynamicBuffer(bytes.length);
ActiveMQBuffer buff = dynamicBuffer(bytes.length);
buff.writeBytes(bytes);
@ -58,9 +58,9 @@ public final class HornetQBuffers
* @param underlying the underlying NIO ByteBuffer
* @return a HornetQBuffer wrapping the underlying NIO ByteBuffer
*/
public static HornetQBuffer wrappedBuffer(final ByteBuffer underlying)
public static ActiveMQBuffer wrappedBuffer(final ByteBuffer underlying)
{
HornetQBuffer buff = new ChannelBufferWrapper(Unpooled.wrappedBuffer(underlying));
ActiveMQBuffer buff = new ChannelBufferWrapper(Unpooled.wrappedBuffer(underlying));
buff.clear();
@ -73,7 +73,7 @@ public final class HornetQBuffers
* @param underlying the underlying byte array
* @return a HornetQBuffer wrapping the underlying byte array
*/
public static HornetQBuffer wrappedBuffer(final byte[] underlying)
public static ActiveMQBuffer wrappedBuffer(final byte[] underlying)
{
return new ChannelBufferWrapper(Unpooled.wrappedBuffer(underlying));
}
@ -84,12 +84,12 @@ public final class HornetQBuffers
* @param size the size of the created HornetQBuffer
* @return a fixed HornetQBuffer with the given size
*/
public static HornetQBuffer fixedBuffer(final int size)
public static ActiveMQBuffer fixedBuffer(final int size)
{
return new ChannelBufferWrapper(Unpooled.buffer(size, size));
}
private HornetQBuffers()
private ActiveMQBuffers()
{
// Utility class
}

View File

@ -16,17 +16,17 @@ package org.apache.activemq.api.core;
/**
* Security exception thrown when the cluster user fails authentication.
*/
public final class HornetQClusterSecurityException extends HornetQException
public final class ActiveMQClusterSecurityException extends ActiveMQException
{
private static final long serialVersionUID = -5890578849781297933L;
public HornetQClusterSecurityException()
public ActiveMQClusterSecurityException()
{
super(HornetQExceptionType.CLUSTER_SECURITY_EXCEPTION);
super(ActiveMQExceptionType.CLUSTER_SECURITY_EXCEPTION);
}
public HornetQClusterSecurityException(final String msg)
public ActiveMQClusterSecurityException(final String msg)
{
super(HornetQExceptionType.CLUSTER_SECURITY_EXCEPTION, msg);
super(ActiveMQExceptionType.CLUSTER_SECURITY_EXCEPTION, msg);
}
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.CONNECTION_TIMEDOUT;
import static org.apache.activemq.api.core.ActiveMQExceptionType.CONNECTION_TIMEDOUT;
/**
* A client timed out will connecting to HornetQ server.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
*/
public final class HornetQConnectionTimedOutException extends HornetQException
public final class ActiveMQConnectionTimedOutException extends ActiveMQException
{
private static final long serialVersionUID = 3244233758084830372L;
public HornetQConnectionTimedOutException()
public ActiveMQConnectionTimedOutException()
{
super(CONNECTION_TIMEDOUT);
}
public HornetQConnectionTimedOutException(String msg)
public ActiveMQConnectionTimedOutException(String msg)
{
super(CONNECTION_TIMEDOUT, msg);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.DISCONNECTED;
import static org.apache.activemq.api.core.ActiveMQExceptionType.DISCONNECTED;
/**
* A client was disconnected from HornetQ server when the server has shut down.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
*/
public final class HornetQDisconnectedException extends HornetQException
public final class ActiveMQDisconnectedException extends ActiveMQException
{
private static final long serialVersionUID = 7414966383933311627L;
public HornetQDisconnectedException()
public ActiveMQDisconnectedException()
{
super(DISCONNECTED);
}
public HornetQDisconnectedException(String message)
public ActiveMQDisconnectedException(String message)
{
super(DISCONNECTED, message);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.DUPLICATE_ID_REJECTED;
import static org.apache.activemq.api.core.ActiveMQExceptionType.DUPLICATE_ID_REJECTED;
/**
* A DuplicateID was rejected.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 5/2/12
*/
public final class HornetQDuplicateIdException extends HornetQException
public final class ActiveMQDuplicateIdException extends ActiveMQException
{
private static final long serialVersionUID = -4302979339865777119L;
public HornetQDuplicateIdException()
public ActiveMQDuplicateIdException()
{
super(DUPLICATE_ID_REJECTED);
}
public HornetQDuplicateIdException(String message)
public ActiveMQDuplicateIdException(String message)
{
super(DUPLICATE_ID_REJECTED, message);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.DUPLICATE_METADATA;
import static org.apache.activemq.api.core.ActiveMQExceptionType.DUPLICATE_METADATA;
/**
* A Session Metadata was set in duplication
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 5/2/12
*/
public final class HornetQDuplicateMetaDataException extends HornetQException
public final class ActiveMQDuplicateMetaDataException extends ActiveMQException
{
private static final long serialVersionUID = 7877182872143004058L;
public HornetQDuplicateMetaDataException()
public ActiveMQDuplicateMetaDataException()
{
super(DUPLICATE_METADATA);
}
public HornetQDuplicateMetaDataException(String msg)
public ActiveMQDuplicateMetaDataException(String msg)
{
super(DUPLICATE_METADATA, msg);
}

View File

@ -13,56 +13,56 @@
package org.apache.activemq.api.core;
/**
* HornetQException is the root exception for the HornetQ API.
* ActiveMQException is the root exception for the ActiveMQ API.
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
*/
public class HornetQException extends Exception
public class ActiveMQException extends Exception
{
private static final long serialVersionUID = -4802014152804997417L;
private final HornetQExceptionType type;
private final ActiveMQExceptionType type;
public HornetQException()
public ActiveMQException()
{
type = HornetQExceptionType.GENERIC_EXCEPTION;
type = ActiveMQExceptionType.GENERIC_EXCEPTION;
}
public HornetQException(final String msg)
public ActiveMQException(final String msg)
{
super(msg);
type = HornetQExceptionType.GENERIC_EXCEPTION;
type = ActiveMQExceptionType.GENERIC_EXCEPTION;
}
/*
* This constructor is needed only for the native layer
*/
public HornetQException(int code, String msg)
public ActiveMQException(int code, String msg)
{
super(msg);
this.type = HornetQExceptionType.getType(code);
this.type = ActiveMQExceptionType.getType(code);
}
public HornetQException(HornetQExceptionType type, String msg)
public ActiveMQException(ActiveMQExceptionType type, String msg)
{
super(msg);
this.type = type;
}
public HornetQException(HornetQExceptionType type)
public ActiveMQException(ActiveMQExceptionType type)
{
this.type = type;
}
public HornetQException(HornetQExceptionType type, String message, Throwable t)
public ActiveMQException(ActiveMQExceptionType type, String message, Throwable t)
{
super(message, t);
this.type = type;
}
public HornetQExceptionType getType()
public ActiveMQExceptionType getType()
{
return type;
}

View File

@ -0,0 +1,298 @@
/*
* Copyright 2005-2014 Red Hat, Inc.
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package org.apache.activemq.api.core;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
/**
* Defines all {@link ActiveMQException} types and their codes.
*/
public enum ActiveMQExceptionType
{
// Error codes -------------------------------------------------
INTERNAL_ERROR(000)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQInternalErrorException(msg);
}
},
UNSUPPORTED_PACKET(001)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQUnsupportedPacketException(msg);
}
},
NOT_CONNECTED(002)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQNotConnectedException(msg);
}
},
CONNECTION_TIMEDOUT(003)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQConnectionTimedOutException(msg);
}
},
DISCONNECTED(004)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQDisconnectedException(msg);
}
},
UNBLOCKED(005)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQUnBlockedException(msg);
}
},
IO_ERROR(006)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQIOErrorException(msg);
}
},
QUEUE_DOES_NOT_EXIST(100)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQNonExistentQueueException(msg);
}
},
QUEUE_EXISTS(101)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQQueueExistsException(msg);
}
},
OBJECT_CLOSED(102)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQObjectClosedException(msg);
}
},
INVALID_FILTER_EXPRESSION(103)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQInvalidFilterExpressionException(msg);
}
},
ILLEGAL_STATE(104)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQIllegalStateException(msg);
}
},
SECURITY_EXCEPTION(105)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQSecurityException(msg);
}
},
ADDRESS_EXISTS(107)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQAddressExistsException(msg);
}
},
INCOMPATIBLE_CLIENT_SERVER_VERSIONS(108)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQIncompatibleClientServerException(msg);
}
},
LARGE_MESSAGE_ERROR_BODY(110)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQLargeMessageException(msg);
}
},
TRANSACTION_ROLLED_BACK(111)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQTransactionRolledBackException(msg);
}
},
SESSION_CREATION_REJECTED(112)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQSessionCreationException(msg);
}
},
DUPLICATE_ID_REJECTED(113)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQDuplicateIdException(msg);
}
},
DUPLICATE_METADATA(114)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQDuplicateMetaDataException(msg);
}
},
TRANSACTION_OUTCOME_UNKNOWN(115)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQTransactionOutcomeUnknownException(msg);
}
},
ALREADY_REPLICATING(116)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQAlreadyReplicatingException(msg);
}
},
INTERCEPTOR_REJECTED_PACKET(117)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQInterceptorRejectedPacketException(msg);
}
},
INVALID_TRANSIENT_QUEUE_USE(118)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQInvalidTransientQueueUseException(msg);
}
},
GENERIC_EXCEPTION(999),
NATIVE_ERROR_INTERNAL(200),
NATIVE_ERROR_INVALID_BUFFER(201),
NATIVE_ERROR_NOT_ALIGNED(202),
NATIVE_ERROR_CANT_INITIALIZE_AIO(203),
NATIVE_ERROR_CANT_RELEASE_AIO(204),
NATIVE_ERROR_CANT_OPEN_CLOSE_FILE(205),
NATIVE_ERROR_CANT_ALLOCATE_QUEUE(206),
NATIVE_ERROR_PREALLOCATE_FILE(208),
NATIVE_ERROR_ALLOCATE_MEMORY(209),
ADDRESS_FULL(210)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQAddressFullException(msg);
}
},
LARGE_MESSAGE_INTERRUPTED(211)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQLargeMessageInterruptedException(msg);
}
},
CLUSTER_SECURITY_EXCEPTION(212)
{
@Override
public ActiveMQException createException(String msg)
{
return new ActiveMQClusterSecurityException(msg);
}
};
private static final Map<Integer, ActiveMQExceptionType> TYPE_MAP;
static
{
HashMap<Integer, ActiveMQExceptionType> map = new HashMap<Integer, ActiveMQExceptionType>();
for (ActiveMQExceptionType type : EnumSet.allOf(ActiveMQExceptionType.class))
{
map.put(type.getCode(), type);
}
TYPE_MAP = Collections.unmodifiableMap(map);
}
private final int code;
ActiveMQExceptionType(int code)
{
this.code = code;
}
public int getCode()
{
return code;
}
public ActiveMQException createException(String msg)
{
return new ActiveMQException(msg + ", code:" + this);
}
public static ActiveMQException createException(int code, String msg)
{
return getType(code).createException(msg);
}
public static ActiveMQExceptionType getType(int code)
{
ActiveMQExceptionType type = TYPE_MAP.get(code);
if (type != null)
return type;
return ActiveMQExceptionType.GENERIC_EXCEPTION;
}
}

View File

@ -13,27 +13,27 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.IO_ERROR;
import static org.apache.activemq.api.core.ActiveMQExceptionType.IO_ERROR;
/**
* Unexpected I/O error occurred on the server.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
*/
public final class HornetQIOErrorException extends HornetQException
public final class ActiveMQIOErrorException extends ActiveMQException
{
private static final long serialVersionUID = 797277117077787396L;
public HornetQIOErrorException()
public ActiveMQIOErrorException()
{
super(IO_ERROR);
}
public HornetQIOErrorException(String msg)
public ActiveMQIOErrorException(String msg)
{
super(IO_ERROR, msg);
}
public HornetQIOErrorException(String msg, Throwable cause)
public ActiveMQIOErrorException(String msg, Throwable cause)
{
super(IO_ERROR, msg, cause);
}

View File

@ -13,23 +13,23 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.ILLEGAL_STATE;
import static org.apache.activemq.api.core.ActiveMQExceptionType.ILLEGAL_STATE;
/**
* A HornetQ resource is not in a legal state (e.g. calling ClientConsumer.receive() if a
* MessageHandler is set).
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 5/2/12
*/
public final class HornetQIllegalStateException extends HornetQException
public final class ActiveMQIllegalStateException extends ActiveMQException
{
private static final long serialVersionUID = -4480125401057788511L;
public HornetQIllegalStateException()
public ActiveMQIllegalStateException()
{
super(ILLEGAL_STATE);
}
public HornetQIllegalStateException(String message)
public ActiveMQIllegalStateException(String message)
{
super(ILLEGAL_STATE, message);
}

View File

@ -13,7 +13,7 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.INCOMPATIBLE_CLIENT_SERVER_VERSIONS;
import static org.apache.activemq.api.core.ActiveMQExceptionType.INCOMPATIBLE_CLIENT_SERVER_VERSIONS;
/**
* The server version and the client version are incompatible.
@ -21,16 +21,16 @@ import static org.apache.activemq.api.core.HornetQExceptionType.INCOMPATIBLE_CLI
* Normally this means you are trying to use a newer client on an older server.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
*/
public final class HornetQIncompatibleClientServerException extends HornetQException
public final class ActiveMQIncompatibleClientServerException extends ActiveMQException
{
private static final long serialVersionUID = -1662999230291452298L;
public HornetQIncompatibleClientServerException()
public ActiveMQIncompatibleClientServerException()
{
super(INCOMPATIBLE_CLIENT_SERVER_VERSIONS);
}
public HornetQIncompatibleClientServerException(String msg)
public ActiveMQIncompatibleClientServerException(String msg)
{
super(INCOMPATIBLE_CLIENT_SERVER_VERSIONS, msg);
}

View File

@ -13,7 +13,7 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.INTERCEPTOR_REJECTED_PACKET;
import static org.apache.activemq.api.core.ActiveMQExceptionType.INTERCEPTOR_REJECTED_PACKET;
/**
* An outgoing interceptor returned false.
@ -21,16 +21,16 @@ import static org.apache.activemq.api.core.HornetQExceptionType.INTERCEPTOR_REJE
* @author Justin Bertram
*/
// XXX I doubt any reader will make much sense of this Javadoc's text.
public final class HornetQInterceptorRejectedPacketException extends HornetQException
public final class ActiveMQInterceptorRejectedPacketException extends ActiveMQException
{
private static final long serialVersionUID = -5798841227645281815L;
public HornetQInterceptorRejectedPacketException()
public ActiveMQInterceptorRejectedPacketException()
{
super(INTERCEPTOR_REJECTED_PACKET);
}
public HornetQInterceptorRejectedPacketException(String msg)
public ActiveMQInterceptorRejectedPacketException(String msg)
{
super(INTERCEPTOR_REJECTED_PACKET, msg);
}

View File

@ -13,32 +13,32 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.INTERNAL_ERROR;
import static org.apache.activemq.api.core.ActiveMQExceptionType.INTERNAL_ERROR;
/**
* Internal error which prevented HornetQ from performing an important operation.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
*/
public final class HornetQInternalErrorException extends HornetQException
public final class ActiveMQInternalErrorException extends ActiveMQException
{
private static final long serialVersionUID = -5987814047521530695L;
public HornetQInternalErrorException()
public ActiveMQInternalErrorException()
{
super(INTERNAL_ERROR);
}
public HornetQInternalErrorException(String msg)
public ActiveMQInternalErrorException(String msg)
{
super(INTERNAL_ERROR, msg);
}
public HornetQInternalErrorException(String message, Exception e)
public ActiveMQInternalErrorException(String message, Exception e)
{
super(INTERNAL_ERROR, message, e);
}
public HornetQInternalErrorException(String message, Throwable t)
public ActiveMQInternalErrorException(String message, Throwable t)
{
super(INTERNAL_ERROR, message, t);
}

View File

@ -16,11 +16,11 @@ package org.apache.activemq.api.core;
* When an interruption happens, we will just throw a non-checked exception.
* @author clebertsuconic
*/
public final class HornetQInterruptedException extends RuntimeException
public final class ActiveMQInterruptedException extends RuntimeException
{
private static final long serialVersionUID = -5744690023549671221L;
public HornetQInterruptedException(Throwable cause)
public ActiveMQInterruptedException(Throwable cause)
{
super(cause);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.INVALID_FILTER_EXPRESSION;
import static org.apache.activemq.api.core.ActiveMQExceptionType.INVALID_FILTER_EXPRESSION;
/**
* A filter expression was found to be invalid.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
*/
public final class HornetQInvalidFilterExpressionException extends HornetQException
public final class ActiveMQInvalidFilterExpressionException extends ActiveMQException
{
private static final long serialVersionUID = 7188625553939665128L;
public HornetQInvalidFilterExpressionException()
public ActiveMQInvalidFilterExpressionException()
{
super(INVALID_FILTER_EXPRESSION);
}
public HornetQInvalidFilterExpressionException(String msg)
public ActiveMQInvalidFilterExpressionException(String msg)
{
super(INVALID_FILTER_EXPRESSION, msg);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.INVALID_TRANSIENT_QUEUE_USE;
import static org.apache.activemq.api.core.ActiveMQExceptionType.INVALID_TRANSIENT_QUEUE_USE;
/**
* An operation failed because a queue exists on the server.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
*/
public final class HornetQInvalidTransientQueueUseException extends HornetQException
public final class ActiveMQInvalidTransientQueueUseException extends ActiveMQException
{
private static final long serialVersionUID = -405552292451883063L;
public HornetQInvalidTransientQueueUseException()
public ActiveMQInvalidTransientQueueUseException()
{
super(INVALID_TRANSIENT_QUEUE_USE);
}
public HornetQInvalidTransientQueueUseException(String msg)
public ActiveMQInvalidTransientQueueUseException(String msg)
{
super(INVALID_TRANSIENT_QUEUE_USE, msg);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.LARGE_MESSAGE_ERROR_BODY;
import static org.apache.activemq.api.core.ActiveMQExceptionType.LARGE_MESSAGE_ERROR_BODY;
/**
* A problem occurred while manipulating the body of a large message.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 5/2/12
*/
public final class HornetQLargeMessageException extends HornetQException
public final class ActiveMQLargeMessageException extends ActiveMQException
{
private static final long serialVersionUID = 1087867463974768491L;
public HornetQLargeMessageException()
public ActiveMQLargeMessageException()
{
super(LARGE_MESSAGE_ERROR_BODY);
}
public HornetQLargeMessageException(String msg)
public ActiveMQLargeMessageException(String msg)
{
super(LARGE_MESSAGE_ERROR_BODY, msg);
}

View File

@ -14,22 +14,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.LARGE_MESSAGE_INTERRUPTED;
import static org.apache.activemq.api.core.ActiveMQExceptionType.LARGE_MESSAGE_INTERRUPTED;
/**
* @author Clebert
*/
// XXX
public class HornetQLargeMessageInterruptedException extends HornetQException
public class ActiveMQLargeMessageInterruptedException extends ActiveMQException
{
private static final long serialVersionUID = 0;
public HornetQLargeMessageInterruptedException(String message)
public ActiveMQLargeMessageInterruptedException(String message)
{
super(LARGE_MESSAGE_INTERRUPTED, message);
}
public HornetQLargeMessageInterruptedException()
public ActiveMQLargeMessageInterruptedException()
{
super(LARGE_MESSAGE_INTERRUPTED);
}

View File

@ -19,17 +19,17 @@ package org.apache.activemq.api.core;
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 5/4/12
*/
// XXX
public final class HornetQNativeIOError extends HornetQException
public final class ActiveMQNativeIOError extends ActiveMQException
{
private static final long serialVersionUID = 2355120980683293085L;
public HornetQNativeIOError()
public ActiveMQNativeIOError()
{
super(HornetQExceptionType.NATIVE_ERROR_CANT_INITIALIZE_AIO);
super(ActiveMQExceptionType.NATIVE_ERROR_CANT_INITIALIZE_AIO);
}
public HornetQNativeIOError(String msg)
public ActiveMQNativeIOError(String msg)
{
super(HornetQExceptionType.NATIVE_ERROR_CANT_INITIALIZE_AIO, msg);
super(ActiveMQExceptionType.NATIVE_ERROR_CANT_INITIALIZE_AIO, msg);
}
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.QUEUE_DOES_NOT_EXIST;
import static org.apache.activemq.api.core.ActiveMQExceptionType.QUEUE_DOES_NOT_EXIST;
/**
* An operation failed because a queue does not exist on the server.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
*/
public final class HornetQNonExistentQueueException extends HornetQException
public final class ActiveMQNonExistentQueueException extends ActiveMQException
{
private static final long serialVersionUID = -8199298881947523607L;
public HornetQNonExistentQueueException()
public ActiveMQNonExistentQueueException()
{
super(QUEUE_DOES_NOT_EXIST);
}
public HornetQNonExistentQueueException(String msg)
public ActiveMQNonExistentQueueException(String msg)
{
super(QUEUE_DOES_NOT_EXIST, msg);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.NOT_CONNECTED;
import static org.apache.activemq.api.core.ActiveMQExceptionType.NOT_CONNECTED;
/**
* A client is not able to connect to HornetQ server.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
*/
public final class HornetQNotConnectedException extends HornetQException
public final class ActiveMQNotConnectedException extends ActiveMQException
{
private static final long serialVersionUID = -3489189971813613325L;
public HornetQNotConnectedException(String message)
public ActiveMQNotConnectedException(String message)
{
super(NOT_CONNECTED, message);
}
public HornetQNotConnectedException()
public ActiveMQNotConnectedException()
{
super(NOT_CONNECTED);
}

View File

@ -13,23 +13,23 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.OBJECT_CLOSED;
import static org.apache.activemq.api.core.ActiveMQExceptionType.OBJECT_CLOSED;
/**
* A client operation failed because the calling resource (ClientSession, ClientProducer, etc.) is
* closed.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
*/
public final class HornetQObjectClosedException extends HornetQException
public final class ActiveMQObjectClosedException extends ActiveMQException
{
private static final long serialVersionUID = 809024052184914812L;
public HornetQObjectClosedException()
public ActiveMQObjectClosedException()
{
super(OBJECT_CLOSED);
}
public HornetQObjectClosedException(String msg)
public ActiveMQObjectClosedException(String msg)
{
super(OBJECT_CLOSED, msg);
}

View File

@ -18,12 +18,12 @@ package org.apache.activemq.api.core;
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
* @see org.apache.activemq.api.core.Message
*/
public final class HornetQPropertyConversionException extends RuntimeException
public final class ActiveMQPropertyConversionException extends RuntimeException
{
private static final long serialVersionUID = -3010008708334904332L;
public HornetQPropertyConversionException(final String message)
public ActiveMQPropertyConversionException(final String message)
{
super(message);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.QUEUE_EXISTS;
import static org.apache.activemq.api.core.ActiveMQExceptionType.QUEUE_EXISTS;
/**
* An operation failed because a queue exists on the server.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
*/
public final class HornetQQueueExistsException extends HornetQException
public final class ActiveMQQueueExistsException extends ActiveMQException
{
private static final long serialVersionUID = -405552292451883063L;
public HornetQQueueExistsException()
public ActiveMQQueueExistsException()
{
super(QUEUE_EXISTS);
}
public HornetQQueueExistsException(String msg)
public ActiveMQQueueExistsException(String msg)
{
super(QUEUE_EXISTS, msg);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.SECURITY_EXCEPTION;
import static org.apache.activemq.api.core.ActiveMQExceptionType.SECURITY_EXCEPTION;
/**
* A security problem occurred (authentication issues, permission issues,...)
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 5/2/12
*/
public final class HornetQSecurityException extends HornetQException
public final class ActiveMQSecurityException extends ActiveMQException
{
private static final long serialVersionUID = 3291210307590756881L;
public HornetQSecurityException()
public ActiveMQSecurityException()
{
super(SECURITY_EXCEPTION);
}
public HornetQSecurityException(String msg)
public ActiveMQSecurityException(String msg)
{
super(SECURITY_EXCEPTION, msg);
}

View File

@ -13,23 +13,23 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.SESSION_CREATION_REJECTED;
import static org.apache.activemq.api.core.ActiveMQExceptionType.SESSION_CREATION_REJECTED;
/**
* The creation of a session was rejected by the server (e.g. if the server is starting and has not
* finish to be initialized.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 5/2/12
*/
public final class HornetQSessionCreationException extends HornetQException
public final class ActiveMQSessionCreationException extends ActiveMQException
{
private static final long serialVersionUID = -4486139158452585895L;
public HornetQSessionCreationException()
public ActiveMQSessionCreationException()
{
super(SESSION_CREATION_REJECTED);
}
public HornetQSessionCreationException(String msg)
public ActiveMQSessionCreationException(String msg)
{
super(SESSION_CREATION_REJECTED, msg);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.TRANSACTION_OUTCOME_UNKNOWN;
import static org.apache.activemq.api.core.ActiveMQExceptionType.TRANSACTION_OUTCOME_UNKNOWN;
/**
* The outcome of a transaction is unknown.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 5/2/12
*/
public final class HornetQTransactionOutcomeUnknownException extends HornetQException
public final class ActiveMQTransactionOutcomeUnknownException extends ActiveMQException
{
private static final long serialVersionUID = 7940794286427650558L;
public HornetQTransactionOutcomeUnknownException()
public ActiveMQTransactionOutcomeUnknownException()
{
super(TRANSACTION_OUTCOME_UNKNOWN);
}
public HornetQTransactionOutcomeUnknownException(String msg)
public ActiveMQTransactionOutcomeUnknownException(String msg)
{
super(TRANSACTION_OUTCOME_UNKNOWN, msg);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.TRANSACTION_ROLLED_BACK;
import static org.apache.activemq.api.core.ActiveMQExceptionType.TRANSACTION_ROLLED_BACK;
/**
* A transaction was rolled back.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 5/2/12
*/
public final class HornetQTransactionRolledBackException extends HornetQException
public final class ActiveMQTransactionRolledBackException extends ActiveMQException
{
private static final long serialVersionUID = 5823412198677126300L;
public HornetQTransactionRolledBackException()
public ActiveMQTransactionRolledBackException()
{
super(TRANSACTION_ROLLED_BACK);
}
public HornetQTransactionRolledBackException(String msg)
public ActiveMQTransactionRolledBackException(String msg)
{
super(TRANSACTION_ROLLED_BACK, msg);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.UNBLOCKED;
import static org.apache.activemq.api.core.ActiveMQExceptionType.UNBLOCKED;
/**
* A blocking call from a client was unblocked during failover.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
*/
public final class HornetQUnBlockedException extends HornetQException
public final class ActiveMQUnBlockedException extends ActiveMQException
{
private static final long serialVersionUID = -4507889261891160608L;
public HornetQUnBlockedException()
public ActiveMQUnBlockedException()
{
super(UNBLOCKED);
}
public HornetQUnBlockedException(String msg)
public ActiveMQUnBlockedException(String msg)
{
super(UNBLOCKED, msg);
}

View File

@ -13,22 +13,22 @@
package org.apache.activemq.api.core;
import static org.apache.activemq.api.core.HornetQExceptionType.UNSUPPORTED_PACKET;
import static org.apache.activemq.api.core.ActiveMQExceptionType.UNSUPPORTED_PACKET;
/**
* A packet of unsupported type was received by HornetQ PacketHandler.
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a> 4/30/12
*/
public final class HornetQUnsupportedPacketException extends HornetQException
public final class ActiveMQUnsupportedPacketException extends ActiveMQException
{
private static final long serialVersionUID = -7074681529482463675L;
public HornetQUnsupportedPacketException()
public ActiveMQUnsupportedPacketException()
{
super(UNSUPPORTED_PACKET);
}
public HornetQUnsupportedPacketException(String msg)
public ActiveMQUnsupportedPacketException(String msg)
{
super(UNSUPPORTED_PACKET, msg);
}

View File

@ -1,298 +0,0 @@
/*
* Copyright 2005-2014 Red Hat, Inc.
* Red Hat licenses this file to you under the Apache License, version
* 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package org.apache.activemq.api.core;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
/**
* Defines all {@link HornetQException} types and their codes.
*/
public enum HornetQExceptionType
{
// Error codes -------------------------------------------------
INTERNAL_ERROR(000)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQInternalErrorException(msg);
}
},
UNSUPPORTED_PACKET(001)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQUnsupportedPacketException(msg);
}
},
NOT_CONNECTED(002)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQNotConnectedException(msg);
}
},
CONNECTION_TIMEDOUT(003)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQConnectionTimedOutException(msg);
}
},
DISCONNECTED(004)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQDisconnectedException(msg);
}
},
UNBLOCKED(005)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQUnBlockedException(msg);
}
},
IO_ERROR(006)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQIOErrorException(msg);
}
},
QUEUE_DOES_NOT_EXIST(100)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQNonExistentQueueException(msg);
}
},
QUEUE_EXISTS(101)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQQueueExistsException(msg);
}
},
OBJECT_CLOSED(102)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQObjectClosedException(msg);
}
},
INVALID_FILTER_EXPRESSION(103)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQInvalidFilterExpressionException(msg);
}
},
ILLEGAL_STATE(104)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQIllegalStateException(msg);
}
},
SECURITY_EXCEPTION(105)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQSecurityException(msg);
}
},
ADDRESS_EXISTS(107)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQAddressExistsException(msg);
}
},
INCOMPATIBLE_CLIENT_SERVER_VERSIONS(108)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQIncompatibleClientServerException(msg);
}
},
LARGE_MESSAGE_ERROR_BODY(110)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQLargeMessageException(msg);
}
},
TRANSACTION_ROLLED_BACK(111)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQTransactionRolledBackException(msg);
}
},
SESSION_CREATION_REJECTED(112)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQSessionCreationException(msg);
}
},
DUPLICATE_ID_REJECTED(113)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQDuplicateIdException(msg);
}
},
DUPLICATE_METADATA(114)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQDuplicateMetaDataException(msg);
}
},
TRANSACTION_OUTCOME_UNKNOWN(115)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQTransactionOutcomeUnknownException(msg);
}
},
ALREADY_REPLICATING(116)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQAlreadyReplicatingException(msg);
}
},
INTERCEPTOR_REJECTED_PACKET(117)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQInterceptorRejectedPacketException(msg);
}
},
INVALID_TRANSIENT_QUEUE_USE(118)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQInvalidTransientQueueUseException(msg);
}
},
GENERIC_EXCEPTION(999),
NATIVE_ERROR_INTERNAL(200),
NATIVE_ERROR_INVALID_BUFFER(201),
NATIVE_ERROR_NOT_ALIGNED(202),
NATIVE_ERROR_CANT_INITIALIZE_AIO(203),
NATIVE_ERROR_CANT_RELEASE_AIO(204),
NATIVE_ERROR_CANT_OPEN_CLOSE_FILE(205),
NATIVE_ERROR_CANT_ALLOCATE_QUEUE(206),
NATIVE_ERROR_PREALLOCATE_FILE(208),
NATIVE_ERROR_ALLOCATE_MEMORY(209),
ADDRESS_FULL(210)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQAddressFullException(msg);
}
},
LARGE_MESSAGE_INTERRUPTED(211)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQLargeMessageInterruptedException(msg);
}
},
CLUSTER_SECURITY_EXCEPTION(212)
{
@Override
public HornetQException createException(String msg)
{
return new HornetQClusterSecurityException(msg);
}
};
private static final Map<Integer, HornetQExceptionType> TYPE_MAP;
static
{
HashMap<Integer, HornetQExceptionType> map = new HashMap<Integer, HornetQExceptionType>();
for (HornetQExceptionType type : EnumSet.allOf(HornetQExceptionType.class))
{
map.put(type.getCode(), type);
}
TYPE_MAP = Collections.unmodifiableMap(map);
}
private final int code;
HornetQExceptionType(int code)
{
this.code = code;
}
public int getCode()
{
return code;
}
public HornetQException createException(String msg)
{
return new HornetQException(msg + ", code:" + this);
}
public static HornetQException createException(int code, String msg)
{
return getType(code).createException(msg);
}
public static HornetQExceptionType getType(int code)
{
HornetQExceptionType type = TYPE_MAP.get(code);
if (type != null)
return type;
return HornetQExceptionType.GENERIC_EXCEPTION;
}
}

View File

@ -17,7 +17,7 @@ import java.nio.ByteBuffer;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.utils.DataConstants;
import org.apache.activemq.utils.UTF8Util;
@ -27,7 +27,7 @@ import org.apache.activemq.utils.UTF8Util;
*
* @author Tim Fox
*/
public class ChannelBufferWrapper implements HornetQBuffer
public class ChannelBufferWrapper implements ActiveMQBuffer
{
protected ByteBuf buffer; // NO_UCD (use final)
private final boolean releasable;
@ -215,12 +215,12 @@ public class ChannelBufferWrapper implements HornetQBuffer
buffer.clear();
}
public HornetQBuffer copy()
public ActiveMQBuffer copy()
{
return new ChannelBufferWrapper(buffer.copy(), releasable);
}
public HornetQBuffer copy(final int index, final int length)
public ActiveMQBuffer copy(final int index, final int length)
{
return new ChannelBufferWrapper(buffer.copy(index, length), releasable);
}
@ -230,7 +230,7 @@ public class ChannelBufferWrapper implements HornetQBuffer
buffer.discardReadBytes();
}
public HornetQBuffer duplicate()
public ActiveMQBuffer duplicate()
{
return new ChannelBufferWrapper(buffer.duplicate(), releasable);
}
@ -255,17 +255,17 @@ public class ChannelBufferWrapper implements HornetQBuffer
buffer.getBytes(index, dst);
}
public void getBytes(final int index, final HornetQBuffer dst, final int dstIndex, final int length)
public void getBytes(final int index, final ActiveMQBuffer dst, final int dstIndex, final int length)
{
buffer.getBytes(index, dst.byteBuf(), dstIndex, length);
}
public void getBytes(final int index, final HornetQBuffer dst, final int length)
public void getBytes(final int index, final ActiveMQBuffer dst, final int length)
{
buffer.getBytes(index, dst.byteBuf(), length);
}
public void getBytes(final int index, final HornetQBuffer dst)
public void getBytes(final int index, final ActiveMQBuffer dst)
{
buffer.getBytes(index, dst.byteBuf());
}
@ -355,22 +355,22 @@ public class ChannelBufferWrapper implements HornetQBuffer
buffer.readBytes(dst);
}
public void readBytes(final HornetQBuffer dst, final int dstIndex, final int length)
public void readBytes(final ActiveMQBuffer dst, final int dstIndex, final int length)
{
buffer.readBytes(dst.byteBuf(), dstIndex, length);
}
public void readBytes(final HornetQBuffer dst, final int length)
public void readBytes(final ActiveMQBuffer dst, final int length)
{
buffer.readBytes(dst.byteBuf(), length);
}
public void readBytes(final HornetQBuffer dst)
public void readBytes(final ActiveMQBuffer dst)
{
buffer.readBytes(dst.byteBuf());
}
public HornetQBuffer readBytes(final int length)
public ActiveMQBuffer readBytes(final int length)
{
return new ChannelBufferWrapper(buffer.readBytes(length), releasable);
}
@ -415,7 +415,7 @@ public class ChannelBufferWrapper implements HornetQBuffer
return buffer.readShort();
}
public HornetQBuffer readSlice(final int length)
public ActiveMQBuffer readSlice(final int length)
{
return new ChannelBufferWrapper(buffer.readSlice(length), releasable);
}
@ -465,17 +465,17 @@ public class ChannelBufferWrapper implements HornetQBuffer
buffer.setBytes(index, src);
}
public void setBytes(final int index, final HornetQBuffer src, final int srcIndex, final int length)
public void setBytes(final int index, final ActiveMQBuffer src, final int srcIndex, final int length)
{
buffer.setBytes(index, src.byteBuf(), srcIndex, length);
}
public void setBytes(final int index, final HornetQBuffer src, final int length)
public void setBytes(final int index, final ActiveMQBuffer src, final int length)
{
buffer.setBytes(index, src.byteBuf(), length);
}
public void setBytes(final int index, final HornetQBuffer src)
public void setBytes(final int index, final ActiveMQBuffer src)
{
buffer.setBytes(index, src.byteBuf());
}
@ -520,12 +520,12 @@ public class ChannelBufferWrapper implements HornetQBuffer
buffer.skipBytes(length);
}
public HornetQBuffer slice()
public ActiveMQBuffer slice()
{
return new ChannelBufferWrapper(buffer.slice(), releasable);
}
public HornetQBuffer slice(final int index, final int length)
public ActiveMQBuffer slice(final int index, final int length)
{
return new ChannelBufferWrapper(buffer.slice(index, length), releasable);
}
@ -570,12 +570,12 @@ public class ChannelBufferWrapper implements HornetQBuffer
buffer.writeBytes(src);
}
public void writeBytes(final HornetQBuffer src, final int srcIndex, final int length)
public void writeBytes(final ActiveMQBuffer src, final int srcIndex, final int length)
{
buffer.writeBytes(src.byteBuf(), srcIndex, length);
}
public void writeBytes(final HornetQBuffer src, final int length)
public void writeBytes(final ActiveMQBuffer src, final int length)
{
buffer.writeBytes(src.byteBuf(), length);
}

View File

@ -13,7 +13,7 @@
package org.apache.activemq.utils;
import org.apache.activemq.api.core.HornetQIllegalStateException;
import org.apache.activemq.api.core.ActiveMQIllegalStateException;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;
@ -35,7 +35,7 @@ public interface HornetQUtilBundle
HornetQUtilBundle BUNDLE = Messages.getBundle(HornetQUtilBundle.class);
@Message(id = 209000, value = "invalid property: {0}" , format = Message.Format.MESSAGE_FORMAT)
HornetQIllegalStateException invalidProperty(String part);
ActiveMQIllegalStateException invalidProperty(String part);
@Message(id = 209001, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
IllegalStateException invalidType(Byte type);

View File

@ -17,8 +17,8 @@ import java.security.PrivilegedAction;
import java.util.HashMap;
import java.util.Map;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.HornetQExceptionType;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQExceptionType;
/**
* A PasswordMarkingUtil
@ -38,7 +38,7 @@ public class PasswordMaskingUtil
*
* Where only <full qualified class name> is required. key/value pairs are optional
*/
public static SensitiveDataCodec<String> getCodec(String codecDesc) throws HornetQException
public static SensitiveDataCodec<String> getCodec(String codecDesc) throws ActiveMQException
{
SensitiveDataCodec<String> codecInstance = null;
@ -46,7 +46,7 @@ public class PasswordMaskingUtil
String[] parts = codecDesc.split(";");
if (parts.length < 1)
throw new HornetQException(HornetQExceptionType.ILLEGAL_STATE, "Invalid PasswordCodec value: " + codecDesc);
throw new ActiveMQException(ActiveMQExceptionType.ILLEGAL_STATE, "Invalid PasswordCodec value: " + codecDesc);
final String codecClassName = parts[0];

View File

@ -20,8 +20,8 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQPropertyConversionException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQPropertyConversionException;
import org.apache.activemq.api.core.SimpleString;
import static org.apache.activemq.utils.DataConstants.BOOLEAN;
@ -168,7 +168,7 @@ public final class TypedProperties
return doGetProperty(key);
}
public Boolean getBooleanProperty(final SimpleString key) throws HornetQPropertyConversionException
public Boolean getBooleanProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
Object value = doGetProperty(key);
if (value == null)
@ -185,11 +185,11 @@ public final class TypedProperties
}
else
{
throw new HornetQPropertyConversionException("Invalid conversion");
throw new ActiveMQPropertyConversionException("Invalid conversion");
}
}
public Byte getByteProperty(final SimpleString key) throws HornetQPropertyConversionException
public Byte getByteProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
Object value = doGetProperty(key);
if (value == null)
@ -206,11 +206,11 @@ public final class TypedProperties
}
else
{
throw new HornetQPropertyConversionException("Invalid conversion");
throw new ActiveMQPropertyConversionException("Invalid conversion");
}
}
public Character getCharProperty(final SimpleString key) throws HornetQPropertyConversionException
public Character getCharProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
Object value = doGetProperty(key);
if (value == null)
@ -224,11 +224,11 @@ public final class TypedProperties
}
else
{
throw new HornetQPropertyConversionException("Invalid conversion");
throw new ActiveMQPropertyConversionException("Invalid conversion");
}
}
public byte[] getBytesProperty(final SimpleString key) throws HornetQPropertyConversionException
public byte[] getBytesProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
Object value = doGetProperty(key);
if (value == null)
@ -241,11 +241,11 @@ public final class TypedProperties
}
else
{
throw new HornetQPropertyConversionException("Invalid conversion");
throw new ActiveMQPropertyConversionException("Invalid conversion");
}
}
public Double getDoubleProperty(final SimpleString key) throws HornetQPropertyConversionException
public Double getDoubleProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
Object value = doGetProperty(key);
if (value == null)
@ -266,11 +266,11 @@ public final class TypedProperties
}
else
{
throw new HornetQPropertyConversionException("Invalid conversion");
throw new ActiveMQPropertyConversionException("Invalid conversion");
}
}
public Integer getIntProperty(final SimpleString key) throws HornetQPropertyConversionException
public Integer getIntProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
Object value = doGetProperty(key);
if (value == null)
@ -295,11 +295,11 @@ public final class TypedProperties
}
else
{
throw new HornetQPropertyConversionException("Invalid conversion");
throw new ActiveMQPropertyConversionException("Invalid conversion");
}
}
public Long getLongProperty(final SimpleString key) throws HornetQPropertyConversionException
public Long getLongProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
Object value = doGetProperty(key);
if (value == null)
@ -328,11 +328,11 @@ public final class TypedProperties
}
else
{
throw new HornetQPropertyConversionException("Invalid conversion");
throw new ActiveMQPropertyConversionException("Invalid conversion");
}
}
public Short getShortProperty(final SimpleString key) throws HornetQPropertyConversionException
public Short getShortProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
Object value = doGetProperty(key);
if (value == null)
@ -353,11 +353,11 @@ public final class TypedProperties
}
else
{
throw new HornetQPropertyConversionException("Invalid Conversion.");
throw new ActiveMQPropertyConversionException("Invalid Conversion.");
}
}
public Float getFloatProperty(final SimpleString key) throws HornetQPropertyConversionException
public Float getFloatProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
Object value = doGetProperty(key);
if (value == null)
@ -370,10 +370,10 @@ public final class TypedProperties
{
return Float.parseFloat(((SimpleString) value).toString());
}
throw new HornetQPropertyConversionException("Invalid conversion: " + key);
throw new ActiveMQPropertyConversionException("Invalid conversion: " + key);
}
public SimpleString getSimpleStringProperty(final SimpleString key) throws HornetQPropertyConversionException
public SimpleString getSimpleStringProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
Object value = doGetProperty(key);
@ -418,7 +418,7 @@ public final class TypedProperties
{
return new SimpleString(value.toString());
}
throw new HornetQPropertyConversionException("Invalid conversion");
throw new ActiveMQPropertyConversionException("Invalid conversion");
}
public Object removeProperty(final SimpleString key)
@ -451,7 +451,7 @@ public final class TypedProperties
}
}
public synchronized void decode(final HornetQBuffer buffer)
public synchronized void decode(final ActiveMQBuffer buffer)
{
byte b = buffer.readByte();
@ -554,7 +554,7 @@ public final class TypedProperties
}
}
public synchronized void encode(final HornetQBuffer buffer)
public synchronized void encode(final ActiveMQBuffer buffer)
{
if (properties == null)
{
@ -741,7 +741,7 @@ public final class TypedProperties
{
abstract Object getValue();
abstract void write(HornetQBuffer buffer);
abstract void write(ActiveMQBuffer buffer);
abstract int encodeSize();
@ -765,7 +765,7 @@ public final class TypedProperties
}
@Override
public void write(final HornetQBuffer buffer)
public void write(final ActiveMQBuffer buffer)
{
buffer.writeByte(DataConstants.NULL);
}
@ -787,7 +787,7 @@ public final class TypedProperties
this.val = val;
}
public BooleanValue(final HornetQBuffer buffer)
public BooleanValue(final ActiveMQBuffer buffer)
{
val = buffer.readBoolean();
}
@ -799,7 +799,7 @@ public final class TypedProperties
}
@Override
public void write(final HornetQBuffer buffer)
public void write(final ActiveMQBuffer buffer)
{
buffer.writeByte(DataConstants.BOOLEAN);
buffer.writeBoolean(val);
@ -822,7 +822,7 @@ public final class TypedProperties
this.val = val;
}
public ByteValue(final HornetQBuffer buffer)
public ByteValue(final ActiveMQBuffer buffer)
{
val = buffer.readByte();
}
@ -834,7 +834,7 @@ public final class TypedProperties
}
@Override
public void write(final HornetQBuffer buffer)
public void write(final ActiveMQBuffer buffer)
{
buffer.writeByte(DataConstants.BYTE);
buffer.writeByte(val);
@ -856,7 +856,7 @@ public final class TypedProperties
this.val = val;
}
public BytesValue(final HornetQBuffer buffer)
public BytesValue(final ActiveMQBuffer buffer)
{
int len = buffer.readInt();
val = new byte[len];
@ -870,7 +870,7 @@ public final class TypedProperties
}
@Override
public void write(final HornetQBuffer buffer)
public void write(final ActiveMQBuffer buffer)
{
buffer.writeByte(DataConstants.BYTES);
buffer.writeInt(val.length);
@ -894,7 +894,7 @@ public final class TypedProperties
this.val = val;
}
public ShortValue(final HornetQBuffer buffer)
public ShortValue(final ActiveMQBuffer buffer)
{
val = buffer.readShort();
}
@ -906,7 +906,7 @@ public final class TypedProperties
}
@Override
public void write(final HornetQBuffer buffer)
public void write(final ActiveMQBuffer buffer)
{
buffer.writeByte(DataConstants.SHORT);
buffer.writeShort(val);
@ -928,7 +928,7 @@ public final class TypedProperties
this.val = val;
}
public IntValue(final HornetQBuffer buffer)
public IntValue(final ActiveMQBuffer buffer)
{
val = buffer.readInt();
}
@ -940,7 +940,7 @@ public final class TypedProperties
}
@Override
public void write(final HornetQBuffer buffer)
public void write(final ActiveMQBuffer buffer)
{
buffer.writeByte(DataConstants.INT);
buffer.writeInt(val);
@ -962,7 +962,7 @@ public final class TypedProperties
this.val = val;
}
public LongValue(final HornetQBuffer buffer)
public LongValue(final ActiveMQBuffer buffer)
{
val = buffer.readLong();
}
@ -974,7 +974,7 @@ public final class TypedProperties
}
@Override
public void write(final HornetQBuffer buffer)
public void write(final ActiveMQBuffer buffer)
{
buffer.writeByte(DataConstants.LONG);
buffer.writeLong(val);
@ -996,7 +996,7 @@ public final class TypedProperties
this.val = val;
}
public FloatValue(final HornetQBuffer buffer)
public FloatValue(final ActiveMQBuffer buffer)
{
val = Float.intBitsToFloat(buffer.readInt());
}
@ -1008,7 +1008,7 @@ public final class TypedProperties
}
@Override
public void write(final HornetQBuffer buffer)
public void write(final ActiveMQBuffer buffer)
{
buffer.writeByte(DataConstants.FLOAT);
buffer.writeInt(Float.floatToIntBits(val));
@ -1031,7 +1031,7 @@ public final class TypedProperties
this.val = val;
}
public DoubleValue(final HornetQBuffer buffer)
public DoubleValue(final ActiveMQBuffer buffer)
{
val = Double.longBitsToDouble(buffer.readLong());
}
@ -1043,7 +1043,7 @@ public final class TypedProperties
}
@Override
public void write(final HornetQBuffer buffer)
public void write(final ActiveMQBuffer buffer)
{
buffer.writeByte(DataConstants.DOUBLE);
buffer.writeLong(Double.doubleToLongBits(val));
@ -1065,7 +1065,7 @@ public final class TypedProperties
this.val = val;
}
public CharValue(final HornetQBuffer buffer)
public CharValue(final ActiveMQBuffer buffer)
{
val = (char) buffer.readShort();
}
@ -1077,7 +1077,7 @@ public final class TypedProperties
}
@Override
public void write(final HornetQBuffer buffer)
public void write(final ActiveMQBuffer buffer)
{
buffer.writeByte(DataConstants.CHAR);
buffer.writeShort((short) val);
@ -1099,7 +1099,7 @@ public final class TypedProperties
this.val = val;
}
public StringValue(final HornetQBuffer buffer)
public StringValue(final ActiveMQBuffer buffer)
{
val = buffer.readSimpleString();
}
@ -1111,7 +1111,7 @@ public final class TypedProperties
}
@Override
public void write(final HornetQBuffer buffer)
public void write(final ActiveMQBuffer buffer)
{
buffer.writeByte(DataConstants.STRING);
buffer.writeSimpleString(val);
@ -1206,7 +1206,7 @@ public final class TypedProperties
}
else
{
throw new HornetQPropertyConversionException(value.getClass() + " is not a valid property type");
throw new ActiveMQPropertyConversionException(value.getClass() + " is not a valid property type");
}
}
}

View File

@ -14,7 +14,7 @@ package org.apache.activemq.utils;
import java.lang.ref.SoftReference;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
/**
*
@ -40,7 +40,7 @@ public final class UTF8Util
private static final ThreadLocal<SoftReference<StringUtilBuffer>> currenBuffer =
new ThreadLocal<SoftReference<StringUtilBuffer>>();
public static void saveUTF(final HornetQBuffer out, final String str)
public static void saveUTF(final ActiveMQBuffer out, final String str)
{
StringUtilBuffer buffer = UTF8Util.getThreadLocalBuffer();
@ -106,7 +106,7 @@ public final class UTF8Util
}
}
public static String readUTF(final HornetQBuffer input)
public static String readUTF(final ActiveMQBuffer input)
{
StringUtilBuffer buffer = UTF8Util.getThreadLocalBuffer();

View File

@ -34,7 +34,7 @@ public interface Interceptor
* @param connection the connection the packet was received on
* @return {@code true} to process the next interceptor and handle the packet,
* {@code false} to abort processing of the packet
* @throws HornetQException
* @throws ActiveMQException
*/
boolean intercept(Packet packet, RemotingConnection connection) throws HornetQException;
boolean intercept(Packet packet, RemotingConnection connection) throws ActiveMQException;
}

View File

@ -44,7 +44,7 @@ import org.apache.activemq.utils.UUID;
* </pre>
* <p>
* If conversion is not allowed (for example calling {@code getFloatProperty} on a property set a
* {@code boolean}), a {@link HornetQPropertyConversionException} will be thrown.
* {@code boolean}), a {@link ActiveMQPropertyConversionException} will be thrown.
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:clebert.suconic@jboss.com">ClebertSuconic</a>
@ -198,7 +198,7 @@ public interface Message
/**
* Returns the message body as a HornetQBuffer
*/
HornetQBuffer getBodyBuffer();
ActiveMQBuffer getBodyBuffer();
/**
* Writes the input byte array to the message body HornetQBuffer
@ -214,7 +214,7 @@ public interface Message
* Returns a <em>copy</em> of the message body as a HornetQBuffer. Any modification
* of this buffer should not impact the underlying buffer.
*/
HornetQBuffer getBodyBufferCopy();
ActiveMQBuffer getBodyBufferCopy();
// Properties
// -----------------------------------------------------------------
@ -371,15 +371,15 @@ public interface Message
*
* @param key property name
* @param value property value
* @throws HornetQPropertyConversionException if the value is not one of the accepted property
* @throws ActiveMQPropertyConversionException if the value is not one of the accepted property
* types.
*/
Message putObjectProperty(SimpleString key, Object value) throws HornetQPropertyConversionException;
Message putObjectProperty(SimpleString key, Object value) throws ActiveMQPropertyConversionException;
/**
* @see #putObjectProperty(SimpleString, Object)
*/
Message putObjectProperty(String key, Object value) throws HornetQPropertyConversionException;
Message putObjectProperty(String key, Object value) throws ActiveMQPropertyConversionException;
/**
* Removes the property corresponding to the specified key.
@ -410,62 +410,62 @@ public interface Message
/**
* Returns the property corresponding to the specified key as a Boolean.
*
* @throws HornetQPropertyConversionException if the value can not be converted to a Boolean
* @throws ActiveMQPropertyConversionException if the value can not be converted to a Boolean
*/
Boolean getBooleanProperty(SimpleString key) throws HornetQPropertyConversionException;
Boolean getBooleanProperty(SimpleString key) throws ActiveMQPropertyConversionException;
/**
* @see #getBooleanProperty(SimpleString)
*/
Boolean getBooleanProperty(String key) throws HornetQPropertyConversionException;
Boolean getBooleanProperty(String key) throws ActiveMQPropertyConversionException;
/**
* Returns the property corresponding to the specified key as a Byte.
*
* @throws HornetQPropertyConversionException if the value can not be converted to a Byte
* @throws ActiveMQPropertyConversionException if the value can not be converted to a Byte
*/
Byte getByteProperty(SimpleString key) throws HornetQPropertyConversionException;
Byte getByteProperty(SimpleString key) throws ActiveMQPropertyConversionException;
/**
* @see #getByteProperty(SimpleString)
*/
Byte getByteProperty(String key) throws HornetQPropertyConversionException;
Byte getByteProperty(String key) throws ActiveMQPropertyConversionException;
/**
* Returns the property corresponding to the specified key as a Double.
*
* @throws HornetQPropertyConversionException if the value can not be converted to a Double
* @throws ActiveMQPropertyConversionException if the value can not be converted to a Double
*/
Double getDoubleProperty(SimpleString key) throws HornetQPropertyConversionException;
Double getDoubleProperty(SimpleString key) throws ActiveMQPropertyConversionException;
/**
* @see #getDoubleProperty(SimpleString)
*/
Double getDoubleProperty(String key) throws HornetQPropertyConversionException;
Double getDoubleProperty(String key) throws ActiveMQPropertyConversionException;
/**
* Returns the property corresponding to the specified key as an Integer.
*
* @throws HornetQPropertyConversionException if the value can not be converted to an Integer
* @throws ActiveMQPropertyConversionException if the value can not be converted to an Integer
*/
Integer getIntProperty(SimpleString key) throws HornetQPropertyConversionException;
Integer getIntProperty(SimpleString key) throws ActiveMQPropertyConversionException;
/**
* @see #getIntProperty(SimpleString)
*/
Integer getIntProperty(String key) throws HornetQPropertyConversionException;
Integer getIntProperty(String key) throws ActiveMQPropertyConversionException;
/**
* Returns the property corresponding to the specified key as a Long.
*
* @throws HornetQPropertyConversionException if the value can not be converted to a Long
* @throws ActiveMQPropertyConversionException if the value can not be converted to a Long
*/
Long getLongProperty(SimpleString key) throws HornetQPropertyConversionException;
Long getLongProperty(SimpleString key) throws ActiveMQPropertyConversionException;
/**
* @see #getLongProperty(SimpleString)
*/
Long getLongProperty(String key) throws HornetQPropertyConversionException;
Long getLongProperty(String key) throws ActiveMQPropertyConversionException;
/**
* Returns the property corresponding to the specified key
@ -480,62 +480,62 @@ public interface Message
/**
* Returns the property corresponding to the specified key as a Short.
*
* @throws HornetQPropertyConversionException if the value can not be converted to a Short
* @throws ActiveMQPropertyConversionException if the value can not be converted to a Short
*/
Short getShortProperty(SimpleString key) throws HornetQPropertyConversionException;
Short getShortProperty(SimpleString key) throws ActiveMQPropertyConversionException;
/**
* @see #getShortProperty(SimpleString)
*/
Short getShortProperty(String key) throws HornetQPropertyConversionException;
Short getShortProperty(String key) throws ActiveMQPropertyConversionException;
/**
* Returns the property corresponding to the specified key as a Float.
*
* @throws HornetQPropertyConversionException if the value can not be converted to a Float
* @throws ActiveMQPropertyConversionException if the value can not be converted to a Float
*/
Float getFloatProperty(SimpleString key) throws HornetQPropertyConversionException;
Float getFloatProperty(SimpleString key) throws ActiveMQPropertyConversionException;
/**
* @see #getFloatProperty(SimpleString)
*/
Float getFloatProperty(String key) throws HornetQPropertyConversionException;
Float getFloatProperty(String key) throws ActiveMQPropertyConversionException;
/**
* Returns the property corresponding to the specified key as a String.
*
* @throws HornetQPropertyConversionException if the value can not be converted to a String
* @throws ActiveMQPropertyConversionException if the value can not be converted to a String
*/
String getStringProperty(SimpleString key) throws HornetQPropertyConversionException;
String getStringProperty(SimpleString key) throws ActiveMQPropertyConversionException;
/**
* @see #getStringProperty(SimpleString)
*/
String getStringProperty(String key) throws HornetQPropertyConversionException;
String getStringProperty(String key) throws ActiveMQPropertyConversionException;
/**
* Returns the property corresponding to the specified key as a SimpleString.
*
* @throws HornetQPropertyConversionException if the value can not be converted to a SimpleString
* @throws ActiveMQPropertyConversionException if the value can not be converted to a SimpleString
*/
SimpleString getSimpleStringProperty(SimpleString key) throws HornetQPropertyConversionException;
SimpleString getSimpleStringProperty(SimpleString key) throws ActiveMQPropertyConversionException;
/**
* @see #getSimpleStringProperty(SimpleString)
*/
SimpleString getSimpleStringProperty(String key) throws HornetQPropertyConversionException;
SimpleString getSimpleStringProperty(String key) throws ActiveMQPropertyConversionException;
/**
* Returns the property corresponding to the specified key as a byte[].
*
* @throws HornetQPropertyConversionException if the value can not be converted to a byte[]
* @throws ActiveMQPropertyConversionException if the value can not be converted to a byte[]
*/
byte[] getBytesProperty(SimpleString key) throws HornetQPropertyConversionException;
byte[] getBytesProperty(SimpleString key) throws ActiveMQPropertyConversionException;
/**
* @see #getBytesProperty(SimpleString)
*/
byte[] getBytesProperty(String key) throws HornetQPropertyConversionException;
byte[] getBytesProperty(String key) throws ActiveMQPropertyConversionException;
/**
* Returns all the names of the properties for this message.

View File

@ -294,7 +294,7 @@ public class TransportConfiguration implements Serializable
*
* @param buffer the buffer to encode into
*/
public void encode(final HornetQBuffer buffer)
public void encode(final ActiveMQBuffer buffer)
{
buffer.writeString(name);
buffer.writeString(factoryClassName);
@ -344,7 +344,7 @@ public class TransportConfiguration implements Serializable
*
* @param buffer the buffer to decode from
*/
public void decode(final HornetQBuffer buffer)
public void decode(final ActiveMQBuffer buffer)
{
name = buffer.readString();
factoryClassName = buffer.readString();

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.api.core.client;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.spi.core.remoting.ConsumerContext;
/**
@ -23,7 +23,7 @@ import org.apache.activemq.spi.core.remoting.ConsumerContext;
* by setting a {@link MessageHandler}.
* <br>
* These 2 types of consumption are exclusive: a ClientConsumer with a MessageHandler set will
* throw HornetQException if its <code>receive()</code> methods are called.
* throw ActiveMQException if its <code>receive()</code> methods are called.
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
@ -46,23 +46,23 @@ public interface ClientConsumer extends AutoCloseable
* <p>
* This call will block indefinitely until a message is received.
* <p>
* Calling this method on a closed consumer will throw a HornetQException.
* Calling this method on a closed consumer will throw a ActiveMQException.
* @return a ClientMessage
* @throws HornetQException if an exception occurs while waiting to receive a message
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while waiting to receive a message
*/
ClientMessage receive() throws HornetQException;
ClientMessage receive() throws ActiveMQException;
/**
* Receives a message from a queue.
* <p>
* This call will block until a message is received or the given timeout expires.
* <p>
* Calling this method on a closed consumer will throw a HornetQException.
* Calling this method on a closed consumer will throw a ActiveMQException.
* @param timeout time (in milliseconds) to wait to receive a message
* @return a message or {@code null} if the time out expired
* @throws HornetQException if an exception occurs while waiting to receive a message
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while waiting to receive a message
*/
ClientMessage receive(long timeout) throws HornetQException;
ClientMessage receive(long timeout) throws ActiveMQException;
/**
* Receives a message from a queue. This call will force a network trip to HornetQ server to
@ -74,38 +74,38 @@ public interface ClientConsumer extends AutoCloseable
* Note however that there is a performance cost as an additional network trip to the server may
* required to check the queue status.
* <p>
* Calling this method on a closed consumer will throw a HornetQException.
* Calling this method on a closed consumer will throw a ActiveMQException.
* @return a message or {@code null} if there are no messages in the queue for this consumer
* @throws HornetQException if an exception occurs while waiting to receive a message
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while waiting to receive a message
*/
ClientMessage receiveImmediate() throws HornetQException;
ClientMessage receiveImmediate() throws ActiveMQException;
/**
* Returns the MessageHandler associated to this consumer.
* <p>
* Calling this method on a closed consumer will throw a HornetQException.
* Calling this method on a closed consumer will throw a ActiveMQException.
* @return the MessageHandler associated to this consumer or {@code null}
* @throws HornetQException if an exception occurs while getting the MessageHandler
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while getting the MessageHandler
*/
MessageHandler getMessageHandler() throws HornetQException;
MessageHandler getMessageHandler() throws ActiveMQException;
/**
* Sets the MessageHandler for this consumer to consume messages asynchronously.
* <p>
* Calling this method on a closed consumer will throw a HornetQException.
* Calling this method on a closed consumer will throw a ActiveMQException.
* @param handler a MessageHandler
* @throws HornetQException if an exception occurs while setting the MessageHandler
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while setting the MessageHandler
*/
ClientConsumer setMessageHandler(MessageHandler handler) throws HornetQException;
ClientConsumer setMessageHandler(MessageHandler handler) throws ActiveMQException;
/**
* Closes the consumer.
* <p>
* Once this consumer is closed, it can not receive messages, whether synchronously or
* asynchronously.
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
void close() throws HornetQException;
void close() throws ActiveMQException;
/**
* Returns whether the consumer is closed or not.

View File

@ -15,7 +15,7 @@ package org.apache.activemq.api.core.client;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.Message;
import org.apache.activemq.api.core.SimpleString;
@ -49,10 +49,10 @@ public interface ClientMessage extends Message
* If the session responsible to acknowledge this message has {@code autoCommitAcks} set to
* {@code true}, the transaction will automatically commit the current transaction. Otherwise,
* this acknowledgement will not be committed until the client commits the session transaction.
* @throws HornetQException if an error occurred while acknowledging the message.
* @throws org.apache.activemq.api.core.ActiveMQException if an error occurred while acknowledging the message.
* @see ClientSession#isAutoCommitAcks()
*/
ClientMessage acknowledge() throws HornetQException;
ClientMessage acknowledge() throws ActiveMQException;
/**
* Acknowledges reception of a single message.
@ -60,10 +60,10 @@ public interface ClientMessage extends Message
* If the session responsible to acknowledge this message has {@code autoCommitAcks} set to
* {@code true}, the transaction will automatically commit the current transaction. Otherwise,
* this acknowledgement will not be committed until the client commits the session transaction.
* @throws HornetQException if an error occurred while acknowledging the message.
* @throws org.apache.activemq.api.core.ActiveMQException if an error occurred while acknowledging the message.
* @see ClientSession#isAutoCommitAcks()
*/
ClientMessage individualAcknowledge() throws HornetQException;
ClientMessage individualAcknowledge() throws ActiveMQException;
/**
* This can be optionally used to verify if the entire message has been received.
@ -71,9 +71,9 @@ public interface ClientMessage extends Message
* The use case for this is to make sure there won't be an exception while getting the buffer.
* Using getBodyBuffer directly would have the same effect but you could get a Runtime non checked Exception
* instead
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
void checkCompletion() throws HornetQException;
void checkCompletion() throws ActiveMQException;
/**
* Returns the size (in bytes) of this message's body
@ -85,19 +85,19 @@ public interface ClientMessage extends Message
* <br>
* This method is used when consuming large messages
*
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
* @return this ClientMessage
*/
ClientMessage setOutputStream(OutputStream out) throws HornetQException;
ClientMessage setOutputStream(OutputStream out) throws ActiveMQException;
/**
* Saves the content of the message to the OutputStream.
* It will block until the entire content is transferred to the OutputStream.
* <br>
*
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
void saveToOutputStream(OutputStream out) throws HornetQException;
void saveToOutputStream(OutputStream out) throws ActiveMQException;
/**
* Wait the outputStream completion of the message.
@ -106,9 +106,9 @@ public interface ClientMessage extends Message
*
* @param timeMilliseconds - 0 means wait forever
* @return true if it reached the end
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
boolean waitOutputStreamCompletion(long timeMilliseconds) throws HornetQException;
boolean waitOutputStreamCompletion(long timeMilliseconds) throws ActiveMQException;
/**
* Sets the body's IntputStream.

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.api.core.client;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.Message;
import org.apache.activemq.api.core.SimpleString;
@ -57,9 +57,9 @@ public interface ClientProducer extends AutoCloseable
* {@link ServerLocator#setBlockOnNonDurableSend(boolean)} are set to <code>true</code> for the
* specified message type.
* @param message the message to send
* @throws HornetQException if an exception occurs while sending the message
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while sending the message
*/
void send(Message message) throws HornetQException;
void send(Message message) throws ActiveMQException;
/**
* Sends a message to the specified address instead of the ClientProducer's address. <br>
@ -69,9 +69,9 @@ public interface ClientProducer extends AutoCloseable
* The handler will only get called if {@link ServerLocator#setConfirmationWindowSize(int) -1}.
* @param message the message to send
* @param handler handler to call after receiving a SEND acknowledgement from the server
* @throws HornetQException if an exception occurs while sending the message
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while sending the message
*/
void send(Message message, SendAcknowledgementHandler handler) throws HornetQException;
void send(Message message, SendAcknowledgementHandler handler) throws ActiveMQException;
/**
* Sends a message to the specified address instead of the ClientProducer's address. <br>
@ -82,9 +82,9 @@ public interface ClientProducer extends AutoCloseable
* message type.
* @param address the address where the message will be sent
* @param message the message to send
* @throws HornetQException if an exception occurs while sending the message
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while sending the message
*/
void send(SimpleString address, Message message) throws HornetQException;
void send(SimpleString address, Message message) throws ActiveMQException;
/**
* Sends a message to the specified address instead of the ClientProducer's address. <br>
@ -95,9 +95,9 @@ public interface ClientProducer extends AutoCloseable
* @param address the address where the message will be sent
* @param message the message to send
* @param handler handler to call after receiving a SEND acknowledgement from the server
* @throws HornetQException if an exception occurs while sending the message
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while sending the message
*/
void send(SimpleString address, Message message, SendAcknowledgementHandler handler) throws HornetQException;
void send(SimpleString address, Message message, SendAcknowledgementHandler handler) throws ActiveMQException;
/**
* Sends a message to the specified address instead of the ClientProducer's address. <br>
@ -108,16 +108,16 @@ public interface ClientProducer extends AutoCloseable
* message type.
* @param address the address where the message will be sent
* @param message the message to send
* @throws HornetQException if an exception occurs while sending the message
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while sending the message
*/
void send(String address, Message message) throws HornetQException;
void send(String address, Message message) throws ActiveMQException;
/**
* Closes the ClientProducer. If already closed nothing is done.
*
* @throws HornetQException if an exception occurs while closing the producer
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while closing the producer
*/
void close() throws HornetQException;
void close() throws ActiveMQException;
/**
* Returns whether the producer is closed or not.

View File

@ -15,7 +15,7 @@ package org.apache.activemq.api.core.client;
import javax.transaction.xa.XAResource;
import java.util.List;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.SimpleString;
/**
@ -111,24 +111,24 @@ public interface ClientSession extends XAResource, AutoCloseable
* Starts the session.
* The session must be started before ClientConsumers created by the session can consume messages from the queue.
*
* @throws HornetQException if an exception occurs while starting the session
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while starting the session
*/
ClientSession start() throws HornetQException;
ClientSession start() throws ActiveMQException;
/**
* Stops the session.
* ClientConsumers created by the session can not consume messages when the session is stopped.
*
* @throws HornetQException if an exception occurs while stopping the session
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while stopping the session
*/
void stop() throws HornetQException;
void stop() throws ActiveMQException;
/**
* Closes the session.
*
* @throws HornetQException if an exception occurs while closing the session
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while closing the session
*/
void close() throws HornetQException;
void close() throws ActiveMQException;
/**
* Returns whether the session is closed or not.
@ -183,9 +183,9 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param address the queue will be bound to this address
* @param queueName the name of the queue
* @param durable whether the queue is durable or not
* @throws HornetQException in an exception occurs while creating the queue
* @throws org.apache.activemq.api.core.ActiveMQException in an exception occurs while creating the queue
*/
void createQueue(SimpleString address, SimpleString queueName, boolean durable) throws HornetQException;
void createQueue(SimpleString address, SimpleString queueName, boolean durable) throws ActiveMQException;
/**
* Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deleted
@ -195,9 +195,9 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param address the queue will be bound to this address
* @param queueName the name of the queue
* @param durable if the queue is durable
* @throws HornetQException in an exception occurs while creating the queue
* @throws org.apache.activemq.api.core.ActiveMQException in an exception occurs while creating the queue
*/
void createSharedQueue(SimpleString address, SimpleString queueName, boolean durable) throws HornetQException;
void createSharedQueue(SimpleString address, SimpleString queueName, boolean durable) throws ActiveMQException;
/**
* Creates a transient queue. A queue that will exist as long as there are consumers. When the last consumer is closed the queue will be deleted
@ -208,9 +208,9 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param queueName the name of the queue
* @param filter whether the queue is durable or not
* @param durable if the queue is durable
* @throws HornetQException in an exception occurs while creating the queue
* @throws org.apache.activemq.api.core.ActiveMQException in an exception occurs while creating the queue
*/
void createSharedQueue(SimpleString address, SimpleString queueName, SimpleString filter, boolean durable) throws HornetQException;
void createSharedQueue(SimpleString address, SimpleString queueName, SimpleString filter, boolean durable) throws ActiveMQException;
/**
* Creates a <em>non-temporary</em> queue.
@ -218,27 +218,27 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param address the queue will be bound to this address
* @param queueName the name of the queue
* @param durable whether the queue is durable or not
* @throws HornetQException in an exception occurs while creating the queue
* @throws org.apache.activemq.api.core.ActiveMQException in an exception occurs while creating the queue
*/
void createQueue(String address, String queueName, boolean durable) throws HornetQException;
void createQueue(String address, String queueName, boolean durable) throws ActiveMQException;
/**
* Creates a <em>non-temporary</em> queue <em>non-durable</em> queue.
*
* @param address the queue will be bound to this address
* @param queueName the name of the queue
* @throws HornetQException in an exception occurs while creating the queue
* @throws org.apache.activemq.api.core.ActiveMQException in an exception occurs while creating the queue
*/
void createQueue(String address, String queueName) throws HornetQException;
void createQueue(String address, String queueName) throws ActiveMQException;
/**
* Creates a <em>non-temporary</em> queue <em>non-durable</em> queue.
*
* @param address the queue will be bound to this address
* @param queueName the name of the queue
* @throws HornetQException in an exception occurs while creating the queue
* @throws org.apache.activemq.api.core.ActiveMQException in an exception occurs while creating the queue
*/
void createQueue(SimpleString address, SimpleString queueName) throws HornetQException;
void createQueue(SimpleString address, SimpleString queueName) throws ActiveMQException;
/**
* Creates a <em>non-temporary</em> queue.
@ -247,9 +247,9 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param queueName the name of the queue
* @param filter only messages which match this filter will be put in the queue
* @param durable whether the queue is durable or not
* @throws HornetQException in an exception occurs while creating the queue
* @throws org.apache.activemq.api.core.ActiveMQException in an exception occurs while creating the queue
*/
void createQueue(SimpleString address, SimpleString queueName, SimpleString filter, boolean durable) throws HornetQException;
void createQueue(SimpleString address, SimpleString queueName, SimpleString filter, boolean durable) throws ActiveMQException;
/**
* Creates a <em>non-temporary</em>queue.
@ -258,27 +258,27 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param queueName the name of the queue
* @param durable whether the queue is durable or not
* @param filter only messages which match this filter will be put in the queue
* @throws HornetQException in an exception occurs while creating the queue
* @throws org.apache.activemq.api.core.ActiveMQException in an exception occurs while creating the queue
*/
void createQueue(String address, String queueName, String filter, boolean durable) throws HornetQException;
void createQueue(String address, String queueName, String filter, boolean durable) throws ActiveMQException;
/**
* Creates a <em>temporary</em> queue.
*
* @param address the queue will be bound to this address
* @param queueName the name of the queue
* @throws HornetQException in an exception occurs while creating the queue
* @throws org.apache.activemq.api.core.ActiveMQException in an exception occurs while creating the queue
*/
void createTemporaryQueue(SimpleString address, SimpleString queueName) throws HornetQException;
void createTemporaryQueue(SimpleString address, SimpleString queueName) throws ActiveMQException;
/**
* Creates a <em>temporary</em> queue.
*
* @param address the queue will be bound to this address
* @param queueName the name of the queue
* @throws HornetQException in an exception occurs while creating the queue
* @throws org.apache.activemq.api.core.ActiveMQException in an exception occurs while creating the queue
*/
void createTemporaryQueue(String address, String queueName) throws HornetQException;
void createTemporaryQueue(String address, String queueName) throws ActiveMQException;
/**
* Creates a <em>temporary</em> queue with a filter.
@ -286,9 +286,9 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param address the queue will be bound to this address
* @param queueName the name of the queue
* @param filter only messages which match this filter will be put in the queue
* @throws HornetQException in an exception occurs while creating the queue
* @throws org.apache.activemq.api.core.ActiveMQException in an exception occurs while creating the queue
*/
void createTemporaryQueue(SimpleString address, SimpleString queueName, SimpleString filter) throws HornetQException;
void createTemporaryQueue(SimpleString address, SimpleString queueName, SimpleString filter) throws ActiveMQException;
/**
* Creates a <em>temporary</em> queue with a filter.
@ -296,25 +296,25 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param address the queue will be bound to this address
* @param queueName the name of the queue
* @param filter only messages which match this filter will be put in the queue
* @throws HornetQException in an exception occurs while creating the queue
* @throws org.apache.activemq.api.core.ActiveMQException in an exception occurs while creating the queue
*/
void createTemporaryQueue(String address, String queueName, String filter) throws HornetQException;
void createTemporaryQueue(String address, String queueName, String filter) throws ActiveMQException;
/**
* Deletes the queue.
*
* @param queueName the name of the queue to delete
* @throws HornetQException if there is no queue for the given name or if the queue has consumers
* @throws org.apache.activemq.api.core.ActiveMQException if there is no queue for the given name or if the queue has consumers
*/
void deleteQueue(SimpleString queueName) throws HornetQException;
void deleteQueue(SimpleString queueName) throws ActiveMQException;
/**
* Deletes the queue.
*
* @param queueName the name of the queue to delete
* @throws HornetQException if there is no queue for the given name or if the queue has consumers
* @throws org.apache.activemq.api.core.ActiveMQException if there is no queue for the given name or if the queue has consumers
*/
void deleteQueue(String queueName) throws HornetQException;
void deleteQueue(String queueName) throws ActiveMQException;
// Consumer Operations -------------------------------------------
@ -323,18 +323,18 @@ public interface ClientSession extends XAResource, AutoCloseable
*
* @param queueName name of the queue to consume messages from
* @return a ClientConsumer
* @throws HornetQException if an exception occurs while creating the ClientConsumer
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the ClientConsumer
*/
ClientConsumer createConsumer(SimpleString queueName) throws HornetQException;
ClientConsumer createConsumer(SimpleString queueName) throws ActiveMQException;
/**
* Creates a ClientConsumer to consume messages from the queue with the given name.
*
* @param queueName name of the queue to consume messages from
* @return a ClientConsumer
* @throws HornetQException if an exception occurs while creating the ClientConsumer
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the ClientConsumer
*/
ClientConsumer createConsumer(String queueName) throws HornetQException;
ClientConsumer createConsumer(String queueName) throws ActiveMQException;
/**
* Creates a ClientConsumer to consume messages matching the filter from the queue with the given name.
@ -342,9 +342,9 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param queueName name of the queue to consume messages from
* @param filter only messages which match this filter will be consumed
* @return a ClientConsumer
* @throws HornetQException if an exception occurs while creating the ClientConsumer
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the ClientConsumer
*/
ClientConsumer createConsumer(SimpleString queueName, SimpleString filter) throws HornetQException;
ClientConsumer createConsumer(SimpleString queueName, SimpleString filter) throws ActiveMQException;
/**
* Creates a ClientConsumer to consume messages matching the filter from the queue with the given name.
@ -352,9 +352,9 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param queueName name of the queue to consume messages from
* @param filter only messages which match this filter will be consumed
* @return a ClientConsumer
* @throws HornetQException if an exception occurs while creating the ClientConsumer
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the ClientConsumer
*/
ClientConsumer createConsumer(String queueName, String filter) throws HornetQException;
ClientConsumer createConsumer(String queueName, String filter) throws ActiveMQException;
/**
* Creates a ClientConsumer to consume or browse messages from the queue with the given name.
@ -370,9 +370,9 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param queueName name of the queue to consume messages from
* @param browseOnly whether the ClientConsumer will only browse the queue or consume messages.
* @return a ClientConsumer
* @throws HornetQException if an exception occurs while creating the ClientConsumer
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the ClientConsumer
*/
ClientConsumer createConsumer(SimpleString queueName, boolean browseOnly) throws HornetQException;
ClientConsumer createConsumer(SimpleString queueName, boolean browseOnly) throws ActiveMQException;
/**
* Creates a ClientConsumer to consume or browse messages from the queue with the given name.
@ -388,9 +388,9 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param queueName name of the queue to consume messages from
* @param browseOnly whether the ClientConsumer will only browse the queue or consume messages.
* @return a ClientConsumer
* @throws HornetQException if an exception occurs while creating the ClientConsumer
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the ClientConsumer
*/
ClientConsumer createConsumer(String queueName, boolean browseOnly) throws HornetQException;
ClientConsumer createConsumer(String queueName, boolean browseOnly) throws ActiveMQException;
/**
* Creates a ClientConsumer to consume or browse messages matching the filter from the queue with
@ -408,9 +408,9 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param filter only messages which match this filter will be consumed
* @param browseOnly whether the ClientConsumer will only browse the queue or consume messages.
* @return a ClientConsumer
* @throws HornetQException if an exception occurs while creating the ClientConsumer
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the ClientConsumer
*/
ClientConsumer createConsumer(String queueName, String filter, boolean browseOnly) throws HornetQException;
ClientConsumer createConsumer(String queueName, String filter, boolean browseOnly) throws ActiveMQException;
/**
* Creates a ClientConsumer to consume or browse messages matching the filter from the queue with
@ -428,9 +428,9 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param filter only messages which match this filter will be consumed
* @param browseOnly whether the ClientConsumer will only browse the queue or consume messages.
* @return a ClientConsumer
* @throws HornetQException if an exception occurs while creating the ClientConsumer
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the ClientConsumer
*/
ClientConsumer createConsumer(SimpleString queueName, SimpleString filter, boolean browseOnly) throws HornetQException;
ClientConsumer createConsumer(SimpleString queueName, SimpleString filter, boolean browseOnly) throws ActiveMQException;
/**
* Creates a ClientConsumer to consume or browse messages matching the filter from the queue with
@ -450,13 +450,13 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param maxRate the maximum rate to consume messages
* @param browseOnly whether the ClientConsumer will only browse the queue or consume messages.
* @return a ClientConsumer
* @throws HornetQException if an exception occurs while creating the ClientConsumer
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the ClientConsumer
*/
ClientConsumer createConsumer(SimpleString queueName,
SimpleString filter,
int windowSize,
int maxRate,
boolean browseOnly) throws HornetQException;
boolean browseOnly) throws ActiveMQException;
/**
* Creates a ClientConsumer to consume or browse messages matching the filter from the queue with
@ -476,9 +476,9 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param maxRate the maximum rate to consume messages
* @param browseOnly whether the ClientConsumer will only browse the queue or consume messages.
* @return a ClientConsumer
* @throws HornetQException if an exception occurs while creating the ClientConsumer
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the ClientConsumer
*/
ClientConsumer createConsumer(String queueName, String filter, int windowSize, int maxRate, boolean browseOnly) throws HornetQException;
ClientConsumer createConsumer(String queueName, String filter, int windowSize, int maxRate, boolean browseOnly) throws ActiveMQException;
// Producer Operations -------------------------------------------
@ -489,25 +489,25 @@ public interface ClientSession extends XAResource, AutoCloseable
* @return a ClientProducer
* @see ClientProducer#send(SimpleString, org.apache.activemq.api.core.Message)
*/
ClientProducer createProducer() throws HornetQException;
ClientProducer createProducer() throws ActiveMQException;
/**
* Creates a producer which sends messages to the given address
*
* @param address the address to send messages to
* @return a ClientProducer
* @throws HornetQException if an exception occurs while creating the ClientProducer
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the ClientProducer
*/
ClientProducer createProducer(SimpleString address) throws HornetQException;
ClientProducer createProducer(SimpleString address) throws ActiveMQException;
/**
* Creates a producer which sends messages to the given address
*
* @param address the address to send messages to
* @return a ClientProducer
* @throws HornetQException if an exception occurs while creating the ClientProducer
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the ClientProducer
*/
ClientProducer createProducer(String address) throws HornetQException;
ClientProducer createProducer(String address) throws ActiveMQException;
/**
* Creates a producer which sends messages to the given address
@ -515,9 +515,9 @@ public interface ClientSession extends XAResource, AutoCloseable
* @param address the address to send messages to
* @param rate the producer rate
* @return a ClientProducer
* @throws HornetQException if an exception occurs while creating the ClientProducer
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the ClientProducer
*/
ClientProducer createProducer(SimpleString address, int rate) throws HornetQException;
ClientProducer createProducer(SimpleString address, int rate) throws ActiveMQException;
// Message operations --------------------------------------------
@ -557,18 +557,18 @@ public interface ClientSession extends XAResource, AutoCloseable
*
* @param queueName the name of the queue to query
* @return a QueueQuery containing information on the given queue
* @throws HornetQException if an exception occurs while querying the queue
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while querying the queue
*/
QueueQuery queueQuery(SimpleString queueName) throws HornetQException;
QueueQuery queueQuery(SimpleString queueName) throws ActiveMQException;
/**
* Queries information on a binding.
*
* @param address the address of the biding to query
* @return a AddressQuery containing information on the binding attached to the given address
* @throws HornetQException if an exception occurs while querying the binding
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while querying the binding
*/
AddressQuery addressQuery(SimpleString address) throws HornetQException;
AddressQuery addressQuery(SimpleString address) throws ActiveMQException;
// Transaction operations ----------------------------------------
@ -589,24 +589,24 @@ public interface ClientSession extends XAResource, AutoCloseable
/**
* Commits the current transaction.
*
* @throws HornetQException if an exception occurs while committing the transaction
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while committing the transaction
*/
void commit() throws HornetQException;
void commit() throws ActiveMQException;
/**
* Rolls back the current transaction.
*
* @throws HornetQException if an exception occurs while rolling back the transaction
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while rolling back the transaction
*/
void rollback() throws HornetQException;
void rollback() throws ActiveMQException;
/**
* Rolls back the current transaction.
*
* @param considerLastMessageAsDelivered the first message on deliveringMessage Buffer is considered as delivered
* @throws HornetQException if an exception occurs while rolling back the transaction
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while rolling back the transaction
*/
void rollback(boolean considerLastMessageAsDelivered) throws HornetQException;
void rollback(boolean considerLastMessageAsDelivered) throws ActiveMQException;
/**
* Returns <code>true</code> if the current transaction has been flagged to rollback, <code>false</code> else.
@ -649,18 +649,18 @@ public interface ClientSession extends XAResource, AutoCloseable
/**
* Attach any metadata to the session.
*
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
void addMetaData(String key, String data) throws HornetQException;
void addMetaData(String key, String data) throws ActiveMQException;
/**
* Attach any metadata to the session. Throws an exception if there's already a metadata available.
* You can use this metadata to ensure that there is no other session with the same meta-data you are passing as an argument.
* This is useful to simulate unique client-ids, where you may want to avoid multiple instances of your client application connected.
*
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
void addUniqueMetaData(String key, String data) throws HornetQException;
void addUniqueMetaData(String key, String data) throws ActiveMQException;
/**
* Return the sessionFactory used to created this Session.

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.api.core.client;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.TransportConfiguration;
import org.apache.activemq.spi.core.protocol.RemotingConnection;
@ -31,9 +31,9 @@ public interface ClientSessionFactory extends AutoCloseable
* Creates a session with XA transaction semantics.
*
* @return a ClientSession with XA transaction semantics
* @throws HornetQException if an exception occurs while creating the session
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the session
*/
ClientSession createXASession() throws HornetQException;
ClientSession createXASession() throws ActiveMQException;
/**
* Creates a <em>transacted</em> session.
@ -41,10 +41,10 @@ public interface ClientSessionFactory extends AutoCloseable
* It is up to the client to commit when sending and acknowledging messages.
*
* @return a transacted ClientSession
* @throws HornetQException if an exception occurs while creating the session
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the session
* @see ClientSession#commit()
*/
ClientSession createTransactedSession() throws HornetQException;
ClientSession createTransactedSession() throws ActiveMQException;
/**
@ -54,9 +54,9 @@ public interface ClientSessionFactory extends AutoCloseable
* the session will automatically commit the transaction containing the acknowledgements.
*
* @return a non-transacted ClientSession
* @throws HornetQException if an exception occurs while creating the session
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the session
*/
ClientSession createSession() throws HornetQException;
ClientSession createSession() throws ActiveMQException;
/**
* Creates a session.
@ -64,9 +64,9 @@ public interface ClientSessionFactory extends AutoCloseable
* @param autoCommitSends <code>true</code> to automatically commit message sends, <code>false</code> to commit manually
* @param autoCommitAcks <code>true</code> to automatically commit message acknowledgement, <code>false</code> to commit manually
* @return a ClientSession
* @throws HornetQException if an exception occurs while creating the session
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the session
*/
ClientSession createSession(boolean autoCommitSends, boolean autoCommitAcks) throws HornetQException;
ClientSession createSession(boolean autoCommitSends, boolean autoCommitAcks) throws ActiveMQException;
/**
* Creates a session.
@ -75,9 +75,9 @@ public interface ClientSessionFactory extends AutoCloseable
* @param autoCommitAcks <code>true</code> to automatically commit message acknowledgement, <code>false</code> to commit manually
* @param ackBatchSize the batch size of the acknowledgements
* @return a ClientSession
* @throws HornetQException if an exception occurs while creating the session
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the session
*/
ClientSession createSession(boolean autoCommitSends, boolean autoCommitAcks, int ackBatchSize) throws HornetQException;
ClientSession createSession(boolean autoCommitSends, boolean autoCommitAcks, int ackBatchSize) throws ActiveMQException;
/**
* Creates a session.
@ -86,9 +86,9 @@ public interface ClientSessionFactory extends AutoCloseable
* @param autoCommitSends <code>true</code> to automatically commit message sends, <code>false</code> to commit manually
* @param autoCommitAcks <code>true</code> to automatically commit message acknowledgement, <code>false</code> to commit manually
* @return a ClientSession
* @throws HornetQException if an exception occurs while creating the session
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the session
*/
ClientSession createSession(boolean xa, boolean autoCommitSends, boolean autoCommitAcks) throws HornetQException;
ClientSession createSession(boolean xa, boolean autoCommitSends, boolean autoCommitAcks) throws ActiveMQException;
/**
* Creates a session.
@ -102,9 +102,9 @@ public interface ClientSessionFactory extends AutoCloseable
* @param autoCommitAcks <code>true</code> to automatically commit message acknowledgement, <code>false</code> to commit manually
* @param preAcknowledge <code>true</code> to pre-acknowledge messages on the server, <code>false</code> to let the client acknowledge the messages
* @return a ClientSession
* @throws HornetQException if an exception occurs while creating the session
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the session
*/
ClientSession createSession(boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge) throws HornetQException;
ClientSession createSession(boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge) throws ActiveMQException;
/**
* Creates an <em>authenticated</em> session.
@ -120,7 +120,7 @@ public interface ClientSessionFactory extends AutoCloseable
* @param autoCommitAcks <code>true</code> to automatically commit message acknowledgement, <code>false</code> to commit manually
* @param preAcknowledge <code>true</code> to pre-acknowledge messages on the server, <code>false</code> to let the client acknowledge the messages
* @return a ClientSession
* @throws HornetQException if an exception occurs while creating the session
* @throws org.apache.activemq.api.core.ActiveMQException if an exception occurs while creating the session
*/
ClientSession createSession(String username,
String password,
@ -128,7 +128,7 @@ public interface ClientSessionFactory extends AutoCloseable
boolean autoCommitSends,
boolean autoCommitAcks,
boolean preAcknowledge,
int ackBatchSize) throws HornetQException;
int ackBatchSize) throws ActiveMQException;
/**
* Closes this factory and any session created by it.

View File

@ -165,7 +165,7 @@ public interface ServerLocator extends AutoCloseable
* Returns the blocking calls timeout.
* <p>
* If client's blocking calls to the server take more than this timeout, the call will throw a
* {@link org.apache.activemq.api.core.HornetQException} with the code {@link org.apache.activemq.api.core.HornetQExceptionType#CONNECTION_TIMEDOUT}. Value
* {@link org.apache.activemq.api.core.ActiveMQException} with the code {@link org.apache.activemq.api.core.ActiveMQExceptionType#CONNECTION_TIMEDOUT}. Value
* is in milliseconds, default value is {@link HornetQClient#DEFAULT_CALL_TIMEOUT}.
*
* @return the blocking calls timeout

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.api.core.client;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.core.remoting.FailureListener;
/**
@ -29,5 +29,5 @@ public interface SessionFailureListener extends FailureListener
*
* @param exception exception which has caused the connection to fail
*/
void beforeReconnect(HornetQException exception);
void beforeReconnect(ActiveMQException exception);
}

View File

@ -316,7 +316,7 @@ public interface HornetQServerControl
/**
* Create a durable queue.
* <br>
* This method throws a {@link org.apache.activemq.api.core.HornetQQueueExistsException}) exception if the queue already exits.
* This method throws a {@link org.apache.activemq.api.core.ActiveMQQueueExistsException}) exception if the queue already exits.
*
* @param address address to bind the queue to
* @param name name of the queue
@ -328,7 +328,7 @@ public interface HornetQServerControl
/**
* Create a queue.
* <br>
* This method throws a {@link org.apache.activemq.api.core.HornetQQueueExistsException}) exception if the queue already exits.
* This method throws a {@link org.apache.activemq.api.core.ActiveMQQueueExistsException}) exception if the queue already exits.
*
* @param address address to bind the queue to
* @param name name of the queue
@ -344,7 +344,7 @@ public interface HornetQServerControl
/**
* Create a queue.
* <br>
* This method throws a {@link org.apache.activemq.api.core.HornetQQueueExistsException}) exception if the queue already exits.
* This method throws a {@link org.apache.activemq.api.core.ActiveMQQueueExistsException}) exception if the queue already exits.
*
* @param address address to bind the queue to
* @param name name of the queue

View File

@ -14,7 +14,7 @@ package org.apache.activemq.core.buffers.impl;
import java.nio.ByteBuffer;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.core.message.impl.MessageInternal;
@ -40,7 +40,7 @@ public final class ResetLimitWrappedHornetQBuffer extends ChannelBufferWrapper
this.message = message;
}
public ResetLimitWrappedHornetQBuffer(final int limit, final HornetQBuffer buffer, final MessageInternal message)
public ResetLimitWrappedHornetQBuffer(final int limit, final ActiveMQBuffer buffer, final MessageInternal message)
{
super(buffer.byteBuf());
@ -64,7 +64,7 @@ public final class ResetLimitWrappedHornetQBuffer extends ChannelBufferWrapper
}
}
public void setBuffer(final HornetQBuffer buffer)
public void setBuffer(final ActiveMQBuffer buffer)
{
if (this.buffer != null)
{
@ -175,7 +175,7 @@ public final class ResetLimitWrappedHornetQBuffer extends ChannelBufferWrapper
}
@Override
public void setBytes(final int index, final HornetQBuffer src, final int srcIndex, final int length)
public void setBytes(final int index, final ActiveMQBuffer src, final int srcIndex, final int length)
{
changed();
@ -183,7 +183,7 @@ public final class ResetLimitWrappedHornetQBuffer extends ChannelBufferWrapper
}
@Override
public void setBytes(final int index, final HornetQBuffer src, final int length)
public void setBytes(final int index, final ActiveMQBuffer src, final int length)
{
changed();
@ -191,7 +191,7 @@ public final class ResetLimitWrappedHornetQBuffer extends ChannelBufferWrapper
}
@Override
public void setBytes(final int index, final HornetQBuffer src)
public void setBytes(final int index, final ActiveMQBuffer src)
{
changed();
@ -287,7 +287,7 @@ public final class ResetLimitWrappedHornetQBuffer extends ChannelBufferWrapper
}
@Override
public void writeBytes(final HornetQBuffer src, final int srcIndex, final int length)
public void writeBytes(final ActiveMQBuffer src, final int srcIndex, final int length)
{
changed();
@ -295,7 +295,7 @@ public final class ResetLimitWrappedHornetQBuffer extends ChannelBufferWrapper
}
@Override
public void writeBytes(final HornetQBuffer src, final int length)
public void writeBytes(final ActiveMQBuffer src, final int length)
{
changed();

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.client;
import org.apache.activemq.api.core.HornetQExceptionType;
import org.apache.activemq.api.core.ActiveMQExceptionType;
import org.apache.activemq.api.core.Interceptor;
import org.apache.activemq.core.protocol.core.Packet;
import org.jboss.logging.BasicLogger;
@ -223,7 +223,7 @@ public interface HornetQClientLogger extends BasicLogger
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212037, value = "Connection failure has been detected: {0} [code={1}]", format = Message.Format.MESSAGE_FORMAT)
void connectionFailureDetected(String message, HornetQExceptionType type);
void connectionFailureDetected(String message, ActiveMQExceptionType type);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 212038, value = "Failure in calling interceptor: {0}", format = Message.Format.MESSAGE_FORMAT)

View File

@ -14,19 +14,19 @@
package org.apache.activemq.core.client;
import org.apache.activemq.api.core.HornetQAddressFullException;
import org.apache.activemq.api.core.HornetQConnectionTimedOutException;
import org.apache.activemq.api.core.HornetQDisconnectedException;
import org.apache.activemq.api.core.HornetQIllegalStateException;
import org.apache.activemq.api.core.HornetQInterceptorRejectedPacketException;
import org.apache.activemq.api.core.HornetQInternalErrorException;
import org.apache.activemq.api.core.HornetQLargeMessageException;
import org.apache.activemq.api.core.HornetQLargeMessageInterruptedException;
import org.apache.activemq.api.core.HornetQNotConnectedException;
import org.apache.activemq.api.core.HornetQObjectClosedException;
import org.apache.activemq.api.core.HornetQTransactionOutcomeUnknownException;
import org.apache.activemq.api.core.HornetQTransactionRolledBackException;
import org.apache.activemq.api.core.HornetQUnBlockedException;
import org.apache.activemq.api.core.ActiveMQAddressFullException;
import org.apache.activemq.api.core.ActiveMQConnectionTimedOutException;
import org.apache.activemq.api.core.ActiveMQDisconnectedException;
import org.apache.activemq.api.core.ActiveMQIllegalStateException;
import org.apache.activemq.api.core.ActiveMQInterceptorRejectedPacketException;
import org.apache.activemq.api.core.ActiveMQInternalErrorException;
import org.apache.activemq.api.core.ActiveMQLargeMessageException;
import org.apache.activemq.api.core.ActiveMQLargeMessageInterruptedException;
import org.apache.activemq.api.core.ActiveMQNotConnectedException;
import org.apache.activemq.api.core.ActiveMQObjectClosedException;
import org.apache.activemq.api.core.ActiveMQTransactionOutcomeUnknownException;
import org.apache.activemq.api.core.ActiveMQTransactionRolledBackException;
import org.apache.activemq.api.core.ActiveMQUnBlockedException;
import org.apache.activemq.core.cluster.DiscoveryGroup;
import org.apache.activemq.spi.core.remoting.Connection;
import org.jboss.logging.annotations.Cause;
@ -51,105 +51,105 @@ public interface HornetQClientMessageBundle
HornetQClientMessageBundle BUNDLE = Messages.getBundle(HornetQClientMessageBundle.class);
@Message(id = 119000, value = "ClientSession closed while creating session", format = Message.Format.MESSAGE_FORMAT)
HornetQInternalErrorException clientSessionClosed();
ActiveMQInternalErrorException clientSessionClosed();
@Message(id = 119001, value = "Failed to create session", format = Message.Format.MESSAGE_FORMAT)
HornetQInternalErrorException failedToCreateSession(@Cause Throwable t);
ActiveMQInternalErrorException failedToCreateSession(@Cause Throwable t);
@Message(id = 119002, value = "Internal Error! ClientSessionFactoryImpl::createSessionInternal "
+ "just reached a condition that was not supposed to happen. "
+ "Please inform this condition to the HornetQ team", format = Message.Format.MESSAGE_FORMAT)
HornetQInternalErrorException clietSessionInternal();
ActiveMQInternalErrorException clietSessionInternal();
@Message(id = 119003, value = "Queue can not be both durable and temporary", format = Message.Format.MESSAGE_FORMAT)
HornetQInternalErrorException queueMisConfigured();
ActiveMQInternalErrorException queueMisConfigured();
@Message(id = 119004, value = "Failed to initialise session factory", format = Message.Format.MESSAGE_FORMAT)
HornetQInternalErrorException failedToInitialiseSessionFactory(@Cause Exception e);
ActiveMQInternalErrorException failedToInitialiseSessionFactory(@Cause Exception e);
@Message(id = 119005, value = "Exception in Netty transport", format = Message.Format.MESSAGE_FORMAT)
HornetQInternalErrorException nettyError();
ActiveMQInternalErrorException nettyError();
@Message(id = 119006, value = "Channel disconnected", format = Message.Format.MESSAGE_FORMAT)
HornetQNotConnectedException channelDisconnected();
ActiveMQNotConnectedException channelDisconnected();
@Message(id = 119007, value = "Cannot connect to server(s). Tried with all available servers.", format = Message.Format.MESSAGE_FORMAT)
HornetQNotConnectedException cannotConnectToServers();
ActiveMQNotConnectedException cannotConnectToServers();
@Message(id = 119008, value = "Failed to connect to any static connectors", format = Message.Format.MESSAGE_FORMAT)
HornetQNotConnectedException cannotConnectToStaticConnectors(@Cause Exception e);
ActiveMQNotConnectedException cannotConnectToStaticConnectors(@Cause Exception e);
@Message(id = 119009, value = "Failed to connect to any static connectors", format = Message.Format.MESSAGE_FORMAT)
HornetQNotConnectedException cannotConnectToStaticConnectors2();
ActiveMQNotConnectedException cannotConnectToStaticConnectors2();
@Message(id = 119010, value = "Connection is destroyed", format = Message.Format.MESSAGE_FORMAT)
HornetQNotConnectedException connectionDestroyed();
ActiveMQNotConnectedException connectionDestroyed();
@Message(id = 119011, value = "Did not receive data from server for {0}", format = Message.Format.MESSAGE_FORMAT)
HornetQConnectionTimedOutException connectionTimedOut(Connection transportConnection);
ActiveMQConnectionTimedOutException connectionTimedOut(Connection transportConnection);
@Message(id = 119012, value = "Timed out waiting to receive initial broadcast from cluster", format = Message.Format.MESSAGE_FORMAT)
HornetQConnectionTimedOutException connectionTimedOutInInitialBroadcast();
ActiveMQConnectionTimedOutException connectionTimedOutInInitialBroadcast();
@Message(id = 119013, value = "Timed out waiting to receive cluster topology. Group:{0}", format = Message.Format.MESSAGE_FORMAT)
HornetQConnectionTimedOutException connectionTimedOutOnReceiveTopology(DiscoveryGroup discoveryGroup);
ActiveMQConnectionTimedOutException connectionTimedOutOnReceiveTopology(DiscoveryGroup discoveryGroup);
@Message(id = 119014, value = "Timed out waiting for response when sending packet {0}", format = Message.Format.MESSAGE_FORMAT)
HornetQConnectionTimedOutException timedOutSendingPacket(Byte type);
ActiveMQConnectionTimedOutException timedOutSendingPacket(Byte type);
@Message(id = 119015, value = "The connection was disconnected because of server shutdown", format = Message.Format.MESSAGE_FORMAT)
HornetQDisconnectedException disconnected();
ActiveMQDisconnectedException disconnected();
@Message(id = 119016, value = "Connection failure detected. Unblocking a blocking call that will never get a resp" +
"onse", format = Message.Format.MESSAGE_FORMAT)
HornetQUnBlockedException unblockingACall(@Cause Throwable t);
ActiveMQUnBlockedException unblockingACall(@Cause Throwable t);
@Message(id = 119017, value = "Consumer is closed", format = Message.Format.MESSAGE_FORMAT)
HornetQObjectClosedException consumerClosed();
ActiveMQObjectClosedException consumerClosed();
@Message(id = 119018, value = "Producer is closed", format = Message.Format.MESSAGE_FORMAT)
HornetQObjectClosedException producerClosed();
ActiveMQObjectClosedException producerClosed();
@Message(id = 119019, value = "Session is closed", format = Message.Format.MESSAGE_FORMAT)
HornetQObjectClosedException sessionClosed();
ActiveMQObjectClosedException sessionClosed();
@Message(id = 119020, value = "Cannot call receive(...) - a MessageHandler is set", format = Message.Format.MESSAGE_FORMAT)
HornetQIllegalStateException messageHandlerSet();
ActiveMQIllegalStateException messageHandlerSet();
@Message(id = 119021, value = "Cannot set MessageHandler - consumer is in receive(...)", format = Message.Format.MESSAGE_FORMAT)
HornetQIllegalStateException inReceive();
ActiveMQIllegalStateException inReceive();
@Message(id = 119022, value = "Header size ({0}) is too big, use the messageBody for large data, or increase minLargeMessageSize",
format = Message.Format.MESSAGE_FORMAT)
HornetQIllegalStateException headerSizeTooBig(Integer headerSize);
ActiveMQIllegalStateException headerSizeTooBig(Integer headerSize);
@Message(id = 119023, value = "The large message lost connection with its session, either because of a rollback or a closed session", format = Message.Format.MESSAGE_FORMAT)
HornetQIllegalStateException largeMessageLostSession();
ActiveMQIllegalStateException largeMessageLostSession();
@Message(id = 119024, value = "Could not select a TransportConfiguration to create SessionFactory", format = Message.Format.MESSAGE_FORMAT)
HornetQIllegalStateException noTCForSessionFactory();
ActiveMQIllegalStateException noTCForSessionFactory();
@Message(id = 119025, value = "Error saving the message body", format = Message.Format.MESSAGE_FORMAT)
HornetQLargeMessageException errorSavingBody(@Cause Exception e);
ActiveMQLargeMessageException errorSavingBody(@Cause Exception e);
@Message(id = 119026, value = "Error reading the LargeMessageBody", format = Message.Format.MESSAGE_FORMAT)
HornetQLargeMessageException errorReadingBody(@Cause Exception e);
ActiveMQLargeMessageException errorReadingBody(@Cause Exception e);
@Message(id = 119027, value = "Error closing stream from LargeMessageBody", format = Message.Format.MESSAGE_FORMAT)
HornetQLargeMessageException errorClosingLargeMessage(@Cause Exception e);
ActiveMQLargeMessageException errorClosingLargeMessage(@Cause Exception e);
@Message(id = 119028, value = "Timeout waiting for LargeMessage Body", format = Message.Format.MESSAGE_FORMAT)
HornetQLargeMessageException timeoutOnLargeMessage();
ActiveMQLargeMessageException timeoutOnLargeMessage();
@Message(id = 119029, value = "Error writing body of message", format = Message.Format.MESSAGE_FORMAT)
HornetQLargeMessageException errorWritingLargeMessage(@Cause Exception e);
ActiveMQLargeMessageException errorWritingLargeMessage(@Cause Exception e);
@Message(id = 119030, value = "The transaction was rolled back on failover to a backup server", format = Message.Format.MESSAGE_FORMAT)
HornetQTransactionRolledBackException txRolledBack();
ActiveMQTransactionRolledBackException txRolledBack();
@Message(id = 119031, value = "The transaction was rolled back on failover however commit may have been successful" +
"", format = Message.Format.MESSAGE_FORMAT)
HornetQTransactionOutcomeUnknownException txOutcomeUnknown();
ActiveMQTransactionOutcomeUnknownException txOutcomeUnknown();
@Message(id = 119032, value = "Invalid type: {0}", format = Message.Format.MESSAGE_FORMAT)
IllegalArgumentException invalidType(Object type);
@ -231,15 +231,15 @@ public interface HornetQClientMessageBundle
IllegalArgumentException errordecodingPassword(@Cause Exception e);
@Message(id = 119058, value = "Address \"{0}\" is full. Message encode size = {1}B", format = Message.Format.MESSAGE_FORMAT)
HornetQAddressFullException addressIsFull(String addressName, int size);
ActiveMQAddressFullException addressIsFull(String addressName, int size);
@Message(id = 119059, value = "Interceptor {0} rejected packet in a blocking call. This call will never complete."
, format = Message.Format.MESSAGE_FORMAT)
HornetQInterceptorRejectedPacketException interceptorRejectedPacket(String interceptionResult);
ActiveMQInterceptorRejectedPacketException interceptorRejectedPacket(String interceptionResult);
@Message(id = 119060, value = "Large Message Transmission interrupted on consumer shutdown."
, format = Message.Format.MESSAGE_FORMAT)
HornetQLargeMessageInterruptedException largeMessageInterrupted();
ActiveMQLargeMessageInterruptedException largeMessageInterrupted();
@Message(id = 119061, value = "error decoding AMQP frame", format = Message.Format.MESSAGE_FORMAT)
String decodeError();

View File

@ -20,9 +20,9 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.HornetQInterruptedException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQInterruptedException;
import org.apache.activemq.api.core.Message;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.api.core.client.ClientMessage;
@ -186,7 +186,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
return consumerContext;
}
private ClientMessage receive(final long timeout, final boolean forcingDelivery) throws HornetQException
private ClientMessage receive(final long timeout, final boolean forcingDelivery) throws ActiveMQException
{
checkClosed();
@ -259,7 +259,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
if (m != null || closed)
@ -391,7 +391,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
}
}
public ClientMessage receive(final long timeout) throws HornetQException
public ClientMessage receive(final long timeout) throws ActiveMQException
{
ClientMessage msg = receive(timeout, false);
@ -403,17 +403,17 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
return msg;
}
public ClientMessage receive() throws HornetQException
public ClientMessage receive() throws ActiveMQException
{
return receive(0, false);
}
public ClientMessage receiveImmediate() throws HornetQException
public ClientMessage receiveImmediate() throws ActiveMQException
{
return receive(0, true);
}
public MessageHandler getMessageHandler() throws HornetQException
public MessageHandler getMessageHandler() throws ActiveMQException
{
checkClosed();
@ -422,7 +422,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
// Must be synchronized since messages may be arriving while handler is being set and might otherwise end
// up not queueing enough executors - so messages get stranded
public synchronized ClientConsumerImpl setMessageHandler(final MessageHandler theHandler) throws HornetQException
public synchronized ClientConsumerImpl setMessageHandler(final MessageHandler theHandler) throws ActiveMQException
{
checkClosed();
@ -454,7 +454,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
return this;
}
public void close() throws HornetQException
public void close() throws ActiveMQException
{
doCleanUp(true);
}
@ -462,10 +462,10 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
/**
* To be used by MDBs to stop any more handling of messages.
*
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
* @param future the future to run once the onMessage Thread has completed
*/
public Thread prepareForClose(final FutureLatch future) throws HornetQException
public Thread prepareForClose(final FutureLatch future) throws ActiveMQException
{
closing = true;
@ -490,7 +490,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
{
doCleanUp(false);
}
catch (HornetQException e)
catch (ActiveMQException e)
{
HornetQClientLogger.LOGGER.warn("problem cleaning up: " + this);
}
@ -501,7 +501,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
return closed;
}
public void stop(final boolean waitForOnMessage) throws HornetQException
public void stop(final boolean waitForOnMessage) throws ActiveMQException
{
waitForOnMessageToComplete(waitForOnMessage);
@ -661,7 +661,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
currentLargeMessageController.setLocal(true);
//sets the packet
HornetQBuffer qbuff = clMessage.getBodyBuffer();
ActiveMQBuffer qbuff = clMessage.getBodyBuffer();
int bytesToRead = qbuff.writerIndex() - qbuff.readerIndex();
final byte[] body = qbuff.readBytes(bytesToRead).toByteBuffer().array();
@ -727,7 +727,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
}
}
public void clear(boolean waitForOnMessage) throws HornetQException
public void clear(boolean waitForOnMessage) throws ActiveMQException
{
synchronized (this)
{
@ -794,7 +794,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
return buffer.size();
}
public void acknowledge(final ClientMessage message) throws HornetQException
public void acknowledge(final ClientMessage message) throws ActiveMQException
{
ClientMessageInternal cmi = (ClientMessageInternal) message;
@ -817,7 +817,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
}
}
public void individualAcknowledge(ClientMessage message) throws HornetQException
public void individualAcknowledge(ClientMessage message) throws ActiveMQException
{
if (lastAckedMessage != null)
{
@ -827,7 +827,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
session.individualAcknowledge(this, message);
}
public void flushAcks() throws HornetQException
public void flushAcks() throws ActiveMQException
{
if (lastAckedMessage != null)
{
@ -841,7 +841,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
*
* @param discountSlowConsumer When dealing with slowConsumers, we need to discount one credit that was pre-sent when the first receive was called. For largeMessage that is only done at the latest packet
*/
public void flowControl(final int messageBytes, final boolean discountSlowConsumer) throws HornetQException
public void flowControl(final int messageBytes, final boolean discountSlowConsumer) throws ActiveMQException
{
if (clientWindowSize >= 0)
{
@ -945,7 +945,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
}
}
@ -1015,7 +1015,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
}
}
private void checkClosed() throws HornetQException
private void checkClosed() throws ActiveMQException
{
if (closed)
{
@ -1139,9 +1139,9 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
/**
* @param message
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
private void flowControlBeforeConsumption(final ClientMessageInternal message) throws HornetQException
private void flowControlBeforeConsumption(final ClientMessageInternal message) throws ActiveMQException
{
// Chunk messages will execute the flow control while receiving the chunks
if (message.getFlowControlSize() != 0)
@ -1151,7 +1151,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
}
}
private void doCleanUp(final boolean sendCloseMessage) throws HornetQException
private void doCleanUp(final boolean sendCloseMessage) throws ActiveMQException
{
try
{
@ -1207,7 +1207,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
buffer.clear();
}
private void doAck(final ClientMessageInternal message) throws HornetQException
private void doAck(final ClientMessageInternal message) throws ActiveMQException
{
ackBytes = 0;

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.client.impl;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.api.core.client.ClientConsumer;
import org.apache.activemq.api.core.client.ClientMessage;
@ -38,17 +38,17 @@ public interface ClientConsumerInternal extends ClientConsumer
void handleLargeMessageContinuation(byte[] chunk, int flowControlSize, boolean isContinues) throws Exception;
void flowControl(final int messageBytes, final boolean discountSlowConsumer) throws HornetQException;
void flowControl(final int messageBytes, final boolean discountSlowConsumer) throws ActiveMQException;
void clear(boolean waitForOnMessage) throws HornetQException;
void clear(boolean waitForOnMessage) throws ActiveMQException;
/**
* To be called by things like MDBs during shutdown of the server
*
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
* @param future
*/
Thread prepareForClose(FutureLatch future) throws HornetQException;
Thread prepareForClose(FutureLatch future) throws ActiveMQException;
void clearAtFailover();
@ -56,15 +56,15 @@ public interface ClientConsumerInternal extends ClientConsumer
int getBufferSize();
void cleanUp() throws HornetQException;
void cleanUp() throws ActiveMQException;
void acknowledge(ClientMessage message) throws HornetQException;
void acknowledge(ClientMessage message) throws ActiveMQException;
void individualAcknowledge(ClientMessage message) throws HornetQException;
void individualAcknowledge(ClientMessage message) throws ActiveMQException;
void flushAcks() throws HornetQException;
void flushAcks() throws ActiveMQException;
void stop(boolean waitForOnMessage) throws HornetQException;
void stop(boolean waitForOnMessage) throws ActiveMQException;
void start();

View File

@ -15,8 +15,8 @@ package org.apache.activemq.core.client.impl;
import java.io.IOException;
import java.io.OutputStream;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.Message;
import org.apache.activemq.core.buffers.impl.ResetLimitWrappedHornetQBuffer;
import org.apache.activemq.utils.DataConstants;
@ -84,20 +84,20 @@ public final class ClientLargeMessageImpl extends ClientMessageImpl implements C
largeMessageController = controller;
}
public void checkCompletion() throws HornetQException
public void checkCompletion() throws ActiveMQException
{
checkBuffer();
}
@Override
public HornetQBuffer getBodyBuffer()
public ActiveMQBuffer getBodyBuffer()
{
try
{
checkBuffer();
}
catch (HornetQException e)
catch (ActiveMQException e)
{
throw new RuntimeException(e.getMessage(), e);
}
@ -117,7 +117,7 @@ public final class ClientLargeMessageImpl extends ClientMessageImpl implements C
}
@Override
public void saveToOutputStream(final OutputStream out) throws HornetQException
public void saveToOutputStream(final OutputStream out) throws ActiveMQException
{
if (bodyBuffer != null)
{
@ -131,7 +131,7 @@ public final class ClientLargeMessageImpl extends ClientMessageImpl implements C
}
@Override
public ClientLargeMessageImpl setOutputStream(final OutputStream out) throws HornetQException
public ClientLargeMessageImpl setOutputStream(final OutputStream out) throws ActiveMQException
{
if (bodyBuffer != null)
{
@ -146,7 +146,7 @@ public final class ClientLargeMessageImpl extends ClientMessageImpl implements C
}
@Override
public boolean waitOutputStreamCompletion(final long timeMilliseconds) throws HornetQException
public boolean waitOutputStreamCompletion(final long timeMilliseconds) throws ActiveMQException
{
if (bodyBuffer != null)
{
@ -171,7 +171,7 @@ public final class ClientLargeMessageImpl extends ClientMessageImpl implements C
}
}
private void checkBuffer() throws HornetQException
private void checkBuffer() throws ActiveMQException
{
if (bodyBuffer == null)
{
@ -193,9 +193,9 @@ public final class ClientLargeMessageImpl extends ClientMessageImpl implements C
private static class HornetQOutputStream extends OutputStream
{
private final HornetQBuffer bufferOut;
private final ActiveMQBuffer bufferOut;
HornetQOutputStream(HornetQBuffer out)
HornetQOutputStream(ActiveMQBuffer out)
{
this.bufferOut = out;
}

View File

@ -17,10 +17,10 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQBuffers;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.HornetQPropertyConversionException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffers;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQPropertyConversionException;
import org.apache.activemq.api.core.Message;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.core.client.HornetQClientMessageBundle;
@ -97,7 +97,7 @@ public class ClientMessageImpl extends MessageImpl implements ClientMessageInter
}
@Override
public ClientMessageImpl acknowledge() throws HornetQException
public ClientMessageImpl acknowledge() throws ActiveMQException
{
if (consumer != null)
{
@ -108,7 +108,7 @@ public class ClientMessageImpl extends MessageImpl implements ClientMessageInter
}
@Override
public ClientMessageImpl individualAcknowledge() throws HornetQException
public ClientMessageImpl individualAcknowledge() throws ActiveMQException
{
if (consumer != null)
{
@ -162,7 +162,7 @@ public class ClientMessageImpl extends MessageImpl implements ClientMessageInter
}
@Override
public void saveToOutputStream(final OutputStream out) throws HornetQException
public void saveToOutputStream(final OutputStream out) throws ActiveMQException
{
try
{
@ -178,14 +178,14 @@ public class ClientMessageImpl extends MessageImpl implements ClientMessageInter
}
@Override
public ClientMessageImpl setOutputStream(final OutputStream out) throws HornetQException
public ClientMessageImpl setOutputStream(final OutputStream out) throws ActiveMQException
{
saveToOutputStream(out);
return this;
}
@Override
public boolean waitOutputStreamCompletion(final long timeMilliseconds) throws HornetQException
public boolean waitOutputStreamCompletion(final long timeMilliseconds) throws ActiveMQException
{
return true;
}
@ -215,7 +215,7 @@ public class ClientMessageImpl extends MessageImpl implements ClientMessageInter
}
@Override
public BodyEncoder getBodyEncoder() throws HornetQException
public BodyEncoder getBodyEncoder() throws ActiveMQException
{
return new DecodingContext();
}
@ -287,13 +287,13 @@ public class ClientMessageImpl extends MessageImpl implements ClientMessageInter
}
@Override
public ClientMessageImpl putObjectProperty(final SimpleString key, final Object value) throws HornetQPropertyConversionException
public ClientMessageImpl putObjectProperty(final SimpleString key, final Object value) throws ActiveMQPropertyConversionException
{
return (ClientMessageImpl) super.putObjectProperty(key, value);
}
@Override
public ClientMessageImpl putObjectProperty(final String key, final Object value) throws HornetQPropertyConversionException
public ClientMessageImpl putObjectProperty(final String key, final Object value) throws ActiveMQPropertyConversionException
{
return (ClientMessageImpl) super.putObjectProperty(key, value);
}
@ -395,14 +395,14 @@ public class ClientMessageImpl extends MessageImpl implements ClientMessageInter
}
@Override
public int encode(final ByteBuffer bufferRead) throws HornetQException
public int encode(final ByteBuffer bufferRead) throws ActiveMQException
{
HornetQBuffer buffer1 = HornetQBuffers.wrappedBuffer(bufferRead);
ActiveMQBuffer buffer1 = ActiveMQBuffers.wrappedBuffer(bufferRead);
return encode(buffer1, bufferRead.capacity());
}
@Override
public int encode(final HornetQBuffer bufferOut, final int size)
public int encode(final ActiveMQBuffer bufferOut, final int size)
{
byte[] bytes = new byte[size];
getWholeBuffer().readBytes(bytes);

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.client.impl;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.spi.core.remoting.SessionContext;
/**
@ -24,7 +24,7 @@ import org.apache.activemq.spi.core.remoting.SessionContext;
*/
public interface ClientProducerCredits
{
void acquireCredits(int credits) throws InterruptedException, HornetQException;
void acquireCredits(int credits) throws InterruptedException, ActiveMQException;
void receiveCredits(int credits);

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.client.impl;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.core.client.HornetQClientLogger;
import org.apache.activemq.core.client.HornetQClientMessageBundle;
@ -76,7 +76,7 @@ public class ClientProducerCreditsImpl implements ClientProducerCredits
this.sessionContext.linkFlowControl(address, this);
}
public void acquireCredits(final int credits) throws InterruptedException, HornetQException
public void acquireCredits(final int credits) throws InterruptedException, ActiveMQException
{
checkCredits(credits);

View File

@ -16,10 +16,10 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQBuffers;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.HornetQInterruptedException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffers;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQInterruptedException;
import org.apache.activemq.api.core.Message;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.api.core.client.SendAcknowledgementHandler;
@ -118,27 +118,27 @@ public class ClientProducerImpl implements ClientProducerInternal
return address;
}
public void send(final Message msg) throws HornetQException
public void send(final Message msg) throws ActiveMQException
{
checkClosed();
doSend(null, msg, null, false);
}
public void send(final SimpleString address1, final Message msg) throws HornetQException
public void send(final SimpleString address1, final Message msg) throws ActiveMQException
{
checkClosed();
doSend(address1, msg, null, false);
}
public void send(final String address1, final Message message) throws HornetQException
public void send(final String address1, final Message message) throws ActiveMQException
{
send(SimpleString.toSimpleString(address1), message);
}
@Override
public void send(SimpleString address1, Message message, SendAcknowledgementHandler handler) throws HornetQException
public void send(SimpleString address1, Message message, SendAcknowledgementHandler handler) throws ActiveMQException
{
checkClosed();
boolean confirmationWindowEnabled = session.isConfirmationWindowEnabled();
@ -157,12 +157,12 @@ public class ClientProducerImpl implements ClientProducerInternal
}
@Override
public void send(Message message, SendAcknowledgementHandler handler) throws HornetQException
public void send(Message message, SendAcknowledgementHandler handler) throws ActiveMQException
{
send(null, message, handler);
}
public synchronized void close() throws HornetQException
public synchronized void close() throws ActiveMQException
{
if (closed)
{
@ -222,7 +222,7 @@ public class ClientProducerImpl implements ClientProducerInternal
}
private void doSend(final SimpleString address1, final Message msg, final SendAcknowledgementHandler handler,
final boolean forceAsync) throws HornetQException
final boolean forceAsync) throws ActiveMQException
{
session.startCall();
@ -307,7 +307,7 @@ public class ClientProducerImpl implements ClientProducerInternal
}
}
private void sendRegularMessage(final MessageInternal msgI, final boolean sendBlocking, final ClientProducerCredits theCredits, final SendAcknowledgementHandler handler) throws HornetQException
private void sendRegularMessage(final MessageInternal msgI, final boolean sendBlocking, final ClientProducerCredits theCredits, final SendAcknowledgementHandler handler) throws ActiveMQException
{
try
{
@ -323,13 +323,13 @@ public class ClientProducerImpl implements ClientProducerInternal
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
sessionContext.sendFullMessage(msgI, sendBlocking, handler, address);
}
private void checkClosed() throws HornetQException
private void checkClosed() throws ActiveMQException
{
if (closed)
{
@ -342,10 +342,10 @@ public class ClientProducerImpl implements ClientProducerInternal
/**
* @param msgI
* @param handler
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
private void largeMessageSend(final boolean sendBlocking, final MessageInternal msgI,
final ClientProducerCredits credits, SendAcknowledgementHandler handler) throws HornetQException
final ClientProducerCredits credits, SendAcknowledgementHandler handler) throws ActiveMQException
{
int headerSize = msgI.getHeadersAndPropertiesEncodeSize();
@ -376,7 +376,7 @@ public class ClientProducerImpl implements ClientProducerInternal
}
}
private void sendInitialLargeMessageHeader(MessageInternal msgI, ClientProducerCredits credits) throws HornetQException
private void sendInitialLargeMessageHeader(MessageInternal msgI, ClientProducerCredits credits) throws ActiveMQException
{
int creditsUsed = sessionContext.sendInitialChunkOnLargeMessage(msgI);
@ -389,7 +389,7 @@ public class ClientProducerImpl implements ClientProducerInternal
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
}
@ -400,10 +400,10 @@ public class ClientProducerImpl implements ClientProducerInternal
* @param sendBlocking
* @param msgI
* @param handler
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
private void largeMessageSendServer(final boolean sendBlocking, final MessageInternal msgI,
final ClientProducerCredits credits, SendAcknowledgementHandler handler) throws HornetQException
final ClientProducerCredits credits, SendAcknowledgementHandler handler) throws ActiveMQException
{
sendInitialLargeMessageHeader(msgI, credits);
@ -421,7 +421,7 @@ public class ClientProducerImpl implements ClientProducerInternal
final int chunkLength = Math.min((int) (bodySize - pos), minLargeMessageSize);
final HornetQBuffer bodyBuffer = HornetQBuffers.fixedBuffer(chunkLength);
final ActiveMQBuffer bodyBuffer = ActiveMQBuffers.fixedBuffer(chunkLength);
context.encode(bodyBuffer, chunkLength);
@ -438,7 +438,7 @@ public class ClientProducerImpl implements ClientProducerInternal
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
}
}
@ -452,11 +452,11 @@ public class ClientProducerImpl implements ClientProducerInternal
* @param sendBlocking
* @param msgI
* @param handler
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
private void
largeMessageSendBuffered(final boolean sendBlocking, final MessageInternal msgI,
final ClientProducerCredits credits, SendAcknowledgementHandler handler) throws HornetQException
final ClientProducerCredits credits, SendAcknowledgementHandler handler) throws ActiveMQException
{
msgI.getBodyBuffer().readerIndex(0);
largeMessageSendStreamed(sendBlocking, msgI, new HornetQBufferInputStream(msgI.getBodyBuffer()), credits,
@ -468,11 +468,11 @@ public class ClientProducerImpl implements ClientProducerInternal
* @param msgI
* @param inputStreamParameter
* @param credits
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
private void largeMessageSendStreamed(final boolean sendBlocking, final MessageInternal msgI,
final InputStream inputStreamParameter, final ClientProducerCredits credits,
SendAcknowledgementHandler handler) throws HornetQException
SendAcknowledgementHandler handler) throws ActiveMQException
{
boolean lastPacket = false;
@ -570,7 +570,7 @@ public class ClientProducerImpl implements ClientProducerInternal
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
}
}
@ -590,7 +590,7 @@ public class ClientProducerImpl implements ClientProducerInternal
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
}
}

View File

@ -28,10 +28,10 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.HornetQInterruptedException;
import org.apache.activemq.api.core.HornetQNotConnectedException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQInterruptedException;
import org.apache.activemq.api.core.ActiveMQNotConnectedException;
import org.apache.activemq.api.core.Interceptor;
import org.apache.activemq.api.core.Pair;
import org.apache.activemq.api.core.TransportConfiguration;
@ -237,7 +237,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
return newFailoverLock;
}
public void connect(final int initialConnectAttempts, final boolean failoverOnInitialConnection) throws HornetQException
public void connect(final int initialConnectAttempts, final boolean failoverOnInitialConnection) throws ActiveMQException
{
// Get the connection
getConnectionWithRetry(initialConnectAttempts);
@ -250,7 +250,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
{
msg.append(" and backup configuration ").append(backupConfig);
}
throw new HornetQNotConnectedException(msg.toString());
throw new ActiveMQNotConnectedException(msg.toString());
}
}
@ -310,7 +310,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
final boolean autoCommitSends,
final boolean autoCommitAcks,
final boolean preAcknowledge,
final int ackBatchSize) throws HornetQException
final int ackBatchSize) throws ActiveMQException
{
return createSessionInternal(username,
password,
@ -323,7 +323,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
public ClientSession createSession(final boolean autoCommitSends,
final boolean autoCommitAcks,
final int ackBatchSize) throws HornetQException
final int ackBatchSize) throws ActiveMQException
{
return createSessionInternal(null,
null,
@ -334,7 +334,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
ackBatchSize);
}
public ClientSession createXASession() throws HornetQException
public ClientSession createXASession() throws ActiveMQException
{
return createSessionInternal(null,
null,
@ -345,7 +345,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
serverLocator.getAckBatchSize());
}
public ClientSession createTransactedSession() throws HornetQException
public ClientSession createTransactedSession() throws ActiveMQException
{
return createSessionInternal(null,
null,
@ -356,7 +356,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
serverLocator.getAckBatchSize());
}
public ClientSession createSession() throws HornetQException
public ClientSession createSession() throws ActiveMQException
{
return createSessionInternal(null,
null,
@ -367,7 +367,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
serverLocator.getAckBatchSize());
}
public ClientSession createSession(final boolean autoCommitSends, final boolean autoCommitAcks) throws HornetQException
public ClientSession createSession(final boolean autoCommitSends, final boolean autoCommitAcks) throws ActiveMQException
{
return createSessionInternal(null,
null,
@ -378,7 +378,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
serverLocator.getAckBatchSize());
}
public ClientSession createSession(final boolean xa, final boolean autoCommitSends, final boolean autoCommitAcks) throws HornetQException
public ClientSession createSession(final boolean xa, final boolean autoCommitSends, final boolean autoCommitAcks) throws ActiveMQException
{
return createSessionInternal(null,
null,
@ -392,7 +392,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
public ClientSession createSession(final boolean xa,
final boolean autoCommitSends,
final boolean autoCommitAcks,
final boolean preAcknowledge) throws HornetQException
final boolean preAcknowledge) throws ActiveMQException
{
return createSessionInternal(null,
null,
@ -413,7 +413,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
{
// The exception has to be created in the same thread where it's being called
// as to avoid a different stack trace cause
final HornetQException ex = HornetQClientMessageBundle.BUNDLE.channelDisconnected();
final ActiveMQException ex = HornetQClientMessageBundle.BUNDLE.channelDisconnected();
// It has to use the same executor as the disconnect message is being sent through
@ -427,7 +427,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
}
public void connectionException(final Object connectionID, final HornetQException me)
public void connectionException(final Object connectionID, final ActiveMQException me)
{
handleConnectionFailure(connectionID, me);
}
@ -559,18 +559,18 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
stopPingingAfterOne = true;
}
private void handleConnectionFailure(final Object connectionID, final HornetQException me)
private void handleConnectionFailure(final Object connectionID, final ActiveMQException me)
{
handleConnectionFailure(connectionID, me, null);
}
private void handleConnectionFailure(final Object connectionID, final HornetQException me, String scaleDownTargetNodeID)
private void handleConnectionFailure(final Object connectionID, final ActiveMQException me, String scaleDownTargetNodeID)
{
try
{
failoverOrReconnect(connectionID, me, scaleDownTargetNodeID);
}
catch (HornetQInterruptedException e1)
catch (ActiveMQInterruptedException e1)
{
// this is just a debug, since an interrupt is an expected event (in case of a shutdown)
HornetQClientLogger.LOGGER.debug(e1.getMessage(), e1);
@ -582,7 +582,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
* @param connectionID
* @param me
*/
private void failoverOrReconnect(final Object connectionID, final HornetQException me, String scaleDownTargetNodeID)
private void failoverOrReconnect(final Object connectionID, final ActiveMQException me, String scaleDownTargetNodeID)
{
Set<ClientSessionInternal> sessionsToClose = null;
if (!clientProtocolManager.isAlive())
@ -630,7 +630,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
// locked.
// While this is still locked it must then get the channel1 lock
// It can then release the failoverLock
// It should catch HornetQException.INTERRUPTED in the call to channel.sendBlocking
// It should catch ActiveMQException.INTERRUPTED in the call to channel.sendBlocking
// It should then return its connections, with channel 1 lock still held
// It can then release the channel 1 lock, and retry (which will cause locking on
// failoverLock
@ -740,7 +740,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
final boolean autoCommitSends,
final boolean autoCommitAcks,
final boolean preAcknowledge,
final int ackBatchSize) throws HornetQException
final int ackBatchSize) throws ActiveMQException
{
String name = UUIDGenerator.getInstance().generateStringUUID();
@ -795,13 +795,13 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
}
private void callSessionFailureListeners(final HornetQException me, final boolean afterReconnect,
private void callSessionFailureListeners(final ActiveMQException me, final boolean afterReconnect,
final boolean failedOver)
{
callSessionFailureListeners(me, afterReconnect, failedOver, null);
}
private void callSessionFailureListeners(final HornetQException me, final boolean afterReconnect,
private void callSessionFailureListeners(final ActiveMQException me, final boolean afterReconnect,
final boolean failedOver, final String scaleDownTargetNodeID)
{
final List<SessionFailureListener> listenersClone = new ArrayList<SessionFailureListener>(listeners);
@ -852,7 +852,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
/*
* Re-attach sessions all pre-existing sessions to the new remoting connection
*/
private void reconnectSessions(final RemotingConnection oldConnection, final int reconnectAttempts, final HornetQException cause)
private void reconnectSessions(final RemotingConnection oldConnection, final int reconnectAttempts, final ActiveMQException cause)
{
HashSet<ClientSessionInternal> sessionsToFailover;
synchronized (sessions)
@ -967,7 +967,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
}
catch (InterruptedException ignore)
{
throw new HornetQInterruptedException(createTrace);
throw new ActiveMQInterruptedException(createTrace);
}
// Exponential back-off
@ -1065,7 +1065,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
connection = null;
}
}
catch (HornetQException e)
catch (ActiveMQException e)
{
if (connection != null)
{
@ -1382,7 +1382,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
private class DelegatingBufferHandler implements BufferHandler
{
public void bufferReceived(final Object connectionID, final HornetQBuffer buffer)
public void bufferReceived(final Object connectionID, final ActiveMQBuffer buffer)
{
RemotingConnection theConn = connection;
@ -1407,13 +1407,13 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
}
@Override
public void connectionFailed(final HornetQException me, final boolean failedOver)
public void connectionFailed(final ActiveMQException me, final boolean failedOver)
{
connectionFailed(me, failedOver, null);
}
@Override
public void connectionFailed(final HornetQException me, final boolean failedOver, String scaleDownTargetNodeID)
public void connectionFailed(final ActiveMQException me, final boolean failedOver, String scaleDownTargetNodeID)
{
handleConnectionFailure(connectionID, me, scaleDownTargetNodeID);
}
@ -1473,7 +1473,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
// We use a different thread to send the fail
// but the exception has to be created here to preserve the stack trace
final HornetQException me = HornetQClientMessageBundle.BUNDLE.connectionTimedOut(connection.getTransportConnection());
final ActiveMQException me = HornetQClientMessageBundle.BUNDLE.connectionTimedOut(connection.getTransportConnection());
cancelled = true;
@ -1550,7 +1550,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
final boolean xa,
final boolean autoCommitSends,
final boolean autoCommitAcks,
final boolean preAcknowledge) throws HornetQException
final boolean preAcknowledge) throws ActiveMQException
{
synchronized (createSessionLock)
{

View File

@ -14,7 +14,7 @@ package org.apache.activemq.core.client.impl;
import java.util.concurrent.locks.Lock;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.TransportConfiguration;
import org.apache.activemq.api.core.client.ClientSessionFactory;
import org.apache.activemq.api.core.client.SessionFailureListener;
@ -47,7 +47,7 @@ public interface ClientSessionFactoryInternal extends ClientSessionFactory
void removeSession(final ClientSessionInternal session, boolean failingOver);
void connect(int reconnectAttempts, boolean failoverOnInitialConnection) throws HornetQException;
void connect(int reconnectAttempts, boolean failoverOnInitialConnection) throws ActiveMQException;
void setBackupConnector(TransportConfiguration live, TransportConfiguration backUp);

View File

@ -23,10 +23,10 @@ import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQBuffers;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.HornetQExceptionType;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffers;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQExceptionType;
import org.apache.activemq.api.core.Message;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.api.core.client.ClientConsumer;
@ -171,7 +171,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
final String groupID,
final SessionContext sessionContext,
final Executor executor,
final Executor flowControlExecutor) throws HornetQException
final Executor flowControlExecutor) throws ActiveMQException
{
this.sessionFactory = sessionFactory;
@ -233,24 +233,24 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
// ClientSession implementation
// -----------------------------------------------------------------
public void createQueue(final SimpleString address, final SimpleString queueName) throws HornetQException
public void createQueue(final SimpleString address, final SimpleString queueName) throws ActiveMQException
{
internalCreateQueue(address, queueName, null, false, false);
}
public void createQueue(final SimpleString address, final SimpleString queueName, final boolean durable) throws HornetQException
public void createQueue(final SimpleString address, final SimpleString queueName, final boolean durable) throws ActiveMQException
{
internalCreateQueue(address, queueName, null, durable, false);
}
public void createQueue(final String address, final String queueName, final boolean durable) throws HornetQException
public void createQueue(final String address, final String queueName, final boolean durable) throws ActiveMQException
{
createQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), durable);
}
public void createSharedQueue(SimpleString address,
SimpleString queueName,
boolean durable) throws HornetQException
boolean durable) throws ActiveMQException
{
createSharedQueue(address, queueName, null, durable);
}
@ -258,7 +258,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
public void createSharedQueue(SimpleString address,
SimpleString queueName,
SimpleString filterString,
boolean durable) throws HornetQException
boolean durable) throws ActiveMQException
{
checkClosed();
@ -280,7 +280,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
public void createQueue(final SimpleString address,
final SimpleString queueName,
final SimpleString filterString,
final boolean durable) throws HornetQException
final boolean durable) throws ActiveMQException
{
internalCreateQueue(address, queueName, filterString, durable, false);
}
@ -288,17 +288,17 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
public void createQueue(final String address,
final String queueName,
final String filterString,
final boolean durable) throws HornetQException
final boolean durable) throws ActiveMQException
{
createQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filterString), durable);
}
public void createTemporaryQueue(final SimpleString address, final SimpleString queueName) throws HornetQException
public void createTemporaryQueue(final SimpleString address, final SimpleString queueName) throws ActiveMQException
{
internalCreateQueue(address, queueName, null, false, true);
}
public void createTemporaryQueue(final String address, final String queueName) throws HornetQException
public void createTemporaryQueue(final String address, final String queueName) throws ActiveMQException
{
internalCreateQueue(SimpleString.toSimpleString(address),
SimpleString.toSimpleString(queueName),
@ -307,12 +307,12 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
true);
}
public void createTemporaryQueue(final SimpleString address, final SimpleString queueName, final SimpleString filter) throws HornetQException
public void createTemporaryQueue(final SimpleString address, final SimpleString queueName, final SimpleString filter) throws ActiveMQException
{
internalCreateQueue(address, queueName, filter, false, true);
}
public void createTemporaryQueue(final String address, final String queueName, final String filter) throws HornetQException
public void createTemporaryQueue(final String address, final String queueName, final String filter) throws ActiveMQException
{
internalCreateQueue(SimpleString.toSimpleString(address),
SimpleString.toSimpleString(queueName),
@ -321,7 +321,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
true);
}
public void deleteQueue(final SimpleString queueName) throws HornetQException
public void deleteQueue(final SimpleString queueName) throws ActiveMQException
{
checkClosed();
@ -336,12 +336,12 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
}
}
public void deleteQueue(final String queueName) throws HornetQException
public void deleteQueue(final String queueName) throws ActiveMQException
{
deleteQueue(SimpleString.toSimpleString(queueName));
}
public QueueQuery queueQuery(final SimpleString queueName) throws HornetQException
public QueueQuery queueQuery(final SimpleString queueName) throws ActiveMQException
{
checkClosed();
@ -363,15 +363,15 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
*
* @param address
* @return
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
@Deprecated
public BindingQuery bindingQuery(final SimpleString address) throws HornetQException
public BindingQuery bindingQuery(final SimpleString address) throws ActiveMQException
{
return (BindingQuery) addressQuery(address);
}
public AddressQuery addressQuery(final SimpleString address) throws HornetQException
public AddressQuery addressQuery(final SimpleString address) throws ActiveMQException
{
checkClosed();
@ -379,51 +379,51 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
return sessionContext.addressQuery(address);
}
public ClientConsumer createConsumer(final SimpleString queueName) throws HornetQException
public ClientConsumer createConsumer(final SimpleString queueName) throws ActiveMQException
{
return createConsumer(queueName, null, false);
}
public ClientConsumer createConsumer(final String queueName) throws HornetQException
public ClientConsumer createConsumer(final String queueName) throws ActiveMQException
{
return createConsumer(SimpleString.toSimpleString(queueName));
}
public ClientConsumer createConsumer(final SimpleString queueName, final SimpleString filterString) throws HornetQException
public ClientConsumer createConsumer(final SimpleString queueName, final SimpleString filterString) throws ActiveMQException
{
return createConsumer(queueName, filterString, consumerWindowSize, consumerMaxRate, false);
}
public void createQueue(final String address, final String queueName) throws HornetQException
public void createQueue(final String address, final String queueName) throws ActiveMQException
{
createQueue(SimpleString.toSimpleString(address), SimpleString.toSimpleString(queueName));
}
public ClientConsumer createConsumer(final String queueName, final String filterString) throws HornetQException
public ClientConsumer createConsumer(final String queueName, final String filterString) throws ActiveMQException
{
return createConsumer(SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filterString));
}
public ClientConsumer createConsumer(final SimpleString queueName,
final SimpleString filterString,
final boolean browseOnly) throws HornetQException
final boolean browseOnly) throws ActiveMQException
{
return createConsumer(queueName, filterString, consumerWindowSize, consumerMaxRate, browseOnly);
}
public ClientConsumer createConsumer(final SimpleString queueName, final boolean browseOnly) throws HornetQException
public ClientConsumer createConsumer(final SimpleString queueName, final boolean browseOnly) throws ActiveMQException
{
return createConsumer(queueName, null, consumerWindowSize, consumerMaxRate, browseOnly);
}
public ClientConsumer createConsumer(final String queueName, final String filterString, final boolean browseOnly) throws HornetQException
public ClientConsumer createConsumer(final String queueName, final String filterString, final boolean browseOnly) throws ActiveMQException
{
return createConsumer(SimpleString.toSimpleString(queueName),
SimpleString.toSimpleString(filterString),
browseOnly);
}
public ClientConsumer createConsumer(final String queueName, final boolean browseOnly) throws HornetQException
public ClientConsumer createConsumer(final String queueName, final boolean browseOnly) throws ActiveMQException
{
return createConsumer(SimpleString.toSimpleString(queueName), null, browseOnly);
}
@ -442,7 +442,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
final SimpleString filterString,
final int windowSize,
final int maxRate,
final boolean browseOnly) throws HornetQException
final boolean browseOnly) throws ActiveMQException
{
return internalCreateConsumer(queueName, filterString, windowSize, maxRate, browseOnly);
}
@ -451,32 +451,32 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
final String filterString,
final int windowSize,
final int maxRate,
final boolean browseOnly) throws HornetQException
final boolean browseOnly) throws ActiveMQException
{
return createConsumer(SimpleString.toSimpleString(queueName), SimpleString.toSimpleString(filterString), windowSize, maxRate, browseOnly);
}
public ClientProducer createProducer() throws HornetQException
public ClientProducer createProducer() throws ActiveMQException
{
return createProducer((SimpleString) null);
}
public ClientProducer createProducer(final SimpleString address) throws HornetQException
public ClientProducer createProducer(final SimpleString address) throws ActiveMQException
{
return createProducer(address, producerMaxRate);
}
public ClientProducer createProducer(final String address) throws HornetQException
public ClientProducer createProducer(final String address) throws ActiveMQException
{
return createProducer(SimpleString.toSimpleString(address));
}
public ClientProducer createProducer(final SimpleString address, final int maxRate) throws HornetQException
public ClientProducer createProducer(final SimpleString address, final int maxRate) throws ActiveMQException
{
return internalCreateProducer(address, maxRate);
}
public ClientProducer createProducer(final String address, final int rate) throws HornetQException
public ClientProducer createProducer(final String address, final int rate) throws ActiveMQException
{
return createProducer(SimpleString.toSimpleString(address), rate);
}
@ -486,7 +486,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
return this;
}
private void rollbackOnFailover(boolean outcomeKnown) throws HornetQException
private void rollbackOnFailover(boolean outcomeKnown) throws ActiveMQException
{
rollback(false);
@ -498,7 +498,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
throw HornetQClientMessageBundle.BUNDLE.txOutcomeUnknown();
}
public void commit() throws HornetQException
public void commit() throws ActiveMQException
{
checkClosed();
@ -528,9 +528,9 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
{
sessionContext.simpleCommit();
}
catch (HornetQException e)
catch (ActiveMQException e)
{
if (e.getType() == HornetQExceptionType.UNBLOCKED || rollbackOnly)
if (e.getType() == ActiveMQExceptionType.UNBLOCKED || rollbackOnly)
{
// The call to commit was unlocked on failover, we therefore rollback the tx,
// and throw a transaction rolled back exception instead
@ -558,12 +558,12 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
return rollbackOnly;
}
public void rollback() throws HornetQException
public void rollback() throws ActiveMQException
{
rollback(false);
}
public void rollback(final boolean isLastMessageAsDelivered) throws HornetQException
public void rollback(final boolean isLastMessageAsDelivered) throws ActiveMQException
{
if (HornetQClientLogger.LOGGER.isTraceEnabled())
{
@ -647,7 +647,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
return xa;
}
public void resetIfNeeded() throws HornetQException
public void resetIfNeeded() throws ActiveMQException
{
if (rollbackOnly)
{
@ -656,7 +656,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
}
}
public ClientSessionImpl start() throws HornetQException
public ClientSessionImpl start() throws ActiveMQException
{
checkClosed();
@ -675,12 +675,12 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
return this;
}
public void stop() throws HornetQException
public void stop() throws ActiveMQException
{
stop(true);
}
public void stop(final boolean waitForOnMessage) throws HornetQException
public void stop(final boolean waitForOnMessage) throws ActiveMQException
{
checkClosed();
@ -762,7 +762,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
/**
* Acknowledges all messages received by the consumer so far.
*/
public void acknowledge(final ClientConsumer consumer, final Message message) throws HornetQException
public void acknowledge(final ClientConsumer consumer, final Message message) throws ActiveMQException
{
// if we're pre-acknowledging then we don't need to do anything
if (preAcknowledge)
@ -787,7 +787,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
}
}
public void individualAcknowledge(final ClientConsumer consumer, final Message message) throws HornetQException
public void individualAcknowledge(final ClientConsumer consumer, final Message message) throws ActiveMQException
{
// if we're pre-acknowledging then we don't need to do anything
if (preAcknowledge)
@ -809,7 +809,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
}
}
public void expire(final ClientConsumer consumer, final Message message) throws HornetQException
public void expire(final ClientConsumer consumer, final Message message) throws ActiveMQException
{
checkClosed();
@ -836,7 +836,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
}
}
public void removeConsumer(final ClientConsumerInternal consumer) throws HornetQException
public void removeConsumer(final ClientConsumerInternal consumer) throws ActiveMQException
{
synchronized (consumers)
{
@ -883,7 +883,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
}
@Override
public void handleConsumerDisconnect(ConsumerContext context) throws HornetQException
public void handleConsumerDisconnect(ConsumerContext context) throws ActiveMQException
{
final ClientConsumerInternal consumer = getConsumer(context);
@ -898,7 +898,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
{
consumer.close();
}
catch (HornetQException e)
catch (ActiveMQException e)
{
HornetQClientLogger.LOGGER.unableToCloseConsumer(e);
}
@ -907,7 +907,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
}
}
public void close() throws HornetQException
public void close() throws ActiveMQException
{
if (closed)
{
@ -942,7 +942,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
doCleanup(false);
}
public synchronized void cleanUp(boolean failingOver) throws HornetQException
public synchronized void cleanUp(boolean failingOver) throws ActiveMQException
{
if (closed)
{
@ -972,7 +972,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
// Needs to be synchronized to prevent issues with occurring concurrently with close()
public void handleFailover(final RemotingConnection backupConnection, HornetQException cause)
public void handleFailover(final RemotingConnection backupConnection, ActiveMQException cause)
{
synchronized (this)
{
@ -1089,7 +1089,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
}
public void addMetaData(String key, String data) throws HornetQException
public void addMetaData(String key, String data) throws ActiveMQException
{
synchronized (metadata)
{
@ -1099,7 +1099,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
sessionContext.addSessionMetadata(key, data);
}
public void addUniqueMetaData(String key, String data) throws HornetQException
public void addUniqueMetaData(String key, String data) throws ActiveMQException
{
sessionContext.addUniqueMetaData(key, data);
}
@ -1425,9 +1425,9 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
{
throw xae;
}
catch (HornetQException e)
catch (ActiveMQException e)
{
if (e.getType() == HornetQExceptionType.UNBLOCKED)
if (e.getType() == ActiveMQExceptionType.UNBLOCKED)
{
// Unblocked on failover
try
@ -1545,9 +1545,9 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
{
throw xae;
}
catch (HornetQException e)
catch (ActiveMQException e)
{
if (e.getType() == HornetQExceptionType.UNBLOCKED)
if (e.getType() == ActiveMQExceptionType.UNBLOCKED)
{
// Unblocked on failover
throw new XAException(XAException.XA_RETRY);
@ -1586,10 +1586,10 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
{
throw xae;
}
catch (HornetQException e)
catch (ActiveMQException e)
{
// we can retry this only because we know for sure that no work would have been done
if (e.getType() == HornetQExceptionType.UNBLOCKED)
if (e.getType() == ActiveMQExceptionType.UNBLOCKED)
{
try
{
@ -1624,7 +1624,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
// FailureListener implementation --------------------------------------------
public void connectionFailed(final HornetQException me, boolean failedOver)
public void connectionFailed(final ActiveMQException me, boolean failedOver)
{
try
{
@ -1636,7 +1636,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
}
}
public void connectionFailed(final HornetQException me, boolean failedOver, String scaleDownTargetNodeID)
public void connectionFailed(final ActiveMQException me, boolean failedOver, String scaleDownTargetNodeID)
{
connectionFailed(me, failedOver);
}
@ -1684,13 +1684,13 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
* @param windowSize
* @param browseOnly
* @return
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
private ClientConsumer internalCreateConsumer(final SimpleString queueName,
final SimpleString filterString,
final int windowSize,
final int maxRate,
final boolean browseOnly) throws HornetQException
final boolean browseOnly) throws ActiveMQException
{
checkClosed();
@ -1712,7 +1712,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
return consumer;
}
private ClientProducer internalCreateProducer(final SimpleString address, final int maxRate) throws HornetQException
private ClientProducer internalCreateProducer(final SimpleString address, final int maxRate) throws ActiveMQException
{
checkClosed();
@ -1736,7 +1736,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
final SimpleString queueName,
final SimpleString filterString,
final boolean durable,
final boolean temp) throws HornetQException
final boolean temp) throws ActiveMQException
{
checkClosed();
@ -1765,7 +1765,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
}
}
private void checkClosed() throws HornetQException
private void checkClosed() throws ActiveMQException
{
if (closed || inClose)
{
@ -1799,7 +1799,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
sessionFactory.removeSession(this, failingOver);
}
private void cleanUpChildren() throws HornetQException
private void cleanUpChildren() throws ActiveMQException
{
Set<ClientConsumerInternal> consumersClone = cloneConsumers();
@ -1845,7 +1845,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
}
}
private void closeChildren() throws HornetQException
private void closeChildren() throws ActiveMQException
{
Set<ClientConsumerInternal> consumersClone = cloneConsumers();
@ -1862,7 +1862,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
}
}
private void flushAcks() throws HornetQException
private void flushAcks() throws ActiveMQException
{
for (ClientConsumerInternal consumer : cloneConsumers())
{
@ -1882,7 +1882,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
*/
public static Object convert(Xid xid)
{
HornetQBuffer buffer = HornetQBuffers.dynamicBuffer(200);
ActiveMQBuffer buffer = ActiveMQBuffers.dynamicBuffer(200);
XidCodecSupport.encodeXid(xid, buffer);
Object obj = XidCodecSupport.decodeXid(buffer);

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.client.impl;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.Message;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.api.core.client.ClientConsumer;
@ -30,9 +30,9 @@ public interface ClientSessionInternal extends ClientSession
{
String getName();
void acknowledge(ClientConsumer consumer, Message message) throws HornetQException;
void acknowledge(ClientConsumer consumer, Message message) throws ActiveMQException;
void individualAcknowledge(final ClientConsumer consumer, final Message message) throws HornetQException;
void individualAcknowledge(final ClientConsumer consumer, final Message message) throws ActiveMQException;
boolean isCacheLargeMessageClient();
@ -40,13 +40,13 @@ public interface ClientSessionInternal extends ClientSession
boolean isCompressLargeMessages();
void expire(ClientConsumer consumer, Message message) throws HornetQException;
void expire(ClientConsumer consumer, Message message) throws ActiveMQException;
void addConsumer(ClientConsumerInternal consumer);
void addProducer(ClientProducerInternal producer);
void removeConsumer(ClientConsumerInternal consumer) throws HornetQException;
void removeConsumer(ClientConsumerInternal consumer) throws ActiveMQException;
void removeProducer(ClientProducerInternal producer);
@ -56,15 +56,15 @@ public interface ClientSessionInternal extends ClientSession
void handleReceiveContinuation(ConsumerContext consumerID, byte[] chunk, int flowControlSize, boolean isContinues) throws Exception;
void handleConsumerDisconnect(ConsumerContext consumerContext) throws HornetQException;
void handleConsumerDisconnect(ConsumerContext consumerContext) throws ActiveMQException;
void preHandleFailover(RemotingConnection connection);
void handleFailover(RemotingConnection backupConnection, HornetQException cause);
void handleFailover(RemotingConnection backupConnection, ActiveMQException cause);
RemotingConnection getConnection();
void cleanUp(boolean failingOver) throws HornetQException;
void cleanUp(boolean failingOver) throws ActiveMQException;
void setForceNotSameRM(boolean force);
@ -86,7 +86,7 @@ public interface ClientSessionInternal extends ClientSession
void setPacketSize(int packetSize);
void resetIfNeeded() throws HornetQException;
void resetIfNeeded() throws ActiveMQException;
/**
* This is used internally to control and educate the user

View File

@ -18,9 +18,9 @@ import java.io.OutputStream;
import java.nio.ByteBuffer;
import io.netty.buffer.ByteBuf;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQBuffers;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffers;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.core.client.HornetQClientLogger;
import org.apache.activemq.utils.DataConstants;
@ -69,12 +69,12 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
bufferDelegate.cancel();
}
public void setOutputStream(final OutputStream output) throws HornetQException
public void setOutputStream(final OutputStream output) throws ActiveMQException
{
bufferDelegate.setOutputStream(new InflaterWriter(output));
}
public synchronized void saveBuffer(final OutputStream output) throws HornetQException
public synchronized void saveBuffer(final OutputStream output) throws ActiveMQException
{
setOutputStream(output);
waitCompletion(0);
@ -83,7 +83,7 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
/**
* @param timeWait Milliseconds to Wait. 0 means forever
*/
public synchronized boolean waitCompletion(final long timeWait) throws HornetQException
public synchronized boolean waitCompletion(final long timeWait) throws ActiveMQException
{
return bufferDelegate.waitCompletion(timeWait);
}
@ -140,7 +140,7 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
}
@Override
public void getBytes(final int index, final HornetQBuffer dst, final int dstIndex, final int length)
public void getBytes(final int index, final ActiveMQBuffer dst, final int dstIndex, final int length)
{
positioningNotSupported();
}
@ -185,7 +185,7 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
}
@Override
public void setBytes(final int index, final HornetQBuffer src, final int srcIndex, final int length)
public void setBytes(final int index, final ActiveMQBuffer src, final int srcIndex, final int length)
{
throw new IllegalAccessError(OPERATION_NOT_SUPPORTED);
}
@ -330,12 +330,12 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
}
}
public void getBytes(final int index, final HornetQBuffer dst)
public void getBytes(final int index, final ActiveMQBuffer dst)
{
getBytes(index, dst, dst.writableBytes());
}
public void getBytes(final int index, final HornetQBuffer dst, final int length)
public void getBytes(final int index, final ActiveMQBuffer dst, final int length)
{
if (length > dst.writableBytes())
{
@ -350,12 +350,12 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
throw new IllegalAccessError(OPERATION_NOT_SUPPORTED);
}
public void setBytes(final int index, final HornetQBuffer src)
public void setBytes(final int index, final ActiveMQBuffer src)
{
throw new IllegalAccessError(OPERATION_NOT_SUPPORTED);
}
public void setBytes(final int index, final HornetQBuffer src, final int length)
public void setBytes(final int index, final ActiveMQBuffer src, final int length)
{
throw new IllegalAccessError(OPERATION_NOT_SUPPORTED);
}
@ -446,12 +446,12 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
readBytes(dst, 0, dst.length);
}
public void readBytes(final HornetQBuffer dst)
public void readBytes(final ActiveMQBuffer dst)
{
readBytes(dst, dst.writableBytes());
}
public void readBytes(final HornetQBuffer dst, final int length)
public void readBytes(final ActiveMQBuffer dst, final int length)
{
if (length > dst.writableBytes())
{
@ -461,7 +461,7 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
dst.writerIndex(dst.writerIndex() + length);
}
public void readBytes(final HornetQBuffer dst, final int dstIndex, final int length)
public void readBytes(final ActiveMQBuffer dst, final int dstIndex, final int length)
{
byte[] destBytes = new byte[length];
readBytes(destBytes);
@ -521,7 +521,7 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
throw new IllegalAccessError(OPERATION_NOT_SUPPORTED);
}
public void writeBytes(final HornetQBuffer src, final int length)
public void writeBytes(final ActiveMQBuffer src, final int length)
{
throw new IllegalAccessError(OPERATION_NOT_SUPPORTED);
}
@ -568,11 +568,11 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
return Float.intBitsToFloat(getInt(index));
}
public HornetQBuffer readBytes(final int length)
public ActiveMQBuffer readBytes(final int length)
{
byte[] bytesToGet = new byte[length];
readBytes(bytesToGet);
return HornetQBuffers.wrappedBuffer(bytesToGet);
return ActiveMQBuffers.wrappedBuffer(bytesToGet);
}
@Override
@ -710,12 +710,12 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
throw new IllegalAccessError(OPERATION_NOT_SUPPORTED);
}
public HornetQBuffer copy()
public ActiveMQBuffer copy()
{
throw new UnsupportedOperationException();
}
public HornetQBuffer slice(final int index, final int length)
public ActiveMQBuffer slice(final int index, final int length)
{
throw new UnsupportedOperationException();
}
@ -727,17 +727,17 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
return null;
}
public HornetQBuffer copy(final int index, final int length)
public ActiveMQBuffer copy(final int index, final int length)
{
throw new IllegalAccessError(OPERATION_NOT_SUPPORTED);
}
public HornetQBuffer duplicate()
public ActiveMQBuffer duplicate()
{
throw new IllegalAccessError(OPERATION_NOT_SUPPORTED);
}
public HornetQBuffer readSlice(final int length)
public ActiveMQBuffer readSlice(final int length)
{
throw new IllegalAccessError(OPERATION_NOT_SUPPORTED);
}
@ -757,12 +757,12 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
throw new IllegalAccessError(OPERATION_NOT_SUPPORTED);
}
public HornetQBuffer slice()
public ActiveMQBuffer slice()
{
throw new IllegalAccessError(OPERATION_NOT_SUPPORTED);
}
public void writeBytes(final HornetQBuffer src, final int srcIndex, final int length)
public void writeBytes(final ActiveMQBuffer src, final int srcIndex, final int length)
{
throw new IllegalAccessError(OPERATION_NOT_SUPPORTED);
}

View File

@ -17,7 +17,7 @@ import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
import java.util.Set;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.Message;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.api.core.client.ClientConsumer;
@ -101,12 +101,12 @@ public class DelegatingSession implements ClientSessionInternal
return session.isClosing();
}
public void acknowledge(final ClientConsumer consumer, final Message message) throws HornetQException
public void acknowledge(final ClientConsumer consumer, final Message message) throws ActiveMQException
{
session.acknowledge(consumer, message);
}
public void individualAcknowledge(final ClientConsumer consumer, final Message message) throws HornetQException
public void individualAcknowledge(final ClientConsumer consumer, final Message message) throws ActiveMQException
{
session.individualAcknowledge(consumer, message);
}
@ -131,17 +131,17 @@ public class DelegatingSession implements ClientSessionInternal
session.addProducer(producer);
}
public AddressQuery addressQuery(final SimpleString address) throws HornetQException
public AddressQuery addressQuery(final SimpleString address) throws ActiveMQException
{
return session.addressQuery(address);
}
public void cleanUp(boolean failingOver) throws HornetQException
public void cleanUp(boolean failingOver) throws ActiveMQException
{
session.cleanUp(failingOver);
}
public void close() throws HornetQException
public void close() throws ActiveMQException
{
closed = true;
@ -153,7 +153,7 @@ public class DelegatingSession implements ClientSessionInternal
session.close();
}
public void commit() throws HornetQException
public void commit() throws ActiveMQException
{
session.commit();
}
@ -184,7 +184,7 @@ public class DelegatingSession implements ClientSessionInternal
public ClientConsumer createConsumer(final SimpleString queueName,
final SimpleString filterString,
final boolean browseOnly) throws HornetQException
final boolean browseOnly) throws ActiveMQException
{
return session.createConsumer(queueName, filterString, browseOnly);
}
@ -193,22 +193,22 @@ public class DelegatingSession implements ClientSessionInternal
final SimpleString filterString,
final int windowSize,
final int maxRate,
final boolean browseOnly) throws HornetQException
final boolean browseOnly) throws ActiveMQException
{
return session.createConsumer(queueName, filterString, windowSize, maxRate, browseOnly);
}
public ClientConsumer createConsumer(final SimpleString queueName, final SimpleString filterString) throws HornetQException
public ClientConsumer createConsumer(final SimpleString queueName, final SimpleString filterString) throws ActiveMQException
{
return session.createConsumer(queueName, filterString);
}
public ClientConsumer createConsumer(final SimpleString queueName) throws HornetQException
public ClientConsumer createConsumer(final SimpleString queueName) throws ActiveMQException
{
return session.createConsumer(queueName);
}
public ClientConsumer createConsumer(final String queueName, final String filterString, final boolean browseOnly) throws HornetQException
public ClientConsumer createConsumer(final String queueName, final String filterString, final boolean browseOnly) throws ActiveMQException
{
return session.createConsumer(queueName, filterString, browseOnly);
}
@ -217,74 +217,74 @@ public class DelegatingSession implements ClientSessionInternal
final String filterString,
final int windowSize,
final int maxRate,
final boolean browseOnly) throws HornetQException
final boolean browseOnly) throws ActiveMQException
{
return session.createConsumer(queueName, filterString, windowSize, maxRate, browseOnly);
}
public ClientConsumer createConsumer(final String queueName, final String filterString) throws HornetQException
public ClientConsumer createConsumer(final String queueName, final String filterString) throws ActiveMQException
{
return session.createConsumer(queueName, filterString);
}
public ClientConsumer createConsumer(final String queueName) throws HornetQException
public ClientConsumer createConsumer(final String queueName) throws ActiveMQException
{
return session.createConsumer(queueName);
}
public ClientConsumer createConsumer(final SimpleString queueName, final boolean browseOnly) throws HornetQException
public ClientConsumer createConsumer(final SimpleString queueName, final boolean browseOnly) throws ActiveMQException
{
return session.createConsumer(queueName, browseOnly);
}
public ClientConsumer createConsumer(final String queueName, final boolean browseOnly) throws HornetQException
public ClientConsumer createConsumer(final String queueName, final boolean browseOnly) throws ActiveMQException
{
return session.createConsumer(queueName, browseOnly);
}
public ClientProducer createProducer() throws HornetQException
public ClientProducer createProducer() throws ActiveMQException
{
return session.createProducer();
}
public ClientProducer createProducer(final SimpleString address, final int rate) throws HornetQException
public ClientProducer createProducer(final SimpleString address, final int rate) throws ActiveMQException
{
return session.createProducer(address, rate);
}
public ClientProducer createProducer(final SimpleString address) throws HornetQException
public ClientProducer createProducer(final SimpleString address) throws ActiveMQException
{
return session.createProducer(address);
}
public ClientProducer createProducer(final String address) throws HornetQException
public ClientProducer createProducer(final String address) throws ActiveMQException
{
return session.createProducer(address);
}
public void createQueue(final String address, final String queueName) throws HornetQException
public void createQueue(final String address, final String queueName) throws ActiveMQException
{
session.createQueue(address, queueName);
}
public void createQueue(final SimpleString address, final SimpleString queueName) throws HornetQException
public void createQueue(final SimpleString address, final SimpleString queueName) throws ActiveMQException
{
session.createQueue(address, queueName);
}
public void createQueue(final SimpleString address, final SimpleString queueName, final boolean durable) throws HornetQException
public void createQueue(final SimpleString address, final SimpleString queueName, final boolean durable) throws ActiveMQException
{
session.createQueue(address, queueName, durable);
}
@Override
public void createSharedQueue(SimpleString address, SimpleString queueName, boolean durable) throws HornetQException
public void createSharedQueue(SimpleString address, SimpleString queueName, boolean durable) throws ActiveMQException
{
session.createSharedQueue(address, queueName, durable);
}
@Override
public void createSharedQueue(SimpleString address, SimpleString queueName, SimpleString filter, boolean durable) throws HornetQException
public void createSharedQueue(SimpleString address, SimpleString queueName, SimpleString filter, boolean durable) throws ActiveMQException
{
session.createSharedQueue(address, queueName, filter, durable);
}
@ -292,12 +292,12 @@ public class DelegatingSession implements ClientSessionInternal
public void createQueue(final SimpleString address,
final SimpleString queueName,
final SimpleString filterString,
final boolean durable) throws HornetQException
final boolean durable) throws ActiveMQException
{
session.createQueue(address, queueName, filterString, durable);
}
public void createQueue(final String address, final String queueName, final boolean durable) throws HornetQException
public void createQueue(final String address, final String queueName, final boolean durable) throws ActiveMQException
{
session.createQueue(address, queueName, durable);
}
@ -305,37 +305,37 @@ public class DelegatingSession implements ClientSessionInternal
public void createQueue(final String address,
final String queueName,
final String filterString,
final boolean durable) throws HornetQException
final boolean durable) throws ActiveMQException
{
session.createQueue(address, queueName, filterString, durable);
}
public void createTemporaryQueue(final SimpleString address, final SimpleString queueName, final SimpleString filter) throws HornetQException
public void createTemporaryQueue(final SimpleString address, final SimpleString queueName, final SimpleString filter) throws ActiveMQException
{
session.createTemporaryQueue(address, queueName, filter);
}
public void createTemporaryQueue(final SimpleString address, final SimpleString queueName) throws HornetQException
public void createTemporaryQueue(final SimpleString address, final SimpleString queueName) throws ActiveMQException
{
session.createTemporaryQueue(address, queueName);
}
public void createTemporaryQueue(final String address, final String queueName, final String filter) throws HornetQException
public void createTemporaryQueue(final String address, final String queueName, final String filter) throws ActiveMQException
{
session.createTemporaryQueue(address, queueName, filter);
}
public void createTemporaryQueue(final String address, final String queueName) throws HornetQException
public void createTemporaryQueue(final String address, final String queueName) throws ActiveMQException
{
session.createTemporaryQueue(address, queueName);
}
public void deleteQueue(final SimpleString queueName) throws HornetQException
public void deleteQueue(final SimpleString queueName) throws ActiveMQException
{
session.deleteQueue(queueName);
}
public void deleteQueue(final String queueName) throws HornetQException
public void deleteQueue(final String queueName) throws ActiveMQException
{
session.deleteQueue(queueName);
}
@ -345,7 +345,7 @@ public class DelegatingSession implements ClientSessionInternal
session.end(xid, flags);
}
public void expire(final ClientConsumer consumer, final Message message) throws HornetQException
public void expire(final ClientConsumer consumer, final Message message) throws ActiveMQException
{
session.expire(consumer, message);
}
@ -390,7 +390,7 @@ public class DelegatingSession implements ClientSessionInternal
session.preHandleFailover(connection);
}
public void handleFailover(final RemotingConnection backupConnection, HornetQException cause)
public void handleFailover(final RemotingConnection backupConnection, ActiveMQException cause)
{
session.handleFailover(backupConnection, cause);
}
@ -414,7 +414,7 @@ public class DelegatingSession implements ClientSessionInternal
}
@Override
public void handleConsumerDisconnect(ConsumerContext consumerContext) throws HornetQException
public void handleConsumerDisconnect(ConsumerContext consumerContext) throws ActiveMQException
{
session.handleConsumerDisconnect(consumerContext);
}
@ -459,7 +459,7 @@ public class DelegatingSession implements ClientSessionInternal
return session.prepare(xid);
}
public QueueQuery queueQuery(final SimpleString queueName) throws HornetQException
public QueueQuery queueQuery(final SimpleString queueName) throws ActiveMQException
{
return session.queueQuery(queueName);
}
@ -469,7 +469,7 @@ public class DelegatingSession implements ClientSessionInternal
return session.recover(flag);
}
public void removeConsumer(final ClientConsumerInternal consumer) throws HornetQException
public void removeConsumer(final ClientConsumerInternal consumer) throws ActiveMQException
{
session.removeConsumer(consumer);
}
@ -489,7 +489,7 @@ public class DelegatingSession implements ClientSessionInternal
session.removeProducer(producer);
}
public void rollback() throws HornetQException
public void rollback() throws ActiveMQException
{
session.rollback();
}
@ -499,7 +499,7 @@ public class DelegatingSession implements ClientSessionInternal
return session.isRollbackOnly();
}
public void rollback(final boolean considerLastMessageAsDelivered) throws HornetQException
public void rollback(final boolean considerLastMessageAsDelivered) throws ActiveMQException
{
session.rollback(considerLastMessageAsDelivered);
}
@ -520,12 +520,12 @@ public class DelegatingSession implements ClientSessionInternal
return session.setTransactionTimeout(seconds);
}
public void resetIfNeeded() throws HornetQException
public void resetIfNeeded() throws ActiveMQException
{
session.resetIfNeeded();
}
public DelegatingSession start() throws HornetQException
public DelegatingSession start() throws ActiveMQException
{
session.start();
return this;
@ -536,7 +536,7 @@ public class DelegatingSession implements ClientSessionInternal
session.start(xid, flags);
}
public void stop() throws HornetQException
public void stop() throws ActiveMQException
{
session.stop();
}
@ -596,7 +596,7 @@ public class DelegatingSession implements ClientSessionInternal
session.setPacketSize(packetSize);
}
public void addMetaData(String key, String data) throws HornetQException
public void addMetaData(String key, String data) throws ActiveMQException
{
session.addMetaData(key, data);
}
@ -613,7 +613,7 @@ public class DelegatingSession implements ClientSessionInternal
}
@Override
public void addUniqueMetaData(String key, String data) throws HornetQException
public void addUniqueMetaData(String key, String data) throws ActiveMQException
{
session.addUniqueMetaData(key, data);

View File

@ -14,15 +14,15 @@ package org.apache.activemq.core.client.impl;
import java.io.OutputStream;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQException;
/**
* A LargeMessageBufferInternal
*
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
*/
public interface LargeMessageController extends HornetQBuffer
public interface LargeMessageController extends ActiveMQBuffer
{
/**
* Returns the size of this buffer.
@ -48,19 +48,19 @@ public interface LargeMessageController extends HornetQBuffer
/**
* Sets the OutputStream of this buffer to the specified output.
*/
void setOutputStream(final OutputStream output) throws HornetQException;
void setOutputStream(final OutputStream output) throws ActiveMQException;
/**
* Saves this buffer to the specified output. This is just a blocking version of
* {@link #setOutputStream(OutputStream)}.
*/
void saveBuffer(final OutputStream output) throws HornetQException;
void saveBuffer(final OutputStream output) throws ActiveMQException;
void addPacket(byte[] chunk, int flowControlSize, boolean isContinues);
/**
* Waits for the completion for the specified waiting time (in milliseconds).
*/
boolean waitCompletion(long timeWait) throws HornetQException;
boolean waitCompletion(long timeWait) throws ActiveMQException;
}

View File

@ -26,11 +26,11 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import io.netty.buffer.ByteBuf;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQBuffers;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.HornetQExceptionType;
import org.apache.activemq.api.core.HornetQInterruptedException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffers;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQExceptionType;
import org.apache.activemq.api.core.ActiveMQInterruptedException;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.core.client.HornetQClientLogger;
import org.apache.activemq.core.client.HornetQClientMessageBundle;
@ -268,7 +268,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
}
}
public void setOutputStream(final OutputStream output) throws HornetQException
public void setOutputStream(final OutputStream output) throws ActiveMQException
{
int totalFlowControl = 0;
@ -304,7 +304,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
}
}
public synchronized void saveBuffer(final OutputStream output) throws HornetQException
public synchronized void saveBuffer(final OutputStream output) throws ActiveMQException
{
if (streamClosed)
{
@ -316,9 +316,9 @@ public class LargeMessageControllerImpl implements LargeMessageController
/**
* @param timeWait Milliseconds to Wait. 0 means forever
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
public synchronized boolean waitCompletion(final long timeWait) throws HornetQException
public synchronized boolean waitCompletion(final long timeWait) throws ActiveMQException
{
if (outStream == null)
{
@ -347,23 +347,17 @@ public class LargeMessageControllerImpl implements LargeMessageController
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
if (!streamEnded && handledException == null)
{
if (timeWait != 0 && System.currentTimeMillis() > timeOut)
{
// TODO: what to do here?
//throw new HornetQException(HornetQException.LARGE_MESSAGE_ERROR_BODY,
// "Timeout waiting for LargeMessage Body");
throw HornetQClientMessageBundle.BUNDLE.timeoutOnLargeMessage();
}
else if (System.currentTimeMillis() > timeOut && !packetAdded)
{
// throw new HornetQException(HornetQException.LARGE_MESSAGE_ERROR_BODY,
// "No packets have arrived within " + readTimeout + " milliseconds");
throw HornetQClientMessageBundle.BUNDLE.timeoutOnLargeMessage();
}
}
@ -376,21 +370,21 @@ public class LargeMessageControllerImpl implements LargeMessageController
}
/**
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
private void checkException() throws HornetQException
private void checkException() throws ActiveMQException
{
// it's not needed to copy it as we never set it back to null
// once the exception is set, the controller is pretty much useless
if (handledException != null)
{
if (handledException instanceof HornetQException)
if (handledException instanceof ActiveMQException)
{
throw (HornetQException)handledException;
throw (ActiveMQException)handledException;
}
else
{
throw new HornetQException(HornetQExceptionType.LARGE_MESSAGE_ERROR_BODY,
throw new ActiveMQException(ActiveMQExceptionType.LARGE_MESSAGE_ERROR_BODY,
"Error on saving LargeMessageBufferImpl",
handledException);
}
@ -431,14 +425,14 @@ public class LargeMessageControllerImpl implements LargeMessageController
}
@Override
public void getBytes(final int index, final HornetQBuffer dst, final int dstIndex, final int length)
public void getBytes(final int index, final ActiveMQBuffer dst, final int dstIndex, final int length)
{
byte[] destBytes = new byte[length];
getBytes(index, destBytes);
dst.setBytes(dstIndex, destBytes);
}
private void getBytes(final long index, final HornetQBuffer dst, final int dstIndex, final int length)
private void getBytes(final long index, final ActiveMQBuffer dst, final int dstIndex, final int length)
{
byte[] destBytes = new byte[length];
getBytes(index, destBytes);
@ -565,7 +559,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
}
@Override
public void setBytes(final int index, final HornetQBuffer src, final int srcIndex, final int length)
public void setBytes(final int index, final ActiveMQBuffer src, final int srcIndex, final int length)
{
throw new IllegalAccessError(LargeMessageControllerImpl.READ_ONLY_ERROR_MESSAGE);
}
@ -763,12 +757,12 @@ public class LargeMessageControllerImpl implements LargeMessageController
}
}
public void getBytes(final int index, final HornetQBuffer dst)
public void getBytes(final int index, final ActiveMQBuffer dst)
{
getBytes(index, dst, dst.writableBytes());
}
public void getBytes(final int index, final HornetQBuffer dst, final int length)
public void getBytes(final int index, final ActiveMQBuffer dst, final int length)
{
if (length > dst.writableBytes())
{
@ -783,12 +777,12 @@ public class LargeMessageControllerImpl implements LargeMessageController
throw new IllegalAccessError(LargeMessageControllerImpl.READ_ONLY_ERROR_MESSAGE);
}
public void setBytes(final int index, final HornetQBuffer src)
public void setBytes(final int index, final ActiveMQBuffer src)
{
throw new IllegalAccessError(LargeMessageControllerImpl.READ_ONLY_ERROR_MESSAGE);
}
public void setBytes(final int index, final HornetQBuffer src, final int length)
public void setBytes(final int index, final ActiveMQBuffer src, final int length)
{
throw new IllegalAccessError(LargeMessageControllerImpl.READ_ONLY_ERROR_MESSAGE);
}
@ -868,12 +862,12 @@ public class LargeMessageControllerImpl implements LargeMessageController
readBytes(dst, 0, dst.length);
}
public void readBytes(final HornetQBuffer dst)
public void readBytes(final ActiveMQBuffer dst)
{
readBytes(dst, dst.writableBytes());
}
public void readBytes(final HornetQBuffer dst, final int length)
public void readBytes(final ActiveMQBuffer dst, final int length)
{
if (length > dst.writableBytes())
{
@ -883,7 +877,7 @@ public class LargeMessageControllerImpl implements LargeMessageController
dst.writerIndex(dst.writerIndex() + length);
}
public void readBytes(final HornetQBuffer dst, final int dstIndex, final int length)
public void readBytes(final ActiveMQBuffer dst, final int dstIndex, final int length)
{
getBytes(readerIndex, dst, dstIndex, length);
readerIndex += length;
@ -952,12 +946,12 @@ public class LargeMessageControllerImpl implements LargeMessageController
throw new IllegalAccessError(LargeMessageControllerImpl.READ_ONLY_ERROR_MESSAGE);
}
public void writeBytes(final HornetQBuffer src)
public void writeBytes(final ActiveMQBuffer src)
{
throw new IllegalAccessError(LargeMessageControllerImpl.READ_ONLY_ERROR_MESSAGE);
}
public void writeBytes(final HornetQBuffer src, final int length)
public void writeBytes(final ActiveMQBuffer src, final int length)
{
throw new IllegalAccessError(LargeMessageControllerImpl.READ_ONLY_ERROR_MESSAGE);
}
@ -1034,12 +1028,12 @@ public class LargeMessageControllerImpl implements LargeMessageController
return Float.intBitsToFloat(getInt(index));
}
public HornetQBuffer readBytes(final int length)
public ActiveMQBuffer readBytes(final int length)
{
byte[] bytesToGet = new byte[length];
getBytes(readerIndex, bytesToGet);
readerIndex += length;
return HornetQBuffers.wrappedBuffer(bytesToGet);
return ActiveMQBuffers.wrappedBuffer(bytesToGet);
}
@Override
@ -1177,12 +1171,12 @@ public class LargeMessageControllerImpl implements LargeMessageController
throw new IllegalAccessError(LargeMessageControllerImpl.READ_ONLY_ERROR_MESSAGE);
}
public HornetQBuffer copy()
public ActiveMQBuffer copy()
{
throw new UnsupportedOperationException();
}
public HornetQBuffer slice(final int index, final int length)
public ActiveMQBuffer slice(final int index, final int length)
{
throw new UnsupportedOperationException();
}
@ -1190,9 +1184,9 @@ public class LargeMessageControllerImpl implements LargeMessageController
/**
* @param output
* @param packet
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws HornetQException
private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException
{
try
{
@ -1427,17 +1421,17 @@ public class LargeMessageControllerImpl implements LargeMessageController
return null;
}
public HornetQBuffer copy(final int index, final int length)
public ActiveMQBuffer copy(final int index, final int length)
{
throw new IllegalAccessError(LargeMessageControllerImpl.READ_ONLY_ERROR_MESSAGE);
}
public HornetQBuffer duplicate()
public ActiveMQBuffer duplicate()
{
throw new IllegalAccessError(LargeMessageControllerImpl.READ_ONLY_ERROR_MESSAGE);
}
public HornetQBuffer readSlice(final int length)
public ActiveMQBuffer readSlice(final int length)
{
throw new IllegalAccessError(LargeMessageControllerImpl.READ_ONLY_ERROR_MESSAGE);
}
@ -1457,12 +1451,12 @@ public class LargeMessageControllerImpl implements LargeMessageController
throw new IllegalAccessError(LargeMessageControllerImpl.READ_ONLY_ERROR_MESSAGE);
}
public HornetQBuffer slice()
public ActiveMQBuffer slice()
{
throw new IllegalAccessError(LargeMessageControllerImpl.READ_ONLY_ERROR_MESSAGE);
}
public void writeBytes(final HornetQBuffer src, final int srcIndex, final int length)
public void writeBytes(final ActiveMQBuffer src, final int srcIndex, final int length)
{
throw new IllegalAccessError(LargeMessageControllerImpl.READ_ONLY_ERROR_MESSAGE);
}

View File

@ -35,11 +35,11 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQExceptionType;
import org.apache.activemq.api.core.ActiveMQIllegalStateException;
import org.apache.activemq.api.core.ActiveMQInterruptedException;
import org.apache.activemq.api.core.DiscoveryGroupConfiguration;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.HornetQExceptionType;
import org.apache.activemq.api.core.HornetQIllegalStateException;
import org.apache.activemq.api.core.HornetQInterruptedException;
import org.apache.activemq.api.core.Interceptor;
import org.apache.activemq.api.core.Pair;
import org.apache.activemq.api.core.TransportConfiguration;
@ -234,7 +234,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
finally
{
@ -254,7 +254,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
finally
{
@ -357,14 +357,14 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
});
}
private synchronized void initialise() throws HornetQException
private synchronized void initialise() throws ActiveMQException
{
if (state == STATE.INITIALIZED)
return;
synchronized (stateGuard)
{
if (state == STATE.CLOSING)
throw new HornetQIllegalStateException();
throw new ActiveMQIllegalStateException();
try
{
state = STATE.INITIALIZED;
@ -669,12 +669,12 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
}
@Override
public ClientSessionFactoryInternal connect() throws HornetQException
public ClientSessionFactoryInternal connect() throws ActiveMQException
{
return connect(false);
}
private ClientSessionFactoryInternal connect(final boolean skipWarnings) throws HornetQException
private ClientSessionFactoryInternal connect(final boolean skipWarnings) throws ActiveMQException
{
synchronized (this)
{
@ -691,7 +691,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
}
@Override
public ClientSessionFactoryInternal connectNoWarnings() throws HornetQException
public ClientSessionFactoryInternal connectNoWarnings() throws ActiveMQException
{
return connect(true);
}
@ -767,7 +767,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
{
factory.connect(reconnectAttempts, failoverOnInitialConnection);
}
catch (HornetQException e1)
catch (ActiveMQException e1)
{
//we need to make sure is closed just for garbage collection
factory.close();
@ -810,7 +810,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
{
factory.connect(reconnectAttempts, failoverOnInitialConnection);
}
catch (HornetQException e1)
catch (ActiveMQException e1)
{
//we need to make sure is closed just for garbage collection
factory.close();
@ -842,7 +842,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
}
}
public ClientSessionFactory createSessionFactory() throws HornetQException
public ClientSessionFactory createSessionFactory() throws ActiveMQException
{
assertOpen();
@ -904,11 +904,11 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
removeFromConnecting(factory);
}
}
catch (HornetQException e)
catch (ActiveMQException e)
{
factory.close();
factory = null;
if (e.getType() == HornetQExceptionType.NOT_CONNECTED)
if (e.getType() == ActiveMQExceptionType.NOT_CONNECTED)
{
attempts++;
@ -947,7 +947,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
}
@ -1556,7 +1556,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
}
@ -1573,7 +1573,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
}
}
@ -1755,7 +1755,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
{
connect();
}
catch (HornetQException e)
catch (ActiveMQException e)
{
HornetQClientLogger.LOGGER.errorConnectingToNodes(e);
}
@ -1860,7 +1860,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
private List<Connector> connectors;
public ClientSessionFactory connect(boolean skipWarnings) throws HornetQException
public ClientSessionFactory connect(boolean skipWarnings) throws ActiveMQException
{
assertOpen();
@ -1893,9 +1893,9 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
// Case the node where the cluster connection was connected is gone, we need to restart the
// connection
@Override
public void connectionFailed(HornetQException exception, boolean failedOver)
public void connectionFailed(ActiveMQException exception, boolean failedOver)
{
if (clusterConnection && exception.getType() == HornetQExceptionType.DISCONNECTED)
if (clusterConnection && exception.getType() == ActiveMQExceptionType.DISCONNECTED)
{
try
{
@ -1910,7 +1910,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
}
@Override
public void connectionFailed(final HornetQException me, boolean failedOver, String scaleDownTargetNodeID)
public void connectionFailed(final ActiveMQException me, boolean failedOver, String scaleDownTargetNodeID)
{
connectionFailed(me, failedOver);
}
@ -2049,7 +2049,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
this.factory = factory;
}
public ClientSessionFactory tryConnect() throws HornetQException
public ClientSessionFactory tryConnect() throws ActiveMQException
{
if (HornetQClientLogger.LOGGER.isDebugEnabled())
{
@ -2073,7 +2073,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
}
return factoryToUse;
}
catch (HornetQException e)
catch (ActiveMQException e)
{
HornetQClientLogger.LOGGER.debug(this + "::Exception on establish connector initial connection", e);
return null;

View File

@ -14,7 +14,7 @@ package org.apache.activemq.core.client.impl;
import java.util.concurrent.Executor;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.TransportConfiguration;
import org.apache.activemq.api.core.client.ClientSessionFactory;
import org.apache.activemq.api.core.client.ServerLocator;
@ -52,13 +52,13 @@ public interface ServerLocatorInternal extends ServerLocator
// Reset this Locator back as if it never received any topology
void resetToInitialConnectors();
ClientSessionFactoryInternal connect() throws HornetQException;
ClientSessionFactoryInternal connect() throws ActiveMQException;
/**
* Like {@link #connect()} but it does not log warnings if it fails to connect.
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
ClientSessionFactoryInternal connectNoWarnings() throws HornetQException;
ClientSessionFactoryInternal connectNoWarnings() throws ActiveMQException;
void notifyNodeUp(long uniqueEventID, String nodeID, String backupGroupName, String scaleDownGroupName,
Pair<TransportConfiguration, TransportConfiguration> connectorPair, boolean last);

View File

@ -19,11 +19,11 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffers;
import org.apache.activemq.api.core.ActiveMQInterruptedException;
import org.apache.activemq.api.core.BroadcastEndpoint;
import org.apache.activemq.api.core.BroadcastEndpointFactory;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQBuffers;
import org.apache.activemq.api.core.HornetQInterruptedException;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.api.core.TransportConfiguration;
import org.apache.activemq.api.core.management.CoreNotificationType;
@ -161,7 +161,7 @@ public final class DiscoveryGroup implements HornetQComponent
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
thread = null;
@ -215,7 +215,7 @@ public final class DiscoveryGroup implements HornetQComponent
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
if (timeout != 0)
@ -295,7 +295,7 @@ public final class DiscoveryGroup implements HornetQComponent
}
}
HornetQBuffer buffer = HornetQBuffers.wrappedBuffer(data);
ActiveMQBuffer buffer = ActiveMQBuffers.wrappedBuffer(data);
String originatingNodeID = buffer.readString();

View File

@ -14,8 +14,8 @@ package org.apache.activemq.core.message;
import java.nio.ByteBuffer;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQException;
/**
* Class used to encode message body into buffers.
@ -30,22 +30,22 @@ public interface BodyEncoder
/**
* This method must not be called directly by HornetQ clients.
*/
void open() throws HornetQException;
void open() throws ActiveMQException;
/**
* This method must not be called directly by HornetQ clients.
*/
void close() throws HornetQException;
void close() throws ActiveMQException;
/**
* This method must not be called directly by HornetQ clients.
*/
int encode(ByteBuffer bufferRead) throws HornetQException;
int encode(ByteBuffer bufferRead) throws ActiveMQException;
/**
* This method must not be called directly by HornetQ clients.
*/
int encode(HornetQBuffer bufferOut, int size) throws HornetQException;
int encode(ActiveMQBuffer bufferOut, int size) throws ActiveMQException;
/**
* This method must not be called directly by HornetQ clients.

View File

@ -17,10 +17,10 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQBuffers;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.HornetQPropertyConversionException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffers;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQPropertyConversionException;
import org.apache.activemq.api.core.Message;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.core.buffers.impl.ResetLimitWrappedHornetQBuffer;
@ -76,7 +76,7 @@ public abstract class MessageImpl implements MessageInternal
protected byte priority;
protected HornetQBuffer buffer;
protected ActiveMQBuffer buffer;
protected ResetLimitWrappedHornetQBuffer bodyBuffer;
@ -205,7 +205,7 @@ public abstract class MessageImpl implements MessageInternal
}
public void encodeHeadersAndProperties(final HornetQBuffer buffer)
public void encodeHeadersAndProperties(final ActiveMQBuffer buffer)
{
buffer.writeLong(messageID);
buffer.writeNullableSimpleString(address);
@ -226,7 +226,7 @@ public abstract class MessageImpl implements MessageInternal
properties.encode(buffer);
}
public void decodeHeadersAndProperties(final HornetQBuffer buffer)
public void decodeHeadersAndProperties(final ActiveMQBuffer buffer)
{
messageID = buffer.readLong();
address = buffer.readNullableSimpleString();
@ -261,7 +261,7 @@ public abstract class MessageImpl implements MessageInternal
properties = msg.getTypedProperties();
}
public HornetQBuffer getBodyBuffer()
public ActiveMQBuffer getBodyBuffer()
{
if (bodyBuffer == null)
{
@ -285,17 +285,17 @@ public abstract class MessageImpl implements MessageInternal
return this;
}
public void checkCompletion() throws HornetQException
public void checkCompletion() throws ActiveMQException
{
// no op on regular messages
}
public synchronized HornetQBuffer getBodyBufferCopy()
public synchronized ActiveMQBuffer getBodyBufferCopy()
{
// Must copy buffer before sending it
HornetQBuffer newBuffer = buffer.copy(0, buffer.capacity());
ActiveMQBuffer newBuffer = buffer.copy(0, buffer.capacity());
newBuffer.setIndex(0, getEndOfBodyPosition());
@ -454,7 +454,7 @@ public abstract class MessageImpl implements MessageInternal
return map;
}
public void decodeFromBuffer(final HornetQBuffer buffer)
public void decodeFromBuffer(final ActiveMQBuffer buffer)
{
this.buffer = buffer;
@ -502,7 +502,7 @@ public abstract class MessageImpl implements MessageInternal
}
// Encode to journal or paging
public void encode(final HornetQBuffer buff)
public void encode(final ActiveMQBuffer buff)
{
encodeToBuffer();
@ -510,7 +510,7 @@ public abstract class MessageImpl implements MessageInternal
}
// Decode from journal or paging
public void decode(final HornetQBuffer buff)
public void decode(final ActiveMQBuffer buff)
{
int start = buff.readerIndex();
@ -529,13 +529,13 @@ public abstract class MessageImpl implements MessageInternal
buff.readerIndex(start + length);
}
public synchronized HornetQBuffer getEncodedBuffer()
public synchronized ActiveMQBuffer getEncodedBuffer()
{
HornetQBuffer buff = encodeToBuffer();
ActiveMQBuffer buff = encodeToBuffer();
if (bufferUsed)
{
HornetQBuffer copied = buff.copy(0, buff.capacity());
ActiveMQBuffer copied = buff.copy(0, buff.capacity());
copied.setIndex(0, endOfMessagePosition);
@ -656,7 +656,7 @@ public abstract class MessageImpl implements MessageInternal
return this;
}
public Message putObjectProperty(final SimpleString key, final Object value) throws HornetQPropertyConversionException
public Message putObjectProperty(final SimpleString key, final Object value) throws ActiveMQPropertyConversionException
{
TypedProperties.setObjectProperty(key, value, properties);
bufferValid = false;
@ -664,7 +664,7 @@ public abstract class MessageImpl implements MessageInternal
return this;
}
public Message putObjectProperty(final String key, final Object value) throws HornetQPropertyConversionException
public Message putObjectProperty(final String key, final Object value) throws ActiveMQPropertyConversionException
{
putObjectProperty(new SimpleString(key), value);
@ -768,87 +768,87 @@ public abstract class MessageImpl implements MessageInternal
return properties.getProperty(key);
}
public Boolean getBooleanProperty(final SimpleString key) throws HornetQPropertyConversionException
public Boolean getBooleanProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
return properties.getBooleanProperty(key);
}
public Boolean getBooleanProperty(final String key) throws HornetQPropertyConversionException
public Boolean getBooleanProperty(final String key) throws ActiveMQPropertyConversionException
{
return properties.getBooleanProperty(new SimpleString(key));
}
public Byte getByteProperty(final SimpleString key) throws HornetQPropertyConversionException
public Byte getByteProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
return properties.getByteProperty(key);
}
public Byte getByteProperty(final String key) throws HornetQPropertyConversionException
public Byte getByteProperty(final String key) throws ActiveMQPropertyConversionException
{
return properties.getByteProperty(new SimpleString(key));
}
public byte[] getBytesProperty(final SimpleString key) throws HornetQPropertyConversionException
public byte[] getBytesProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
return properties.getBytesProperty(key);
}
public byte[] getBytesProperty(final String key) throws HornetQPropertyConversionException
public byte[] getBytesProperty(final String key) throws ActiveMQPropertyConversionException
{
return getBytesProperty(new SimpleString(key));
}
public Double getDoubleProperty(final SimpleString key) throws HornetQPropertyConversionException
public Double getDoubleProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
return properties.getDoubleProperty(key);
}
public Double getDoubleProperty(final String key) throws HornetQPropertyConversionException
public Double getDoubleProperty(final String key) throws ActiveMQPropertyConversionException
{
return properties.getDoubleProperty(new SimpleString(key));
}
public Integer getIntProperty(final SimpleString key) throws HornetQPropertyConversionException
public Integer getIntProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
return properties.getIntProperty(key);
}
public Integer getIntProperty(final String key) throws HornetQPropertyConversionException
public Integer getIntProperty(final String key) throws ActiveMQPropertyConversionException
{
return properties.getIntProperty(new SimpleString(key));
}
public Long getLongProperty(final SimpleString key) throws HornetQPropertyConversionException
public Long getLongProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
return properties.getLongProperty(key);
}
public Long getLongProperty(final String key) throws HornetQPropertyConversionException
public Long getLongProperty(final String key) throws ActiveMQPropertyConversionException
{
return properties.getLongProperty(new SimpleString(key));
}
public Short getShortProperty(final SimpleString key) throws HornetQPropertyConversionException
public Short getShortProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
return properties.getShortProperty(key);
}
public Short getShortProperty(final String key) throws HornetQPropertyConversionException
public Short getShortProperty(final String key) throws ActiveMQPropertyConversionException
{
return properties.getShortProperty(new SimpleString(key));
}
public Float getFloatProperty(final SimpleString key) throws HornetQPropertyConversionException
public Float getFloatProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
return properties.getFloatProperty(key);
}
public Float getFloatProperty(final String key) throws HornetQPropertyConversionException
public Float getFloatProperty(final String key) throws ActiveMQPropertyConversionException
{
return properties.getFloatProperty(new SimpleString(key));
}
public String getStringProperty(final SimpleString key) throws HornetQPropertyConversionException
public String getStringProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
SimpleString str = getSimpleStringProperty(key);
@ -862,17 +862,17 @@ public abstract class MessageImpl implements MessageInternal
}
}
public String getStringProperty(final String key) throws HornetQPropertyConversionException
public String getStringProperty(final String key) throws ActiveMQPropertyConversionException
{
return getStringProperty(new SimpleString(key));
}
public SimpleString getSimpleStringProperty(final SimpleString key) throws HornetQPropertyConversionException
public SimpleString getSimpleStringProperty(final SimpleString key) throws ActiveMQPropertyConversionException
{
return properties.getSimpleStringProperty(key);
}
public SimpleString getSimpleStringProperty(final String key) throws HornetQPropertyConversionException
public SimpleString getSimpleStringProperty(final String key) throws ActiveMQPropertyConversionException
{
return properties.getSimpleStringProperty(new SimpleString(key));
}
@ -911,12 +911,12 @@ public abstract class MessageImpl implements MessageInternal
return properties.getPropertyNames();
}
public HornetQBuffer getWholeBuffer()
public ActiveMQBuffer getWholeBuffer()
{
return buffer;
}
public BodyEncoder getBodyEncoder() throws HornetQException
public BodyEncoder getBodyEncoder() throws ActiveMQException
{
return new DecodingContext();
}
@ -1001,7 +1001,7 @@ public abstract class MessageImpl implements MessageInternal
// This must be synchronized as it can be called concurrently id the message is being delivered
// concurrently to
// many queues - the first caller in this case will actually encode it
private synchronized HornetQBuffer encodeToBuffer()
private synchronized ActiveMQBuffer encodeToBuffer()
{
if (!bufferValid)
{
@ -1062,7 +1062,7 @@ public abstract class MessageImpl implements MessageInternal
public void createBody(final int initialMessageBufferSize)
{
buffer = HornetQBuffers.dynamicBuffer(initialMessageBufferSize);
buffer = ActiveMQBuffers.dynamicBuffer(initialMessageBufferSize);
// There's a bug in netty which means a dynamic buffer won't resize until you write a byte
buffer.writeByte((byte) 0);
@ -1109,13 +1109,13 @@ public abstract class MessageImpl implements MessageInternal
return buffer.writerIndex();
}
public int encode(final ByteBuffer bufferRead) throws HornetQException
public int encode(final ByteBuffer bufferRead) throws ActiveMQException
{
HornetQBuffer buffer = HornetQBuffers.wrappedBuffer(bufferRead);
ActiveMQBuffer buffer = ActiveMQBuffers.wrappedBuffer(bufferRead);
return encode(buffer, bufferRead.capacity());
}
public int encode(final HornetQBuffer bufferOut, final int size)
public int encode(final ActiveMQBuffer bufferOut, final int size)
{
bufferOut.writeBytes(getWholeBuffer(), lastPos, size);
lastPos += size;

View File

@ -14,8 +14,8 @@ package org.apache.activemq.core.message.impl;
import java.io.InputStream;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.Message;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.core.message.BodyEncoder;
@ -30,7 +30,7 @@ import org.apache.activemq.utils.TypedProperties;
*/
public interface MessageInternal extends Message
{
void decodeFromBuffer(HornetQBuffer buffer);
void decodeFromBuffer(ActiveMQBuffer buffer);
int getEndOfMessagePosition();
@ -44,17 +44,17 @@ public interface MessageInternal extends Message
boolean isServerMessage();
HornetQBuffer getEncodedBuffer();
ActiveMQBuffer getEncodedBuffer();
int getHeadersAndPropertiesEncodeSize();
HornetQBuffer getWholeBuffer();
ActiveMQBuffer getWholeBuffer();
void encodeHeadersAndProperties(HornetQBuffer buffer);
void encodeHeadersAndProperties(ActiveMQBuffer buffer);
void decodeHeadersAndProperties(HornetQBuffer buffer);
void decodeHeadersAndProperties(ActiveMQBuffer buffer);
BodyEncoder getBodyEncoder() throws HornetQException;
BodyEncoder getBodyEncoder() throws ActiveMQException;
InputStream getBodyInputStream();

View File

@ -16,7 +16,7 @@ package org.apache.activemq.core.protocol;
import static org.apache.activemq.core.protocol.core.impl.PacketImpl.SESS_RECEIVE_LARGE_MSG;
import static org.apache.activemq.core.protocol.core.impl.PacketImpl.SESS_RECEIVE_MSG;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.core.client.impl.ClientLargeMessageImpl;
import org.apache.activemq.core.client.impl.ClientMessageImpl;
import org.apache.activemq.core.protocol.core.Packet;
@ -33,7 +33,7 @@ public class ClientPacketDecoder extends PacketDecoder
public static final ClientPacketDecoder INSTANCE = new ClientPacketDecoder();
@Override
public Packet decode(final HornetQBuffer in)
public Packet decode(final ActiveMQBuffer in)
{
final byte packetType = in.readByte();

View File

@ -14,7 +14,7 @@ package org.apache.activemq.core.protocol.core;
import java.util.concurrent.locks.Lock;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQException;
/**
* A channel is a way of interleaving data meant for different endpoints over the same {@link org.apache.activemq.core.protocol.core.CoreRemotingConnection}.
@ -69,9 +69,9 @@ public interface Channel
* @param packet the packet to send
* @param expectedPacket the packet being expected.
* @return the response
* @throws HornetQException if an error occurs during the send
* @throws org.apache.activemq.api.core.ActiveMQException if an error occurs during the send
*/
Packet sendBlocking(Packet packet, byte expectedPacket) throws HornetQException;
Packet sendBlocking(Packet packet, byte expectedPacket) throws ActiveMQException;
/**
* Sets the {@link org.apache.activemq.core.protocol.core.ChannelHandler} that this channel should

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.spi.core.protocol.RemotingConnection;
/**
@ -54,19 +54,19 @@ public interface Packet
byte getType();
/**
* Encodes the packet and returns a {@link org.apache.activemq.api.core.HornetQBuffer} containing the data
* Encodes the packet and returns a {@link org.apache.activemq.api.core.ActiveMQBuffer} containing the data
*
* @param connection the connection
* @return the buffer to encode to
*/
HornetQBuffer encode(RemotingConnection connection);
ActiveMQBuffer encode(RemotingConnection connection);
/**
* decodes the buffer into this packet
*
* @param buffer the buffer to decode from
*/
void decode(HornetQBuffer buffer);
void decode(ActiveMQBuffer buffer);
/**
* returns the size needed to encode this packet.

View File

@ -21,9 +21,9 @@ import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.HornetQInterruptedException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQInterruptedException;
import org.apache.activemq.api.core.Interceptor;
import org.apache.activemq.core.client.HornetQClientLogger;
import org.apache.activemq.core.client.HornetQClientMessageBundle;
@ -240,7 +240,7 @@ public final class ChannelImpl implements Channel
HornetQClientLogger.LOGGER.trace("Sending packet nonblocking " + packet + " on channeID=" + id);
}
HornetQBuffer buffer = packet.encode(connection);
ActiveMQBuffer buffer = packet.encode(connection);
lock.lock();
@ -255,7 +255,7 @@ public final class ChannelImpl implements Channel
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
}
@ -294,7 +294,7 @@ public final class ChannelImpl implements Channel
* and the client could eventually retry another call, but the server could then answer a previous command issuing a class-cast-exception.
* The expectedPacket will be used to filter out undesirable packets that would belong to previous calls.
*/
public Packet sendBlocking(final Packet packet, byte expectedPacket) throws HornetQException
public Packet sendBlocking(final Packet packet, byte expectedPacket) throws ActiveMQException
{
String interceptionResult = invokeInterceptors(packet, interceptors, connection);
@ -320,7 +320,7 @@ public final class ChannelImpl implements Channel
{
packet.setChannelID(id);
final HornetQBuffer buffer = packet.encode(connection);
final ActiveMQBuffer buffer = packet.encode(connection);
lock.lock();
@ -347,7 +347,7 @@ public final class ChannelImpl implements Channel
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
}
@ -373,7 +373,7 @@ public final class ChannelImpl implements Channel
}
catch (InterruptedException e)
{
throw new HornetQInterruptedException(e);
throw new ActiveMQInterruptedException(e);
}
if (response != null && response.getType() != PacketImpl.EXCEPTION && response.getType() != expectedPacket)
@ -402,7 +402,7 @@ public final class ChannelImpl implements Channel
{
final HornetQExceptionMessage mem = (HornetQExceptionMessage) response;
HornetQException e = mem.getException();
ActiveMQException e = mem.getException();
e.fillInStackTrace();
@ -653,7 +653,7 @@ public final class ChannelImpl implements Channel
private void doWrite(final Packet packet)
{
final HornetQBuffer buffer = packet.encode(connection);
final ActiveMQBuffer buffer = packet.encode(connection);
connection.getTransportConnection().write(buffer, false, false);
}

View File

@ -19,10 +19,10 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
import io.netty.channel.ChannelPipeline;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.HornetQExceptionType;
import org.apache.activemq.api.core.HornetQInterruptedException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQExceptionType;
import org.apache.activemq.api.core.ActiveMQInterruptedException;
import org.apache.activemq.api.core.Interceptor;
import org.apache.activemq.api.core.Pair;
import org.apache.activemq.api.core.SimpleString;
@ -250,7 +250,7 @@ public class HornetQClientProtocolManager implements ClientProtocolManager
@Override
public SessionContext createSessionContext(String name, String username, String password,
boolean xa, boolean autoCommitSends, boolean autoCommitAcks,
boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize) throws HornetQException
boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize) throws ActiveMQException
{
for (Version clientVersion : VersionLoader.getClientVersions())
{
@ -267,21 +267,21 @@ public class HornetQClientProtocolManager implements ClientProtocolManager
minLargeMessageSize,
confirmationWindowSize);
}
catch (HornetQException e)
catch (ActiveMQException e)
{
if (e.getType() != HornetQExceptionType.INCOMPATIBLE_CLIENT_SERVER_VERSIONS)
if (e.getType() != ActiveMQExceptionType.INCOMPATIBLE_CLIENT_SERVER_VERSIONS)
{
throw e;
}
}
}
connection.destroy();
throw new HornetQException(HornetQExceptionType.INCOMPATIBLE_CLIENT_SERVER_VERSIONS);
throw new ActiveMQException(ActiveMQExceptionType.INCOMPATIBLE_CLIENT_SERVER_VERSIONS);
}
public SessionContext createSessionContext(Version clientVersion, String name, String username, String password,
boolean xa, boolean autoCommitSends, boolean autoCommitAcks,
boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize) throws HornetQException
boolean preAcknowledge, int minLargeMessageSize, int confirmationWindowSize) throws ActiveMQException
{
if (!isAlive())
throw HornetQClientMessageBundle.BUNDLE.clientSessionClosed();
@ -331,12 +331,12 @@ public class HornetQClientProtocolManager implements ClientProtocolManager
// channel1 reference here has to go away
response = (CreateSessionResponseMessage) getChannel1().sendBlocking(request, PacketImpl.CREATESESSION_RESP);
}
catch (HornetQException cause)
catch (ActiveMQException cause)
{
if (!isAlive())
throw cause;
if (cause.getType() == HornetQExceptionType.UNBLOCKED)
if (cause.getType() == ActiveMQExceptionType.UNBLOCKED)
{
// This means the thread was blocked on create session and failover unblocked it
// so failover could occur
@ -363,9 +363,9 @@ public class HornetQClientProtocolManager implements ClientProtocolManager
lock = null;
}
if (t instanceof HornetQException)
if (t instanceof ActiveMQException)
{
throw (HornetQException) t;
throw (ActiveMQException) t;
}
else
{
@ -392,7 +392,7 @@ public class HornetQClientProtocolManager implements ClientProtocolManager
}
public boolean cleanupBeforeFailover(HornetQException cause)
public boolean cleanupBeforeFailover(ActiveMQException cause)
{
boolean needToInterrupt;
@ -437,7 +437,7 @@ public class HornetQClientProtocolManager implements ClientProtocolManager
}
catch (InterruptedException e1)
{
throw new HornetQInterruptedException(e1);
throw new ActiveMQInterruptedException(e1);
}
}
}
@ -446,7 +446,7 @@ public class HornetQClientProtocolManager implements ClientProtocolManager
}
@Override
public boolean checkForFailover(String liveNodeID) throws HornetQException
public boolean checkForFailover(String liveNodeID) throws ActiveMQException
{
CheckFailoverMessage packet = new CheckFailoverMessage(liveNodeID);
CheckFailoverReplyMessage message = (CheckFailoverReplyMessage) getChannel1().sendBlocking(packet,
@ -479,7 +479,7 @@ public class HornetQClientProtocolManager implements ClientProtocolManager
{
// no need to send handshake on inVM as inVM is not using the NettyProtocolHandling
String handshake = "HORNETQ";
HornetQBuffer hqbuffer = connection.createBuffer(handshake.length());
ActiveMQBuffer hqbuffer = connection.createBuffer(handshake.length());
hqbuffer.writeBytes(handshake.getBytes());
transportConnection.write(hqbuffer);
}
@ -598,7 +598,7 @@ public class HornetQClientProtocolManager implements ClientProtocolManager
return ClientPacketDecoder.INSTANCE;
}
private void forceReturnChannel1(HornetQException cause)
private void forceReturnChannel1(ActiveMQException cause)
{
if (connection != null)
{

View File

@ -23,9 +23,9 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.Executor;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.HornetQExceptionType;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQExceptionType;
import org.apache.activemq.api.core.Message;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.api.core.client.ClientConsumer;
@ -172,7 +172,7 @@ public class HornetQSessionContext extends SessionContext
// Failover utility methods
@Override
public void returnBlocking(HornetQException cause)
public void returnBlocking(ActiveMQException cause)
{
sessionChannel.returnBlocking(cause);
}
@ -215,17 +215,17 @@ public class HornetQSessionContext extends SessionContext
public void createSharedQueue(SimpleString address,
SimpleString queueName,
SimpleString filterString,
boolean durable) throws HornetQException
boolean durable) throws ActiveMQException
{
sessionChannel.sendBlocking(new CreateSharedQueueMessage(address, queueName, filterString, durable, true), PacketImpl.NULL_RESPONSE);
}
public void deleteQueue(final SimpleString queueName) throws HornetQException
public void deleteQueue(final SimpleString queueName) throws ActiveMQException
{
sessionChannel.sendBlocking(new SessionDeleteQueueMessage(queueName), PacketImpl.NULL_RESPONSE);
}
public ClientSession.QueueQuery queueQuery(final SimpleString queueName) throws HornetQException
public ClientSession.QueueQuery queueQuery(final SimpleString queueName) throws ActiveMQException
{
SessionQueueQueryMessage request = new SessionQueueQueryMessage(queueName);
SessionQueueQueryResponseMessage response = (SessionQueueQueryResponseMessage) sessionChannel.sendBlocking(request, PacketImpl.SESS_QUEUEQUERY_RESP);
@ -237,7 +237,7 @@ public class HornetQSessionContext extends SessionContext
public ClientConsumerInternal createConsumer(SimpleString queueName, SimpleString filterString,
int windowSize, int maxRate, int ackBatchSize, boolean browseOnly,
Executor executor, Executor flowControlExecutor) throws HornetQException
Executor executor, Executor flowControlExecutor) throws ActiveMQException
{
long consumerID = idGenerator.generateID();
@ -278,7 +278,7 @@ public class HornetQSessionContext extends SessionContext
return serverVersion;
}
public ClientSession.AddressQuery addressQuery(final SimpleString address) throws HornetQException
public ClientSession.AddressQuery addressQuery(final SimpleString address) throws ActiveMQException
{
SessionBindingQueryResponseMessage response =
(SessionBindingQueryResponseMessage) sessionChannel.sendBlocking(new SessionBindingQueryMessage(address), PacketImpl.SESS_BINDINGQUERY_RESP);
@ -288,7 +288,7 @@ public class HornetQSessionContext extends SessionContext
@Override
public void closeConsumer(final ClientConsumer consumer) throws HornetQException
public void closeConsumer(final ClientConsumer consumer) throws ActiveMQException
{
sessionChannel.sendBlocking(new SessionConsumerCloseMessage(getConsumerID(consumer)), PacketImpl.NULL_RESPONSE);
}
@ -298,44 +298,44 @@ public class HornetQSessionContext extends SessionContext
sessionChannel.send(new SessionConsumerFlowCreditMessage(getConsumerID(consumer), credits));
}
public void forceDelivery(final ClientConsumer consumer, final long sequence) throws HornetQException
public void forceDelivery(final ClientConsumer consumer, final long sequence) throws ActiveMQException
{
SessionForceConsumerDelivery request = new SessionForceConsumerDelivery(getConsumerID(consumer), sequence);
sessionChannel.send(request);
}
public void simpleCommit() throws HornetQException
public void simpleCommit() throws ActiveMQException
{
sessionChannel.sendBlocking(new PacketImpl(PacketImpl.SESS_COMMIT), PacketImpl.NULL_RESPONSE);
}
public void simpleRollback(boolean lastMessageAsDelivered) throws HornetQException
public void simpleRollback(boolean lastMessageAsDelivered) throws ActiveMQException
{
sessionChannel.sendBlocking(new RollbackMessage(lastMessageAsDelivered), PacketImpl.NULL_RESPONSE);
}
public void sessionStart() throws HornetQException
public void sessionStart() throws ActiveMQException
{
sessionChannel.send(new PacketImpl(PacketImpl.SESS_START));
}
public void sessionStop() throws HornetQException
public void sessionStop() throws ActiveMQException
{
sessionChannel.sendBlocking(new PacketImpl(PacketImpl.SESS_STOP), PacketImpl.NULL_RESPONSE);
}
public void addSessionMetadata(String key, String data) throws HornetQException
public void addSessionMetadata(String key, String data) throws ActiveMQException
{
sessionChannel.sendBlocking(new SessionAddMetaDataMessageV2(key, data), PacketImpl.NULL_RESPONSE);
}
public void addUniqueMetaData(String key, String data) throws HornetQException
public void addUniqueMetaData(String key, String data) throws ActiveMQException
{
sessionChannel.sendBlocking(new SessionUniqueAddMetaDataMessage(key, data), PacketImpl.NULL_RESPONSE);
}
public void xaCommit(Xid xid, boolean onePhase) throws XAException, HornetQException
public void xaCommit(Xid xid, boolean onePhase) throws XAException, ActiveMQException
{
SessionXACommitMessage packet = new SessionXACommitMessage(xid, onePhase);
SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(packet, PacketImpl.SESS_XA_RESP);
@ -351,7 +351,7 @@ public class HornetQSessionContext extends SessionContext
}
}
public void xaEnd(Xid xid, int flags) throws XAException, HornetQException
public void xaEnd(Xid xid, int flags) throws XAException, ActiveMQException
{
Packet packet;
if (flags == XAResource.TMSUSPEND)
@ -401,7 +401,7 @@ public class HornetQSessionContext extends SessionContext
return msgI.getEncodeSize();
}
public void sendFullMessage(MessageInternal msgI, boolean sendBlocking, SendAcknowledgementHandler handler, SimpleString defaultAddress) throws HornetQException
public void sendFullMessage(MessageInternal msgI, boolean sendBlocking, SendAcknowledgementHandler handler, SimpleString defaultAddress) throws ActiveMQException
{
SessionSendMessage packet = new SessionSendMessage(msgI, sendBlocking, handler);
@ -416,7 +416,7 @@ public class HornetQSessionContext extends SessionContext
}
@Override
public int sendInitialChunkOnLargeMessage(MessageInternal msgI) throws HornetQException
public int sendInitialChunkOnLargeMessage(MessageInternal msgI) throws ActiveMQException
{
SessionSendLargeMessage initialChunk = new SessionSendLargeMessage(msgI);
@ -426,7 +426,7 @@ public class HornetQSessionContext extends SessionContext
}
@Override
public int sendLargeMessageChunk(MessageInternal msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, SendAcknowledgementHandler messageHandler) throws HornetQException
public int sendLargeMessageChunk(MessageInternal msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, SendAcknowledgementHandler messageHandler) throws ActiveMQException
{
final boolean requiresResponse = lastChunk && sendBlocking;
final SessionSendContinuationMessage chunkPacket =
@ -446,7 +446,7 @@ public class HornetQSessionContext extends SessionContext
return chunkPacket.getPacketSize();
}
public void sendACK(boolean individual, boolean block, final ClientConsumer consumer, final Message message) throws HornetQException
public void sendACK(boolean individual, boolean block, final ClientConsumer consumer, final Message message) throws ActiveMQException
{
PacketImpl messagePacket;
if (individual)
@ -468,7 +468,7 @@ public class HornetQSessionContext extends SessionContext
}
}
public void expireMessage(final ClientConsumer consumer, Message message) throws HornetQException
public void expireMessage(final ClientConsumer consumer, Message message) throws ActiveMQException
{
SessionExpireMessage messagePacket = new SessionExpireMessage(getConsumerID(consumer), message.getMessageID());
@ -476,12 +476,12 @@ public class HornetQSessionContext extends SessionContext
}
public void sessionClose() throws HornetQException
public void sessionClose() throws ActiveMQException
{
sessionChannel.sendBlocking(new SessionCloseMessage(), PacketImpl.NULL_RESPONSE);
}
public void xaForget(Xid xid) throws XAException, HornetQException
public void xaForget(Xid xid) throws XAException, ActiveMQException
{
SessionXAResponseMessage response = (SessionXAResponseMessage) sessionChannel.sendBlocking(new SessionXAForgetMessage(xid), PacketImpl.SESS_XA_RESP);
@ -491,7 +491,7 @@ public class HornetQSessionContext extends SessionContext
}
}
public int xaPrepare(Xid xid) throws XAException, HornetQException
public int xaPrepare(Xid xid) throws XAException, ActiveMQException
{
SessionXAPrepareMessage packet = new SessionXAPrepareMessage(xid);
@ -507,7 +507,7 @@ public class HornetQSessionContext extends SessionContext
}
}
public Xid[] xaScan() throws HornetQException
public Xid[] xaScan() throws ActiveMQException
{
SessionXAGetInDoubtXidsResponseMessage response = (SessionXAGetInDoubtXidsResponseMessage) sessionChannel.sendBlocking(new PacketImpl(PacketImpl.SESS_XA_INDOUBT_XIDS), PacketImpl.SESS_XA_INDOUBT_XIDS_RESP);
@ -518,7 +518,7 @@ public class HornetQSessionContext extends SessionContext
return xidArray;
}
public void xaRollback(Xid xid, boolean wasStarted) throws HornetQException, XAException
public void xaRollback(Xid xid, boolean wasStarted) throws ActiveMQException, XAException
{
SessionXARollbackMessage packet = new SessionXARollbackMessage(xid);
@ -530,7 +530,7 @@ public class HornetQSessionContext extends SessionContext
}
}
public void xaStart(Xid xid, int flags) throws XAException, HornetQException
public void xaStart(Xid xid, int flags) throws XAException, ActiveMQException
{
Packet packet;
if (flags == XAResource.TMJOIN)
@ -560,28 +560,28 @@ public class HornetQSessionContext extends SessionContext
}
}
public boolean configureTransactionTimeout(int seconds) throws HornetQException
public boolean configureTransactionTimeout(int seconds) throws ActiveMQException
{
SessionXASetTimeoutResponseMessage response = (SessionXASetTimeoutResponseMessage) sessionChannel.sendBlocking(new SessionXASetTimeoutMessage(seconds), PacketImpl.SESS_XA_SET_TIMEOUT_RESP);
return response.isOK();
}
public int recoverSessionTimeout() throws HornetQException
public int recoverSessionTimeout() throws ActiveMQException
{
SessionXAGetTimeoutResponseMessage response = (SessionXAGetTimeoutResponseMessage) sessionChannel.sendBlocking(new PacketImpl(PacketImpl.SESS_XA_GET_TIMEOUT), PacketImpl.SESS_XA_GET_TIMEOUT_RESP);
return response.getTimeoutSeconds();
}
public void createQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp) throws HornetQException
public void createQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp) throws ActiveMQException
{
CreateQueueMessage request = new CreateQueueMessage(address, queueName, filterString, durable, temp, true);
sessionChannel.sendBlocking(request, PacketImpl.NULL_RESPONSE);
}
@Override
public boolean reattachOnNewConnection(RemotingConnection newConnection) throws HornetQException
public boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException
{
this.remotingConnection = newConnection;
@ -623,7 +623,7 @@ public class HornetQSessionContext extends SessionContext
final boolean autoCommitSends,
final boolean autoCommitAcks,
final boolean preAcknowledge,
final SimpleString defaultAddress) throws HornetQException
final SimpleString defaultAddress) throws ActiveMQException
{
Packet createRequest = new CreateSessionMessage(name,
sessionChannel.getID(),
@ -646,10 +646,10 @@ public class HornetQSessionContext extends SessionContext
getCreateChannel().sendBlocking(createRequest, PacketImpl.CREATESESSION_RESP);
retry = false;
}
catch (HornetQException e)
catch (ActiveMQException e)
{
// the session was created while its server was starting, retry it:
if (e.getType() == HornetQExceptionType.SESSION_CREATION_REJECTED)
if (e.getType() == ActiveMQExceptionType.SESSION_CREATION_REJECTED)
{
HornetQClientLogger.LOGGER.retryCreateSessionSeverStarting(name);
retry = true;
@ -674,7 +674,7 @@ public class HornetQSessionContext extends SessionContext
}
@Override
public void recreateConsumerOnServer(ClientConsumerInternal consumerInternal) throws HornetQException
public void recreateConsumerOnServer(ClientConsumerInternal consumerInternal) throws ActiveMQException
{
ClientSession.QueueQuery queueInfo = consumerInternal.getQueueInfo();
@ -719,12 +719,12 @@ public class HornetQSessionContext extends SessionContext
}
}
public void xaFailed(Xid xid) throws HornetQException
public void xaFailed(Xid xid) throws ActiveMQException
{
sendPacketWithoutLock(sessionChannel, new SessionXAAfterFailedMessage(xid));
}
public void restartSession() throws HornetQException
public void restartSession() throws ActiveMQException
{
sendPacketWithoutLock(sessionChannel, new PacketImpl(PacketImpl.SESS_START));
}
@ -754,9 +754,9 @@ public class HornetQSessionContext extends SessionContext
/**
* This doesn't apply to other protocols probably, so it will be a hornetq exclusive feature
*
* @throws HornetQException
* @throws org.apache.activemq.api.core.ActiveMQException
*/
private void handleConsumerDisconnected(DisconnectConsumerMessage packet) throws HornetQException
private void handleConsumerDisconnected(DisconnectConsumerMessage packet) throws ActiveMQException
{
DisconnectConsumerMessage message = packet;
@ -931,7 +931,7 @@ public class HornetQSessionContext extends SessionContext
Connection conn = parameterChannel.getConnection().getTransportConnection();
HornetQBuffer buffer = packet.encode(this.getCoreConnection());
ActiveMQBuffer buffer = packet.encode(this.getCoreConnection());
conn.write(buffer, false, false);
}

View File

@ -76,7 +76,7 @@ import static org.apache.activemq.core.protocol.core.impl.PacketImpl.SUBSCRIBE_T
import java.io.Serializable;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.core.client.HornetQClientMessageBundle;
import org.apache.activemq.core.protocol.core.Packet;
import org.apache.activemq.core.protocol.core.impl.wireformat.CheckFailoverMessage;
@ -144,7 +144,7 @@ import org.apache.activemq.core.protocol.core.impl.wireformat.SubscribeClusterTo
*/
public abstract class PacketDecoder implements Serializable
{
public abstract Packet decode(final HornetQBuffer in);
public abstract Packet decode(final ActiveMQBuffer in);
public Packet decode(byte packetType)
{

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core.impl;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.core.protocol.core.Packet;
import org.apache.activemq.spi.core.protocol.RemotingConnection;
import org.apache.activemq.utils.DataConstants;
@ -266,9 +266,9 @@ public class PacketImpl implements Packet
this.channelID = channelID;
}
public HornetQBuffer encode(final RemotingConnection connection)
public ActiveMQBuffer encode(final RemotingConnection connection)
{
HornetQBuffer buffer = connection.createBuffer(PacketImpl.INITIAL_PACKET_SIZE);
ActiveMQBuffer buffer = connection.createBuffer(PacketImpl.INITIAL_PACKET_SIZE);
// The standard header fields
@ -288,7 +288,7 @@ public class PacketImpl implements Packet
return buffer;
}
public void decode(final HornetQBuffer buffer)
public void decode(final ActiveMQBuffer buffer)
{
channelID = buffer.readLong();
@ -312,11 +312,11 @@ public class PacketImpl implements Packet
return false;
}
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
}
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
}

View File

@ -19,8 +19,8 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.Interceptor;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.core.client.HornetQClientLogger;
@ -198,7 +198,7 @@ public class RemotingConnectionImpl extends AbstractRemotingConnection implement
channels.put(channelID, channel);
}
public void fail(final HornetQException me, String scaleDownTargetNodeID)
public void fail(final ActiveMQException me, String scaleDownTargetNodeID)
{
synchronized (failLock)
{
@ -366,7 +366,7 @@ public class RemotingConnectionImpl extends AbstractRemotingConnection implement
// Buffer Handler implementation
// ----------------------------------------------------
public void bufferReceived(final Object connectionID, final HornetQBuffer buffer)
public void bufferReceived(final Object connectionID, final ActiveMQBuffer buffer)
{
try
{

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.core.protocol.core.impl.PacketImpl;
public class CheckFailoverMessage extends PacketImpl
@ -31,13 +31,13 @@ public class CheckFailoverMessage extends PacketImpl
}
@Override
public void encodeRest(HornetQBuffer buffer)
public void encodeRest(ActiveMQBuffer buffer)
{
buffer.writeNullableString(nodeID);
}
@Override
public void decodeRest(HornetQBuffer buffer)
public void decodeRest(ActiveMQBuffer buffer)
{
nodeID = buffer.readNullableString();
}

View File

@ -13,7 +13,7 @@
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.core.protocol.core.impl.PacketImpl;
public class CheckFailoverReplyMessage extends PacketImpl
@ -38,13 +38,13 @@ public class CheckFailoverReplyMessage extends PacketImpl
}
@Override
public void encodeRest(HornetQBuffer buffer)
public void encodeRest(ActiveMQBuffer buffer)
{
buffer.writeBoolean(okToFailover);
}
@Override
public void decodeRest(HornetQBuffer buffer)
public void decodeRest(ActiveMQBuffer buffer)
{
okToFailover = buffer.readBoolean();
}

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.Pair;
import org.apache.activemq.api.core.TransportConfiguration;
import org.apache.activemq.core.protocol.core.impl.PacketImpl;
@ -92,7 +92,7 @@ public class ClusterTopologyChangeMessage extends PacketImpl
}
@Override
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
buffer.writeBoolean(exit);
buffer.writeString(nodeID);
@ -121,7 +121,7 @@ public class ClusterTopologyChangeMessage extends PacketImpl
}
@Override
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
exit = buffer.readBoolean();
nodeID = buffer.readString();

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.Pair;
import org.apache.activemq.api.core.TransportConfiguration;
@ -77,7 +77,7 @@ public class ClusterTopologyChangeMessage_V2 extends ClusterTopologyChangeMessag
}
@Override
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
buffer.writeBoolean(exit);
buffer.writeString(nodeID);
@ -108,7 +108,7 @@ public class ClusterTopologyChangeMessage_V2 extends ClusterTopologyChangeMessag
}
@Override
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
exit = buffer.readBoolean();
nodeID = buffer.readString();

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.Pair;
import org.apache.activemq.api.core.TransportConfiguration;
@ -54,14 +54,14 @@ public class ClusterTopologyChangeMessage_V3 extends ClusterTopologyChangeMessag
}
@Override
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
super.encodeRest(buffer);
buffer.writeNullableString(scaleDownGroupName);
}
@Override
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
super.decodeRest(buffer);
scaleDownGroupName = buffer.readNullableString();

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.core.protocol.core.impl.PacketImpl;
@ -128,7 +128,7 @@ public class CreateQueueMessage extends PacketImpl
}
@Override
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
buffer.writeSimpleString(address);
buffer.writeSimpleString(queueName);
@ -139,7 +139,7 @@ public class CreateQueueMessage extends PacketImpl
}
@Override
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
address = buffer.readSimpleString();
queueName = buffer.readSimpleString();

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.core.protocol.core.impl.PacketImpl;
/**
@ -149,7 +149,7 @@ public class CreateSessionMessage extends PacketImpl
}
@Override
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
buffer.writeString(name);
buffer.writeLong(sessionChannelID);
@ -166,7 +166,7 @@ public class CreateSessionMessage extends PacketImpl
}
@Override
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
name = buffer.readString();
sessionChannelID = buffer.readLong();

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.core.protocol.core.impl.PacketImpl;
/**
@ -48,13 +48,13 @@ public class CreateSessionResponseMessage extends PacketImpl
}
@Override
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
buffer.writeInt(serverVersion);
}
@Override
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
serverVersion = buffer.readInt();
}

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.core.protocol.core.impl.PacketImpl;
@ -108,7 +108,7 @@ public class CreateSharedQueueMessage extends PacketImpl
}
@Override
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
buffer.writeSimpleString(address);
buffer.writeSimpleString(queueName);
@ -118,7 +118,7 @@ public class CreateSharedQueueMessage extends PacketImpl
}
@Override
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
address = buffer.readSimpleString();
queueName = buffer.readSimpleString();

View File

@ -13,7 +13,7 @@
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.core.protocol.core.impl.PacketImpl;
public class DisconnectConsumerMessage extends PacketImpl
@ -32,13 +32,13 @@ public class DisconnectConsumerMessage extends PacketImpl
}
@Override
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
buffer.writeLong(consumerId);
}
@Override
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
consumerId = buffer.readLong();
}

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.SimpleString;
import org.apache.activemq.core.protocol.core.impl.PacketImpl;
@ -53,13 +53,13 @@ public class DisconnectMessage extends PacketImpl
}
@Override
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
buffer.writeNullableSimpleString(nodeID);
}
@Override
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
nodeID = buffer.readNullableSimpleString();
}

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.SimpleString;
public class DisconnectMessage_V2 extends DisconnectMessage
@ -41,14 +41,14 @@ public class DisconnectMessage_V2 extends DisconnectMessage
}
@Override
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
super.encodeRest(buffer);
buffer.writeNullableSimpleString(scaleDownNodeID);
}
@Override
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
super.decodeRest(buffer);
scaleDownNodeID = buffer.readNullableSimpleString();

View File

@ -12,9 +12,9 @@
*/
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.HornetQException;
import org.apache.activemq.api.core.HornetQExceptionType;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.api.core.ActiveMQException;
import org.apache.activemq.api.core.ActiveMQExceptionType;
import org.apache.activemq.core.protocol.core.impl.PacketImpl;
/**
@ -24,13 +24,13 @@ import org.apache.activemq.core.protocol.core.impl.PacketImpl;
public class HornetQExceptionMessage extends PacketImpl
{
private HornetQException exception;
private ActiveMQException exception;
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
public HornetQExceptionMessage(final HornetQException exception)
public HornetQExceptionMessage(final ActiveMQException exception)
{
super(EXCEPTION);
@ -50,25 +50,25 @@ public class HornetQExceptionMessage extends PacketImpl
return true;
}
public HornetQException getException()
public ActiveMQException getException()
{
return exception;
}
@Override
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
buffer.writeInt(exception.getType().getCode());
buffer.writeNullableString(exception.getMessage());
}
@Override
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
int code = buffer.readInt();
String msg = buffer.readNullableString();
exception = HornetQExceptionType.createException(code, msg);
exception = ActiveMQExceptionType.createException(code, msg);
}
@Override

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.core.protocol.core.impl.PacketImpl;
/**
@ -47,13 +47,13 @@ public class PacketsConfirmedMessage extends PacketImpl
}
@Override
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
buffer.writeInt(commandID);
}
@Override
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
commandID = buffer.readInt();
}

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.core.protocol.core.impl.PacketImpl;
/**
@ -43,13 +43,13 @@ public final class Ping extends PacketImpl
}
@Override
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
buffer.writeLong(connectionTTL);
}
@Override
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
connectionTTL = buffer.readLong();
}

View File

@ -12,7 +12,7 @@
*/
package org.apache.activemq.core.protocol.core.impl.wireformat;
import org.apache.activemq.api.core.HornetQBuffer;
import org.apache.activemq.api.core.ActiveMQBuffer;
import org.apache.activemq.core.protocol.core.impl.PacketImpl;
/**
@ -53,14 +53,14 @@ public class ReattachSessionMessage extends PacketImpl
}
@Override
public void encodeRest(final HornetQBuffer buffer)
public void encodeRest(final ActiveMQBuffer buffer)
{
buffer.writeString(name);
buffer.writeInt(lastConfirmedCommandID);
}
@Override
public void decodeRest(final HornetQBuffer buffer)
public void decodeRest(final ActiveMQBuffer buffer)
{
name = buffer.readString();
lastConfirmedCommandID = buffer.readInt();

Some files were not shown because too many files have changed in this diff Show More