Ejb3MessageDispatcherpublic class Ejb3MessageDispatcher extends Object implements EjbMessageDispatcherImplementation of the Ejb Message Dispatcher for EJB3 endpoints. |
Fields Summary |
---|
private static Logger | logger | private static WsUtil | wsUtil | private com.sun.enterprise.webservice.monitoring.WebServiceEngineImpl | wsEngine |
Constructors Summary |
---|
public Ejb3MessageDispatcher()Creates a new instance of Ejb3MessageDispatcher
wsEngine = WebServiceEngineImpl.getInstance();
|
Methods Summary |
---|
private void | handleGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, javax.servlet.ServletContext ctxt, EjbRuntimeEndpointInfo endpointInfo)
try {
ServletAdapter adapter =
(ServletAdapter) endpointInfo.prepareInvocation(false);
if (adapter != null) {
adapter.publishWSDL(ctxt, req, resp);
} else {
String message = "Invalid wsdl request " + req.getRequestURL();
(new WsUtil()).writeInvalidMethodType(resp, message);
}
} catch (Throwable e) {
String errorMessage = "invocation error on ejb endpoint " +
endpointInfo.getEndpoint().getEndpointName() + " at " +
endpointInfo.getEndpointAddressUri() + " : " + e.getMessage();
logger.log(Level.WARNING, errorMessage, e);
String binding = endpointInfo.getEndpoint().getProtocolBinding();
WsUtil.raiseException(resp, binding, errorMessage);
}
| private void | handlePost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, EjbRuntimeEndpointInfo endpointInfo)
try {
try {
ServletAdapter adapter =
(ServletAdapter) endpointInfo.prepareInvocation(true);
if (adapter != null) {
adapter.handle(null, req, resp);
} else {
logger.log(Level.SEVERE,
"Unable to find adpater for endpoint " + endpointInfo.getEndpoint().getName());
}
} finally {
// Always call release, even if an error happened
// during getImplementor(), since some of the
// preInvoke steps might have occurred. It's ok
// if implementor is null.
endpointInfo.releaseImplementor();
}
} catch (Throwable e) {
String errorMessage = "invocation error on ejb endpoint " +
endpointInfo.getEndpoint().getEndpointName() + " at " +
endpointInfo.getEndpointAddressUri() + " : " + e.getMessage();
logger.log(Level.WARNING, errorMessage, e);
String binding = endpointInfo.getEndpoint().getProtocolBinding();
WsUtil.raiseException(resp, binding, errorMessage);
}
| public void | invoke(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, javax.servlet.ServletContext ctxt, EjbRuntimeEndpointInfo endpointInfo)
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, "JAXWS WebServiceDispatcher " + req.getMethod() +
" entering for " + req.getRequestURI() + " and query string " + req.getQueryString());
}
String method = req.getMethod();
try {
if( method.equals("POST") ) {
handlePost(req, resp, endpointInfo);
} else if( method.equals("GET") ) {
handleGet(req, resp, ctxt, endpointInfo);
} else {
String errorMessage = "Unsupported method request = ["
+ method + "] for endpoint " +
endpointInfo.getEndpoint().getEndpointName() + " at " +
endpointInfo.getEndpointAddressUri();
logger.warning(errorMessage);
wsUtil.writeInvalidMethodType(resp, errorMessage);
}
} catch(Exception e) {
logger.log(Level.WARNING, "ejb endpoint exception", e);
}
|
|