summaryrefslogblamecommitdiffstats
path: root/src/main/java/org/openslx/satserver/util/ProxyHandler.java
blob: f70a4965b2b1eafe27ba421b8d72d1208a2f1822 (plain) (tree)
1
2
3
4
5
6
7
8
9




                                              

                                                          
                 
   
   

                         
                                                          
                                                              
 



















                                                                       


                 
package org.openslx.satserver.util;

import org.openslx.network.ProxyConfiguration;

/**
 * Class for handling proxy configuration in task manager.
 * 
 * @author bjoern
 * 
 */
public class ProxyHandler
{
	private static boolean hasDoneConfigProxy = false;
	private static final Object proxyMutex = new Object();

	/**
	 * Do proxy setup if not done already
	 */
	public static void configProxy()
	{
		configProxy( false );
	}

	/**
	 * Do proxy setup if not done already, or if explicitly forced.
	 * 
	 * @param force Do setup even if already done
	 */
	public static synchronized void configProxy( boolean force )
	{
		synchronized ( proxyMutex ) {
			if ( !hasDoneConfigProxy || force ) {
				ProxyConfiguration.configProxy();
				hasDoneConfigProxy = true;
			}
		}
	}
}