Package org.jboss.dashboard.ui.controller.responses

Examples of org.jboss.dashboard.ui.controller.responses.SendErrorResponse


            log.warn("Memory is running low ...");
            freeSomeMemory(freeMemory, totalMemory);
            freeMemory = Runtime.getRuntime().freeMemory();
            totalMemory = Runtime.getRuntime().totalMemory();
            if (isLowMemory(freeMemory, totalMemory)) {
                getControllerStatus().setResponse(new SendErrorResponse(503));
                getControllerStatus().consumeURIPart(getControllerStatus().getURIToBeConsumed());
                log.error("Memory is so low that a user request had to be canceled - 503 sent. Consider increasing memory for current running application.");
                return false;
            }
        }
View Full Code Here


    }

    public CommandResponse getResourceAsResponse() {
        if (file == null || !file.exists()) {
            log.debug("Resource does not exist: " + file);
            return new SendErrorResponse(HttpServletResponse.SC_NOT_FOUND);
        }
        try {
            return new SendStreamResponse(file);
        } catch (Exception e) {
            log.error("Failed to return resource named " + resName, e);
            return new SendErrorResponse(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.ui.controller.responses.SendErrorResponse

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.