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

com.genexus.platform.NativeFunctions Maven / Gradle / Ivy

Go to download

Core classes for the runtime used by Java and Android apps generated with GeneXus

There is a newer version: 4.7.3
Show newest version
package com.genexus.platform;

import com.genexus.CommonUtil;

public class NativeFunctions
{
    private volatile static INativeFunctions instance;

    private static Boolean isMicrosoft;

    private NativeFunctions()
    {
    }

    public static boolean isWindows()
    {
    	return CommonUtil.isWindows();
    }

    public static boolean isUnix()
    {
        return !isWindows();
    }

	private static Object handleLock = new Object();

    public static INativeFunctions getInstance() 
    {
        if	(instance == null)
        {
            synchronized (handleLock)
            {
                if	(instance == null)
                {
                    try
                    {
                    	instance = (INativeFunctions) Class.forName("com.genexus.platform.NativeFunctions11").newInstance();
                    }
                    catch (ClassNotFoundException e)
                    {
                        System.err.println("ClassNotFound " + e.getMessage());
                    }
                    catch (IllegalAccessException e)
                    {
                        System.err.println("ClassNotFound " + e.getMessage());
                    }
                    catch (InstantiationException e)
                    {
                        System.err.println("ClassNotFound " + e.getMessage());
                    }
                }
            }
        }

        return instance;
	}

	public static void endNativeFunctions()
	{
		instance = null;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy