"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "log4j-core/src/main/java/org/apache/logging/log4j/core/config/ReliabilityStrategyFactory.java" between
apache-log4j-2.11.1-src.tar.gz and apache-log4j-2.11.2-src.tar.gz

About: Apache Log4j 2 is a logging library for Java. Source distribution (Java).

ReliabilityStrategyFactory.java  (apache-log4j-2.11.1-src):ReliabilityStrategyFactory.java  (apache-log4j-2.11.2-src)
skipping to change at line 20 skipping to change at line 20
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the license for the specific language governing permissions and * See the license for the specific language governing permissions and
* limitations under the license. * limitations under the license.
*/ */
package org.apache.logging.log4j.core.config; package org.apache.logging.log4j.core.config;
import org.apache.logging.log4j.core.util.Loader;
import org.apache.logging.log4j.status.StatusLogger; import org.apache.logging.log4j.status.StatusLogger;
import org.apache.logging.log4j.util.LoaderUtil;
import org.apache.logging.log4j.util.PropertiesUtil; import org.apache.logging.log4j.util.PropertiesUtil;
/** /**
* Factory for ReliabilityStrategies. * Factory for ReliabilityStrategies.
*/ */
public final class ReliabilityStrategyFactory { public final class ReliabilityStrategyFactory {
private ReliabilityStrategyFactory() { private ReliabilityStrategyFactory() {
} }
/** /**
skipping to change at line 61 skipping to change at line 61
if ("AwaitCompletion".equals(strategy)) { if ("AwaitCompletion".equals(strategy)) {
return new AwaitCompletionReliabilityStrategy(loggerConfig); return new AwaitCompletionReliabilityStrategy(loggerConfig);
} }
if ("AwaitUnconditionally".equals(strategy)) { if ("AwaitUnconditionally".equals(strategy)) {
return new AwaitUnconditionallyReliabilityStrategy(loggerConfig); return new AwaitUnconditionallyReliabilityStrategy(loggerConfig);
} }
if ("Locking".equals(strategy)) { if ("Locking".equals(strategy)) {
return new LockingReliabilityStrategy(loggerConfig); return new LockingReliabilityStrategy(loggerConfig);
} }
try { try {
final Class<? extends ReliabilityStrategy> cls = LoaderUtil.loadClas s(strategy).asSubclass( final Class<? extends ReliabilityStrategy> cls = Loader.loadClass(st rategy).asSubclass(
ReliabilityStrategy.class); ReliabilityStrategy.class);
return cls.getConstructor(LoggerConfig.class).newInstance(loggerConf ig); return cls.getConstructor(LoggerConfig.class).newInstance(loggerConf ig);
} catch (final Exception dynamicFailed) { } catch (final Exception dynamicFailed) {
StatusLogger.getLogger().warn( StatusLogger.getLogger().warn(
"Could not create ReliabilityStrategy for '{}', using defaul t AwaitCompletionReliabilityStrategy: {}", strategy, dynamicFailed); "Could not create ReliabilityStrategy for '{}', using defaul t AwaitCompletionReliabilityStrategy: {}", strategy, dynamicFailed);
return new AwaitCompletionReliabilityStrategy(loggerConfig); return new AwaitCompletionReliabilityStrategy(loggerConfig);
} }
} }
} }
 End of changes. 3 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)