// Path: QuickProject-Util/src/main/java/chanedi/context/ContextUtils.java
// @Slf4j
// public class ContextUtils {
// 
// 	private static ApplicationContext applicationContext;
// 
// 	public static ApplicationContext getApplicationContext() {
// 		synchronized (ContextUtils.class) {
// 			while (applicationContext == null) {
// 				try {
// 					ContextUtils.class.wait(60000);
// 					if (applicationContext == null) {
// 						log.warn("Have been waiting for ApplicationContext to be set for 1 minute", new Exception());
// 					}
// 				} catch (InterruptedException ex) {
// 					log.debug("getApplicationContext, wait interrupted");
// 				}
// 			}
// 			return applicationContext;
// 		}
// 	}
// 
// 	public static Object getBean(Class<?> beanType) {
// 		return getApplicationContext().getBean(beanType);
// 	}
// 
// 	public static Object getBean(String name) {
// 		return getApplicationContext().getBean(name);
// 	}
// 
// 	protected static void setApplicationContext(ApplicationContext applicationContext) {
// 		synchronized (ContextUtils.class) {
// 			ContextUtils.applicationContext = applicationContext;
// 			ContextUtils.class.notifyAll();
// 		}
// 	}
// 
// }


import chanedi.context.ContextUtils;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
package chanedi.exception;


public class MessageKeyException extends RuntimeException {

    private Object[] messageArgs;

    public MessageKeyException() {
		super("unknown");
	}

	public MessageKeyException(String messageKey, Throwable cause, Object... messageArgs) {
		super(messageKey, cause);
        this.messageArgs = messageArgs;
	}

	public MessageKeyException(String messageKey, Object... messageArgs) {
		super(messageKey);
        this.messageArgs = messageArgs;
	}

	public MessageKeyException(Throwable cause) {
		super("unknown", cause);
	}
	
	public String getLocalizedMessage() {
// Path: QuickProject-Util/src/main/java/chanedi/context/ContextUtils.java
// @Slf4j
// public class ContextUtils {
// 
// 	private static ApplicationContext applicationContext;
// 
// 	public static ApplicationContext getApplicationContext() {
// 		synchronized (ContextUtils.class) {
// 			while (applicationContext == null) {
// 				try {
// 					ContextUtils.class.wait(60000);
// 					if (applicationContext == null) {
// 						log.warn("Have been waiting for ApplicationContext to be set for 1 minute", new Exception());
// 					}
// 				} catch (InterruptedException ex) {
// 					log.debug("getApplicationContext, wait interrupted");
// 				}
// 			}
// 			return applicationContext;
// 		}
// 	}
// 
// 	public static Object getBean(Class<?> beanType) {
// 		return getApplicationContext().getBean(beanType);
// 	}
// 
// 	public static Object getBean(String name) {
// 		return getApplicationContext().getBean(name);
// 	}
// 
// 	protected static void setApplicationContext(ApplicationContext applicationContext) {
// 		synchronized (ContextUtils.class) {
// 			ContextUtils.applicationContext = applicationContext;
// 			ContextUtils.class.notifyAll();
// 		}
// 	}
// 
// }


// Path: QuickProject-Core/src/main/java/chanedi/exception/MessageKeyException.java
import chanedi.context.ContextUtils;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;

package chanedi.exception;


public class MessageKeyException extends RuntimeException {

    private Object[] messageArgs;

    public MessageKeyException() {
		super("unknown");
	}

	public MessageKeyException(String messageKey, Throwable cause, Object... messageArgs) {
		super(messageKey, cause);
        this.messageArgs = messageArgs;
	}

	public MessageKeyException(String messageKey, Object... messageArgs) {
		super(messageKey);
        this.messageArgs = messageArgs;
	}

	public MessageKeyException(Throwable cause) {
		super("unknown", cause);
	}
	
	public String getLocalizedMessage() {
        MessageSource messageSource = (MessageSource) ContextUtils.getBean("messageSource");