ARTEMIS-104 missing i18n warns

This commit is contained in:
jbertram 2015-06-24 13:33:27 -05:00
parent 6babfee36a
commit bf9f6d213b
18 changed files with 96 additions and 29 deletions

View File

@ -405,7 +405,7 @@ public final class XmlDataImporter implements Action
File tempFile = new File(tempFileName);
if (!tempFile.delete())
{
ActiveMQServerLogger.LOGGER.warn("Could not delete: " + tempFileName);
ActiveMQServerLogger.LOGGER.couldNotDeleteTempFile(tempFileName);
}
tempFileName = "";
}

View File

@ -95,6 +95,12 @@ public interface ActiveMQJMSServerLogger extends BasicLogger
format = Message.Format.MESSAGE_FORMAT)
void failedToCorrectHost(@Cause Exception e, String name);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 122018,
value = "Failed to send notification: {0}",
format = Message.Format.MESSAGE_FORMAT)
void failedToSendNotification(String notification);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 124000, value = "key attribute missing for JMS configuration {0}" , format = Message.Format.MESSAGE_FORMAT)
void jmsConfigMissingKey(Node e);

View File

@ -1200,7 +1200,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
}
catch (Exception e)
{
ActiveMQJMSServerLogger.LOGGER.warn("Failed to send notification : " + notif);
ActiveMQJMSServerLogger.LOGGER.failedToSendNotification(notif.toString());
}
}

View File

@ -595,10 +595,7 @@ public class AMQSession implements SessionCallback
long now = System.currentTimeMillis();
if (now >= nextWarn)
{
ActiveMQServerLogger.LOGGER.warn("Memory Limit reached. Producer (" + producerId + ") stopped to prevent flooding "
+ result.getBlockingAddress()
+ " See http://activemq.apache.org/producer-flow-control.html for more info"
+ " (blocking for " + ((now - start) / 1000) + "s");
ActiveMQServerLogger.LOGGER.memoryLimitReached(producerId.toString(), result.getBlockingAddress().toString(), ((now - start) / 1000));
nextWarn = now + blockedProducerWarningInterval;
}
}

View File

@ -97,6 +97,14 @@ public interface ActiveMQRALogger extends BasicLogger
@Message(id = 152006, value = "Unable to call after delivery", format = Message.Format.MESSAGE_FORMAT)
void unableToCallAfterDelivery(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 152007, value = "Thread {0} could not be finished", format = Message.Format.MESSAGE_FORMAT)
void threadCouldNotFinish(String thread);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 152008, value = "Error interrupting handler on endpoint {0} handler = {1}", format = Message.Format.MESSAGE_FORMAT)
void errorInterruptingHandler(String endpoint, String handler, @Cause Throwable cause);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 154000, value = "Error while creating object Reference.", format = Message.Format.MESSAGE_FORMAT)
void errorCreatingReference(@Cause Exception e);

View File

@ -477,7 +477,7 @@ public class ActiveMQActivation
if (threadTearDown.isAlive())
{
ActiveMQRALogger.LOGGER.warn("Thread " + threadTearDown + " couldn't be finished");
ActiveMQRALogger.LOGGER.threadCouldNotFinish(threadTearDown.toString());
}
}

View File

@ -228,7 +228,7 @@ public class ActiveMQMessageHandler implements MessageHandler
}
catch (Throwable e)
{
ActiveMQRALogger.LOGGER.warn("Error interrupting handler on endpoint " + endpoint + " handler=" + consumer);
ActiveMQRALogger.LOGGER.errorInterruptingHandler(endpoint.toString(), consumer.toString(), e);
}
return null;
}

View File

