// Path: src/main/java/net/datenwerke/sandbox/exception/SandboxedTaskKilledException.java
// public class SandboxedTaskKilledException extends SandboxException {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = 3308981843831471410L;
// 
// 	public SandboxedTaskKilledException(String msg) {
// 		super(msg);
// 	}
// }


import java.lang.management.LockInfo;
import java.lang.management.ManagementFactory;
import java.lang.management.MonitorInfo;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;
import net.datenwerke.sandbox.exception.SandboxedTaskKilledException;
/*
*  java-sandbox
*  Copyright (c) 2012 datenwerke Jan Albrecht
*  http://www.datenwerke.net
*  
*  This file is part of the java-sandbox: https://sourceforge.net/p/dw-sandbox/
*
*
*  This program 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.

*  This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
*
*/

package net.datenwerke.sandbox;



/**
 * Default implementation of {@link SandboxCleanupService}.
 * 
 * @author Arno Mittelbach
 *
 */
public class SandboxCleanupServiceImpl implements SandboxCleanupService{

	private ThreadMXBean threadBean;

	public SandboxCleanupServiceImpl(){
		this.threadBean = ManagementFactory.getThreadMXBean();
	}
	
	/*
	 * (non-Javadoc)
	 * @see net.datenwerke.sandbox.SandboxCleanupService#kill(net.datenwerke.sandbox.SandboxMonitoredThread, net.datenwerke.sandbox.jvm.exceptions.SandboxTaskKilledException)
	 */
	@Override
// Path: src/main/java/net/datenwerke/sandbox/exception/SandboxedTaskKilledException.java
// public class SandboxedTaskKilledException extends SandboxException {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = 3308981843831471410L;
// 
// 	public SandboxedTaskKilledException(String msg) {
// 		super(msg);
// 	}
// }


// Path: src/main/java/net/datenwerke/sandbox/SandboxCleanupServiceImpl.java
import java.lang.management.LockInfo;
import java.lang.management.ManagementFactory;
import java.lang.management.MonitorInfo;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;
import net.datenwerke.sandbox.exception.SandboxedTaskKilledException;

/*
*  java-sandbox
*  Copyright (c) 2012 datenwerke Jan Albrecht
*  http://www.datenwerke.net
*  
*  This file is part of the java-sandbox: https://sourceforge.net/p/dw-sandbox/
*
*
*  This program 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.

*  This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
*
*/

package net.datenwerke.sandbox;



/**
 * Default implementation of {@link SandboxCleanupService}.
 * 
 * @author Arno Mittelbach
 *
 */
public class SandboxCleanupServiceImpl implements SandboxCleanupService{

	private ThreadMXBean threadBean;

	public SandboxCleanupServiceImpl(){
		this.threadBean = ManagementFactory.getThreadMXBean();
	}
	
	/*
	 * (non-Javadoc)
	 * @see net.datenwerke.sandbox.SandboxCleanupService#kill(net.datenwerke.sandbox.SandboxMonitoredThread, net.datenwerke.sandbox.jvm.exceptions.SandboxTaskKilledException)
	 */
	@Override
	public BadKillInfo kill(SandboxMonitoredThread monitor, SandboxedTaskKilledException exception) {