From: Terefang V. <ter...@gm...> - 2015-01-22 09:13:12
|
hi! i think that other 3rd parties might also like to go the non jax-rs route. we decided to use json-rpc with only the basic java objects (Collection, Map, String, Integer, Boolean, Long, Float, Double) for maximum interoperability due to language issues (perl, python, java, dotnet) (http://json-rpc.org/wiki/specification) for our java environment we chose jsonrpc4j, since it can be used over almost any transport (stream) and and can use interface proxies. (https://github.com/briandilley/jsonrpc4j#client) unit testing the rpc calls is trivial. (i use RESTClient for directly calling the endpoint for verification) ok now making it work ... i already know that i need an authentication filter -- my current code looks like this: --- @Override public ServletContextHandler getServletContextHandler() { if (context != null) return context; context = new ServletContextHandler(ServletContextHandler.SESSIONS); context.setContextPath(description.getContextAddress()); // authnFilter = ... // context.addFilter(new FilterHolder(authnFilter), "/*", EnumSet.of(DispatcherType.REQUEST)); JsonRpcServlet theServlet = new JsonRpcServlet(); theServlet.setAttributesManagement(attributesMan); theServlet.setGroupsManagement(groupsMan); theServlet.setIdentitiesManagement(identitiesMan); theServlet.setSessionManagement(sessionMan); context.addServlet(createServletHolder(theServlet), this.getEndpointDescription().getContextAddress()+"/json-rpc"); return context; } protected ServletHolder createServletHolder(Servlet servlet) { ServletHolder holder = new ServletHolder(servlet); holder.setInitParameter("closeIdleSessions", "true"); holder.setInitParameter("session-timeout", "3600"); return holder; } --- can you point me in the right direction ? regards, -- terefang |