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

com.genexus.cloud.serverless.aws.handler.LambdaApplicationHelper 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.6.8
Show newest version
package com.genexus.cloud.serverless.aws.handler;

import com.genexus.ApplicationContext;
import com.genexus.specific.java.Connect;
import com.genexus.util.IniFile;

import javax.ws.rs.core.Application;

public class LambdaApplicationHelper {
	private static final String GX_APPLICATION_CLASS = "GXApplication";
	private static final String GX_APPLICATION_CONFIG = "client.cfg";

	public static Application initialize() throws Exception {
		Connect.init();
		IniFile config = com.genexus.ConfigFileFinder.getConfigFile(null, GX_APPLICATION_CONFIG, null);
		String className = config.getProperty("Client", "PACKAGE", null);
		Class cls = Class.forName(className.isEmpty() ? GX_APPLICATION_CLASS : String.format("%s.%s", className, GX_APPLICATION_CLASS));
		Application app = (Application) cls.getDeclaredConstructor().newInstance();
		ApplicationContext appContext = ApplicationContext.getInstance();
		appContext.setServletEngine(true);
		appContext.setServletEngineDefaultPath("");
		com.genexus.Application.init(cls);
		return app;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy