下面列出了java.util.logging.LogRecord#getResourceBundleName ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
public void publish(LogRecord record) {
lastBundle = record.getResourceBundle();
lastBundleName = record.getResourceBundleName();
lastParams = record.getParameters();
lastThrown = record.getThrown();
lastMessage = record.getMessage();
}
@Override
public synchronized void publish(LogRecord record) {
Object[] params = record.getParameters();
// Each GetRB thread has its own handler, but since they
// log into the same logger, each handler may receive
// messages emitted by other threads.
// This means that GetRB#2.handler may receive a message
// emitted by GetRB#1 at a time where the resource bundle
// was still null.
// To avoid falling into this trap, the GetRB thread passes
// 'this' as argument to the messages it logs - which does
// allow us here to ignore messages that where not emitted
// by our own GetRB.this thread...
if (params.length == 1) {
if (params[0] == GetRB.this) {
// The message was emitted by our thread.
count++;
rb = record.getResourceBundle();
rbName = record.getResourceBundleName();
} else {
// The message was emitted by another thread: just
// ignore it, as it may have been emitted at a time
// where the resource bundle was still null, and
// processing it may overwrite the 'rb' and 'rbName'
// recorded from the message emitted by our own thread.
if (VERBOSE) {
System.out.println("Ignoring message logged by " + params[0]);
}
ignoreLogCount.incrementAndGet();
}
} else {
ignoreLogCount.incrementAndGet();
System.err.println("Unexpected message received");
}
}
@Override
public synchronized void publish(LogRecord record) {
Object[] params = record.getParameters();
// Each GetRB thread has its own handler, but since they
// log into the same logger, each handler may receive
// messages emitted by other threads.
// This means that GetRB#2.handler may receive a message
// emitted by GetRB#1 at a time where the resource bundle
// was still null.
// To avoid falling into this trap, the GetRB thread passes
// 'this' as argument to the messages it logs - which does
// allow us here to ignore messages that where not emitted
// by our own GetRB.this thread...
if (params.length == 1) {
if (params[0] == GetRB.this) {
// The message was emitted by our thread.
count++;
rb = record.getResourceBundle();
rbName = record.getResourceBundleName();
} else {
// The message was emitted by another thread: just
// ignore it, as it may have been emitted at a time
// where the resource bundle was still null, and
// processing it may overwrite the 'rb' and 'rbName'
// recorded from the message emitted by our own thread.
if (VERBOSE) {
System.out.println("Ignoring message logged by " + params[0]);
}
ignoreLogCount.incrementAndGet();
}
} else {
ignoreLogCount.incrementAndGet();
System.err.println("Unexpected message received");
}
}
@Override
public void publish(LogRecord record) {
lastBundle = record.getResourceBundle();
lastBundleName = record.getResourceBundleName();
lastParams = record.getParameters();
lastThrown = record.getThrown();
lastMessage = record.getMessage();
}
@Override
public synchronized void publish(LogRecord record) {
Object[] params = record.getParameters();
// Each GetRB thread has its own handler, but since they
// log into the same logger, each handler may receive
// messages emitted by other threads.
// This means that GetRB#2.handler may receive a message
// emitted by GetRB#1 at a time where the resource bundle
// was still null.
// To avoid falling into this trap, the GetRB thread passes
// 'this' as argument to the messages it logs - which does
// allow us here to ignore messages that where not emitted
// by our own GetRB.this thread...
if (params.length == 1) {
if (params[0] == GetRB.this) {
// The message was emitted by our thread.
count++;
rb = record.getResourceBundle();
rbName = record.getResourceBundleName();
} else {
// The message was emitted by another thread: just
// ignore it, as it may have been emitted at a time
// where the resource bundle was still null, and
// processing it may overwrite the 'rb' and 'rbName'
// recorded from the message emitted by our own thread.
if (VERBOSE) {
System.out.println("Ignoring message logged by " + params[0]);
}
ignoreLogCount.incrementAndGet();
}
} else {
ignoreLogCount.incrementAndGet();
System.err.println("Unexpected message received");
}
}
@Override
public synchronized void publish(LogRecord record) {
Object[] params = record.getParameters();
// Each GetRB thread has its own handler, but since they
// log into the same logger, each handler may receive
// messages emitted by other threads.
// This means that GetRB#2.handler may receive a message
// emitted by GetRB#1 at a time where the resource bundle
// was still null.
// To avoid falling into this trap, the GetRB thread passes
// 'this' as argument to the messages it logs - which does
// allow us here to ignore messages that where not emitted
// by our own GetRB.this thread...
if (params.length == 1) {
if (params[0] == GetRB.this) {
// The message was emitted by our thread.
count++;
rb = record.getResourceBundle();
rbName = record.getResourceBundleName();
} else {
// The message was emitted by another thread: just
// ignore it, as it may have been emitted at a time
// where the resource bundle was still null, and
// processing it may overwrite the 'rb' and 'rbName'
// recorded from the message emitted by our own thread.
if (VERBOSE) {
System.out.println("Ignoring message logged by " + params[0]);
}
ignoreLogCount.incrementAndGet();
}
} else {
ignoreLogCount.incrementAndGet();
System.err.println("Unexpected message received");
}
}
@Override
public synchronized void publish(LogRecord record) {
Object[] params = record.getParameters();
// Each GetRB thread has its own handler, but since they
// log into the same logger, each handler may receive
// messages emitted by other threads.
// This means that GetRB#2.handler may receive a message
// emitted by GetRB#1 at a time where the resource bundle
// was still null.
// To avoid falling into this trap, the GetRB thread passes
// 'this' as argument to the messages it logs - which does
// allow us here to ignore messages that where not emitted
// by our own GetRB.this thread...
if (params.length == 1) {
if (params[0] == GetRB.this) {
// The message was emitted by our thread.
count++;
rb = record.getResourceBundle();
rbName = record.getResourceBundleName();
} else {
// The message was emitted by another thread: just
// ignore it, as it may have been emitted at a time
// where the resource bundle was still null, and
// processing it may overwrite the 'rb' and 'rbName'
// recorded from the message emitted by our own thread.
if (VERBOSE) {
System.out.println("Ignoring message logged by " + params[0]);
}
ignoreLogCount.incrementAndGet();
}
} else {
ignoreLogCount.incrementAndGet();
System.err.println("Unexpected message received");
}
}
@Override
public void publish(LogRecord record) {
lastBundle = record.getResourceBundle();
lastBundleName = record.getResourceBundleName();
lastParams = record.getParameters();
lastThrown = record.getThrown();
lastMessage = record.getMessage();
}
@Override
public synchronized void publish(LogRecord record) {
Object[] params = record.getParameters();
// Each GetRB thread has its own handler, but since they
// log into the same logger, each handler may receive
// messages emitted by other threads.
// This means that GetRB#2.handler may receive a message
// emitted by GetRB#1 at a time where the resource bundle
// was still null.
// To avoid falling into this trap, the GetRB thread passes
// 'this' as argument to the messages it logs - which does
// allow us here to ignore messages that where not emitted
// by our own GetRB.this thread...
if (params.length == 1) {
if (params[0] == GetRB.this) {
// The message was emitted by our thread.
count++;
rb = record.getResourceBundle();
rbName = record.getResourceBundleName();
} else {
// The message was emitted by another thread: just
// ignore it, as it may have been emitted at a time
// where the resource bundle was still null, and
// processing it may overwrite the 'rb' and 'rbName'
// recorded from the message emitted by our own thread.
if (VERBOSE) {
System.out.println("Ignoring message logged by " + params[0]);
}
ignoreLogCount.incrementAndGet();
}
} else {
ignoreLogCount.incrementAndGet();
System.err.println("Unexpected message received");
}
}
@Override
public void publish(LogRecord record) {
lastBundle = record.getResourceBundle();
lastBundleName = record.getResourceBundleName();
lastParams = record.getParameters();
lastThrown = record.getThrown();
lastMessage = record.getMessage();
}
@Override
public synchronized void publish(LogRecord record) {
Object[] params = record.getParameters();
// Each GetRB thread has its own handler, but since they
// log into the same logger, each handler may receive
// messages emitted by other threads.
// This means that GetRB#2.handler may receive a message
// emitted by GetRB#1 at a time where the resource bundle
// was still null.
// To avoid falling into this trap, the GetRB thread passes
// 'this' as argument to the messages it logs - which does
// allow us here to ignore messages that where not emitted
// by our own GetRB.this thread...
if (params.length == 1) {
if (params[0] == GetRB.this) {
// The message was emitted by our thread.
count++;
rb = record.getResourceBundle();
rbName = record.getResourceBundleName();
} else {
// The message was emitted by another thread: just
// ignore it, as it may have been emitted at a time
// where the resource bundle was still null, and
// processing it may overwrite the 'rb' and 'rbName'
// recorded from the message emitted by our own thread.
if (VERBOSE) {
System.out.println("Ignoring message logged by " + params[0]);
}
ignoreLogCount.incrementAndGet();
}
} else {
ignoreLogCount.incrementAndGet();
System.err.println("Unexpected message received");
}
}
@Override
public void publish(LogRecord record) {
lastBundle = record.getResourceBundle();
lastBundleName = record.getResourceBundleName();
lastParams = record.getParameters();
lastThrown = record.getThrown();
lastMessage = record.getMessage();
}
@Override
public void publish(LogRecord record) {
lastBundle = record.getResourceBundle();
lastBundleName = record.getResourceBundleName();
}
@Override
public void publish(LogRecord record) {
lastBundle = record.getResourceBundle();
lastBundleName = record.getResourceBundleName();
}
@Override
public void publish(LogRecord record) {
lastBundle = record.getResourceBundle();
lastBundleName = record.getResourceBundleName();
}
@Override
public synchronized void publish(LogRecord record) {
rb = record.getResourceBundle();
rbName = record.getResourceBundleName();
}
@Override
public void publish(LogRecord record) {
lastBundle = record.getResourceBundle();
lastBundleName = record.getResourceBundleName();
}
@Override
public void publish(LogRecord record) {
lastBundle = record.getResourceBundle();
lastBundleName = record.getResourceBundleName();
}
@Override
public void publish(LogRecord record) {
lastBundle = record.getResourceBundle();
lastBundleName = record.getResourceBundleName();
}
@Override
public void publish(LogRecord record) {
lastBundle = record.getResourceBundle();
lastBundleName = record.getResourceBundleName();
}