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

com.genexus.specific.java.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.specific.java;

import com.genexus.common.interfaces.IExtensionNativeFunctions;
import com.genexus.platform.INativeFunctions;
import com.genexus.util.IThreadLocal;
import com.genexus.util.IThreadLocalInitializer;

public class NativeFunctions implements IExtensionNativeFunctions {

	@Override
	public IThreadLocal newThreadLocal(IThreadLocalInitializer initializer) {
		return new InheritableThreadLocalSun(initializer);
	}
	
	class InheritableThreadLocalSun extends ThreadLocal implements com.genexus.util.IThreadLocal
	{	
		private IThreadLocalInitializer initializer;

		public InheritableThreadLocalSun()
		{ 
			
		}
		
		public InheritableThreadLocalSun(IThreadLocalInitializer initializer)
		{
			this.initializer = initializer;
		}

		@SuppressWarnings("unchecked")
		public Object get()
		{
			Object obj = super.get();
			if(obj == null && initializer != null)
			{
				set(initializer.initialValue());
				return super.get();
			}
			return obj;
		}		
	}  
	
	@Override
	public INativeFunctions getInstance() {
		return com.genexus.platform.NativeFunctions.getInstance();
	}  


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy