Package com.noelios.restlet.http

Examples of com.noelios.restlet.http.HttpServerHelper


     * @param request
     *            The HTTP Servlet request.
     * @return The new HTTP server handling calls.
     */
    protected HttpServerHelper createServer(HttpServletRequest request) {
        HttpServerHelper result = null;
        final Component component = getComponent();

        if (component != null) {
            // First, let's create a pseudo server
            final Server server = new Server(component.getContext()
                    .createChildContext(), (List<Protocol>) null, request
                    .getLocalAddr(), request.getLocalPort(), component);
            result = new HttpServerHelper(server);

            // Attach the hosted application(s) to the right path
            final String uriPattern = request.getContextPath()
                    + request.getServletPath();

View Full Code Here


     * @param request
     *            The HTTP Servlet request.
     * @return The HTTP server handling calls.
     */
    public HttpServerHelper getServer(HttpServletRequest request) {
        HttpServerHelper result = this.helper;

        if (result == null) {
            synchronized (ServerServlet.class) {
                if (result == null) {
                    // Find the attribute name to use to store the server
View Full Code Here

     *            The HTTP Servlet response.
     */
    @Override
    public void service(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        final HttpServerHelper helper = getServer(request);

        if (helper != null) {
            helper.handle(createCall(helper.getHelped(), request, response));
        } else {
            log("[Noelios Restlet Engine] - Unable to get the Restlet HTTP server connector. Status code 500 returned.");
            response.sendError(500);
        }
    }
View Full Code Here

     * @param request
     *            The HTTP Servlet request.
     * @return The new HTTP server handling calls.
     */
    protected HttpServerHelper createServer(HttpServletRequest request) {
        HttpServerHelper result = null;
        final Component component = getComponent();

        if (component != null) {
            // First, let's create a pseudo server
            final Server server = new Server(component.getContext()
                    .createChildContext(), (List<Protocol>) null, request
                    .getLocalAddr(), request.getLocalPort(), component);
            result = new HttpServerHelper(server);

            // Attach the hosted application(s) to the right path
            final String uriPattern = request.getContextPath()
                    + request.getServletPath();

View Full Code Here

     *            The HTTP Servlet request.
     * @return The HTTP server handling calls.
     */
    @SuppressWarnings("null")
    public HttpServerHelper getServer(HttpServletRequest request) {
        HttpServerHelper result = this.helper;

        if (result == null) {
            synchronized (ServerServlet.class) {
                if (result == null) {
                    // Find the attribute name to use to store the server
View Full Code Here

     *            The HTTP Servlet response.
     */
    @Override
    public void service(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        final HttpServerHelper helper = getServer(request);

        if (helper != null) {
            helper.handle(createCall(helper.getHelped(), request, response));
        } else {
            log("[Noelios Restlet Engine] - Unable to get the Restlet HTTP server connector. Status code 500 returned.");
            response.sendError(500);
        }
    }
View Full Code Here

     * @param request
     *            The HTTP Servlet request.
     * @return The new HTTP server handling calls.
     */
    public HttpServerHelper createServer(HttpServletRequest request) {
        HttpServerHelper result = null;
        Component component = getComponent();
        Application application = getApplication();

        if ((component != null) && (application != null)) {
            // First, let's locate the closest component
            Server server = new Server(component.getContext(),
                    (List<Protocol>) null, request.getLocalAddr(), request
                            .getLocalPort(), component);
            result = new HttpServerHelper(server);

            // Attach the application
            String uriPattern = request.getContextPath()
                    + request.getServletPath();
            component.getDefaultHost().attach(uriPattern, application);
View Full Code Here

     * @param request
     *            The HTTP Servlet request.
     * @return The HTTP server handling calls.
     */
    public HttpServerHelper getServer(HttpServletRequest request) {
        HttpServerHelper result = this.helper;

        if (result == null) {
            synchronized (ServerServlet.class) {
                // Find the attribute name to use to store the server reference
                String serverAttributeName = getInitParameter(
View Full Code Here

     * @param response
     *            The HTTP Servlet response.
     */
    public void service(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        HttpServerHelper helper = getServer(request);

        if (helper != null) {
            helper
                    .handle(new ServletCall(helper.getServer(), request,
                            response));
        } else {
            log("[Noelios Restlet Engine] - Unable to get the Restlet HTTP server connector. Status code 500 returned.");
            response.sendError(500);
        }
View Full Code Here

   * @param request
   *            The HTTP Servlet request.
   * @return The new HTTP server handling calls.
   */
  public HttpServerHelper createServer(HttpServletRequest request) {
    HttpServerHelper result = null;
    Component component = getComponent();
    Application application = getApplication();

    if ((component != null) && (application != null)) {
      // First, let's locate the closest component
      Server server = new Server(component.getContext(),
          (List<Protocol>) null, request.getLocalAddr(), request
              .getLocalPort(), component);
      result = new HttpServerHelper(server);

      // Attach the application
      String uriPattern = request.getContextPath()
          + request.getServletPath();
      component.getDefaultHost().attach(uriPattern, application);
View Full Code Here

TOP

Related Classes of com.noelios.restlet.http.HttpServerHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.