All Downloads are FREE. Search and download functionalities are using the official Maven repository.

patterntesting.concurrent.DeadLockLogger Maven / Gradle / Ivy

/**
 * $Id: DeadLockLogger.java,v 1.3 2010/06/08 21:08:37 oboehm Exp $
 *
 * Copyright (c) 2009 by Oliver Boehm
 *
 * Licensed 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 orimplied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * (c)reated 14.07.2009 by oliver ([email protected])
 */

package patterntesting.concurrent;

import org.apache.commons.logging.*;

import patterntesting.runtime.util.Converter;

/**
 * The Class DeadLockLogger.
 *
 * @author oliver
 * @since 14.07.2009
 * @version $Revision: 1.3 $
 */
public final class DeadLockLogger implements DeadLockListener {

	private static final Log log = LogFactory.getLog(DeadLockLogger.class);

	/**
	 * Dead lock detected.
	 *
	 * @param threads the threads
	 * @see patterntesting.concurrent.DeadLockListener#deadLockDetected(java.lang.Thread[])
	 */
	public void deadLockDetected(final Thread[] threads) {
		if (log.isInfoEnabled()) {
			log.info("deadlock in " + threads.length + " threads detected: "
					+ Converter.toString(threads));
		}
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy