msg = new MessageImpl(); Exchange exchange = new ExchangeImpl(); msg.setExchange(exchange);
private MessageImpl createMessage(Endpoint e, Bus b) { MessageImpl m = new MessageImpl(); Exchange ex = new ExchangeImpl(); m.setExchange(ex); ex.put(Endpoint.class, e); ex.put(Bus.class, b); ex.put(Service.class, e.getService()); return m; }
private MessageImpl createMessage(Endpoint e, Bus b) { MessageImpl m = new MessageImpl(); Exchange ex = new ExchangeImpl(); m.setExchange(ex); ex.put(Endpoint.class, e); ex.put(Bus.class, b); ex.put(Service.class, e.getService()); return m; }
public void handleResponse() throws IOException { LOG.log(Level.FINE, "incoming observer is " + incomingObserver); Exchange exchange = message.getExchange(); CorbaMessage corbaMsg = (CorbaMessage) message; MessageImpl inMessage = new MessageImpl(); CorbaDestination destination = new CorbaDestination(endpointInfo, orbConfig, typeMap); inMessage.setDestination(destination); exchange.put(ORB.class, orb); inMessage.setExchange(exchange); CorbaMessage inCorbaMsg = new CorbaMessage(inMessage); inCorbaMsg.setCorbaTypeMap(typeMap); if (corbaMsg.getStreamableException() != null) { exchange.setInFaultMessage(corbaMsg); inCorbaMsg.setStreamableException(corbaMsg.getStreamableException()); } else if (corbaMsg.getSystemException() != null) { exchange.setInFaultMessage(corbaMsg); inCorbaMsg.setSystemException(corbaMsg.getSystemException()); } LOG.log(Level.FINE, "incoming observer is " + incomingObserver); incomingObserver.onMessage(inCorbaMsg); message.setContent(Exception.class, inCorbaMsg.getContent(Exception.class)); }
public void run() { ExchangeImpl ex = new ExchangeImpl(); ex.put(Bus.class, destination.getBus()); ex.setInMessage(inMsg); inMsg.setExchange(ex); ex.put(IN_EXCHANGE, exchange); try { destination.getMessageObserver().onMessage(inMsg); } catch (Throwable t) { Message m = inMsg.getExchange().getOutFaultMessage(); if (m == null) { m = inMsg.getExchange().getOutMessage(); } if (m != null) { try { m.put(Message.RESPONSE_CODE, 500); m.put(Message.PROTOCOL_HEADERS, new HashMap<String, List<String>>()); m.getExchange().put(Message.RESPONSE_CODE, 500); m.getContent(OutputStream.class).close(); } catch (IOException e) { //ignore } } } } };
public void run() { ExchangeImpl ex = new ExchangeImpl(); ex.put(Bus.class, destination.getBus()); ex.setInMessage(inMsg); inMsg.setExchange(ex); ex.put(IN_EXCHANGE, exchange); try { destination.getMessageObserver().onMessage(inMsg); } catch (Throwable t) { Message m = inMsg.getExchange().getOutFaultMessage(); if (m == null) { m = inMsg.getExchange().getOutMessage(); } if (m != null) { try { m.put(Message.RESPONSE_CODE, 500); m.put(Message.PROTOCOL_HEADERS, new HashMap<String, List<String>>()); m.getExchange().put(Message.RESPONSE_CODE, 500); m.getContent(OutputStream.class).close(); } catch (IOException e) { //ignore } } } } };
private MuleEvent sendThroughCxf(MuleEvent event, Exchange exchange) throws TransformerException, IOException m.setExchange(exchange); final MuleMessage muleReqMsg = event.getMessage();
public void invoke(ServerRequest request) throws CorbaBindingException { String opName = request.operation(); QName requestOperation = operationMap.get(opName); MessageImpl msgImpl = new MessageImpl(); msgImpl.setDestination(getDestination()); Exchange exg = new ExchangeImpl(); exg.put(String.class, requestOperation.getLocalPart()); exg.put(ORB.class, getOrb()); exg.put(ServerRequest.class, request); msgImpl.setExchange(exg); CorbaMessage msg = new CorbaMessage(msgImpl); msg.setCorbaTypeMap(typeMap); // If there's no output message part in our operation then it's a oneway op BindingMessageInfo bindingMsgOutputInfo = null; BindingOperationInfo bindingOpInfo = null; try { bindingOpInfo = this.destination.getEndPointInfo().getBinding().getOperation(requestOperation); } catch (Exception ex) { throw new CorbaBindingException("Invalid Request. Operation unknown: " + opName); } if (bindingOpInfo != null) { bindingMsgOutputInfo = bindingOpInfo.getOutput(); if (bindingMsgOutputInfo == null) { exg.setOneWay(true); } } // invokes the interceptors getObserver().onMessage(msg); }
resMsg.setContent(InputStream.class, new ByteArrayInputStream(res)); resMsg.put(Message.CONTENT_TYPE, obs.getResponseContentType()); resMsg.setExchange(new ExchangeImpl()); AttachmentDeserializer deserializer = new AttachmentDeserializer(resMsg); deserializer.initializeAttachments();
resMsg.setContent(InputStream.class, new ByteArrayInputStream(res)); resMsg.put(Message.CONTENT_TYPE, obs.getResponseContentType()); resMsg.setExchange(new ExchangeImpl()); AttachmentDeserializer deserializer = new AttachmentDeserializer(resMsg); deserializer.initializeAttachments();
resMsg.setContent(InputStream.class, new ByteArrayInputStream(res)); resMsg.put(Message.CONTENT_TYPE, obs.getResponseContentType()); resMsg.setExchange(new ExchangeImpl()); AttachmentDeserializer deserializer = new AttachmentDeserializer(resMsg); deserializer.initializeAttachments();