You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2014/09/08 03:12:24 UTC

[9/9] git commit: Add ResourceLoader interface.

Add ResourceLoader interface.


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a2ac12f1
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a2ac12f1
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a2ac12f1

Branch: refs/heads/LOG4J2-814
Commit: a2ac12f1a49559e8f6682c77c9a6aec56d48a9b8
Parents: 574211e
Author: Matt Sicker <ma...@apache.org>
Authored: Sun Sep 7 20:11:50 2014 -0500
Committer: Matt Sicker <ma...@apache.org>
Committed: Sun Sep 7 20:11:50 2014 -0500

----------------------------------------------------------------------
 .../logging/log4j/core/spi/ResourceLoader.java  | 41 ++++++++++++++++++++
 1 file changed, 41 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a2ac12f1/log4j-core/src/main/java/org/apache/logging/log4j/core/spi/ResourceLoader.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/spi/ResourceLoader.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/spi/ResourceLoader.java
new file mode 100644
index 0000000..1479b02
--- /dev/null
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/spi/ResourceLoader.java
@@ -0,0 +1,41 @@
+/*
+ * 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.core.spi;
+
+/**
+ * Strategy interface for loading {@link Resource Resources}.
+ *
+ * @since 2.1
+ */
+public interface ResourceLoader {
+
+    /**
+     * Returns a {@link Resource} handle for the specified resource location.
+     *
+     * @param location the resource location
+     * @return a corresponding Resource handle (not {@code null})
+     */
+    Resource getResource(String location);
+
+    /**
+     * Returns the {@link ClassLoader} used by this ResourceLoader.
+     *
+     * @return the underlying ClassLoader (not {@code null})
+     */
+    ClassLoader getClassLoader();
+}