use of org.traccar.events.OverspeedEventHandler in project traccar by tananaev.
the class Context method initEventsModule.
private static void initEventsModule() {
geofenceManager = new GeofenceManager(dataManager);
calendarManager = new CalendarManager(dataManager);
notificationManager = new NotificationManager(dataManager);
Properties velocityProperties = new Properties();
velocityProperties.setProperty("file.resource.loader.path", Context.getConfig().getString("templates.rootPath", "templates") + "/");
velocityProperties.setProperty("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.NullLogChute");
String address;
try {
address = config.getString("web.address", InetAddress.getLocalHost().getHostAddress());
} catch (UnknownHostException e) {
address = "localhost";
}
String webUrl = URIUtil.newURI("http", address, config.getInteger("web.port", 8082), "", "");
webUrl = Context.getConfig().getString("web.url", webUrl);
velocityProperties.setProperty("web.url", webUrl);
velocityEngine = new VelocityEngine();
velocityEngine.init(velocityProperties);
motionEventHandler = new MotionEventHandler(tripsConfig);
overspeedEventHandler = new OverspeedEventHandler(Context.getConfig().getLong("event.overspeed.minimalDuration") * 1000, Context.getConfig().getBoolean("event.overspeed.notRepeat"));
}
Aggregations