ItEr51S04ValidacionEProbasFuncionaisItEr50S04: Removing manual signaling of detection of ConcurrentModification.
It was added applying transparent proxies on after compose. A less intrusive technique is required.
This commit is contained in:
parent
efcf58672e
commit
bc951b612c
2 changed files with 0 additions and 55 deletions
|
|
@ -1,51 +0,0 @@
|
|||
/*
|
||||
* This file is part of NavalPlan
|
||||
*
|
||||
* Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
|
||||
* Desenvolvemento Tecnolóxico de Galicia
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.navalplanner.web.common;
|
||||
|
||||
import org.navalplanner.web.common.ExceptionCatcherProxy.IExceptionHandler;
|
||||
import org.springframework.dao.OptimisticLockingFailureException;
|
||||
|
||||
public class ConcurrentModificationDetector {
|
||||
|
||||
private ConcurrentModificationDetector() {
|
||||
}
|
||||
|
||||
public static <T> T addAutomaticHandlingOfConcurrentModification(Class<T> interfaceClass,
|
||||
T model, final String backURL) {
|
||||
IExceptionHandler<OptimisticLockingFailureException> handler = createHandler(backURL);
|
||||
return ExceptionCatcherProxy.doCatchFor(interfaceClass).when(
|
||||
OptimisticLockingFailureException.class, handler)
|
||||
.applyTo(model);
|
||||
}
|
||||
|
||||
private static IExceptionHandler<OptimisticLockingFailureException> createHandler(
|
||||
final String backURL) {
|
||||
return new IExceptionHandler<OptimisticLockingFailureException>() {
|
||||
|
||||
@Override
|
||||
public void onException(OptimisticLockingFailureException exception) {
|
||||
ConcurrentModificationController.showException(exception,
|
||||
backURL);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,6 @@
|
|||
package org.navalplanner.web.resources.worker;
|
||||
|
||||
import static org.navalplanner.web.I18nHelper._;
|
||||
import static org.navalplanner.web.common.ConcurrentModificationDetector.addAutomaticHandlingOfConcurrentModification;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -269,9 +268,6 @@ public class WorkerCRUDController extends GenericForwardComposer implements
|
|||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
super.doAfterCompose(comp);
|
||||
this.workerModel = addAutomaticHandlingOfConcurrentModification(
|
||||
IWorkerModel.class, this.workerModel,
|
||||
"/resources/worker/worker.zul");
|
||||
localizationsForEditionController = createLocalizationsController(comp,
|
||||
"editWindow");
|
||||
localizationsForCreationController = createLocalizationsController(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue