LOG4J2-1349 add ThreadContextBenchmarkAccess for calling init() from benchmark
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/eb0d5ed8 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/eb0d5ed8 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/eb0d5ed8 Branch: refs/heads/LOG4J2-1349-gcfree-threadcontext Commit: eb0d5ed8d6c568bba9d2dc38e0a4ed0355ededd3 Parents: bdee385 Author: rpopma <[email protected]> Authored: Sun Aug 21 20:08:13 2016 +0900 Committer: rpopma <[email protected]> Committed: Tue Aug 23 00:31:18 2016 +0900 ---------------------------------------------------------------------- .../log4j/ThreadContextBenchmarkAccess.java | 34 ++++++++++++++++++++ 1 file changed, 34 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/eb0d5ed8/log4j-perf/src/main/java/org/apache/logging/log4j/ThreadContextBenchmarkAccess.java ---------------------------------------------------------------------- diff --git a/log4j-perf/src/main/java/org/apache/logging/log4j/ThreadContextBenchmarkAccess.java b/log4j-perf/src/main/java/org/apache/logging/log4j/ThreadContextBenchmarkAccess.java new file mode 100644 index 0000000..129b863 --- /dev/null +++ b/log4j-perf/src/main/java/org/apache/logging/log4j/ThreadContextBenchmarkAccess.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache license, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the license for the specific language governing permissions and + * limitations under the license. + */ +package org.apache.logging.log4j; + +/** + * <p> + * Utility class to access package protected methods in {@code ThreadContext}. + * </p> + * + * @see ThreadContext + * @since 2.7 + */ +public final class ThreadContextBenchmarkAccess { + private ThreadContextBenchmarkAccess() { // prevent instantiation + } + + public static void init() { + ThreadContext.init(); + } +}
