/*******************************************************************************
 * This file is part of OpenNMS(R).
 *
 * Copyright (C) 2011-2012 The OpenNMS Group, Inc.
 * OpenNMS(R) is Copyright (C) 1999-2012 The OpenNMS Group, Inc.
 *
 * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
 *
 * OpenNMS(R) is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation, either version 3 of the License,
 * or (at your option) any later version.
 *
 * OpenNMS(R) is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with OpenNMS(R).  If not, see:
 *      http://www.gnu.org/licenses/
 *
 * For more information contact:
 *     OpenNMS(R) Licensing <license@opennms.org>
 *     http://www.opennms.org/
 *     http://www.opennms.com/
 *******************************************************************************/

package org.opennms.netmgt.icmp;

import org.opennms.core.utils.LogUtils;

/**
 * <p>PingerFactory class.</p>
 *
 * @author <A HREF="mailto:seth@opennms.org">Seth Leger</A>
 * @author <A HREF="mailto:brozow@opennms.org">Matt Brozowski</A>
 */
public abstract class PingerFactory {
	/**
     * The {@link Pinger} instance.
     */
    private static Pinger m_pinger;

    /**
     * Returns an implementation of the default {@link Pinger} class
     *
     * @return a {@link Pinger} object.
     */
    public static Pinger getInstance() {
        if (m_pinger == null) {
            final String pingerClassName = System.getProperty("org.opennms.netmgt.icmp.pingerClass", "org.opennms.netmgt.icmp.jni6.Jni6Pinger");
            Class<? extends Pinger> clazz = null;
            try {
                clazz = Class.forName(pingerClassName).asSubclass(Pinger.class);
                m_pinger = clazz.newInstance();
            } catch (final ClassNotFoundException e) {
                IllegalArgumentException ex = new IllegalArgumentException("Unable to find class named " + pingerClassName, e);
                LogUtils.errorf(PingerFactory.class, ex, ex.getMessage());
                throw ex;
            } catch (final InstantiationException e) {
                IllegalArgumentException ex = new IllegalArgumentException("Error trying to create pinger of type " + clazz, e);
                LogUtils.errorf(PingerFactory.class, ex, ex.getMessage());
                throw ex;
            } catch (final IllegalAccessException e) {
                IllegalArgumentException ex = new IllegalArgumentException("Unable to create pinger of type " + clazz + ".  It does not appear to have a public constructor", e);
                LogUtils.errorf(PingerFactory.class, ex, ex.getMessage());
                throw ex;
            } catch (final Throwable e) {
                IllegalArgumentException ex = new IllegalArgumentException("Unexpected exception thrown while trying to create pinger of type " + clazz, e);
                LogUtils.errorf(PingerFactory.class, ex, ex.getMessage());
                throw ex;
            }
        }
        return m_pinger;
    }

    /**
     * <p>setIpcManager</p>
     *
     * @param pinger a {@link Pinger} object.
     */
    public static void setInstance(final Pinger pinger) {
        m_pinger = pinger;
    }
    
    /**
     * This is here for unit testing so we can reset this class before
     * every test.
     */
    protected static void reset() {
        m_pinger = null;
    }
    
}

@@ -1228,35 +1228,52 @@
 org.
-opennms.core.utils.LogUtils
+slf4j.Logger;%0Aimport org.slf4j.LoggerFactory
 ;%0A%0A/
@@ -1477,16 +1477,100 @@
 ctory %7B%0A
+    private static final Logger LOG = LoggerFactory.getLogger(PingerFactory.class);%0A
 %09/**%0A   
@@ -2398,54 +2398,32 @@
    L
-ogUtils.errorf(PingerFactory.class, ex, ex.get
+OG.error(ex.getLocalized
 Mess
@@ -2419,32 +2419,36 @@
 calizedMessage()
+, ex
 );%0A             
@@ -2665,54 +2665,32 @@
    L
-ogUtils.errorf(PingerFactory.class, ex, ex.get
+OG.error(ex.getLocalized
 Mess
@@ -2686,32 +2686,36 @@
 calizedMessage()
+, ex
 );%0A             
@@ -2981,54 +2981,32 @@
    L
-ogUtils.errorf(PingerFactory.class, ex, ex.get
+OG.error(ex.getLocalized
 Mess
@@ -3002,32 +3002,36 @@
 calizedMessage()
+, ex
 );%0A             
@@ -3263,54 +3263,32 @@
    L
-ogUtils.errorf(PingerFactory.class, ex, ex.get
+OG.error(ex.getLocalized
 Mess
@@ -3292,16 +3292,20 @@
 essage()
+, ex
 );%0A     

converted to use slf4j