});
}
}
private Continuation getContinuation(String name) {
ContinuationProvider provider =
(ContinuationProvider)context.get(ContinuationProvider.class.getName());
if (provider == null) {
Message m = PhaseInterceptorChain.getCurrentMessage();
UriInfo uriInfo = new UriInfoImpl(m);
if (uriInfo.getAbsolutePath().toString().contains("/books/subresources/")) {
// when we suspend a CXF continuation from a sub-resource, the invocation will
// return directly to that object - and sub-resources do not have contexts supported
// by default - so we just need to depend on PhaseInterceptorChain
provider = (ContinuationProvider)m.get(ContinuationProvider.class.getName());
}
}
if (provider == null) {
throw new WebApplicationException(500);
}
synchronized (suspended) {
Continuation suspendedCont = suspended.remove(name);
if (suspendedCont != null) {
return suspendedCont;
}
}
return provider.getContinuation();
}