params.add(handler); return ret; } else if (cp != null && cp.getContinuation() != null) { final Continuation c = cp.getContinuation(); c.suspend(0); JaxwsServerHandler handler = new JaxwsServerHandler(c);
protected void invokeComplete(final ServletContext context, final HttpServletRequest req, final HttpServletResponse resp, Message m) throws IOException { ContinuationProvider p = m.get(ContinuationProvider.class); if (p != null) { p.complete(); } }
private void initContinuation() { ContinuationProvider provider = (ContinuationProvider)inMessage.get(ContinuationProvider.class.getName()); cont = provider.getContinuation(); initialSuspend = true; }
protected void invokeComplete(final ServletContext context, final HttpServletRequest req, final HttpServletResponse resp, Message m) throws IOException { ContinuationProvider p = m.get(ContinuationProvider.class); if (p != null) { p.complete(); } }
private void initContinuation() { ContinuationProvider provider = (ContinuationProvider)inMessage.get(ContinuationProvider.class.getName()); cont = provider.getContinuation(); initialSuspend = true; }
ContinuationProvider p = inMessage.get(ContinuationProvider.class); if (p != null) { p.complete();
private Continuation getContinuation(Exchange cxfExchange) { ContinuationProvider provider = (ContinuationProvider)cxfExchange.getInMessage().get(ContinuationProvider.class.getName()); Continuation continuation = provider == null ? null : provider.getContinuation(); // Make sure we don't return the JMSContinuation, as it doesn't support the Continuation we wants // Don't want to introduce the dependency of cxf-rt-transprot-jms here if (continuation != null && continuation.getClass().getName().equals("org.apache.cxf.transport.jms.continuations.JMSContinuation")) { return null; } else { return continuation; } }
ContinuationProvider p = inMessage.get(ContinuationProvider.class); if (p != null) { p.complete();
private Continuation getContinuation(Exchange cxfExchange) { ContinuationProvider provider = (ContinuationProvider)cxfExchange.getInMessage().get(ContinuationProvider.class.getName()); return provider == null ? null : provider.getContinuation(); }
private Continuation getContinuation(String name) { synchronized (suspended) { Continuation suspendedCont = suspended.remove(name); if (suspendedCont != null) { return suspendedCont; } } ContinuationProvider provider = (ContinuationProvider)context.getMessageContext().get(ContinuationProvider.class.getName()); return provider.getContinuation(); } }
private Continuation getContinuation(Integer name) { ContinuationProvider provider = (ContinuationProvider)context.getMessageContext().get(ContinuationProvider.class.getName()); return provider.getContinuation(); }
private Continuation getContinuation(String name) { //System.out.println("Getting continuation for " + name); synchronized (suspended) { Continuation suspendedCont = suspended.remove(name); if (suspendedCont != null) { return suspendedCont; } } ContinuationProvider provider = (ContinuationProvider)context.getMessageContext().get(ContinuationProvider.class.getName()); return provider.getContinuation(); }
private Continuation getContinuation(String name) { synchronized (suspended) { Continuation suspendedCont = suspended.remove(name); if (suspendedCont != null) { return suspendedCont; } } ContinuationProvider provider = (ContinuationProvider)context.getMessageContext().get(ContinuationProvider.class.getName()); return provider.getContinuation(); } }
private Continuation getContinuation(String name) { //System.out.println("Getting continuation for " + name); synchronized (suspended) { Continuation suspendedCont = suspended.remove(name); if (suspendedCont != null) { return suspendedCont; } } ContinuationProvider provider = (ContinuationProvider)context.getMessageContext().get(ContinuationProvider.class.getName()); return provider.getContinuation(); }
private Continuation getContinuation(String name) { ContinuationProvider provider = (ContinuationProvider)context.getMessageContext().get(ContinuationProvider.class.getName()); return provider.getContinuation(); } }
@Override public void writeTo(NioWriteEntity entity, Class<?> cls, Type t, Annotation[] anns, MediaType mt, MultivaluedMap<String, Object> headers, OutputStream os) throws IOException, WebApplicationException { Continuation cont = getContinuationProvider().getContinuation(); NioWriteListenerImpl listener = new NioWriteListenerImpl(cont, entity, os); Message m = JAXRSUtils.getCurrentMessage(); m.put(WriteListener.class, listener); // return the current thread to the pool cont.suspend(0); }
params.add(handler); return ret; } else if (cp != null && cp.getContinuation() != null) { final Continuation c = cp.getContinuation(); c.suspend(0); JaxwsServerHandler handler = new JaxwsServerHandler(c);
private Continuation getContinuation(String name) { ContinuationProvider provider = (ContinuationProvider)context.get(ContinuationProvider.class.getName()); if (provider == null) { Message m = PhaseInterceptorChain.getCurrentMessage(); UriInfo uriInfo = new UriInfoImpl(m); if (uriInfo.getAbsolutePath().toString().contains("/books/subresources/")) { // when we suspend a CXF continuation from a sub-resource, the invocation will // return directly to that object - and sub-resources do not have contexts supported // by default - so we just need to depend on PhaseInterceptorChain provider = (ContinuationProvider)m.get(ContinuationProvider.class.getName()); } } if (provider == null) { throw new WebApplicationException(500); } synchronized (suspended) { Continuation suspendedCont = suspended.remove(name); if (suspendedCont != null) { return suspendedCont; } } return provider.getContinuation(); }
@Override public void handleMessage(Message message) throws Fault { ThrottleResponse rsp = manager.getThrottleResponse(getPhase(), message); if (rsp == null) { return; } message.getExchange().put(ThrottleResponse.class, rsp); if (rsp.getResponseCode() >= 300) { createOutMessage(message); message.getInterceptorChain().doInterceptStartingAt(message, OutgoingChainInterceptor.class.getName()); return; } long l = rsp.getDelay(); if (l > 0) { ContinuationProvider cp = message.get(ContinuationProvider.class); if (cp == null) { LOG.warning("No ContinuationProvider available, sleeping on current thread"); try { Thread.sleep(l); } catch (InterruptedException e) { //ignore } return; } Continuation c = cp.getContinuation(); c.suspend(l); } } private Message createOutMessage(Message inMessage) {
@Override public void handleMessage(Message message) throws Fault { ThrottleResponse rsp = manager.getThrottleResponse(getPhase(), message); if (rsp == null) { return; } message.getExchange().put(ThrottleResponse.class, rsp); if (rsp.getResponseCode() >= 300) { createOutMessage(message); message.getInterceptorChain().doInterceptStartingAt(message, OutgoingChainInterceptor.class.getName()); return; } long l = rsp.getDelay(); if (l > 0) { ContinuationProvider cp = message.get(ContinuationProvider.class); if (cp == null) { LOG.warning("No ContinuationProvider available, sleeping on current thread"); try { Thread.sleep(l); } catch (InterruptedException e) { //ignore } return; } Continuation c = cp.getContinuation(); c.suspend(l); } } private Message createOutMessage(Message inMessage) {