Package br.edu.utfpr.cm.JGitMinerWeb.model.metric

Examples of br.edu.utfpr.cm.JGitMinerWeb.model.metric.EntityMetric


            out.printLog(message);
            progress = 0;
            initialized = false;
            fail = true;
        } else {
            final EntityMetric entityMetric = new EntityMetric();
            dao.insert(entityMetric);
            entityMetric.setParams(params);
            entityMetric.setMatrix(matrix + "");
            entityMetric.setLog(out.getLog().toString());
            entityMetric.setClassServicesName(serviceClass.getName());
            dao.edit(entityMetric);

            initialized = true;
            progress = 10;

            final AbstractMetricServices services = createMetricServiceInstance();

            process = new Thread(services) {
                @Override
                public void run() {
                    try {
                        if (!canceled) {
                            out.setCurrentProcess("Iniciando coleta dos dados para geração da metrica.");
                            super.run();
                            out.printLog(services.getNodes().size() + " Registros coletados!");
                        }
                        progress = 50;
                        out.printLog("");
                        if (!canceled) {
                            out.setCurrentProcess("Iniciando salvamento dos dados gerados.");
                            entityMetric.setNodes(services.getMetricNodes());
                            for (EntityMetricNode node : services.getMetricNodes()){
                                node.setMetric(entityMetric);
                            }
                            entityMetric.setComplete(true);
                            dao.edit(entityMetric);
                            out.printLog("Salvamento dos dados concluído!");
                        }
                        message = "Geração da matriz finalizada.";
                    } catch (Exception ex) {
                        ex.printStackTrace();
                        StringWriter errors = new StringWriter();
                        ex.printStackTrace(new PrintWriter(errors));
                        message = "Geração da rede abortada, erro: " + errors.toString();
                        out.printLog(errors.toString());
                        fail = true;
                    } finally {
                        out.printLog("");
                        if (canceled) {
                            out.setCurrentProcess("Geração da matriz abortada pelo usuário.");
                        } else {
                            out.setCurrentProcess(message);
                        }
                        progress = 100;
                        initialized = false;
                        entityMetric.setLog(out.getLog().toString());
                        entityMetric.setStoped(new Date());
                        dao.edit(entityMetric);
                        params.clear();
                        System.gc();
                    }
                }
View Full Code Here


                out.printLog("");
                out.printLog("Params: " + params);
                out.printLog("");

                final EntityMetric entityMetric = new EntityMetric();
                dao.insert(entityMetric);
                entityMetric.setParams(params);
                entityMetric.setMatrix(matrix + "");
                entityMetric.setLog(out.getLog().toString());
                entityMetric.setClassServicesName(serviceClass.getName());
                dao.edit(entityMetric);

                final AbstractBichoMetricServices services = createMetricServiceInstance(params, matrix);

                Thread process = new Thread(services) {
                    @Override
                    public void run() {
                        try {
                            if (!canceled) {
                                out.setCurrentProcess("Iniciando coleta dos dados para geração da metrica.");
                                super.run();
                                out.printLog(services.getNodes().size() + " Registros coletados!");
                            }
                            progress += fraction / 2;
                            out.printLog("");
                            if (!canceled) {
                                out.setCurrentProcess("Iniciando salvamento dos dados gerados.");
                                entityMetric.setNodes(services.getMetricNodes());
                                for (EntityMetricNode node : services.getMetricNodes()) {
                                    node.setMetric(entityMetric);
                                }
                                entityMetric.setComplete(true);
                                dao.edit(entityMetric);
                                out.printLog("Salvamento dos dados concluído!");
                            }
                            message = "Geração da matriz finalizada.";
                        } catch (Exception ex) {
                            ex.printStackTrace();
                            StringWriter errors = new StringWriter();
                            ex.printStackTrace(new PrintWriter(errors));
                            message = "Geração da rede abortada, erro: " + errors.toString();
                            out.printLog(errors.toString());
                            fail = true;
                        } finally {
                            out.printLog("");
                            if (canceled) {
                                out.setCurrentProcess("Geração da matriz abortada pelo usuário.");
                            } else {
                                out.setCurrentProcess(message);
                            }
                            progress += fraction / 2;
                            initialized = false;
                            entityMetric.setLog(out.getLog().toString());
                            entityMetric.setStoped(new Date());
                            dao.edit(entityMetric);
                            params.clear();
                            System.gc();
                        }
                    }
View Full Code Here

                out.printLog("");
                out.printLog("Params: " + params);
                out.printLog("");

                final EntityMetric entityMetric = new EntityMetric();
                dao.insert(entityMetric);
                entityMetric.setParams(params);
                entityMetric.setMatrix(matrix + "");
                entityMetric.setLog(out.getLog().toString());
                entityMetric.setClassServicesName(serviceClass.getName());
                dao.edit(entityMetric);

                final AbstractMetricServices services = createMetricServiceInstance(params, matrix);

                Thread process = new Thread(services) {
                    @Override
                    public void run() {
                        try {
                            if (!canceled) {
                                out.setCurrentProcess("Iniciando coleta dos dados para geração da metrica.");
                                super.run();
                                out.printLog(services.getNodes().size() + " Registros coletados!");
                            }
                            progress += fraction / 2;
                            out.printLog("");
                            if (!canceled) {
                                out.setCurrentProcess("Iniciando salvamento dos dados gerados.");
                                entityMetric.setNodes(services.getMetricNodes());
                                for (EntityMetricNode node : services.getMetricNodes()) {
                                    node.setMetric(entityMetric);
                                }
                                entityMetric.setComplete(true);
                                dao.edit(entityMetric);
                                out.printLog("Salvamento dos dados concluído!");
                            }
                            message = "Geração da matriz finalizada.";
                        } catch (Exception ex) {
                            ex.printStackTrace();
                            StringWriter errors = new StringWriter();
                            ex.printStackTrace(new PrintWriter(errors));
                            message = "Geração da rede abortada, erro: " + errors.toString();
                            out.printLog(errors.toString());
                            fail = true;
                        } finally {
                            out.printLog("");
                            if (canceled) {
                                out.setCurrentProcess("Geração da matriz abortada pelo usuário.");
                            } else {
                                out.setCurrentProcess(message);
                            }
                            progress += fraction / 2;
                            initialized = false;
                            entityMetric.setLog(out.getLog().toString());
                            entityMetric.setStoped(new Date());
                            dao.edit(entityMetric);
                            params.clear();
                            System.gc();
                        }
                    }
View Full Code Here

    public GitMetricViewBean() {
    }

    public void delete() {
        try {
            EntityMetric forDelete = (EntityMetric) JsfUtil.getObjectFromSession(FOR_DELETE);
            dao.remove(forDelete);
            reloadList();
        } catch (Exception ex) {
            ex.printStackTrace();
            JsfUtil.addErrorMessage(ex.toString());
View Full Code Here

TOP

Related Classes of br.edu.utfpr.cm.JGitMinerWeb.model.metric.EntityMetric

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.