package com.northglass.listener;
|
|
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.support.GenericXmlApplicationContext;
|
|
public abstract class AbstractServerListener {
|
|
protected static final int MESSAGE_LENGTH_START = 10;
|
protected static final int MESSAGE_LENGTH_END = 13;
|
|
protected static final int DATA_START = 74;
|
|
/**
|
* 信息头,字符串“<STA>”的16进制表示
|
*/
|
protected static final String HEAD = "3c5354413e";
|
|
/**
|
* 信息尾,字符串“<EOF>”的16进制表示
|
*/
|
protected static final String END = "3c454f463e";
|
|
protected ApplicationContext initializeSpringContext() {
|
GenericXmlApplicationContext context = new GenericXmlApplicationContext();
|
context.getEnvironment().setActiveProfiles("production");
|
context.load("applicationContext.xml");
|
context.refresh();
|
|
return context;
|
}
|
}
|