SystemBean.java
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.airport.util;
import org.apache.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.context.support.FileSystemXmlApplicationContext;
public class SystemBean {
private static Logger logger = Logger.getLogger(SystemBean.class);
private static SystemBean inistance;
private static FileSystemXmlApplicationContext fileSystemXmlApplicationContext;
private static Object lock = new Object();
public SystemBean() {
}
public static final synchronized void createInstance(String path) throws LteException {
if (inistance == null) {
Object var1 = lock;
synchronized(lock) {
if (inistance == null) {
inistance = new SystemBean();
String err;
try {
logger.info("Initialization ApplicationContext ");
fileSystemXmlApplicationContext = new FileSystemXmlApplicationContext(path);
fileSystemXmlApplicationContext.registerShutdownHook();
} catch (BeansException var4) {
err = ExceptionUtils.getStackTrace(var4);
throw new LteException("Initialization ApplicationContext error:" + err);
} catch (Exception var5) {
err = ExceptionUtils.getStackTrace(var5);
throw new LteException("Initialization ApplicationContext error:" + err);
}
}
}
}
}
public static final Object getBean(String beanName) {
return fileSystemXmlApplicationContext.getBean(beanName);
}
public static final void destroy() {
fileSystemXmlApplicationContext.getBeanFactory().destroySingletons();
}
}