FileDocCategorySizeDatePackage
PlatformManagerFactory.javaAPI DocAzureus 3.0.3.42830Fri Jan 12 12:39:24 GMT 2007org.gudy.azureus2.platform

PlatformManagerFactory

public class PlatformManagerFactory extends Object
author
parg

Fields Summary
protected static PlatformManager
platform_manager
protected static org.gudy.azureus2.core3.util.AEMonitor
class_mon
Constructors Summary
Methods Summary
public static PlatformManagergetPlatformManager()

	
	  
	
	
		try{
			class_mon.enter();
		
			if ( platform_manager == null ){
										  
				try{
					if ( getPlatformType() == PlatformManager.PT_WINDOWS ){
						
						platform_manager = org.gudy.azureus2.platform.win32.PlatformManagerImpl.getSingleton();
						
					}else if( getPlatformType() == PlatformManager.PT_MACOSX ){
						
	                    platform_manager = org.gudy.azureus2.platform.macosx.PlatformManagerImpl.getSingleton();
	                    
					}else if( getPlatformType() == PlatformManager.PT_UNIX ){
						
            platform_manager = org.gudy.azureus2.platform.unix.PlatformManagerImpl.getSingleton();

					}
				}catch( PlatformManagerException e ){
					
						// exception will already have been logged
					
				}catch( Throwable e ){
					
					Debug.printStackTrace(e);
				}
			}
			
			if ( platform_manager == null ){
				
				platform_manager = org.gudy.azureus2.platform.dummy.PlatformManagerImpl.getSingleton();
			}
			
			return( platform_manager );
			
		}finally{
			
			class_mon.exit();
		}
	
public static intgetPlatformType()

		if (Constants.isWindows) {

			return (PlatformManager.PT_WINDOWS );

		} else if (Constants.isOSX) {

			return (PlatformManager.PT_MACOSX );

		} else if (Constants.isUnix) {

			return (PlatformManager.PT_UNIX );

		} else {
			return (PlatformManager.PT_OTHER );
		}