@ -923,7 +923,7 @@ final class PageSubscriptionImpl implements PageSubscription
{
// This could become null if the page file was deleted, or if the queue was removed maybe?
// it's better to diagnose it (based on support tickets) instead of NPE
ActiveMQServerLogger.LOGGER.warn("PageCursorInfo == null on address " + this.getPagingStore().getAddress() + ", pos = " + pos + ", queue = " + cursorId);
ActiveMQServerLogger.LOGGER.nullPageCursorInfo(this.getPagingStore().getAddress().toString(), pos.toString(), cursorId);
}
else
{

View File

@ -2765,8 +2765,7 @@ public class JournalStorageManager implements StorageManager
long messageID = buff.readLong();
if (!pendingLargeMessages.remove(new Pair<Long, Long>(recordDeleted.id, messageID)))
{
// TODO: Logging
ActiveMQServerLogger.LOGGER.warn("Large message " + recordDeleted.id + " wasn't found when dealing with add pending large message");
ActiveMQServerLogger.LOGGER.largeMessageNotFound(recordDeleted.id);
}
installLargeMessageConfirmationOnTX(tx, recordDeleted.id);
break;

View File

@ -686,7 +686,7 @@ public final class BindingsImpl implements Bindings
}
else
{
ActiveMQServerLogger.LOGGER.warn("Couldn't find binding with id=" + bindingID + " on routeFromCluster for message=" + message + " binding = " + this);
ActiveMQServerLogger.LOGGER.bindingNotFound(bindingID, message.toString(), this.toString());
}
}
}

View File

