webServiceContainer.getWsdl(request, response);
jettyRequest.setHandled(true);
} catch (IOException e) {
throw e;
} catch (Exception e) {
throw (HttpException) new HttpException(500, "Could not fetch wsdl!").initCause(e);
}
} else {
if (isConfidentialTransportGuarantee) {
if (!req.isSecure()) {
throw new HttpException(403, null);
}
} else if (isIntegralTransportGuarantee) {
if (!jettyRequest.getConnection().isIntegral(jettyRequest)) {
throw new HttpException(403, null);
}
}
PolicyContext.setHandlerData((realm == null) ? null : req);
Thread currentThread = Thread.currentThread();
ClassLoader oldClassLoader = currentThread.getContextClassLoader();
currentThread.setContextClassLoader(classLoader);
//hard to imagine this could be anything but null, but....
// Subject oldSubject = ContextManager.getCurrentCaller();
try {
if (authenticator != null) {
String pathInContext = org.mortbay.util.URIUtil.canonicalPath(req.getContextPath());
if (authenticator.authenticate(realm, pathInContext, jettyRequest, jettyResponse) == null) {
throw new HttpException(403, null);
}
} else {
//EJB will figure out correct defaultSubject shortly
//TODO consider replacing the GenericEJBContainer.DefaultSubjectInterceptor with this line
//setting the defaultSubject.
ContextManager.popCallers(null);
}
try {
webServiceContainer.invoke(request, response);
jettyRequest.setHandled(true);
} catch (IOException e) {
throw e;
} catch (Exception e) {
throw (HttpException) new HttpException(500, "Could not process message!").initCause(e);
}
} finally {
// ContextManager.setCurrentCaller(oldSubject);
currentThread.setContextClassLoader(oldClassLoader);
}