if(dei != null) {
service = dei.getServiceName();
endpointName = dei.getEndpointName();
}
JBIAdapterBuilder builder = new JBIAdapterBuilder();
JBIAdapter jbiAdapter = null;
try {
debug(Level.FINE,"serviceengine.process_incoming_request",
new Object[]{service.getLocalPart(), endpointName});
jbiAdapter = builder.createAdapter(service,endpointName,me);
Thread curThread = Thread.currentThread();
if (jbiAdapter != null) {
ClassLoader currentLoader =
curThread.getContextClassLoader();
try {
// do we need to perform security checks here?
curThread.setContextClassLoader(jbiAdapter.getClassLoader());
// call to invoke the endpoint
jbiAdapter.handle();
} finally {
curThread.setContextClassLoader(currentLoader);
}
} else
logger.log(Level.WARNING, "Endpoint ["+endpointName+"] not registered");
debug(Level.FINE,"serviceengine.success_incoming_request",
new Object[]{service.getLocalPart(), endpointName});
} catch(Throwable e) {
logger.log(Level.SEVERE, "serviceengine.error_incoming_request", e);
ServiceEngineException seException = new ServiceEngineException(e);
if(jbiAdapter != null) {
jbiAdapter.handleException(seException);
}
}
} catch(Exception e) {
logger.log(Level.SEVERE, "JavaEEServiceEngine : Error processing request" + e , e);
}