java - Is toResponse from ExceptionMapper thread safe? -
i use resteasy
in application , have simple implementation of toresponse
method exceptionmapper
interface.
my question is: method have problems in environment massive amount of requests happening(many requests cause exception thrown)? have thread safety?
i must admit still don't understand question fully.
i used use exception response translation way: define exception class extends javax.ws.rs.webapplicationexception
. in constructor of exception class call super constructor appropriate params, e.g. super(response.status(404).entity(errormessage).build())
what nice can use dto entity , gets translated.
note don't use reasteasy. use jersey jackson.
so in business logic throw exception, it's handled jaxrs , translated response. there's no place thread-unsafety ;)
Comments
Post a Comment