com.talk2object.common.ApplicationContextUtils Maven / Gradle / Ivy
The newest version!
package com.talk2object.common;
import com.talk2object.plum.repository.biz.TransactionExecutor;
/**
* singleton utils
*
* @author jack
*
*/
public class ApplicationContextUtils {
public static final String VERSION = "VERSION";
public static final String KEY_TRANSACTION_EXECUTOR = "TransactionExecutor";
private static Object get(String key) {
return ApplicationContext.getInstance().get(key);
}
private static void set(String key, Object value) {
ApplicationContext.getInstance().set(key, value);
}
public static String getVersion() {
return (String) get(VERSION);
}
public static Context getApplicationContext() {
return ApplicationContext.getInstance();
}
public static void setVersion(String version) {
set(VERSION, version);
}
public static TransactionExecutor getTransactionExecutor() {
return (TransactionExecutor) get(KEY_TRANSACTION_EXECUTOR);
}
public static void setTransactionExecutor(
TransactionExecutor transactionExecutor) {
set(KEY_TRANSACTION_EXECUTOR, transactionExecutor);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy