Package org.sf.bee.profiler.components

Examples of org.sf.bee.profiler.components.TimeWatcher


    private Date _startTime;
    private Date _stopTime;
   
    /** Creates a new instance of TimeWatcherTool */
    public TimeWatcherTool() {
        _watch = new TimeWatcher();
    }
View Full Code Here


    public final boolean open() {
        if (_initialized) {
            return true;
        }

        final TimeWatcher watch = new TimeWatcher();
        watch.start();

        boolean result = true;

        // open runtime
        try {
            // ON BEFORE OPEN
            final AbstractRuntimeConfiguration config = this.onBeforeOpen();
            if (null != config) {
                _configuration = config;
                //-- open configuration --//
                _configuration.open();
                //-- initialize logging level --//
                this.initLoggingLevel(_configuration.getFlagDebugMode());
                //-- store configuration and initialize runtime --//
                this.loadConfiguration(_configuration);
                _initialized = true;
                // ON OPEN
                this.onOpen();
                this.notifyListenersOnOpen();

                //-- STATUS: READY --//
                this.setStatus(RuntimeStatus.READY);
            }
        } catch (Throwable t) {
            _errors.add(t);
        }

        // check initialization errors
        final ExceptionList errors = this.getErrors();
        if (errors.hasErrors()) {
            this.getLogger().log(
                    Level.SEVERE,
                    "Problem initializing {0}: \n{1}",
                    new Object[]{this.getClass().getSimpleName(),
                        errors.toString(false)});
            this.setStatus(RuntimeStatus.ERROR);
            result = false;
        } else {
            result = true;
        }

        watch.stop();
        this.logStarted(watch.toString());

        return result;
    }
View Full Code Here

    private void closeRuntime() {
        // reset status
        this.setStatus(RuntimeStatus.IDLE);

        final TimeWatcher mainProfiler = new TimeWatcher();
        final TimeWatcher profiler = new TimeWatcher();

        mainProfiler.start();
        this.getLogger().info("Cleaning runtime ...");

        // Clear resources cache
        profiler.reset();
        profiler.start();
        this.getLogger().fine(
                "\tStart Finalizing Resource Bundle Cache (i18n) ...");
        try {
            _repository.clear();
        } catch (Exception e) {
            this.getLogger().log(
                    Level.SEVERE, "ERROR ON REPOSITORY CLEARING: {0}", e.getMessage());
        }
        profiler.stop();
        this.getLogger().log(
                Level.FINE, "\tFinish Finalizing Repository: {0}", profiler.toString());

        mainProfiler.stop();
        this.getLogger().log(Level.INFO, "Finish clean Runtime: {0}", mainProfiler.toString());
    }
View Full Code Here

    private final TimeWatcher _profiler;

    public SQLCommandResponse(final SQLCommand command) {
        this._command = command;
        this._date = DateUtils.now();
        this._profiler = new TimeWatcher();
    }
View Full Code Here

TOP

Related Classes of org.sf.bee.profiler.components.TimeWatcher

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.