public TextWireFormat getWireFormat() { if (wireFormat == null) { wireFormat = createWireFormat(); } return wireFormat; }
private void addGzipHandler(ServletContextHandler contextHandler) throws Exception { HandlerWrapper handler = null; try { handler = (HandlerWrapper) forName("org.eclipse.jetty.servlets.gzip.GzipHandler").newInstance(); } catch (Throwable t) { handler = (HandlerWrapper) forName("org.eclipse.jetty.server.handler.gzip.GzipHandler").newInstance(); } contextHandler.insertHandler(handler); }
@Override protected void doStart() throws Exception { createServer(); if (connector == null) { connector = socketConnectorFactory.createConnector(server); URI boundTo = bind(); contextHandler.addServlet(holder, "/"); contextHandler.setAttribute("acceptListener", getAcceptListener()); contextHandler.setAttribute("wireFormat", getWireFormat()); contextHandler.setAttribute("transportFactory", transportFactory); contextHandler.setAttribute("transportOptions", transportOptions); configureTraceMethod((ConstraintSecurityHandler) contextHandler.getSecurityHandler(), httpOptions.isEnableTrace()); addGzipHandler(contextHandler); int p2 = getConnectorLocalPort(); if (p2 != -1) { port = p2; setConnectURI(new URI(boundTo.getScheme(), boundTo.getUserInfo(), boundTo.getHost(),
@Override public TransportServer doBind(URI location) throws IOException { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); HttpTransportServer result = new HttpTransportServer(location, this); Map<String, Object> jettyOptions = IntrospectionSupport.extractProperties(options, "jetty."); Map<String, Object> httpOptions = IntrospectionSupport.extractProperties(options, "http."); Map<String, Object> transportOptions = IntrospectionSupport.extractProperties(options, "transport."); result.setJettyOptions(jettyOptions); result.setTransportOption(transportOptions); result.setHttpOptions(httpOptions); return result; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
protected void doStart() throws Exception { server = new Server(); if (connector == null) { connector = socketConnectorFactory.createConnector(); } URI bind = getBindLocation(); bind(); ServletContextHandler contextHandler = new ServletContextHandler(server, "/", ServletContextHandler.NO_SECURITY); ServletHolder holder = new ServletHolder(); holder.setServlet(new HttpTunnelServlet()); contextHandler.addServlet(holder, "/"); contextHandler.setAttribute("acceptListener", getAcceptListener()); contextHandler.setAttribute("wireFormat", getWireFormat()); contextHandler.setAttribute("transportFactory", transportFactory); contextHandler.setAttribute("transportOptions", transportOptions); GzipHandler gzipHandler = new GzipHandler(); contextHandler.setHandler(gzipHandler); server.start(); }
public TransportServer doBind(URI location) throws IOException { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); HttpTransportServer result = new HttpTransportServer(location, this); Map<String, Object> transportOptions = IntrospectionSupport.extractProperties(options, "transport."); result.setTransportOption(transportOptions); return result; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
public synchronized void init() throws ServletException { // lets initialize the ActiveMQ broker try { if (broker == null) { broker = createBroker(); // Add the servlet connector String url = getConnectorURL(); HttpTransportFactory factory = new HttpTransportFactory(); transportConnector = (HttpTransportServer) factory.doBind(new URI(url)); broker.addConnector(transportConnector); String brokerURL = getServletContext().getInitParameter("org.apache.activemq.brokerURL"); if (brokerURL != null) { log("Listening for internal communication on: " + brokerURL); } } broker.start(); } catch (Exception e) { throw new ServletException("Failed to start embedded broker: " + e, e); } // now lets register the listener TransportAcceptListener listener = transportConnector.getAcceptListener(); getServletContext().setAttribute("transportChannelListener", listener); super.init(); }
@Override protected void doStart() throws Exception { createServer(); if (connector == null) { connector = socketConnectorFactory.createConnector(server); URI boundTo = bind(); contextHandler.addServlet(holder, "/"); contextHandler.setAttribute("acceptListener", getAcceptListener()); contextHandler.setAttribute("wireFormat", getWireFormat()); contextHandler.setAttribute("transportFactory", transportFactory); contextHandler.setAttribute("transportOptions", transportOptions); configureTraceMethod((ConstraintSecurityHandler) contextHandler.getSecurityHandler(), httpOptions.isEnableTrace()); addGzipHandler(contextHandler); int p2 = getConnectorLocalPort(); if (p2 != -1) { port = p2; setConnectURI(new URI(boundTo.getScheme(), boundTo.getUserInfo(), boundTo.getHost(),
@Override public TransportServer doBind(URI location) throws IOException { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); HttpTransportServer result = new HttpTransportServer(location, this); Map<String, Object> jettyOptions = IntrospectionSupport.extractProperties(options, "jetty."); Map<String, Object> httpOptions = IntrospectionSupport.extractProperties(options, "http."); Map<String, Object> transportOptions = IntrospectionSupport.extractProperties(options, "transport."); result.setJettyOptions(jettyOptions); result.setTransportOption(transportOptions); result.setHttpOptions(httpOptions); return result; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
public synchronized void init() throws ServletException { // lets initialize the ActiveMQ broker try { if (broker == null) { broker = createBroker(); // Add the servlet connector String url = getConnectorURL(); HttpTransportFactory factory = new HttpTransportFactory(); transportConnector = (HttpTransportServer) factory.doBind(new URI(url)); broker.addConnector(transportConnector); String brokerURL = getServletContext().getInitParameter("org.apache.activemq.brokerURL"); if (brokerURL != null) { log("Listening for internal communication on: " + brokerURL); } } broker.start(); } catch (Exception e) { throw new ServletException("Failed to start embedded broker: " + e, e); } // now lets register the listener TransportAcceptListener listener = transportConnector.getAcceptListener(); getServletContext().setAttribute("transportChannelListener", listener); super.init(); }
@Override protected void doStart() throws Exception { createServer(); if (connector == null) { connector = socketConnectorFactory.createConnector(server); URI boundTo = bind(); contextHandler.addServlet(holder, "/"); contextHandler.setAttribute("acceptListener", getAcceptListener()); contextHandler.setAttribute("wireFormat", getWireFormat()); contextHandler.setAttribute("transportFactory", transportFactory); contextHandler.setAttribute("transportOptions", transportOptions); configureTraceMethod((ConstraintSecurityHandler) contextHandler.getSecurityHandler(), httpOptions.isEnableTrace()); addGzipHandler(contextHandler); int p2 = getConnectorLocalPort(); if (p2 != -1) { port = p2; setConnectURI(new URI(boundTo.getScheme(), boundTo.getUserInfo(), boundTo.getHost(),
@Override public TransportServer doBind(URI location) throws IOException { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); HttpTransportServer result = new HttpTransportServer(location, this); Map<String, Object> jettyOptions = IntrospectionSupport.extractProperties(options, "jetty."); Map<String, Object> httpOptions = IntrospectionSupport.extractProperties(options, "http."); Map<String, Object> transportOptions = IntrospectionSupport.extractProperties(options, "transport."); result.setJettyOptions(jettyOptions); result.setTransportOption(transportOptions); result.setHttpOptions(httpOptions); return result; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
public TextWireFormat getWireFormat() { if (wireFormat == null) { wireFormat = createWireFormat(); } return wireFormat; }
public synchronized void init() throws ServletException { // lets initialize the ActiveMQ broker try { if (broker == null) { broker = createBroker(); // Add the servlet connector String url = getConnectorURL(); HttpTransportFactory factory = new HttpTransportFactory(); transportConnector = (HttpTransportServer) factory.doBind(new URI(url)); broker.addConnector(transportConnector); String brokerURL = getServletContext().getInitParameter("org.apache.activemq.brokerURL"); if (brokerURL != null) { log("Listening for internal communication on: " + brokerURL); } } broker.start(); } catch (Exception e) { throw new ServletException("Failed to start embedded broker: " + e, e); } // now lets register the listener TransportAcceptListener listener = transportConnector.getAcceptListener(); getServletContext().setAttribute("transportChannelListener", listener); super.init(); }
private void addGzipHandler(ServletContextHandler contextHandler) throws Exception { HandlerWrapper handler = null; try { handler = (HandlerWrapper) forName("org.eclipse.jetty.servlets.gzip.GzipHandler").newInstance(); } catch (Throwable t) { handler = (HandlerWrapper) forName("org.eclipse.jetty.server.handler.gzip.GzipHandler").newInstance(); } contextHandler.insertHandler(handler); }
public TextWireFormat getWireFormat() { if (wireFormat == null) { wireFormat = createWireFormat(); } return wireFormat; }
public synchronized void init() throws ServletException { // lets initialize the ActiveMQ broker try { if (broker == null) { broker = createBroker(); // Add the servlet connector String url = getConnectorURL(); HttpTransportFactory factory = new HttpTransportFactory(); transportConnector = (HttpTransportServer) factory.doBind(new URI(url)); broker.addConnector(transportConnector); String brokerURL = getServletContext().getInitParameter("org.apache.activemq.brokerURL"); if (brokerURL != null) { log("Listening for internal communication on: " + brokerURL); } } broker.start(); } catch (Exception e) { throw new ServletException("Failed to start embedded broker: " + e, e); } // now lets register the listener TransportAcceptListener listener = transportConnector.getAcceptListener(); getServletContext().setAttribute("transportChannelListener", listener); super.init(); }
private void addGzipHandler(ServletContextHandler contextHandler) throws Exception { HandlerWrapper handler = null; try { handler = (HandlerWrapper) forName("org.eclipse.jetty.servlets.gzip.GzipHandler").newInstance(); } catch (Throwable t) { handler = (HandlerWrapper) forName("org.eclipse.jetty.server.handler.gzip.GzipHandler").newInstance(); } contextHandler.insertHandler(handler); }
public TextWireFormat getWireFormat() { if (wireFormat == null) { wireFormat = createWireFormat(); } return wireFormat; }