This closes #340

This commit is contained in:
Clebert Suconic 2016-01-25 13:48:22 -05:00
commit 27c59583f6
27 changed files with 169 additions and 27 deletions

View File

@ -121,7 +121,7 @@ public class URISupport {
public static Map<String, String> parseQuery(String uri) throws URISyntaxException { public static Map<String, String> parseQuery(String uri) throws URISyntaxException {
try { try {
uri = uri.substring(uri.lastIndexOf("?") + 1); // get only the relevant part of the query uri = uri.substring(uri.lastIndexOf("?") + 1); // get only the relevant part of the query
Map<String, String> rc = new HashMap<String, String>(); Map<String, String> rc = new HashMap<>();
if (uri != null && !uri.isEmpty()) { if (uri != null && !uri.isEmpty()) {
parseParameters(rc, uri.split("&")); parseParameters(rc, uri.split("&"));
parseParameters(rc, uri.split(";")); parseParameters(rc, uri.split(";"));
@ -164,7 +164,7 @@ public class URISupport {
} }
else { else {
CompositeData data = URISupport.parseComposite(uri); CompositeData data = URISupport.parseComposite(uri);
Map<String, String> parameters = new HashMap<String, String>(); Map<String, String> parameters = new HashMap<>();
parameters.putAll(data.getParameters()); parameters.putAll(data.getParameters());
if (parameters.isEmpty()) { if (parameters.isEmpty()) {
parameters = emptyMap(); parameters = emptyMap();
@ -402,7 +402,7 @@ public class URISupport {
* @return an array containing each inner URI from the composite one. * @return an array containing each inner URI from the composite one.
*/ */
private static String[] splitComponents(String str) { private static String[] splitComponents(String str) {
List<String> l = new ArrayList<String>(); List<String> l = new ArrayList<>();
int last = 0; int last = 0;
int depth = 0; int depth = 0;

View File

@ -304,7 +304,7 @@ public class JMSQueueControlImpl extends StandardMBean implements JMSQueueContro
@Override @Override
public String sendTextMessageWithProperties(String properties) throws Exception { public String sendTextMessageWithProperties(String properties) throws Exception {
String[] kvs = properties.split(","); String[] kvs = properties.split(",");
Map<String, String> props = new HashMap<String, String>(); Map<String, String> props = new HashMap<>();
for (String kv : kvs) { for (String kv : kvs) {
String[] it = kv.split("="); String[] it = kv.split("=");
if (it.length == 2) { if (it.length == 2) {

View File

@ -52,10 +52,11 @@ public final class JMSOpenTypeSupport {
public abstract static class AbstractOpenTypeFactory implements OpenTypeFactory { public abstract static class AbstractOpenTypeFactory implements OpenTypeFactory {
private CompositeType compositeType; private CompositeType compositeType;
private final List<String> itemNamesList = new ArrayList<String>(); private final List<String> itemNamesList = new ArrayList<>();
private final List<String> itemDescriptionsList = new ArrayList<String>(); private final List<String> itemDescriptionsList = new ArrayList<>();
private final List<OpenType> itemTypesList = new ArrayList<OpenType>(); private final List<OpenType> itemTypesList = new ArrayList<>();
@Override
public CompositeType getCompositeType() throws OpenDataException { public CompositeType getCompositeType() throws OpenDataException {
if (compositeType == null) { if (compositeType == null) {
init(); init();
@ -86,8 +87,9 @@ public final class JMSOpenTypeSupport {
return getTypeName(); return getTypeName();
} }
@Override
public Map<String, Object> getFields(CompositeDataSupport data) throws OpenDataException { public Map<String, Object> getFields(CompositeDataSupport data) throws OpenDataException {
Map<String, Object> rc = new HashMap<String, Object>(); Map<String, Object> rc = new HashMap<>();
return rc; return rc;
} }
} }

View File

@ -25,9 +25,9 @@ public class PreparedTransactionInfo {
private final byte[] extraData; private final byte[] extraData;
private final List<RecordInfo> records = new ArrayList<RecordInfo>(); private final List<RecordInfo> records = new ArrayList<>();
private final List<RecordInfo> recordsToDelete = new ArrayList<RecordInfo>(); private final List<RecordInfo> recordsToDelete = new ArrayList<>();
public PreparedTransactionInfo(final long id, final byte[] extraData) { public PreparedTransactionInfo(final long id, final byte[] extraData) {
this.id = id; this.id = id;

View File

@ -495,6 +495,7 @@ public class ConfigurationImpl implements Configuration, Serializable {
return this; return this;
} }
@Override
public ClusterConnectionConfiguration addClusterConfiguration(String name, String uri) throws Exception { public ClusterConnectionConfiguration addClusterConfiguration(String name, String uri) throws Exception {
ClusterConnectionConfiguration newConfig = new ClusterConnectionConfiguration(new URI(uri)).setName(name); ClusterConnectionConfiguration newConfig = new ClusterConnectionConfiguration(new URI(uri)).setName(name);
clusterConfigurations.add(newConfig); clusterConfigurations.add(newConfig);
@ -1289,10 +1290,12 @@ public class ConfigurationImpl implements Configuration, Serializable {
return this; return this;
} }
@Override
public TransportConfiguration[] getTransportConfigurations(String... connectorNames) { public TransportConfiguration[] getTransportConfigurations(String... connectorNames) {
return getTransportConfigurations(Arrays.asList(connectorNames)); return getTransportConfigurations(Arrays.asList(connectorNames));
} }
@Override
public TransportConfiguration[] getTransportConfigurations(final List<String> connectorNames) { public TransportConfiguration[] getTransportConfigurations(final List<String> connectorNames) {
TransportConfiguration[] tcConfigs = (TransportConfiguration[]) Array.newInstance(TransportConfiguration.class, connectorNames.size()); TransportConfiguration[] tcConfigs = (TransportConfiguration[]) Array.newInstance(TransportConfiguration.class, connectorNames.size());
int count = 0; int count = 0;

View File

@ -52,9 +52,9 @@ public final class OpenTypeSupport {
static class MessageOpenTypeFactory { static class MessageOpenTypeFactory {
private CompositeType compositeType; private CompositeType compositeType;
private final List<String> itemNamesList = new ArrayList<String>(); private final List<String> itemNamesList = new ArrayList<>();
private final List<String> itemDescriptionsList = new ArrayList<String>(); private final List<String> itemDescriptionsList = new ArrayList<>();
private final List<OpenType> itemTypesList = new ArrayList<OpenType>(); private final List<OpenType> itemTypesList = new ArrayList<>();
protected TabularType stringPropertyTabularType; protected TabularType stringPropertyTabularType;
protected TabularType booleanPropertyTabularType; protected TabularType booleanPropertyTabularType;
@ -239,7 +239,7 @@ public final class OpenTypeSupport {
} }
protected CompositeDataSupport createTabularRowValue(TabularType type, String key, Object value) throws OpenDataException { protected CompositeDataSupport createTabularRowValue(TabularType type, String key, Object value) throws OpenDataException {
Map<String, Object> fields = new HashMap<String, Object>(); Map<String, Object> fields = new HashMap<>();
fields.put("key", key); fields.put("key", key);
fields.put("value", value); fields.put("value", value);
return new CompositeDataSupport(type.getRowType(), fields); return new CompositeDataSupport(type.getRowType(), fields);

View File

@ -263,10 +263,12 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
return getContext().waitCompletion(timeout); return getContext().waitCompletion(timeout);
} }
@Override
public OperationContext getContext() { public OperationContext getContext() {
return OperationContextImpl.getContext(executorFactory); return OperationContextImpl.getContext(executorFactory);
} }
@Override
public void setContext(final OperationContext context) { public void setContext(final OperationContext context) {
OperationContextImpl.setContext(context); OperationContextImpl.setContext(context);
} }
@ -275,22 +277,27 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
return singleThreadExecutor; return singleThreadExecutor;
} }
@Override
public OperationContext newSingleThreadContext() { public OperationContext newSingleThreadContext() {
return newContext(singleThreadExecutor); return newContext(singleThreadExecutor);
} }
@Override
public OperationContext newContext(final Executor executor1) { public OperationContext newContext(final Executor executor1) {
return new OperationContextImpl(executor1); return new OperationContextImpl(executor1);
} }
@Override
public void afterCompleteOperations(final IOCallback run) { public void afterCompleteOperations(final IOCallback run) {
getContext().executeOnCompletion(run); getContext().executeOnCompletion(run);
} }
@Override
public long generateID() { public long generateID() {
return idGenerator.generateID(); return idGenerator.generateID();
} }
@Override
public long getCurrentID() { public long getCurrentID() {
return idGenerator.getCurrentID(); return idGenerator.getCurrentID();
} }
@ -298,6 +305,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
// Non transactional operations // Non transactional operations
@Override
public void confirmPendingLargeMessageTX(final Transaction tx, long messageID, long recordID) throws Exception { public void confirmPendingLargeMessageTX(final Transaction tx, long messageID, long recordID) throws Exception {
readLock(); readLock();
try { try {
@ -312,6 +320,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
/** /**
* We don't need messageID now but we are likely to need it we ever decide to support a database * We don't need messageID now but we are likely to need it we ever decide to support a database
*/ */
@Override
public void confirmPendingLargeMessage(long recordID) throws Exception { public void confirmPendingLargeMessage(long recordID) throws Exception {
readLock(); readLock();
try { try {
@ -322,6 +331,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void storeMessage(final ServerMessage message) throws Exception { public void storeMessage(final ServerMessage message) throws Exception {
if (message.getMessageID() <= 0) { if (message.getMessageID() <= 0) {
// Sanity check only... this shouldn't happen unless there is a bug // Sanity check only... this shouldn't happen unless there is a bug
@ -345,6 +355,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void storeReference(final long queueID, final long messageID, final boolean last) throws Exception { public void storeReference(final long queueID, final long messageID, final boolean last) throws Exception {
readLock(); readLock();
try { try {
@ -365,6 +376,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
storageManagerLock.readLock().unlock(); storageManagerLock.readLock().unlock();
} }
@Override
public void storeAcknowledge(final long queueID, final long messageID) throws Exception { public void storeAcknowledge(final long queueID, final long messageID) throws Exception {
readLock(); readLock();
try { try {
@ -375,6 +387,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void storeCursorAcknowledge(long queueID, PagePosition position) throws Exception { public void storeCursorAcknowledge(long queueID, PagePosition position) throws Exception {
readLock(); readLock();
try { try {
@ -387,6 +400,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void deleteMessage(final long messageID) throws Exception { public void deleteMessage(final long messageID) throws Exception {
readLock(); readLock();
try { try {
@ -401,6 +415,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void updateScheduledDeliveryTime(final MessageReference ref) throws Exception { public void updateScheduledDeliveryTime(final MessageReference ref) throws Exception {
ScheduledDeliveryEncoding encoding = new ScheduledDeliveryEncoding(ref.getScheduledDeliveryTime(), ref.getQueue().getID()); ScheduledDeliveryEncoding encoding = new ScheduledDeliveryEncoding(ref.getScheduledDeliveryTime(), ref.getQueue().getID());
readLock(); readLock();
@ -412,6 +427,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void storeDuplicateID(final SimpleString address, final byte[] duplID, final long recordID) throws Exception { public void storeDuplicateID(final SimpleString address, final byte[] duplID, final long recordID) throws Exception {
readLock(); readLock();
try { try {
@ -424,6 +440,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void deleteDuplicateID(final long recordID) throws Exception { public void deleteDuplicateID(final long recordID) throws Exception {
readLock(); readLock();
try { try {
@ -436,6 +453,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
// Transactional operations // Transactional operations
@Override
public void storeMessageTransactional(final long txID, final ServerMessage message) throws Exception { public void storeMessageTransactional(final long txID, final ServerMessage message) throws Exception {
if (message.getMessageID() <= 0) { if (message.getMessageID() <= 0) {
throw ActiveMQMessageBundle.BUNDLE.messageIdNotAssigned(); throw ActiveMQMessageBundle.BUNDLE.messageIdNotAssigned();
@ -456,6 +474,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void storePageTransaction(final long txID, final PageTransactionInfo pageTransaction) throws Exception { public void storePageTransaction(final long txID, final PageTransactionInfo pageTransaction) throws Exception {
readLock(); readLock();
try { try {
@ -467,6 +486,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void updatePageTransaction(final long txID, public void updatePageTransaction(final long txID,
final PageTransactionInfo pageTransaction, final PageTransactionInfo pageTransaction,
final int depages) throws Exception { final int depages) throws Exception {
@ -479,6 +499,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void updatePageTransaction(final PageTransactionInfo pageTransaction, final int depages) throws Exception { public void updatePageTransaction(final PageTransactionInfo pageTransaction, final int depages) throws Exception {
readLock(); readLock();
try { try {
@ -489,6 +510,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void storeReferenceTransactional(final long txID, final long queueID, final long messageID) throws Exception { public void storeReferenceTransactional(final long txID, final long queueID, final long messageID) throws Exception {
readLock(); readLock();
try { try {
@ -499,6 +521,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void storeAcknowledgeTransactional(final long txID, public void storeAcknowledgeTransactional(final long txID,
final long queueID, final long queueID,
final long messageID) throws Exception { final long messageID) throws Exception {
@ -511,6 +534,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void storeCursorAcknowledgeTransactional(long txID, long queueID, PagePosition position) throws Exception { public void storeCursorAcknowledgeTransactional(long txID, long queueID, PagePosition position) throws Exception {
readLock(); readLock();
try { try {
@ -523,16 +547,19 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void storePageCompleteTransactional(long txID, long queueID, PagePosition position) throws Exception { public void storePageCompleteTransactional(long txID, long queueID, PagePosition position) throws Exception {
long recordID = idGenerator.generateID(); long recordID = idGenerator.generateID();
position.setRecordID(recordID); position.setRecordID(recordID);
messageJournal.appendAddRecordTransactional(txID, recordID, JournalRecordIds.PAGE_CURSOR_COMPLETE, new CursorAckRecordEncoding(queueID, position)); messageJournal.appendAddRecordTransactional(txID, recordID, JournalRecordIds.PAGE_CURSOR_COMPLETE, new CursorAckRecordEncoding(queueID, position));
} }
@Override
public void deletePageComplete(long ackID) throws Exception { public void deletePageComplete(long ackID) throws Exception {
messageJournal.appendDeleteRecord(ackID, false); messageJournal.appendDeleteRecord(ackID, false);
} }
@Override
public void deleteCursorAcknowledgeTransactional(long txID, long ackID) throws Exception { public void deleteCursorAcknowledgeTransactional(long txID, long ackID) throws Exception {
readLock(); readLock();
try { try {
@ -543,10 +570,12 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void deleteCursorAcknowledge(long ackID) throws Exception { public void deleteCursorAcknowledge(long ackID) throws Exception {
messageJournal.appendDeleteRecord(ackID, false); messageJournal.appendDeleteRecord(ackID, false);
} }
@Override
public long storeHeuristicCompletion(final Xid xid, final boolean isCommit) throws Exception { public long storeHeuristicCompletion(final Xid xid, final boolean isCommit) throws Exception {
readLock(); readLock();
try { try {
@ -560,6 +589,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void deleteHeuristicCompletion(final long id) throws Exception { public void deleteHeuristicCompletion(final long id) throws Exception {
readLock(); readLock();
try { try {
@ -571,6 +601,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void deletePageTransactional(final long recordID) throws Exception { public void deletePageTransactional(final long recordID) throws Exception {
readLock(); readLock();
try { try {
@ -581,6 +612,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void updateScheduledDeliveryTimeTransactional(final long txID, final MessageReference ref) throws Exception { public void updateScheduledDeliveryTimeTransactional(final long txID, final MessageReference ref) throws Exception {
ScheduledDeliveryEncoding encoding = new ScheduledDeliveryEncoding(ref.getScheduledDeliveryTime(), ref.getQueue().getID()); ScheduledDeliveryEncoding encoding = new ScheduledDeliveryEncoding(ref.getScheduledDeliveryTime(), ref.getQueue().getID());
readLock(); readLock();
@ -593,6 +625,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void prepare(final long txID, final Xid xid) throws Exception { public void prepare(final long txID, final Xid xid) throws Exception {
readLock(); readLock();
try { try {
@ -603,19 +636,23 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void commit(final long txID) throws Exception { public void commit(final long txID) throws Exception {
commit(txID, true); commit(txID, true);
} }
@Override
public void commitBindings(final long txID) throws Exception { public void commitBindings(final long txID) throws Exception {
bindingsJournal.appendCommitRecord(txID, true); bindingsJournal.appendCommitRecord(txID, true);
} }
@Override
public void rollbackBindings(final long txID) throws Exception { public void rollbackBindings(final long txID) throws Exception {
// no need to sync, it's going away anyways // no need to sync, it's going away anyways
bindingsJournal.appendRollbackRecord(txID, false); bindingsJournal.appendRollbackRecord(txID, false);
} }
@Override
public void commit(final long txID, final boolean lineUpContext) throws Exception { public void commit(final long txID, final boolean lineUpContext) throws Exception {
readLock(); readLock();
try { try {
@ -636,6 +673,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void rollback(final long txID) throws Exception { public void rollback(final long txID) throws Exception {
readLock(); readLock();
try { try {
@ -646,6 +684,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void storeDuplicateIDTransactional(final long txID, public void storeDuplicateIDTransactional(final long txID,
final SimpleString address, final SimpleString address,
final byte[] duplID, final byte[] duplID,
@ -661,6 +700,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void updateDuplicateIDTransactional(final long txID, public void updateDuplicateIDTransactional(final long txID,
final SimpleString address, final SimpleString address,
final byte[] duplID, final byte[] duplID,
@ -676,6 +716,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void deleteDuplicateIDTransactional(final long txID, final long recordID) throws Exception { public void deleteDuplicateIDTransactional(final long txID, final long recordID) throws Exception {
readLock(); readLock();
try { try {
@ -688,6 +729,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
// Other operations // Other operations
@Override
public void updateDeliveryCount(final MessageReference ref) throws Exception { public void updateDeliveryCount(final MessageReference ref) throws Exception {
// no need to store if it's the same value // no need to store if it's the same value
// otherwise the journal will get OME in case of lots of redeliveries // otherwise the journal will get OME in case of lots of redeliveries
@ -707,6 +749,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void storeAddressSetting(PersistedAddressSetting addressSetting) throws Exception { public void storeAddressSetting(PersistedAddressSetting addressSetting) throws Exception {
deleteAddressSetting(addressSetting.getAddressMatch()); deleteAddressSetting(addressSetting.getAddressMatch());
readLock(); readLock();
@ -721,14 +764,17 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public List<PersistedAddressSetting> recoverAddressSettings() throws Exception { public List<PersistedAddressSetting> recoverAddressSettings() throws Exception {
return new ArrayList<>(mapPersistedAddressSettings.values()); return new ArrayList<>(mapPersistedAddressSettings.values());
} }
@Override
public List<PersistedRoles> recoverPersistedRoles() throws Exception { public List<PersistedRoles> recoverPersistedRoles() throws Exception {
return new ArrayList<>(mapPersistedRoles.values()); return new ArrayList<>(mapPersistedRoles.values());
} }
@Override
public void storeSecurityRoles(PersistedRoles persistedRoles) throws Exception { public void storeSecurityRoles(PersistedRoles persistedRoles) throws Exception {
deleteSecurityRoles(persistedRoles.getAddressMatch()); deleteSecurityRoles(persistedRoles.getAddressMatch());
@ -766,6 +812,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void deleteAddressSetting(SimpleString addressMatch) throws Exception { public void deleteAddressSetting(SimpleString addressMatch) throws Exception {
PersistedAddressSetting oldSetting = mapPersistedAddressSettings.remove(addressMatch); PersistedAddressSetting oldSetting = mapPersistedAddressSettings.remove(addressMatch);
if (oldSetting != null) { if (oldSetting != null) {
@ -779,6 +826,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void deleteSecurityRoles(SimpleString addressMatch) throws Exception { public void deleteSecurityRoles(SimpleString addressMatch) throws Exception {
PersistedRoles oldRoles = mapPersistedRoles.remove(addressMatch); PersistedRoles oldRoles = mapPersistedRoles.remove(addressMatch);
if (oldRoles != null) { if (oldRoles != null) {
@ -1174,6 +1222,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
// grouping handler operations // grouping handler operations
@Override
public void addGrouping(final GroupBinding groupBinding) throws Exception { public void addGrouping(final GroupBinding groupBinding) throws Exception {
GroupingEncoding groupingEncoding = new GroupingEncoding(groupBinding.getId(), groupBinding.getGroupId(), groupBinding.getClusterName()); GroupingEncoding groupingEncoding = new GroupingEncoding(groupBinding.getId(), groupBinding.getGroupId(), groupBinding.getClusterName());
readLock(); readLock();
@ -1185,6 +1234,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void deleteGrouping(long tx, final GroupBinding groupBinding) throws Exception { public void deleteGrouping(long tx, final GroupBinding groupBinding) throws Exception {
readLock(); readLock();
try { try {
@ -1197,6 +1247,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
// BindingsImpl operations // BindingsImpl operations
@Override
public void addQueueBinding(final long tx, final Binding binding) throws Exception { public void addQueueBinding(final long tx, final Binding binding) throws Exception {
Queue queue = (Queue) binding.getBindable(); Queue queue = (Queue) binding.getBindable();
@ -1215,6 +1266,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void deleteQueueBinding(long tx, final long queueBindingID) throws Exception { public void deleteQueueBinding(long tx, final long queueBindingID) throws Exception {
readLock(); readLock();
try { try {
@ -1225,6 +1277,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public long storePageCounterInc(long txID, long queueID, int value) throws Exception { public long storePageCounterInc(long txID, long queueID, int value) throws Exception {
readLock(); readLock();
try { try {
@ -1237,6 +1290,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public long storePageCounterInc(long queueID, int value) throws Exception { public long storePageCounterInc(long queueID, int value) throws Exception {
readLock(); readLock();
try { try {
@ -1278,6 +1332,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void deleteIncrementRecord(long txID, long recordID) throws Exception { public void deleteIncrementRecord(long txID, long recordID) throws Exception {
readLock(); readLock();
try { try {
@ -1288,6 +1343,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void deletePageCounter(long txID, long recordID) throws Exception { public void deletePageCounter(long txID, long recordID) throws Exception {
readLock(); readLock();
try { try {
@ -1298,6 +1354,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void deletePendingPageCounter(long txID, long recordID) throws Exception { public void deletePendingPageCounter(long txID, long recordID) throws Exception {
readLock(); readLock();
try { try {
@ -1308,11 +1365,12 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public JournalLoadInformation loadBindingJournal(final List<QueueBindingInfo> queueBindingInfos, public JournalLoadInformation loadBindingJournal(final List<QueueBindingInfo> queueBindingInfos,
final List<GroupingInfo> groupingInfos) throws Exception { final List<GroupingInfo> groupingInfos) throws Exception {
List<RecordInfo> records = new ArrayList<RecordInfo>(); List<RecordInfo> records = new ArrayList<>();
List<PreparedTransactionInfo> preparedTransactions = new ArrayList<PreparedTransactionInfo>(); List<PreparedTransactionInfo> preparedTransactions = new ArrayList<>();
JournalLoadInformation bindingsInfo = bindingsJournal.load(records, preparedTransactions, null); JournalLoadInformation bindingsInfo = bindingsJournal.load(records, preparedTransactions, null);
@ -1354,6 +1412,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
return bindingsInfo; return bindingsInfo;
} }
@Override
public void lineUpContext() { public void lineUpContext() {
readLock(); readLock();
try { try {
@ -1369,6 +1428,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
protected abstract void beforeStart() throws Exception; protected abstract void beforeStart() throws Exception;
@Override
public synchronized void start() throws Exception { public synchronized void start() throws Exception {
if (started) { if (started) {
return; return;
@ -1390,6 +1450,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
started = true; started = true;
} }
@Override
public void stop() throws Exception { public void stop() throws Exception {
stop(false); stop(false);
} }
@ -1407,6 +1468,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
*/ */
protected abstract void performCachedLargeMessageDeletes(); protected abstract void performCachedLargeMessageDeletes();
@Override
public synchronized void stop(boolean ioCriticalError) throws Exception { public synchronized void stop(boolean ioCriticalError) throws Exception {
if (!started) { if (!started) {
return; return;
@ -1444,6 +1506,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
protected abstract void beforeStop() throws Exception; protected abstract void beforeStop() throws Exception;
@Override
public synchronized boolean isStarted() { public synchronized boolean isStarted() {
return started; return started;
} }
@ -1465,12 +1528,14 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
} }
} }
@Override
public void beforePageRead() throws Exception { public void beforePageRead() throws Exception {
if (pageMaxConcurrentIO != null) { if (pageMaxConcurrentIO != null) {
pageMaxConcurrentIO.acquire(); pageMaxConcurrentIO.acquire();
} }
} }
@Override
public void afterPageRead() throws Exception { public void afterPageRead() throws Exception {
if (pageMaxConcurrentIO != null) { if (pageMaxConcurrentIO != null) {
pageMaxConcurrentIO.release(); pageMaxConcurrentIO.release();
@ -1479,10 +1544,12 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
// Public ----------------------------------------------------------------------------------- // Public -----------------------------------------------------------------------------------
@Override
public Journal getMessageJournal() { public Journal getMessageJournal() {
return messageJournal; return messageJournal;
} }
@Override
public Journal getBindingsJournal() { public Journal getBindingsJournal() {
return bindingsJournal; return bindingsJournal;
} }
@ -1521,9 +1588,9 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
Transaction tx = new TransactionImpl(preparedTransaction.getId(), xid, this); Transaction tx = new TransactionImpl(preparedTransaction.getId(), xid, this);
List<MessageReference> referencesToAck = new ArrayList<MessageReference>(); List<MessageReference> referencesToAck = new ArrayList<>();
Map<Long, ServerMessage> messages = new HashMap<Long, ServerMessage>(); Map<Long, ServerMessage> messages = new HashMap<>();
// Use same method as load message journal to prune out acks, so they don't get added. // Use same method as load message journal to prune out acks, so they don't get added.
// Then have reacknowledge(tx) methods on queue, which needs to add the page size // Then have reacknowledge(tx) methods on queue, which needs to add the page size
@ -1677,7 +1744,7 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
switch (b) { switch (b) {
case ADD_LARGE_MESSAGE_PENDING: { case ADD_LARGE_MESSAGE_PENDING: {
long messageID = buff.readLong(); long messageID = buff.readLong();
if (!pendingLargeMessages.remove(new Pair<Long, Long>(recordDeleted.id, messageID))) { if (!pendingLargeMessages.remove(new Pair<>(recordDeleted.id, messageID))) {
ActiveMQServerLogger.LOGGER.largeMessageNotFound(recordDeleted.id); ActiveMQServerLogger.LOGGER.largeMessageNotFound(recordDeleted.id);
} }
installLargeMessageConfirmationOnTX(tx, recordDeleted.id); installLargeMessageConfirmationOnTX(tx, recordDeleted.id);
@ -1714,37 +1781,47 @@ public abstract class AbstractJournalStorageManager implements StorageManager {
return DummyOperationContext.instance; return DummyOperationContext.instance;
} }
@Override
public void executeOnCompletion(final IOCallback runnable) { public void executeOnCompletion(final IOCallback runnable) {
// There are no executeOnCompletion calls while using the DummyOperationContext // There are no executeOnCompletion calls while using the DummyOperationContext
// However we keep the code here for correctness // However we keep the code here for correctness
runnable.done(); runnable.done();
} }
@Override
public void replicationDone() { public void replicationDone() {
} }
@Override
public void replicationLineUp() { public void replicationLineUp() {
} }
@Override
public void storeLineUp() { public void storeLineUp() {
} }
@Override
public void done() { public void done() {
} }
@Override
public void onError(final int errorCode, final String errorMessage) { public void onError(final int errorCode, final String errorMessage) {
} }
@Override
public void waitCompletion() { public void waitCompletion() {
} }
@Override
public boolean waitCompletion(final long timeout) { public boolean waitCompletion(final long timeout) {
return true; return true;
} }
@Override
public void pageSyncLineUp() { public void pageSyncLineUp() {
} }
@Override
public void pageSyncDone() { public void pageSyncDone() {
} }
} }

View File

@ -564,7 +564,7 @@ public final class DescribeJournal {
} }
case QUEUE_BINDING_RECORD: case QUEUE_BINDING_RECORD:
return JournalStorageManager.newBindingEncoding(id, buffer); return AbstractJournalStorageManager.newBindingEncoding(id, buffer);
case ID_COUNTER_RECORD: case ID_COUNTER_RECORD:
EncodingSupport idReturn = new IDCounterEncoding(); EncodingSupport idReturn = new IDCounterEncoding();
@ -573,13 +573,13 @@ public final class DescribeJournal {
return idReturn; return idReturn;
case JournalRecordIds.GROUP_RECORD: case JournalRecordIds.GROUP_RECORD:
return JournalStorageManager.newGroupEncoding(id, buffer); return AbstractJournalStorageManager.newGroupEncoding(id, buffer);
case ADDRESS_SETTING_RECORD: case ADDRESS_SETTING_RECORD:
return JournalStorageManager.newAddressEncoding(id, buffer); return AbstractJournalStorageManager.newAddressEncoding(id, buffer);
case SECURITY_RECORD: case SECURITY_RECORD:
return JournalStorageManager.newSecurityRecord(id, buffer); return AbstractJournalStorageManager.newSecurityRecord(id, buffer);
default: default:
return null; return null;

View File

@ -27,37 +27,47 @@ final class DummyOperationContext implements OperationContext {
return DummyOperationContext.instance; return DummyOperationContext.instance;
} }
@Override
public void executeOnCompletion(final IOCallback runnable) { public void executeOnCompletion(final IOCallback runnable) {
// There are no executeOnCompletion calls while using the DummyOperationContext // There are no executeOnCompletion calls while using the DummyOperationContext
// However we keep the code here for correctness // However we keep the code here for correctness
runnable.done(); runnable.done();
} }
@Override
public void replicationDone() { public void replicationDone() {
} }
@Override
public void replicationLineUp() { public void replicationLineUp() {
} }
@Override
public void storeLineUp() { public void storeLineUp() {
} }
@Override
public void done() { public void done() {
} }
@Override
public void onError(final int errorCode, final String errorMessage) { public void onError(final int errorCode, final String errorMessage) {
} }
@Override
public void waitCompletion() { public void waitCompletion() {
} }
@Override
public boolean waitCompletion(final long timeout) { public boolean waitCompletion(final long timeout) {
return true; return true;
} }
@Override
public void pageSyncLineUp() { public void pageSyncLineUp() {
} }
@Override
public void pageSyncDone() { public void pageSyncDone() {
} }
} }

View File

@ -41,6 +41,7 @@ public class LargeMessageTXFailureCallback implements TransactionFailureCallback
this.messages = messages; this.messages = messages;
} }
@Override
public void failedTransaction(final long transactionID, public void failedTransaction(final long transactionID,
final List<RecordInfo> records, final List<RecordInfo> records,
final List<RecordInfo> recordsToDelete) { final List<RecordInfo> recordsToDelete) {

View File

@ -26,7 +26,7 @@ import org.apache.activemq.artemis.core.transaction.TransactionOperationAbstract
public final class TXLargeMessageConfirmationOperation extends TransactionOperationAbstract { public final class TXLargeMessageConfirmationOperation extends TransactionOperationAbstract {
private AbstractJournalStorageManager journalStorageManager; private AbstractJournalStorageManager journalStorageManager;
public List<Long> confirmedMessages = new LinkedList<Long>(); public List<Long> confirmedMessages = new LinkedList<>();
public TXLargeMessageConfirmationOperation(AbstractJournalStorageManager journalStorageManager) { public TXLargeMessageConfirmationOperation(AbstractJournalStorageManager journalStorageManager) {
this.journalStorageManager = journalStorageManager; this.journalStorageManager = journalStorageManager;

View File

@ -42,16 +42,19 @@ public class CursorAckRecordEncoding implements EncodingSupport {
public PagePosition position; public PagePosition position;
@Override
public int getEncodeSize() { public int getEncodeSize() {
return DataConstants.SIZE_LONG + DataConstants.SIZE_LONG + DataConstants.SIZE_INT; return DataConstants.SIZE_LONG + DataConstants.SIZE_LONG + DataConstants.SIZE_INT;
} }
@Override
public void encode(ActiveMQBuffer buffer) { public void encode(ActiveMQBuffer buffer) {
buffer.writeLong(queueID); buffer.writeLong(queueID);
buffer.writeLong(position.getPageNr()); buffer.writeLong(position.getPageNr());
buffer.writeInt(position.getMessageNr()); buffer.writeInt(position.getMessageNr());
} }
@Override
public void decode(ActiveMQBuffer buffer) { public void decode(ActiveMQBuffer buffer) {
queueID = buffer.readLong(); queueID = buffer.readLong();
long pageNR = buffer.readLong(); long pageNR = buffer.readLong();

View File

@ -35,16 +35,19 @@ public class DeliveryCountUpdateEncoding implements EncodingSupport {
this.count = count; this.count = count;
} }
@Override
public void decode(final ActiveMQBuffer buffer) { public void decode(final ActiveMQBuffer buffer) {
queueID = buffer.readLong(); queueID = buffer.readLong();
count = buffer.readInt(); count = buffer.readInt();
} }
@Override
public void encode(final ActiveMQBuffer buffer) { public void encode(final ActiveMQBuffer buffer) {
buffer.writeLong(queueID); buffer.writeLong(queueID);
buffer.writeInt(count); buffer.writeInt(count);
} }
@Override
public int getEncodeSize() { public int getEncodeSize() {
return 8 + 4; return 8 + 4;
} }

View File

@ -40,6 +40,7 @@ public class DuplicateIDEncoding implements EncodingSupport {
public DuplicateIDEncoding() { public DuplicateIDEncoding() {
} }
@Override
public void decode(final ActiveMQBuffer buffer) { public void decode(final ActiveMQBuffer buffer) {
address = buffer.readSimpleString(); address = buffer.readSimpleString();
@ -50,6 +51,7 @@ public class DuplicateIDEncoding implements EncodingSupport {
buffer.readBytes(duplID); buffer.readBytes(duplID);
} }
@Override
public void encode(final ActiveMQBuffer buffer) { public void encode(final ActiveMQBuffer buffer) {
buffer.writeSimpleString(address); buffer.writeSimpleString(address);
@ -58,6 +60,7 @@ public class DuplicateIDEncoding implements EncodingSupport {
buffer.writeBytes(duplID); buffer.writeBytes(duplID);
} }
@Override
public int getEncodeSize() { public int getEncodeSize() {
return SimpleString.sizeofString(address) + DataConstants.SIZE_INT + duplID.length; return SimpleString.sizeofString(address) + DataConstants.SIZE_INT + duplID.length;
} }

View File

@ -38,20 +38,24 @@ public class GroupingEncoding implements EncodingSupport, GroupingInfo {
public GroupingEncoding() { public GroupingEncoding() {
} }
@Override
public int getEncodeSize() { public int getEncodeSize() {
return SimpleString.sizeofString(groupId) + SimpleString.sizeofString(clusterName); return SimpleString.sizeofString(groupId) + SimpleString.sizeofString(clusterName);
} }
@Override
public void encode(final ActiveMQBuffer buffer) { public void encode(final ActiveMQBuffer buffer) {
buffer.writeSimpleString(groupId); buffer.writeSimpleString(groupId);
buffer.writeSimpleString(clusterName); buffer.writeSimpleString(clusterName);
} }
@Override
public void decode(final ActiveMQBuffer buffer) { public void decode(final ActiveMQBuffer buffer) {
groupId = buffer.readSimpleString(); groupId = buffer.readSimpleString();
clusterName = buffer.readSimpleString(); clusterName = buffer.readSimpleString();
} }
@Override
public long getId() { public long getId() {
return id; return id;
} }
@ -60,10 +64,12 @@ public class GroupingEncoding implements EncodingSupport, GroupingInfo {
this.id = id; this.id = id;
} }
@Override
public SimpleString getGroupId() { public SimpleString getGroupId() {
return groupId; return groupId;
} }
@Override
public SimpleString getClusterName() { public SimpleString getClusterName() {
return clusterName; return clusterName;
} }

View File

@ -42,16 +42,19 @@ public class HeuristicCompletionEncoding implements EncodingSupport {
public HeuristicCompletionEncoding() { public HeuristicCompletionEncoding() {
} }
@Override
public void decode(final ActiveMQBuffer buffer) { public void decode(final ActiveMQBuffer buffer) {
xid = XidCodecSupport.decodeXid(buffer); xid = XidCodecSupport.decodeXid(buffer);
isCommit = buffer.readBoolean(); isCommit = buffer.readBoolean();
} }
@Override
public void encode(final ActiveMQBuffer buffer) { public void encode(final ActiveMQBuffer buffer) {
XidCodecSupport.encodeXid(xid, buffer); XidCodecSupport.encodeXid(xid, buffer);
buffer.writeBoolean(isCommit); buffer.writeBoolean(isCommit);
} }
@Override
public int getEncodeSize() { public int getEncodeSize() {
return XidCodecSupport.getXidEncodeLength(xid) + DataConstants.SIZE_BOOLEAN; return XidCodecSupport.getXidEncodeLength(xid) + DataConstants.SIZE_BOOLEAN;
} }

View File

@ -31,6 +31,7 @@ public class LargeMessageEncoding implements EncodingSupport {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.apache.activemq.artemis.core.journal.EncodingSupport#decode(org.apache.activemq.artemis.spi.core.remoting.ActiveMQBuffer) * @see org.apache.activemq.artemis.core.journal.EncodingSupport#decode(org.apache.activemq.artemis.spi.core.remoting.ActiveMQBuffer)
*/ */
@Override
public void decode(final ActiveMQBuffer buffer) { public void decode(final ActiveMQBuffer buffer) {
message.decodeHeadersAndProperties(buffer); message.decodeHeadersAndProperties(buffer);
} }
@ -38,6 +39,7 @@ public class LargeMessageEncoding implements EncodingSupport {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.apache.activemq.artemis.core.journal.EncodingSupport#encode(org.apache.activemq.artemis.spi.core.remoting.ActiveMQBuffer) * @see org.apache.activemq.artemis.core.journal.EncodingSupport#encode(org.apache.activemq.artemis.spi.core.remoting.ActiveMQBuffer)
*/ */
@Override
public void encode(final ActiveMQBuffer buffer) { public void encode(final ActiveMQBuffer buffer) {
message.encode(buffer); message.encode(buffer);
} }
@ -45,6 +47,7 @@ public class LargeMessageEncoding implements EncodingSupport {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.apache.activemq.artemis.core.journal.EncodingSupport#getEncodeSize() * @see org.apache.activemq.artemis.core.journal.EncodingSupport#getEncodeSize()
*/ */
@Override
public int getEncodeSize() { public int getEncodeSize() {
return message.getEncodeSize(); return message.getEncodeSize();
} }

View File

@ -47,14 +47,17 @@ public class PageCountPendingImpl implements EncodingSupport, PageCountPending {
this.id = id; this.id = id;
} }
@Override
public long getID() { public long getID() {
return id; return id;
} }
@Override
public long getQueueID() { public long getQueueID() {
return queueID; return queueID;
} }
@Override
public long getPageID() { public long getPageID() {
return pageID; return pageID;
} }

View File

@ -47,15 +47,18 @@ public class PageCountRecordInc implements EncodingSupport {
return value; return value;
} }
@Override
public int getEncodeSize() { public int getEncodeSize() {
return DataConstants.SIZE_LONG + DataConstants.SIZE_INT; return DataConstants.SIZE_LONG + DataConstants.SIZE_INT;
} }
@Override
public void encode(ActiveMQBuffer buffer) { public void encode(ActiveMQBuffer buffer) {
buffer.writeLong(queueID); buffer.writeLong(queueID);
buffer.writeInt(value); buffer.writeInt(value);
} }
@Override
public void decode(ActiveMQBuffer buffer) { public void decode(ActiveMQBuffer buffer) {
queueID = buffer.readLong(); queueID = buffer.readLong();
value = buffer.readInt(); value = buffer.readInt();

View File

@ -42,6 +42,7 @@ public class PageUpdateTXEncoding implements EncodingSupport {
this.recods = records; this.recods = records;
} }
@Override
public void decode(ActiveMQBuffer buffer) { public void decode(ActiveMQBuffer buffer) {
this.pageTX = buffer.readLong(); this.pageTX = buffer.readLong();
this.recods = buffer.readInt(); this.recods = buffer.readInt();

View File

@ -34,6 +34,7 @@ public class PendingLargeMessageEncoding implements EncodingSupport {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.apache.activemq.artemis.core.journal.EncodingSupport#decode(org.apache.activemq.artemis.spi.core.remoting.ActiveMQBuffer) * @see org.apache.activemq.artemis.core.journal.EncodingSupport#decode(org.apache.activemq.artemis.spi.core.remoting.ActiveMQBuffer)
*/ */
@Override
public void decode(final ActiveMQBuffer buffer) { public void decode(final ActiveMQBuffer buffer) {
largeMessageID = buffer.readLong(); largeMessageID = buffer.readLong();
} }
@ -41,6 +42,7 @@ public class PendingLargeMessageEncoding implements EncodingSupport {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.apache.activemq.artemis.core.journal.EncodingSupport#encode(org.apache.activemq.artemis.spi.core.remoting.ActiveMQBuffer) * @see org.apache.activemq.artemis.core.journal.EncodingSupport#encode(org.apache.activemq.artemis.spi.core.remoting.ActiveMQBuffer)
*/ */
@Override
public void encode(final ActiveMQBuffer buffer) { public void encode(final ActiveMQBuffer buffer) {
buffer.writeLong(largeMessageID); buffer.writeLong(largeMessageID);
} }
@ -48,6 +50,7 @@ public class PendingLargeMessageEncoding implements EncodingSupport {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.apache.activemq.artemis.core.journal.EncodingSupport#getEncodeSize() * @see org.apache.activemq.artemis.core.journal.EncodingSupport#getEncodeSize()
*/ */
@Override
public int getEncodeSize() { public int getEncodeSize() {
return DataConstants.SIZE_LONG; return DataConstants.SIZE_LONG;
} }

View File

@ -67,6 +67,7 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin
this.autoCreated = autoCreated; this.autoCreated = autoCreated;
} }
@Override
public long getId() { public long getId() {
return id; return id;
} }
@ -75,30 +76,37 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin
this.id = id; this.id = id;
} }
@Override
public SimpleString getAddress() { public SimpleString getAddress() {
return address; return address;
} }
@Override
public void replaceQueueName(SimpleString newName) { public void replaceQueueName(SimpleString newName) {
this.name = newName; this.name = newName;
} }
@Override
public SimpleString getFilterString() { public SimpleString getFilterString() {
return filterString; return filterString;
} }
@Override
public SimpleString getQueueName() { public SimpleString getQueueName() {
return name; return name;
} }
@Override
public SimpleString getUser() { public SimpleString getUser() {
return user; return user;
} }
@Override
public boolean isAutoCreated() { public boolean isAutoCreated() {
return autoCreated; return autoCreated;
} }
@Override
public void decode(final ActiveMQBuffer buffer) { public void decode(final ActiveMQBuffer buffer) {
name = buffer.readSimpleString(); name = buffer.readSimpleString();
address = buffer.readSimpleString(); address = buffer.readSimpleString();
@ -120,6 +128,7 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin
autoCreated = buffer.readBoolean(); autoCreated = buffer.readBoolean();
} }
@Override
public void encode(final ActiveMQBuffer buffer) { public void encode(final ActiveMQBuffer buffer) {
buffer.writeSimpleString(name); buffer.writeSimpleString(name);
buffer.writeSimpleString(address); buffer.writeSimpleString(address);
@ -128,6 +137,7 @@ public class PersistentQueueBindingEncoding implements EncodingSupport, QueueBin
buffer.writeBoolean(autoCreated); buffer.writeBoolean(autoCreated);
} }
@Override
public int getEncodeSize() { public int getEncodeSize() {
return SimpleString.sizeofString(name) + SimpleString.sizeofString(address) + return SimpleString.sizeofString(name) + SimpleString.sizeofString(address) +
SimpleString.sizeofNullableString(filterString) + DataConstants.SIZE_BOOLEAN + SimpleString.sizeofNullableString(filterString) + DataConstants.SIZE_BOOLEAN +

View File

@ -32,14 +32,17 @@ public class QueueEncoding implements EncodingSupport {
super(); super();
} }
@Override
public void decode(final ActiveMQBuffer buffer) { public void decode(final ActiveMQBuffer buffer) {
queueID = buffer.readLong(); queueID = buffer.readLong();
} }
@Override
public void encode(final ActiveMQBuffer buffer) { public void encode(final ActiveMQBuffer buffer) {
buffer.writeLong(queueID); buffer.writeLong(queueID);
} }
@Override
public int getEncodeSize() { public int getEncodeSize() {
return 8; return 8;
} }

View File

@ -38,14 +38,17 @@ public class XidEncoding implements EncodingSupport {
xid = XidCodecSupport.decodeXid(ActiveMQBuffers.wrappedBuffer(data)); xid = XidCodecSupport.decodeXid(ActiveMQBuffers.wrappedBuffer(data));
} }
@Override
public void decode(final ActiveMQBuffer buffer) { public void decode(final ActiveMQBuffer buffer) {
throw new IllegalStateException("Non Supported Operation"); throw new IllegalStateException("Non Supported Operation");
} }
@Override
public void encode(final ActiveMQBuffer buffer) { public void encode(final ActiveMQBuffer buffer) {
XidCodecSupport.encodeXid(xid, buffer); XidCodecSupport.encodeXid(xid, buffer);
} }
@Override
public int getEncodeSize() { public int getEncodeSize() {
return XidCodecSupport.getXidEncodeLength(xid); return XidCodecSupport.getXidEncodeLength(xid);
} }

View File

@ -384,6 +384,7 @@ public class LegacyLDAPSecuritySettingPlugin implements SecuritySettingPlugin {
} }
} }
@Override
public SecuritySettingPlugin stop() { public SecuritySettingPlugin stop() {
try { try {
eventContext.close(); eventContext.close();

View File

@ -40,6 +40,7 @@ public class ThreadLeakCheckRule extends ExternalResource {
* *
* @throws if setup fails (which will disable {@code after} * @throws if setup fails (which will disable {@code after}
*/ */
@Override
protected void before() throws Throwable { protected void before() throws Throwable {
// do nothing // do nothing
@ -50,6 +51,7 @@ public class ThreadLeakCheckRule extends ExternalResource {
/** /**
* Override to tear down your specific external resource. * Override to tear down your specific external resource.
*/ */
@Override
protected void after() { protected void after() {
try { try {
if (enabled) { if (enabled) {

View File

@ -41,7 +41,6 @@ import org.apache.activemq.artemis.api.core.management.MessageCounterInfo;
import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder; import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
import org.apache.activemq.artemis.api.core.management.QueueControl; import org.apache.activemq.artemis.api.core.management.QueueControl;
import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.config.Configuration;
import org.apache.activemq.artemis.core.message.impl.MessageImpl;
import org.apache.activemq.artemis.core.messagecounter.impl.MessageCounterManagerImpl; import org.apache.activemq.artemis.core.messagecounter.impl.MessageCounterManagerImpl;
import org.apache.activemq.artemis.core.server.ActiveMQServer; import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.core.server.ActiveMQServers; import org.apache.activemq.artemis.core.server.ActiveMQServers;
@ -2030,7 +2029,7 @@ public class QueueControlTest extends ManagementTestBase {
QueueControl queueControl = createManagementControl(address, queue); QueueControl queueControl = createManagementControl(address, queue);
queueControl.sendMessage(new HashMap<String, String>(), MessageImpl.TEXT_TYPE, Base64.encodeBytes("theBody".getBytes()), "myID", true, "myUser", "myPassword"); queueControl.sendMessage(new HashMap<String, String>(), Message.TEXT_TYPE, Base64.encodeBytes("theBody".getBytes()), "myID", true, "myUser", "myPassword");
Assert.assertEquals(1, getMessageCount(queueControl)); Assert.assertEquals(1, getMessageCount(queueControl));
@ -2055,7 +2054,7 @@ public class QueueControlTest extends ManagementTestBase {
QueueControl queueControl = createManagementControl(address, queue); QueueControl queueControl = createManagementControl(address, queue);
queueControl.sendMessage(new HashMap<String, String>(), MessageImpl.TEXT_TYPE, null, "myID", true, "myUser", "myPassword"); queueControl.sendMessage(new HashMap<String, String>(), Message.TEXT_TYPE, null, "myID", true, "myUser", "myPassword");
Assert.assertEquals(1, getMessageCount(queueControl)); Assert.assertEquals(1, getMessageCount(queueControl));