((MessageImpl)inMessage).setDestination(this);
((MessageImpl)inMessage).setDestination(this); } else { LOG.fine("Get the message from the request for processing");
public void process(Exchange camelExchange) throws Exception { LOG.trace("Received request : {}", camelExchange); org.apache.cxf.message.Message cxfMessage = endpoint.getCxfBeanBinding().createCxfMessageFromCamelExchange(camelExchange, endpoint.getHeaderFilterStrategy()); cxfMessage.put(CamelTransportConstants.CAMEL_EXCHANGE, camelExchange); ((MessageImpl)cxfMessage).setDestination(this); // Handling the incoming message // The response message will be send back by the outgoing chain incomingObserver.onMessage(cxfMessage); }
((MessageImpl)inMessage).setDestination(this);
final Exchange exchange = new ExchangeImpl(); exchange.setDestination(UDPDestination.this); m.setDestination(UDPDestination.this); exchange.setInMessage(m); m.setContent(InputStream.class, new ByteArrayInputStream(bytes, 0, p.getLength()));
final Exchange exchange = new ExchangeImpl(); exchange.setDestination(UDPDestination.this); m.setDestination(UDPDestination.this); exchange.setInMessage(m); m.setContent(InputStream.class, new ByteArrayInputStream(bytes, 0, p.getLength()));
@Override public void invoke(final ServletConfig config, final ServletContext context, final HttpServletRequest req, final HttpServletResponse resp) throws IOException { // eager create the message to ensure we set our continuation for @Suspended Message inMessage = retrieveFromContinuation(req); if (inMessage == null) { inMessage = new MessageImpl(); final ExchangeImpl exchange = new ExchangeImpl(); exchange.setInMessage(inMessage); setupMessage(inMessage, config, context, req, resp); exchange.setSession(new HTTPSession(req)); MessageImpl.class.cast(inMessage).setDestination(this); } delegate.invoke(config, context, req, resp); }
inMessage.setDestination(this); getMessageObserver().onMessage(inMessage);
setupMessage(inMessage, context, req, resp); ((MessageImpl)inMessage).setDestination(this);
((MessageImpl)inMessage).setDestination(this); } else { LOG.fine("Get the message from the request for processing");
inMessage.setDestination(((JBITransportFactory)conduitInitiator). getDestination(exchange.getService().toString() + exchange.getInterfaceName().toString()));
inMessage.setDestination(((JBITransportFactory)conduitInitiator). getDestination(exchange.getService().toString() + exchange.getInterfaceName().toString()));
protected void processStreamIo(IoSession session, InputStream in, OutputStream out) { final MessageImpl m = new MessageImpl(); final Exchange exchange = new ExchangeImpl(); exchange.setDestination(UDPDestination.this); m.setDestination(UDPDestination.this); exchange.setInMessage(m); m.setContent(InputStream.class, in); out = new UDPDestinationOutputStream(out); m.put(OutputStream.class, out); queue.execute(() -> getMessageObserver().onMessage(m)); }
protected void processStreamIo(IoSession session, InputStream in, OutputStream out) { final MessageImpl m = new MessageImpl(); final Exchange exchange = new ExchangeImpl(); exchange.setDestination(UDPDestination.this); m.setDestination(UDPDestination.this); exchange.setInMessage(m); m.setContent(InputStream.class, in); out = new UDPDestinationOutputStream(out); m.put(OutputStream.class, out); queue.execute(() -> getMessageObserver().onMessage(m)); }
((MessageImpl)inMessage).setDestination(this); } else { LOG.fine("Get the message from the request for processing");
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)); }
private void dispatchDirect(Message message) throws IOException { if (destination.getMessageObserver() == null) { throw new IllegalStateException("Local destination does not have a MessageObserver on address " + destination.getAddress().getAddress().getValue()); } MessageImpl copy = new MessageImpl(); copy.put(IN_CONDUIT, this); copy.setDestination(destination); transportFactory.copy(message, copy); MessageImpl.copyContent(message, copy); OutputStream out = message.getContent(OutputStream.class); out.flush(); out.close(); CachedOutputStream stream = message.get(CachedOutputStream.class); copy.setContent(InputStream.class, stream.getInputStream()); copy.removeContent(CachedOutputStream.class); stream.releaseTempFileHold(); // Create a new incoming exchange and store the original exchange for the response ExchangeImpl ex = new ExchangeImpl(); ex.setInMessage(copy); ex.put(IN_EXCHANGE, message.getExchange()); ex.put(LocalConduit.DIRECT_DISPATCH, true); ex.setDestination(destination); destination.getMessageObserver().onMessage(copy); }
private void dispatchDirect(Message message) throws IOException { if (destination.getMessageObserver() == null) { throw new IllegalStateException("Local destination does not have a MessageObserver on address " + destination.getAddress().getAddress().getValue()); } MessageImpl copy = new MessageImpl(); copy.put(IN_CONDUIT, this); copy.setDestination(destination); transportFactory.copy(message, copy); MessageImpl.copyContent(message, copy); OutputStream out = message.getContent(OutputStream.class); out.flush(); out.close(); CachedOutputStream stream = message.get(CachedOutputStream.class); copy.setContent(InputStream.class, stream.getInputStream()); copy.removeContent(CachedOutputStream.class); stream.releaseTempFileHold(); // Create a new incoming exchange and store the original exchange for the response ExchangeImpl ex = new ExchangeImpl(); ex.setInMessage(copy); ex.put(IN_EXCHANGE, message.getExchange()); ex.put(LocalConduit.DIRECT_DISPATCH, true); ex.setDestination(destination); destination.getMessageObserver().onMessage(copy); }
public void invoke(Request request, Response response) throws Exception { MessageImpl message = new MessageImpl(); message.setContent(InputStream.class, request.getInputStream()); message.setDestination(this);
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); }