Rename URLHandler to EntryPointsHandler

The new name reflects better is meaning.

FEA: ItEr74S04BugFixing
This commit is contained in:
Óscar González Fernández 2011-05-10 12:37:47 +02:00
parent bbc49962cf
commit d31e03fe44
13 changed files with 33 additions and 33 deletions

View file

@ -35,8 +35,8 @@ import javax.servlet.http.HttpServletRequest;
import org.navalplanner.business.common.Registry;
import org.navalplanner.business.users.entities.UserRole;
import org.navalplanner.web.common.entrypoints.URLHandler;
import org.navalplanner.web.common.entrypoints.URLHandler.ICapture;
import org.navalplanner.web.common.entrypoints.EntryPointsHandler;
import org.navalplanner.web.common.entrypoints.EntryPointsHandler.ICapture;
import org.navalplanner.web.planner.tabs.IGlobalViewEntryPoints;
import org.navalplanner.web.security.SecurityUtils;
import org.springframework.web.context.WebApplicationContext;
@ -245,7 +245,7 @@ public class CustomMenuController extends Div implements IMenuItemsRegister {
private CustomMenuItem subItem(String name, ICapture urlCapture,
String helpLink) {
return new CustomMenuItem(name, URLHandler.capturePath(urlCapture),
return new CustomMenuItem(name, EntryPointsHandler.capturePath(urlCapture),
helpLink);
}

View file

@ -51,14 +51,14 @@ import org.zkoss.zk.ui.event.EventListener;
* <br />
* @author Óscar González Fernández <ogonzalez@igalia.com>
*/
public class URLHandler<T> {
public class EntryPointsHandler<T> {
private static final String MANUALLY_SET_PARAMS = "PARAMS";
private static final String FLAG_ATTRIBUTE = URLHandler.class.getName()
private static final String FLAG_ATTRIBUTE = EntryPointsHandler.class.getName()
+ "_";
private static final Log LOG = LogFactory.getLog(URLHandler.class);
private static final Log LOG = LogFactory.getLog(EntryPointsHandler.class);
private static class EntryPointMetadata {
private final Method method;
@ -131,7 +131,7 @@ public class URLHandler<T> {
}
}
public URLHandler(IConverterFactory converterFactory,
public EntryPointsHandler(IConverterFactory converterFactory,
IExecutorRetriever executorRetriever,
Class<T> interfaceDefiningEntryPoints) {
Validate.isTrue(interfaceDefiningEntryPoints.isInterface());

View file

@ -27,7 +27,7 @@ package org.navalplanner.web.common.entrypoints;
*/
public interface IURLHandlerRegistry {
public abstract <T> URLHandler<T> getRedirectorFor(
public abstract <T> EntryPointsHandler<T> getRedirectorFor(
Class<T> klassWithLinkableMetadata);
}

View file

@ -58,7 +58,7 @@ public class RedirectorSynthetiser implements BeanFactoryPostProcessor {
private final Class<?> pageInterface;
private URLHandler<?> urlHandler;
private EntryPointsHandler<?> urlHandler;
private SynthetizedImplementation(
ConfigurableListableBeanFactory beanFactory,
@ -70,12 +70,12 @@ public class RedirectorSynthetiser implements BeanFactoryPostProcessor {
@Override
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
URLHandler<?> redirector = getHandler();
EntryPointsHandler<?> redirector = getHandler();
redirector.doTransition(method.getName(), args);
return null;
}
private URLHandler<?> getHandler() {
private EntryPointsHandler<?> getHandler() {
if (urlHandler != null) {
return urlHandler;
}

View file

@ -31,7 +31,7 @@ import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
/**
* Registry of {@link URLHandler} <br />
* Registry of {@link EntryPointsHandler} <br />
* @author Óscar González Fernández <ogonzalez@igalia.com>
*/
@Component
@ -44,14 +44,14 @@ public class URLHandlerRegistry implements IURLHandlerRegistry {
@Autowired
private IConverterFactory converterFactory;
private Map<Class<?>, URLHandler<?>> cached = new HashMap<Class<?>, URLHandler<?>>();;
private Map<Class<?>, EntryPointsHandler<?>> cached = new HashMap<Class<?>, EntryPointsHandler<?>>();;
@SuppressWarnings("unchecked")
public <T> URLHandler<T> getRedirectorFor(Class<T> klassWithLinkableMetadata) {
public <T> EntryPointsHandler<T> getRedirectorFor(Class<T> klassWithLinkableMetadata) {
if (cached.containsKey(klassWithLinkableMetadata)) {
return (URLHandler<T>) cached.get(klassWithLinkableMetadata);
return (EntryPointsHandler<T>) cached.get(klassWithLinkableMetadata);
}
URLHandler<T> result = new URLHandler<T>(converterFactory,
EntryPointsHandler<T> result = new EntryPointsHandler<T>(converterFactory,
executorRetriever, klassWithLinkableMetadata);
cached.put(klassWithLinkableMetadata, result);
return result;

View file

@ -56,8 +56,8 @@ import org.navalplanner.business.scenarios.entities.Scenario;
import org.navalplanner.business.workingday.EffortDuration;
import org.navalplanner.web.calendars.BaseCalendarModel;
import org.navalplanner.web.common.concurrentdetection.ConcurrentModificationHandling;
import org.navalplanner.web.common.entrypoints.URLHandler;
import org.navalplanner.web.common.entrypoints.URLHandler.ICapture;
import org.navalplanner.web.common.entrypoints.EntryPointsHandler;
import org.navalplanner.web.common.entrypoints.EntryPointsHandler.ICapture;
import org.navalplanner.web.planner.allocation.AdvancedAllocationController;
import org.navalplanner.web.planner.allocation.AdvancedAllocationController.AllocationInput;
import org.navalplanner.web.planner.allocation.AdvancedAllocationController.IAdvanceAllocationResultReceiver;
@ -101,7 +101,7 @@ public class AdvancedAllocationTabCreator {
this.aggregate = this.allocationResult.getAggregate();
this.task = task;
this.associatedResources = getAssociatedResources(task);
this.retryPage = URLHandler.capturePath(new ICapture() {
this.retryPage = EntryPointsHandler.capturePath(new ICapture() {
@Override
public void capture() {
globalViewEntryPoints.goToAdvancedAllocation(order);

View file

@ -38,7 +38,7 @@ import org.navalplanner.business.resources.daos.IResourceDAO;
import org.navalplanner.business.resources.daos.IResourcesSearcher;
import org.navalplanner.business.scenarios.IScenarioManager;
import org.navalplanner.business.templates.entities.OrderTemplate;
import org.navalplanner.web.common.entrypoints.URLHandler;
import org.navalplanner.web.common.entrypoints.EntryPointsHandler;
import org.navalplanner.web.common.entrypoints.URLHandlerRegistry;
import org.navalplanner.web.limitingresources.LimitingResourcesController;
import org.navalplanner.web.montecarlo.MonteCarloController;
@ -372,7 +372,7 @@ public class MultipleTabsPlannerController implements Composer,
tabsSwitcher = (TabSwitcher) comp;
breadcrumbs = comp.getPage().getFellow("breadcrumbs");
tabsSwitcher.setConfiguration(buildTabsConfiguration());
final URLHandler<IGlobalViewEntryPoints> handler = registry
final EntryPointsHandler<IGlobalViewEntryPoints> handler = registry
.getRedirectorFor(IGlobalViewEntryPoints.class);
if (!handler.applyIfMatches(this)) {
planningTab.toggleToNoFeedback();

View file

@ -46,7 +46,7 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.navalplanner.business.orders.entities.Order;
import org.navalplanner.web.common.entrypoints.URLHandler;
import org.navalplanner.web.common.entrypoints.EntryPointsHandler;
import org.springframework.security.context.SecurityContext;
import org.springframework.security.context.SecurityContextHolder;
import org.zkoss.ganttz.Planner;
@ -157,7 +157,7 @@ public class CutyPrint {
HttpServletResponse response)
throws ServletException, IOException {
URLHandler.setupEntryPointsForThisRequest(request,
EntryPointsHandler.setupEntryPointsForThisRequest(request,
entryPointsMap);
// Pending to forward and process additional parameters
// as show labels, resources, zoom or expand all

View file

@ -48,7 +48,7 @@ import org.navalplanner.web.common.Util;
import org.navalplanner.web.common.components.bandboxsearch.BandboxMultipleSearch;
import org.navalplanner.web.common.components.finders.FilterPair;
import org.navalplanner.web.common.entrypoints.IURLHandlerRegistry;
import org.navalplanner.web.common.entrypoints.URLHandler;
import org.navalplanner.web.common.entrypoints.EntryPointsHandler;
import org.navalplanner.web.costcategories.ResourcesCostCategoryAssignmentController;
import org.navalplanner.web.resources.search.ResourcePredicate;
import org.zkoss.zk.ui.Component;
@ -336,7 +336,7 @@ public class WorkerCRUDController extends GenericForwardComposer implements
messages = new MessagesForUser(messagesContainer);
setupResourcesCostCategoryAssignmentController(comp);
final URLHandler<IWorkerCRUDControllerEntryPoints> handler = URLHandlerRegistry
final EntryPointsHandler<IWorkerCRUDControllerEntryPoints> handler = URLHandlerRegistry
.getRedirectorFor(IWorkerCRUDControllerEntryPoints.class);
handler.register(this, page);
getVisibility().showOnly(listWindow);

View file

@ -36,7 +36,7 @@ import org.navalplanner.web.common.MessagesForUser;
import org.navalplanner.web.common.OnlyOneVisible;
import org.navalplanner.web.common.Util;
import org.navalplanner.web.common.entrypoints.IURLHandlerRegistry;
import org.navalplanner.web.common.entrypoints.URLHandler;
import org.navalplanner.web.common.entrypoints.EntryPointsHandler;
import org.navalplanner.web.planner.tabs.IGlobalViewEntryPoints;
import org.navalplanner.web.templates.advances.AdvancesAssignmentComponent;
import org.navalplanner.web.templates.criterionrequirements.CriterionRequirementTemplateComponent;
@ -265,7 +265,7 @@ public class OrderTemplatesController extends GenericForwardComposer implements
messagesForUser = new MessagesForUser(messagesContainer);
getVisibility().showOnly(listWindow);
final URLHandler<IOrderTemplatesControllerEntryPoints> handler = handlerRegistry
final EntryPointsHandler<IOrderTemplatesControllerEntryPoints> handler = handlerRegistry
.getRedirectorFor(IOrderTemplatesControllerEntryPoints.class);
handler.register(this, page);

View file

@ -37,7 +37,7 @@ import org.navalplanner.web.common.OnlyOneVisible;
import org.navalplanner.web.common.Util;
import org.navalplanner.web.common.components.Autocomplete;
import org.navalplanner.web.common.entrypoints.IURLHandlerRegistry;
import org.navalplanner.web.common.entrypoints.URLHandler;
import org.navalplanner.web.common.entrypoints.EntryPointsHandler;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zk.ui.util.GenericForwardComposer;
@ -84,7 +84,7 @@ public class UserCRUDController extends GenericForwardComposer implements
comp.setVariable("controller", this, true);
messagesForUser = new MessagesForUser(messagesContainer);
final URLHandler<IUserCRUDController> handler = URLHandlerRegistry
final EntryPointsHandler<IUserCRUDController> handler = URLHandlerRegistry
.getRedirectorFor(IUserCRUDController.class);
handler.register(this, page);

View file

@ -54,7 +54,7 @@ import org.navalplanner.web.common.components.NewDataSortableColumn;
import org.navalplanner.web.common.components.NewDataSortableGrid;
import org.navalplanner.web.common.components.bandboxsearch.BandboxSearch;
import org.navalplanner.web.common.entrypoints.IURLHandlerRegistry;
import org.navalplanner.web.common.entrypoints.URLHandler;
import org.navalplanner.web.common.entrypoints.EntryPointsHandler;
import org.zkoss.ganttz.IPredicate;
import org.zkoss.ganttz.util.ComponentsFinder;
import org.zkoss.zk.ui.Component;
@ -171,7 +171,7 @@ public class WorkReportCRUDController extends GenericForwardComposer implements
.getFellowIfAny("listWorkReportLines");
messagesForUser = new MessagesForUser(messagesContainer);
comp.setVariable("controller", this, true);
final URLHandler<IWorkReportCRUDControllerEntryPoints> handler = URLHandlerRegistry
final EntryPointsHandler<IWorkReportCRUDControllerEntryPoints> handler = URLHandlerRegistry
.getRedirectorFor(IWorkReportCRUDControllerEntryPoints.class);
handler.register(this, page);
initCurrentList();

View file

@ -45,7 +45,7 @@ import org.navalplanner.web.common.Util;
import org.navalplanner.web.common.components.Autocomplete;
import org.navalplanner.web.common.components.NewDataSortableGrid;
import org.navalplanner.web.common.entrypoints.IURLHandlerRegistry;
import org.navalplanner.web.common.entrypoints.URLHandler;
import org.navalplanner.web.common.entrypoints.EntryPointsHandler;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zk.ui.event.CheckEvent;
@ -139,7 +139,7 @@ public class WorkReportTypeCRUDController extends GenericForwardComposer
super.doAfterCompose(comp);
messagesForUser = new MessagesForUser(messagesContainer);
comp.setVariable("controller", this, true);
final URLHandler<IWorkReportTypeCRUDControllerEntryPoints> handler = URLHandlerRegistry
final EntryPointsHandler<IWorkReportTypeCRUDControllerEntryPoints> handler = URLHandlerRegistry
.getRedirectorFor(IWorkReportTypeCRUDControllerEntryPoints.class);
handler.register(this, page);
getVisibility().showOnly(listWindow);