Start the background thread that will periodically check for session timeouts.
()
| 1076 | * Start the background thread that will periodically check for session timeouts. |
| 1077 | */ |
| 1078 | protected void threadStart() { |
| 1079 | if (backgroundProcessorDelay > 0 && |
| 1080 | (getState().isAvailable() || LifecycleState.STARTING_PREP.equals(getState())) && |
| 1081 | (backgroundProcessorFuture == null || backgroundProcessorFuture.isDone())) { |
| 1082 | if (backgroundProcessorFuture != null && backgroundProcessorFuture.isDone()) { |
| 1083 | // There was an error executing the scheduled task, get it and log it |
| 1084 | try { |
| 1085 | backgroundProcessorFuture.get(); |
| 1086 | } catch (InterruptedException | ExecutionException e) { |
| 1087 | log.error(sm.getString("containerBase.backgroundProcess.error"), e); |
| 1088 | } |
| 1089 | } |
| 1090 | backgroundProcessorFuture = Container.getService(this).getServer().getUtilityExecutor() |
| 1091 | .scheduleWithFixedDelay(new ContainerBackgroundProcessor(), backgroundProcessorDelay, |
| 1092 | backgroundProcessorDelay, TimeUnit.SECONDS); |
| 1093 | } |
| 1094 | } |
| 1095 | |
| 1096 | |
| 1097 | /** |
no test coverage detected