Java Code Examples for java.util.logging.LogRecord#getResourceBundleName()

The following examples show how to use java.util.logging.LogRecord#getResourceBundleName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestLoggerBundleSync.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@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");
    }
}
 
Example 2
Source File: TestLoggerBundleSync.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@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");
    }
}
 
Example 3
Source File: TestLogrbResourceBundle.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void publish(LogRecord record) {
    lastBundle = record.getResourceBundle();
    lastBundleName = record.getResourceBundleName();
    lastParams = record.getParameters();
    lastThrown = record.getThrown();
    lastMessage = record.getMessage();
}
 
Example 4
Source File: TestLogrbResourceBundle.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void publish(LogRecord record) {
    lastBundle = record.getResourceBundle();
    lastBundleName = record.getResourceBundleName();
    lastParams = record.getParameters();
    lastThrown = record.getThrown();
    lastMessage = record.getMessage();
}
 
Example 5
Source File: TestLoggerBundleSync.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@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");
    }
}
 
Example 6
Source File: TestLogrbResourceBundle.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void publish(LogRecord record) {
    lastBundle = record.getResourceBundle();
    lastBundleName = record.getResourceBundleName();
    lastParams = record.getParameters();
    lastThrown = record.getThrown();
    lastMessage = record.getMessage();
}
 
Example 7
Source File: TestLoggerBundleSync.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@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");
    }
}
 
Example 8
Source File: TestLoggerBundleSync.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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");
    }
}
 
Example 9
Source File: TestLoggerBundleSync.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@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");
    }
}
 
Example 10
Source File: TestLogrbResourceBundle.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void publish(LogRecord record) {
    lastBundle = record.getResourceBundle();
    lastBundleName = record.getResourceBundleName();
    lastParams = record.getParameters();
    lastThrown = record.getThrown();
    lastMessage = record.getMessage();
}
 
Example 11
Source File: TestLogrbResourceBundle.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void publish(LogRecord record) {
    lastBundle = record.getResourceBundle();
    lastBundleName = record.getResourceBundleName();
    lastParams = record.getParameters();
    lastThrown = record.getThrown();
    lastMessage = record.getMessage();
}
 
Example 12
Source File: TestLoggerBundleSync.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@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");
    }
}
 
Example 13
Source File: TestSetResourceBundle.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void publish(LogRecord record) {
    lastBundle = record.getResourceBundle();
    lastBundleName = record.getResourceBundleName();
}
 
Example 14
Source File: TestSetResourceBundle.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void publish(LogRecord record) {
    lastBundle = record.getResourceBundle();
    lastBundleName = record.getResourceBundleName();
}
 
Example 15
Source File: TestSetResourceBundle.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void publish(LogRecord record) {
    lastBundle = record.getResourceBundle();
    lastBundleName = record.getResourceBundleName();
}
 
Example 16
Source File: TestSetResourceBundle.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void publish(LogRecord record) {
    lastBundle = record.getResourceBundle();
    lastBundleName = record.getResourceBundleName();
}
 
Example 17
Source File: TestLoggerBundleSync.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public synchronized void publish(LogRecord record) {
    rb = record.getResourceBundle();
    rbName = record.getResourceBundleName();
}
 
Example 18
Source File: TestSetResourceBundle.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void publish(LogRecord record) {
    lastBundle = record.getResourceBundle();
    lastBundleName = record.getResourceBundleName();
}
 
Example 19
Source File: TestSetResourceBundle.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void publish(LogRecord record) {
    lastBundle = record.getResourceBundle();
    lastBundleName = record.getResourceBundleName();
}
 
Example 20
Source File: TestSetResourceBundle.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void publish(LogRecord record) {
    lastBundle = record.getResourceBundle();
    lastBundleName = record.getResourceBundleName();
}