use of org.apache.qpid.server.logging.LogMessage in project qpid-broker-j by apache.
the class ManagementConsoleMessages method READY.
/**
* Log a ManagementConsole message of the Format:
* <pre>MNG-1004 : {0} Management Ready</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage READY(String param1) {
String rawMessage = _messages.getString("READY");
final Object[] messageArguments = { param1 };
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage() {
@Override
public String toString() {
return message;
}
@Override
public String getLogHierarchy() {
return READY_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode() {
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
use of org.apache.qpid.server.logging.LogMessage in project qpid-broker-j by apache.
the class ManagementConsoleMessages method STOPPED.
/**
* Log a ManagementConsole message of the Format:
* <pre>MNG-1005 : {0} Management Stopped</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage STOPPED(String param1) {
String rawMessage = _messages.getString("STOPPED");
final Object[] messageArguments = { param1 };
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage() {
@Override
public String toString() {
return message;
}
@Override
public String getLogHierarchy() {
return STOPPED_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode() {
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
use of org.apache.qpid.server.logging.LogMessage in project qpid-broker-j by apache.
the class MessageStoreMessages method RECOVERED.
/**
* Log a MessageStore message of the Format:
* <pre>MST-1005 : Recovered {0,number} messages</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage RECOVERED(Number param1) {
String rawMessage = _messages.getString("RECOVERED");
final Object[] messageArguments = { param1 };
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage() {
@Override
public String toString() {
return message;
}
@Override
public String getLogHierarchy() {
return RECOVERED_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode() {
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
use of org.apache.qpid.server.logging.LogMessage in project qpid-broker-j by apache.
the class MessageStoreMessages method OVERFULL.
/**
* Log a MessageStore message of the Format:
* <pre>MST-1008 : Store overfull, flow control will be enforced</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*/
public static LogMessage OVERFULL() {
String rawMessage = _messages.getString("OVERFULL");
final String message = rawMessage;
return new LogMessage() {
@Override
public String toString() {
return message;
}
@Override
public String getLogHierarchy() {
return OVERFULL_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode() {
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
use of org.apache.qpid.server.logging.LogMessage in project qpid-broker-j by apache.
the class AMQChannel method close.
public void close(int cause, String message) {
if (!_closing.compareAndSet(false, true)) {
// Channel is already closing
return;
}
try {
unsubscribeAllConsumers();
setDefaultQueue(null);
for (Action<? super AMQChannel> task : _taskList) {
task.performAction(this);
}
if (_transaction instanceof LocalTransaction) {
if (((LocalTransaction) _transaction).hasOutstandingWork()) {
_connection.incrementTransactionRollbackCounter();
}
_connection.decrementTransactionOpenCounter();
_connection.unregisterTransactionTickers(_transaction);
}
_transaction.rollback();
requeue();
} finally {
dispose();
LogMessage operationalLogMessage = cause == 0 ? ChannelMessages.CLOSE() : ChannelMessages.CLOSE_FORCED(cause, message);
messageWithSubject(operationalLogMessage);
}
}
Aggregations