public abstract class AbstractService extends Object
Constructor and Description |
---|
AbstractService() |
Modifier and Type | Method and Description |
---|---|
abstract void |
handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the service request and stores the result in the response.
|
protected com.thetransactioncompany.jsonrpc2.JSONRPC2Request |
parseJSONRequest(javax.servlet.http.HttpServletRequest request)
Parses the JSON request.
|
protected static String |
stack2string(Exception e)
Gets the exception stack trace in a string.
|
protected void |
writeJSONObject(javax.servlet.http.HttpServletResponse response,
com.thetransactioncompany.jsonrpc2.JSONRPC2Response jresp)
Writes json object.
|
public abstract void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
request
- the requestresponse
- the responseprotected com.thetransactioncompany.jsonrpc2.JSONRPC2Request parseJSONRequest(javax.servlet.http.HttpServletRequest request) throws IOException, com.thetransactioncompany.jsonrpc2.JSONRPC2ParseException
request
- the requestIOException
- Signals that an I/O exception has occurred.com.thetransactioncompany.jsonrpc2.JSONRPC2ParseException
- if JSON request is invalidprotected void writeJSONObject(javax.servlet.http.HttpServletResponse response, com.thetransactioncompany.jsonrpc2.JSONRPC2Response jresp) throws IOException
response
- the responsejresp
- the JSON responseIOException
- Signals that an I/O exception has occurred.Copyright © 2015. All rights reserved.