Package org.sf.bee.commons

Examples of org.sf.bee.commons.ResponseObject


    @Override
    public void execute() {
        final Logger logger = this.getLogger();
        try {
            final ResponseObject runtimeStatus = _monitor.getRuntimeStatus();
            final ResponseObject memory = _memory.getMemoryReport();
            final ResponseObject cpu = _cpu.getCpuReport();

            //-- retrieve report --//
            final String report = this.getReport(runtimeStatus,
                    0,
                    memory,
                    cpu);

            if (runtimeStatus.hasErrors()) {
                logger.log(Level.SEVERE,
                        null, runtimeStatus.getLastError());
            }
            if (memory.hasErrors()) {
                logger.log(Level.SEVERE,
                        null, memory.getLastError());
            }
            if (cpu.hasErrors()) {
                logger.log(Level.SEVERE,
                        null, cpu.getLastError());
            }

            logger.info(report.toString());
        } catch (Throwable t) {
            logger.log(Level.SEVERE,
View Full Code Here


    public String getReportAsHTML() {
        return _cpu.getReportAsHTML();
    }

    public ResponseObject getCpuReport() {
        final ResponseObject result = new ResponseObject();
        try {
            if (null == _error) {
                if (!_cpu.hasError()) {
                    result.setValue(_cpu.getReport());
                } else {
                    result.addError(_cpu.getError());
                }
            } else {
                result.addError(_error);
            }
        } catch (Exception ex) {
            result.addError(ex);
        }
        return result;
    }
View Full Code Here

        }
        return result;
    }

    public ResponseObject getCpuReportAsHTML() {
        final ResponseObject result = new ResponseObject();
        try {
            if (null == _error) {
                if (!_cpu.hasError()) {
                    result.setValue(_cpu.getReportAsHTML());
                } else {
                    result.addError(_cpu.getError());
                }
            } else {
                result.addError(_error);
            }
        } catch (Exception ex) {
            result.addError(ex);
        }
        return result;
    }
View Full Code Here

        muc.setMu(mu);
        return muc;
    }

    public ResponseObject getMemoryReport() {
        final ResponseObject result = new ResponseObject();
        try {
            final String report = this.getMemoryReport(MemoryMeasureUnit.mbytes);
            result.setValue(report);
        } catch (Exception ex) {
            result.addError(ex);
        }
        return result;
    }
View Full Code Here

        }
        return result;
    }

    public ResponseObject getMemoryReportAsHTML() {
        final ResponseObject result = new ResponseObject();
        try {
            final String report = this.getMemoryReport(MemoryMeasureUnit.mbytes);
            result.setValue(HTMLUtils.nl2br(report));
        } catch (Exception ex) {
            result.addError(ex);
        }
        return result;
    }
View Full Code Here

    public String now(){
        return (new Date()).toString();
    }
   
    public ResponseObject getRuntimeStatus(){
        ResponseObject result = new ResponseObject();
        try{
            result.setValue( BeeRuntimeFactory.getInstance().getStatus().toString() );
        }catch(Exception ex){
            result.addError(ex);
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of org.sf.bee.commons.ResponseObject

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.