@ -649,10 +649,10 @@ public final class ReplicationManager implements ActiveMQComponent
*/
public OperationContext sendLiveIsStopping(final LiveStopping finalMessage)
{
ActiveMQServerLogger.LOGGER.warn("LIVE IS STOPPING?!? message=" + finalMessage + " enabled=" + enabled);
ActiveMQServerLogger.LOGGER.debug("LIVE IS STOPPING?!? message=" + finalMessage + " enabled=" + enabled);
if (enabled)
{
ActiveMQServerLogger.LOGGER.warn("LIVE IS STOPPING?!? message=" + finalMessage + " " + enabled);
ActiveMQServerLogger.LOGGER.debug("LIVE IS STOPPING?!? message=" + finalMessage + " " + enabled);
return sendReplicatePacket(new ReplicationLiveIsStoppingMessage(finalMessage));
}
return null;

View File

@ -60,8 +60,8 @@ public interface ActiveMQMessageBundle
@Message(id = 119000, value = "Activation for server {0}", format = Message.Format.MESSAGE_FORMAT)
String activationForServer(ActiveMQServer server);
@Message(id = 119001, value = "Generating thread dump because - {0}", format = Message.Format.MESSAGE_FORMAT)
String generatingThreadDump(String reason);
@Message(id = 119001, value = "Generating thread dump", format = Message.Format.MESSAGE_FORMAT)
String generatingThreadDump();
@Message(id = 119002, value = "Thread {0} name = {1} id = {2} group = {3}", format = Message.Format.MESSAGE_FORMAT)
String threadDump(Thread key, String name, Long id, ThreadGroup threadGroup);

View File

@ -248,7 +248,7 @@ public interface ActiveMQServer extends ActiveMQComponent
ServerSession getSessionByID(String sessionID);
void threadDump(String reason);
void threadDump();
/**
* return true if there is a binding for this address (i.e. if there is a created queue)

View File

@ -356,10 +356,6 @@ public interface ActiveMQServerLogger extends BasicLogger
@Message(id = 222014, value = "Error when trying to stop replication", format = Message.Format.MESSAGE_FORMAT)
void errorStoppingReplication(@Cause Exception e);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222015, value = "{0}", format = Message.Format.MESSAGE_FORMAT)
void warn(String message);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222016, value = "Cannot deploy a connector with no name specified.", format = Message.Format.MESSAGE_FORMAT)
void connectorWithNoName();
@ -1110,6 +1106,65 @@ public interface ActiveMQServerLogger extends BasicLogger
format = Message.Format.MESSAGE_FORMAT)
void cannotFindRoleForUser(String user);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222192,
value = "Could not delete: {0}",
format = Message.Format.MESSAGE_FORMAT)
void couldNotDeleteTempFile(String tempFileName);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222193,
value = "Memory Limit reached. Producer ({0}) stopped to prevent flooding {1} (blocking for {2}s). See http://activemq.apache.org/producer-flow-control.html for more info.",
format = Message.Format.MESSAGE_FORMAT)
void memoryLimitReached(String producerID, String address, long duration);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222194,
value = "PageCursorInfo == null on address {0}, pos = {1}, queue = {2}.",
format = Message.Format.MESSAGE_FORMAT)
void nullPageCursorInfo(String address, String position, long id);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222195,
value = "Large message {0} wasn't found when dealing with add pending large message",
format = Message.Format.MESSAGE_FORMAT)
void largeMessageNotFound(long id);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222196,
value = "Couldn't find binding with id={0} on routeFromCluster for message={1} binding = {2}",
format = Message.Format.MESSAGE_FORMAT)
void bindingNotFound(long id, String message, String binding);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222197,
value = "Internal error! Delivery logic has identified a non delivery and still handled a consumer!",
format = Message.Format.MESSAGE_FORMAT)
void nonDeliveryHandled();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222198,
value = "Couldn't flush ClusterManager executor ({0}) in 10 seconds, verify your thread pool size",
format = Message.Format.MESSAGE_FORMAT)
void couldNotFlushClusterManager(String manager);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222199,
value = "Thread dump: {0}",
format = Message.Format.MESSAGE_FORMAT)
void threadDump(String manager);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222200,
value = "Couldn't finish executor on {0}",
format = Message.Format.MESSAGE_FORMAT)
void couldNotFinishExecutor(String clusterConnection);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222201,
value = "Timed out waiting for backup activation to exit",
format = Message.Format.MESSAGE_FORMAT)
void backupActivationTimeout();
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 224000, value = "Failure in initialisation", format = Message.Format.MESSAGE_FORMAT)

View File

@ -391,8 +391,8 @@ public final class ClusterManager implements ActiveMQComponent
executor.execute(future);
if (!future.await(10000))
{
server.threadDump("Couldn't flush ClusterManager executor (" + this +
") in 10 seconds, verify your thread pool size");
ActiveMQServerLogger.LOGGER.couldNotFlushClusterManager(this.toString());
server.threadDump();
}
}

View File

@ -386,7 +386,8 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
executor.execute(future);
if (!future.await(10000))
{
server.threadDump("Couldn't finish executor on " + this);
ActiveMQServerLogger.LOGGER.couldNotFinishExecutor(this.toString());
server.threadDump();
}
}

View File

@ -491,7 +491,8 @@ public class ActiveMQServerImpl implements ActiveMQServer
if (System.currentTimeMillis() - start >= timeout)
{
threadDump("Timed out waiting for backup activation to exit");
ActiveMQServerLogger.LOGGER.backupActivationTimeout();
threadDump();
}
}
@ -576,14 +577,14 @@ public class ActiveMQServerImpl implements ActiveMQServer
return postOffice.isAddressBound(SimpleString.toSimpleString(address));
}
public void threadDump(final String reason)
public void threadDump()
{
StringWriter str = new StringWriter();
PrintWriter out = new PrintWriter(str);
Map<Thread, StackTraceElement[]> stackTrace = Thread.getAllStackTraces();
out.println(ActiveMQMessageBundle.BUNDLE.generatingThreadDump(reason));
out.println(ActiveMQMessageBundle.BUNDLE.generatingThreadDump());
out.println("*******************************************************************************");
for (Map.Entry<Thread, StackTraceElement[]> el : stackTrace.entrySet())
@ -601,7 +602,7 @@ public class ActiveMQServerImpl implements ActiveMQServer
out.println(ActiveMQMessageBundle.BUNDLE.endThreadDump());
out.println("*******************************************************************************");
ActiveMQServerLogger.LOGGER.warn(str.toString());
ActiveMQServerLogger.LOGGER.threadDump(str.toString());
}
public final void stop(boolean failoverOnServerShutdown) throws Exception

View File

@ -2182,7 +2182,7 @@ public class QueueImpl implements Queue
{
// this shouldn't really happen,
// however I'm keeping this as an assertion case future developers ever change the logic here on this class
ActiveMQServerLogger.LOGGER.warn("Internal error! Delivery logic has identified a non delivery and still handled a consumer!");
ActiveMQServerLogger.LOGGER.nonDeliveryHandled();
}
else
{