Wednesday, 15 April 2015

java - Is toResponse from ExceptionMapper thread safe? -


I use RestEasy in my application and I have toResponse Method exception mappers interface.

My question is this: Is there a problem in such an environment in which there are large-scale requests (many requests will be thrown out of the exception)? Is this thread safety?

I must admit that I still do not understand the question completely. / P>

I used the exception to the translation of the response like this: I define an exception class which extends the javax.ws.rs.WebApplicationException . Then in the manufacturer of my exception class, I call a super constructor with the appropriate parameters, eg Super (Response. Stats (404). Antititi (Error Message). Build ())

What's really good about it as a unit of DTI Can also be used and it is translated.

Note that I do not use reciprocity. I use jersey with Jackson.

That is why I throw an exception in my business logic, compared to this by the publishers and translated into the reaction. There is no room for Thread-Asanta;)


No comments:

Post a Comment