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

bitronix.tm.utils.ManagementRegistrarThread Maven / Gradle / Ivy

There is a newer version: 62
Show newest version
package bitronix.tm.utils;

import java.util.logging.Level;

import static bitronix.tm.utils.ManagementRegistrar.*;

public class ManagementRegistrarThread
		extends Thread
{
	private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(ManagementRegistrarThread.class.toString());

	public ManagementRegistrarThread()
	{
		setName("bitronix-async-jmx-worker");
		setDaemon(true);
	}

	/**
	 * Method run ...
	 */
	@Override
	public void run()
	{
		while (!isInterrupted())
		{
			try
			{
				normalizeAndRunQueuedCommands();
				Thread.sleep(250); // sampling interval
			}
			catch (InterruptedException ex)
			{
				log.log(Level.FINEST, "an unexpected error occurred in JMX asynchronous registration code", ex);
				return;
			}
			catch (Exception ex)
			{
				log.log(Level.SEVERE, "an unexpected error occurred in JMX asynchronous registration code", ex);
			}
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy