com.googlecode.jsonrpc4j.spring.CompositeJsonServiceExporter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsonrpc4j Show documentation
Show all versions of jsonrpc4j Show documentation
This project aims to provide the facility to easily implement JSON-RPC for the java programming language.
package com.googlecode.jsonrpc4j.spring;
import com.googlecode.jsonrpc4j.JsonRpcServer;
import org.springframework.web.HttpRequestHandler;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* A Composite service exporter for spring that exposes
* multiple services via JSON-RPC over HTTP.
*/
@SuppressWarnings("unused")
public class CompositeJsonServiceExporter extends AbstractCompositeJsonServiceExporter implements HttpRequestHandler {
private JsonRpcServer jsonRpcServer;
/**
* {@inheritDoc}
*/
protected void exportService() throws Exception {
jsonRpcServer = getJsonRpcServer();
}
/**
* {@inheritDoc}
*/
public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
jsonRpcServer.handle(request, response);
response.getOutputStream().flush();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy