-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ab996d
commit 7183b93
Showing
8 changed files
with
108 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/main/java/fr/univlorraine/ecandidat/config/StopAppConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* ESUP-Portail eCandidat - Copyright (c) 2016 ESUP-Portail consortium | ||
* | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package fr.univlorraine.ecandidat.config; | ||
|
||
import javax.annotation.Resource; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.context.ApplicationListener; | ||
import org.springframework.context.event.ContextStoppedEvent; | ||
import org.springframework.stereotype.Component; | ||
|
||
import fr.univlorraine.ecandidat.controllers.LockCandidatController; | ||
|
||
/** | ||
* Configuration du lancement de l'appli | ||
* @author Kevin Hergalant | ||
*/ | ||
@Component | ||
public class StopAppConfig implements ApplicationListener<ContextStoppedEvent> { | ||
|
||
private final Logger logger = LoggerFactory.getLogger(StopAppConfig.class); | ||
|
||
@Resource | ||
private transient LockCandidatController lockCandidatController; | ||
|
||
@Override | ||
public void onApplicationEvent(final ContextStoppedEvent event) { | ||
preprocessCleanLock(); | ||
} | ||
|
||
/** Au stop de l'appli, on supprime tout les locks */ | ||
private void preprocessCleanLock() { | ||
logger.info("Nettoyage des locks"); | ||
lockCandidatController.cleanAllLockCandidatForInstance(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters