public RESTDispatcher(GeoServer gs) { this.gs = gs; setSupportedMethods(new String[] { METHOD_GET, METHOD_POST, METHOD_PUT, METHOD_DELETE, METHOD_HEAD }); }
protected void initApplicationContext() throws BeansException { super.initApplicationContext(); myConverter = new GeoServerServletConverter(getServletContext()); myConverter.setTarget(createRoot()); callbacks = GeoServerExtensions.extensions(DispatcherCallback.class, getApplicationContext()); }
public void addRoutes(Map m, Router r){ Iterator it = m.entrySet().iterator(); while (it.hasNext()){ Map.Entry entry = (Map.Entry) it.next(); // LOG.info("Found mapping: " + entry.getKey().toString()); Restlet restlet = (getApplicationContext().getBean(entry.getValue().toString()) instanceof Resource) ? new BeanResourceFinder(getApplicationContext(), entry.getValue().toString()) : new BeanDelegatingRestlet(getApplicationContext(), entry.getValue().toString()); String path = entry.getKey().toString(); r.attach(path, restlet); if (path.indexOf("?") == -1){ r.attach(path + "?{q}", restlet); } else LOG.fine("Query string already listed in restlet mapping: " + path); } }
addRoutes(rm.getRoutes(), myRouter);