public AbstractHTTPDestination createDestination(EndpointInfo endpointInfo, Bus bus, DestinationRegistry registry) throws IOException { return new ServletDestination(bus, registry, endpointInfo, endpointInfo.getAddress()); } }
protected String getBasePath(String contextPath) throws IOException { String address = getAddress().getAddress().getValue(); if (address == null) { return contextPath; } if (address.startsWith("http")) { return URI.create(address).getPath(); } return contextPath + address; }
private String getAbsoluteAddress(String basePath, AbstractDestination d) { String endpointAddress = (String)d.getEndpointInfo().getProperty("publishedEndpointUrl"); if (endpointAddress != null) { return endpointAddress; } endpointAddress = d.getEndpointInfo().getAddress(); if (d instanceof ServletDestination && (endpointAddress.startsWith("http://") || endpointAddress.startsWith("https://"))) { String path = ((ServletDestination)d).getPath(); return basePath + path; } else if (basePath == null || endpointAddress.startsWith(basePath)) { return endpointAddress; } else { return basePath + endpointAddress; } } }
/** * Activate receipt of incoming messages. */ protected void activate() { super.activate(); LOG.log(Level.FINE, "Activating receipt of incoming messages"); if (engine != null) { UndertowHTTPHandler jhd = createUndertowHTTPHandler(this, contextMatchOnExact()); engine.addServant(nurl, jhd); } }
/** * Deactivate receipt of incoming messages. */ protected void deactivate() { super.deactivate(); LOG.log(Level.FINE, "Deactivating receipt of incoming messages"); if (engine != null) { engine.removeServant(nurl); } }
protected void setupContinuation(Message inMessage, final HttpServletRequest req, final HttpServletResponse resp) { if (engine != null && engine.getContinuationsEnabled()) { super.setupContinuation(inMessage, req, resp); } }
protected void invokeComplete(final ServletContext context, final HttpServletRequest req, final HttpServletResponse resp, Message m) throws IOException { resp.flushBuffer(); super.invokeComplete(context, req, resp, m); }
private Function<ServletDestination, String> getServletDestinationPath(ServletConfig sc, LogFacade log) final Endpoint endpoint = ChainInitiationObserver.class.cast(sd.getMessageObserver()).getEndpoint(); final ApplicationInfo app = ApplicationInfo.class.cast(endpoint.get(Application.class.getName())); final JAXRSServiceFactoryBean sfb = JAXRSServiceFactoryBean.class.cast(endpoint.get(JAXRSServiceFactoryBean.class.getName())); final String base = sd.getEndpointInfo().getAddress();
protected OutputStream flushHeaders(Message outMessage, boolean getStream) throws IOException { OutputStream out = super.flushHeaders(outMessage, getStream); return wrapOutput(out); }
/** * Activate receipt of incoming messages. */ protected void activate() { super.activate(); LOG.log(Level.FINE, "Activating receipt of incoming messages"); // pick the handler supporting websocket if jetty-websocket is available otherwise pick the default handler. if (engine != null) { handler = createJettyHTTPHandler(this, contextMatchOnExact()); engine.addServant(nurl, handler); } }
/** * Deactivate receipt of incoming messages. */ protected void deactivate() { super.deactivate(); LOG.log(Level.FINE, "Deactivating receipt of incoming messages"); if (engine != null) { engine.removeServant(nurl); } handler = null; }
protected void setupContinuation(Message inMessage, final HttpServletRequest req, final HttpServletResponse resp) { if (engine != null && engine.getContinuationsEnabled()) { super.setupContinuation(inMessage, req, resp); } }
protected void invokeComplete(final ServletContext context, final HttpServletRequest req, final HttpServletResponse resp, Message m) throws IOException { resp.flushBuffer(); super.invokeComplete(context, req, resp, m); }
private Function<ServletDestination, String> getServletDestinationPath(ServletConfig sc, LogFacade log) final Endpoint endpoint = ChainInitiationObserver.class.cast(sd.getMessageObserver()).getEndpoint(); final ApplicationInfo app = ApplicationInfo.class.cast(endpoint.get(Application.class.getName())); final JAXRSServiceFactoryBean sfb = JAXRSServiceFactoryBean.class.cast(endpoint.get(JAXRSServiceFactoryBean.class.getName())); final String base = sd.getEndpointInfo().getAddress();
protected OutputStream flushHeaders(Message outMessage, boolean getStream) throws IOException { OutputStream out = super.flushHeaders(outMessage, getStream); return wrapOutput(out); }
/** * Activate receipt of incoming messages. */ protected void activate() { super.activate(); LOG.log(Level.FINE, "Activating receipt of incoming messages"); // pick the handler supporting websocket if jetty-websocket is available otherwise pick the default handler. if (engine != null) { handler = createJettyHTTPHandler(this, contextMatchOnExact()); engine.addServant(nurl, handler); } }
/** * Deactivate receipt of incoming messages. */ protected void deactivate() { super.deactivate(); LOG.log(Level.FINE, "Deactivating receipt of incoming messages"); if (engine != null) { engine.removeServant(nurl); } handler = null; }
protected void setupContinuation(Message inMessage, final HttpServletRequest req, final HttpServletResponse resp) { if (engine != null && engine.getContinuationsEnabled()) { super.setupContinuation(inMessage, req, resp); if (!inMessage.containsKey(ContinuationProvider.class.getName())) { inMessage.put(ContinuationProvider.class.getName(), new JettyContinuationProvider(req, resp, inMessage)); } } }
protected void invokeComplete(final ServletContext context, final HttpServletRequest req, final HttpServletResponse resp, Message m) throws IOException { resp.flushBuffer(); Request baseRequest = (req instanceof Request) ? (Request)req : getCurrentRequest(); if (baseRequest != null) { baseRequest.setHandled(true); } super.invokeComplete(context, req, resp, m); }
public AbstractHTTPDestination createDestination(EndpointInfo endpointInfo, Bus bus, DestinationRegistry registry) throws IOException { return new ServletDestination(bus, registry, endpointInfo, endpointInfo.getAddress()); } }