public WebServiceProtocol() { super(Fault.class); bus.setExtension(new ServletDestinationFactory(), HttpDestinationFactory.class); }
@Override public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { if (servletController == null) { HttpServlet httpServlet = DispatcherServlet.getInstance(); if (httpServlet == null) { response.sendError(500, "No such DispatcherServlet instance."); return; } synchronized (this) { if (servletController == null) { servletController = new ServletController(transportFactory.getRegistry(), httpServlet.getServletConfig(), httpServlet); } } } RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort()); servletController.invoke(request, response); }
@Override protected void finalizeServletInit(ServletConfig servletConfig) throws ServletException { super.finalizeServletInit(servletConfig); if (this.destinationRegistry instanceof ServletConfigAware) { ((ServletConfigAware)this.destinationRegistry).onServletConfigAvailable(servletConfig); } }
@Override public void init(ServletConfig sc) throws ServletException { super.init(sc); if (this.bus == null && loadBus) { loadBus(sc); } if (this.bus != null) { loader = initClassLoader(); registerServletContextResolver(sc); if (destinationRegistry == null) { this.destinationRegistry = getDestinationRegistryFromBusOrDefault(sc.getInitParameter(TRANSPORT_ID)); } } this.controller = createServletController(sc); finalizeServletInit(sc); }
private ServletController createServletController(ServletConfig servletConfig) { HttpServlet serviceListGeneratorServlet = new ServiceListGeneratorServlet(destinationRegistry, bus); ServletController newController = new ServletController(destinationRegistry, servletConfig, serviceListGeneratorServlet); return newController; }
public boolean filter(HttpServletRequest request, HttpServletResponse res) throws ServletException { return invoke(request, res, false); } public void invoke(HttpServletRequest request, HttpServletResponse res) throws ServletException {
public void onApplicationEvent(ContextRefreshedEvent event) { destroy(); setBus(null); try { init(getServletConfig()); } catch (ServletException e) { throw new RuntimeException("Unable to reinitialize the CXFServlet", e); } }
public final void init(final FilterConfig filterConfig) throws ServletException { init(new ServletConfig() { public String getServletName() { return filterConfig.getFilterName(); } public ServletContext getServletContext() { return filterConfig.getServletContext(); } public String getInitParameter(String name) { return filterConfig.getInitParameter(name); } public Enumeration<String> getInitParameterNames() { return filterConfig.getInitParameterNames(); } }); }
protected void updateDestination(HttpServletRequest request, AbstractHTTPDestination d) { String base = getBaseURL(request); if (disableAddressUpdates) { updateDestination(request, base, d); } else { synchronized (d) { updateDestination(request, base, d); } } }
protected String getBaseURL(HttpServletRequest request) { return forcedBaseAddress == null ? BaseUrlHelper.getBaseURL(request) : forcedBaseAddress; }
@Override protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { handleRequest(request, response); }
public ServletController(DestinationRegistry destinationRegistry, ServletConfig config, HttpServlet serviceListGenerator) { this.servletConfig = config; this.destinationRegistry = destinationRegistry; this.serviceListGenerator = serviceListGenerator; init(); }
public AbstractHTTPDestination createDestination(EndpointInfo endpointInfo, Bus bus, DestinationRegistry registry) throws IOException { return new ServletDestination(bus, registry, endpointInfo, endpointInfo.getAddress()); } }
@Override public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { if (servletController == null) { HttpServlet httpServlet = DispatcherServlet.getInstance(); if (httpServlet == null) { response.sendError(500, "No such DispatcherServlet instance."); return; } synchronized (this) { if (servletController == null) { servletController = new ServletController(transportFactory.getRegistry(), httpServlet.getServletConfig(), httpServlet); } } } RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort()); servletController.invoke(request, response); }
public WebServiceProtocol() { super(Fault.class); bus.setExtension(new ServletDestinationFactory(), HttpDestinationFactory.class); }
@Override protected void doOptions(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { handleRequest(request, response); }
@Override protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { handleRequest(request, response); }
@Override protected void doHead(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { handleRequest(request, response); }
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException { handleRequest(request, response); }
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException { handleRequest(request, response); }