1 23 package com.sun.enterprise.jbi.serviceengine.bridge; 24 import com.sun.enterprise.jbi.serviceengine.ServiceEngineException; 25 import com.sun.enterprise.jbi.serviceengine.bridge.transport.NMRServerConnection; 26 import com.sun.enterprise.jbi.serviceengine.comm.MessageProcessor; 27 import com.sun.xml.ws.spi.runtime.RuntimeEndpointInfo; 28 import com.sun.xml.ws.spi.runtime.Tie; 29 import com.sun.xml.ws.spi.runtime.WSRtObjectFactory; 30 31 import java.util.logging.Level ; 32 import javax.jbi.messaging.MessageExchange; 33 import javax.xml.namespace.QName ; 34 35 41 public class JAXWSMessageProcessor extends MessageProcessor { 42 45 public void process() { 46 execute(); 47 } 48 49 52 public void doWork() { 53 try { 54 MessageExchange me = getMessageExchange(); 56 String endpoint = me.getEndpoint().getEndpointName(); 57 QName service = me.getEndpoint().getServiceName(); 58 NMRServerConnection connection = new NMRServerConnection(me); 59 try { 60 debug(Level.FINEST,"serviceengine.process_incoming_request", 61 new Object []{service.getLocalPart(), endpoint}); 62 63 RuntimeEndpointInfo runtimeEndpointInfo = 64 (RuntimeEndpointInfo)RuntimeEndpointInfoRegistryImpl.getInstance(). 65 getRuntimeEndpointInfo(service, endpoint); 66 67 Tie tie = WSRtObjectFactory.newInstance().createTie(); 69 tie.handle(connection,runtimeEndpointInfo); 70 71 RuntimeEndpointInfoRegistryImpl.getInstance().releaseEndpoint(service, endpoint); 72 73 debug(Level.FINEST,"serviceengine.success_incoming_request", 74 new Object []{service.getLocalPart(), endpoint}); 75 76 } catch(Throwable e) { 77 logger.log(Level.SEVERE, "serviceengine.error_incoming_request", e); 78 79 ServiceEngineException seException = new ServiceEngineException(e); 80 connection.handleException(seException); 81 } 82 } catch(Exception e) { 83 logger.log(Level.SEVERE, "JavaEEServiceEngine : Error processing request" + e , e); 84 } 85 } 86 87 private void debug(Level logLevel, String msgID, Object [] params) { 88 logger.log(logLevel, msgID, params); 89 } 90 } 91 92 | Popular Tags |