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

Popular posts from this blog

c# - ItextSharp font color issue in ver 5.5.4+ -

jquery - Multiple issues with pushstate: history, loading, calling functions -

ios - retrievePeripherals deprecated in IOS7 how to substitude it with retrievePeripheralsWithIdentifiers -