use of jp.ossc.nimbus.util.converter.BeanJSONConverter in project nimbus by nimbus-org.
the class ScheduleManagerServlet method init.
/**
* サーブレットの初期化を行う。<p>
* サービス定義のロード及びロード完了チェックを行う。
*
* @exception ServletException サーブレットの初期化に失敗した場合
*/
public synchronized void init() throws ServletException {
ServiceName jsonConverterServiceName = getJSONConverterServiceName();
if (jsonConverterServiceName == null) {
jsonConverter = new BeanJSONConverter();
DateFormatConverter dateFormatConverter = new DateFormatConverter(DateFormatConverter.DATE_TO_STRING, "yyyyMMddHHmmssSSS");
dateFormatConverter.setNullString(null);
jsonConverter.setFormatConverter(Date.class, dateFormatConverter);
} else {
jsonConverter = (BeanJSONConverter) ServiceManagerFactory.getServiceObject(jsonConverterServiceName);
}
jsonConverter.setCharacterEncodingToStream("UTF-8");
jsonConverter.setUnicodeEscape(isUnicodeEscape());
toStringConverter = new StringStreamConverter(StringStreamConverter.STREAM_TO_STRING);
toStringConverter.setCharacterEncodingToObject("UTF-8");
ServiceName scheduleManagerServiceName = getScheduleManagerServiceName();
if (scheduleManagerServiceName == null) {
throw new ServletException("ScheduleManagerServiceName is null.");
} else {
scheduleManager = (ScheduleManager) ServiceManagerFactory.getServiceObject(scheduleManagerServiceName);
}
ServiceName schedulerServiceName = getSchedulerServiceName();
if (schedulerServiceName != null) {
scheduler = (Scheduler) ServiceManagerFactory.getServiceObject(schedulerServiceName);
}
}
Aggregations