solving the hibernate transaction problem
authorBruno Sinou <bsinou@argeo.org>
Mon, 27 Sep 2010 15:39:14 +0000 (15:39 +0000)
committerBruno Sinou <bsinou@argeo.org>
Mon, 27 Sep 2010 15:39:14 +0000 (15:39 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@3805 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

14 files changed:
eclipse/plugins/org.argeo.slc.client.core/META-INF/MANIFEST.MF
eclipse/plugins/org.argeo.slc.client.core/src/main/java/org/argeo/slc/client/aspects/ContentProviderAspect.java [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.core/src/main/java/org/argeo/slc/client/core/ProcessListTableContent.java
eclipse/plugins/org.argeo.slc.client.core/src/main/java/org/argeo/slc/client/core/TableContent.java
eclipse/plugins/org.argeo.slc.client.hibernate/META-INF/MANIFEST.MF
eclipse/plugins/org.argeo.slc.client.hibernate/META-INF/spring/core.xml
eclipse/plugins/org.argeo.slc.client.hibernate/META-INF/spring/transaction-osgi.xml
eclipse/plugins/org.argeo.slc.client.ui/META-INF/spring/commands.xml
eclipse/plugins/org.argeo.slc.client.ui/plugin.xml
eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/ProcessListViewRefreshHandler.java [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/RefreshHandler.java [deleted file]
eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/ResultListViewRefreshHandler.java [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/listeners/TestManagerServiceAdapter.java
eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/views/ProcessListView.java

index 90fb8d0924197b4e26c2b825546e70406bd3249e..4203255fa363c27a127f589b0d9f78cd88cb375b 100644 (file)
@@ -4,8 +4,14 @@ Bundle-Name: Core
 Bundle-SymbolicName: org.argeo.slc.client.core
 Bundle-Version: 1.0.0.qualifier
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.argeo.slc.client.core
+Export-Package: org.argeo.slc.client.aspects,
+ org.argeo.slc.client.core
 Import-Package: org.apache.commons.io;version="1.4.0",
  org.apache.commons.logging;version="1.1.1",
  org.argeo.slc.dao.process,
- org.argeo.slc.process
+ org.argeo.slc.process,
+ org.aspectj.lang,
+ org.aspectj.lang.annotation,
+ org.springframework.beans.factory;version="2.5.6.SEC01",
+ org.springframework.transaction;version="2.5.6.SEC01"
+Require-Bundle: org.springframework.orm;bundle-version="2.5.6"
diff --git a/eclipse/plugins/org.argeo.slc.client.core/src/main/java/org/argeo/slc/client/aspects/ContentProviderAspect.java b/eclipse/plugins/org.argeo.slc.client.core/src/main/java/org/argeo/slc/client/aspects/ContentProviderAspect.java
new file mode 100644 (file)
index 0000000..82290af
--- /dev/null
@@ -0,0 +1,57 @@
+package org.argeo.slc.client.aspects;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+
+@Aspect
+public class ContentProviderAspect {
+
+       // private final static Log log = LogFactory
+       // .getLog(ContentProviderAspect.class);
+
+       // Advices
+       @Around("execution (* getLabel(..))")
+       public Object aroundGetVariable(ProceedingJoinPoint thisJoinPoint)
+                       throws Throwable {
+               //log.debug("***************** IN THE ASPECT. Before proceed");
+               // log.debug("We have an open session : "
+               // + sessionFactory.getCurrentSession().isOpen());
+               // log.debug("Current transaction is active : "
+               // + sessionFactory.getCurrentSession().getTransaction()
+               // .isActive());
+
+               Object o = thisJoinPoint.proceed();
+               //log.debug("**************** IN THE ASPECT. After proceed");
+               return o;
+       }
+
+       // @Before("methodeTrace()")
+       // public void log(JoinPoint joinPoint) {
+       // log.info("Before calling " + joinPoint.getSignature().getName());
+       // log.debug("SessionFactory " + sessionFactory.toString());
+       // }
+
+       // @Around("methodeTrace()")
+       // public void proxyCalling(JoinPoint joinPoint) {
+       // log.info("*********** We Call the method "
+       // + joinPoint.getSignature().getName());
+       // }
+       //
+       // // Pointcuts
+       // @Pointcut("execution(* org.argeo.slc.client.core.ProcessListTableContent.set*(..))")
+       // public void methodeTrace() {
+       // }
+
+       // IoC
+       // public void setSessionFactory(SessionFactory sessionFactory) {
+       // this.sessionFactory = sessionFactory;
+       // }
+       //
+       // public void setTransactionManager(
+       // PlatformTransactionManager transactionManager) {
+       // if (transactionManager instanceof HibernateTransactionManager)
+       // this.transactionManager = (HibernateTransactionManager)
+       // transactionManager;
+       // }
+}
index 79e2efe6fd15259af3501cde48ebd4e45d110bab..e02f1e074bb35d59b3c61450ed5ba91418b088f5 100644 (file)
@@ -1,7 +1,5 @@
 package org.argeo.slc.client.core;
 
-import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.commons.logging.Log;
@@ -13,23 +11,27 @@ public class ProcessListTableContent implements TableContent {
        private static final Log log = LogFactory
                        .getLog(ProcessListTableContent.class);
 
-       private List<SlcExecution> slcExecutions = new ArrayList<SlcExecution>();
-
        // IoC
        private SlcExecutionDao slcExecutionDao;
 
        @Override
        public SlcExecution getLine(int index) {
-               return slcExecutions.get(index);
+               return slcExecutionDao.listSlcExecutions().get(index);
+               // return slcExecutions.get(index);
        }
 
        @Override
-       public synchronized String getLabel(Object o, int i) {
+       // public synchronized String getLabel(Object o, int i) {
+       public String getLabel(Object o, int i) {
                SlcExecution se = (SlcExecution) o;
+
                switch (i) {
 
                case 0:
-                       return se.getStartDate().toString();
+                       // return se.getStartDate().toString();
+                       // Workaround to insure that we have no Lazy Init PB
+                       return slcExecutionDao.getSlcExecution(se.getUuid()).getStartDate()
+                                       .toString();
                case 1:
                        return se.getHost();
                case 2:
@@ -37,30 +39,12 @@ public class ProcessListTableContent implements TableContent {
                case 3:
                        return se.getStatus();
                }
-               return "test";
+               return null;
        }
 
        public synchronized List<SlcExecution> getContent() {
-               return this.slcExecutions;
-       }
-
-       public synchronized void setContent() {
-               // Thread.currentThread().setContextClassLoader(null);
-               List<SlcExecution> lst = slcExecutionDao.listSlcExecutions();
-               if (lst.get(0) != null) {
-                       log.debug("======================== set CONTENT =====================");
-                       log.debug("Lst Size : " + lst.size());
-                       log.debug("Date : " + lst.get(0).getStartDate());
-                       log.debug("Host : " + lst.get(0).getHost());
-                       log.debug("Status : " + lst.get(0).getStatus());
-                       log.debug("UUID : " + lst.get(0).getUuid());
-               }
-
-               slcExecutions.clear();
-               Iterator<SlcExecution> it = lst.iterator();
-               while (it.hasNext()) {
-                       slcExecutions.add(it.next());
-               }
+               return slcExecutionDao.listSlcExecutions();
+               // return this.slcExecutions;
        }
 
        // IoC
index df480c3258e05f9bb970168bd792f65ef4aaaff7..bc85e83e8828ffa74611d9a508553c123206eb88 100644 (file)
@@ -10,7 +10,5 @@ public interface TableContent {
 
        public String getLabel(Object o, int index);
 
-       public void setContent();
-
        public List<SlcExecution> getContent();
 }
index 91c937807e25826c1cd228c6f0e09d1dedc71bf1..4e6e168683c2f673ebbda30755f682d13949785e 100644 (file)
@@ -4,8 +4,10 @@ Bundle-Name: Hibernate Interface for RCP Client
 Bundle-SymbolicName: org.argeo.slc.client.hibernate
 Bundle-Version: 1.0.0.qualifier
 Import-Package: org.aopalliance.aop;version="1.0.0",
+ org.argeo.slc.client.aspects,
  org.argeo.slc.client.core,
  org.argeo.slc.dao.process;version="0.13.0.SNAPSHOT-r3777",
  org.springframework.aop;version="2.5.6.SEC01",
+ org.springframework.aop.aspectj.annotation;version="2.5.6.SEC01",
  org.springframework.aop.framework;version="2.5.6.SEC01",
  org.springframework.transaction;version="2.5.6.SEC01"
index 29dfe3b2bb2c1ab3eabd3bb64b5993f4b7d830dc..7250277e08cc22bfd0acd6b755ecd99dbb251d75 100644 (file)
@@ -1,11 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd">
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+              http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+              ">
 
        <bean id="processListTableContent" class="org.argeo.slc.client.core.ProcessListTableContent">
                <property name="slcExecutionDao" ref="slcExecutionDao" />
        </bean>
 
+       <!-- Events -->
+       <aop:aspectj-autoproxy />
+       <bean id="contentProviderAspect" class="org.argeo.slc.client.aspects.ContentProviderAspect">
+               <!-- <property name="sessionFactory" ref="sessionFactory" /> <property 
+                       name="transactionManager" ref="transactionManager" /> -->
+       </bean>
 </beans>
index 3cd4bac8dddc54942173320a8d2af4d35d132c06..dd8484c8b2ee0b2d17e2b54c889d1c473781e24f 100644 (file)
@@ -9,4 +9,6 @@
        <reference id="transactionManager"
                interface="org.springframework.transaction.PlatformTransactionManager"
                context-class-loader="service-provider" />
+       <!-- <reference id="sessionFactory" interface="org.hibernate.SessionFactory" 
+               /> -->
 </beans:beans>
\ No newline at end of file
index 34a365353995c49ec3690edfd0b4f05e8d2bbcf9..2abb6ed673b6d7cd6c62c4eb5235c79c5730aa5b 100644 (file)
@@ -4,9 +4,12 @@
        xsi:schemaLocation="http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans.xsd">
 
-       <bean id="org.argeo.slc.client.ui.RefreshResultList" class="org.argeo.slc.client.ui.commands.RefreshHandler"
+       <bean id="org.argeo.slc.client.ui.RefreshResultList"
+               class="org.argeo.slc.client.ui.commands.ResultListViewRefreshHandler"
+               scope="prototype">
+       </bean>
+       <bean id="org.argeo.slc.client.ui.RefreshProcessList"
+               class="org.argeo.slc.client.ui.commands.ProcessListViewRefreshHandler"
                scope="prototype">
        </bean>
-
-
 </beans>
index 591e9fecddc85930739349f8e575687a093fb452..3ca7dafa868c581a896ab904912b0e71726c1e1f 100644 (file)
             id="org.argeo.slc.client.ui.RefreshResultList"
             name="RefreshResultList ">
       </command>
+      <command
+            defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+            id="org.argeo.slc.client.ui.RefreshProcessList"
+            name="RefreshProcessList ">
+      </command>
    </extension>
    <extension
         point="org.eclipse.ui.bindings">
diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/ProcessListViewRefreshHandler.java b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/ProcessListViewRefreshHandler.java
new file mode 100644 (file)
index 0000000..47f9d00
--- /dev/null
@@ -0,0 +1,19 @@
+package org.argeo.slc.client.ui.commands;
+
+import org.argeo.slc.client.ui.views.ProcessListView;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class ProcessListViewRefreshHandler extends AbstractHandler {
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               ProcessListView pView = (ProcessListView) HandlerUtil
+                               .getActiveWorkbenchWindow(event).getActivePage()
+                               .findView(ProcessListView.ID);
+               pView.retrieveResults();
+               return null;
+       }
+
+}
diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/RefreshHandler.java b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/RefreshHandler.java
deleted file mode 100644 (file)
index fb424a4..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.argeo.slc.client.ui.commands;
-
-import org.argeo.slc.client.ui.views.ProcessListView;
-import org.argeo.slc.client.ui.views.ResultListView;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-public class RefreshHandler extends AbstractHandler {
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               ResultListView view = (ResultListView) HandlerUtil
-                               .getActiveWorkbenchWindow(event).getActivePage().findView(
-                                               ResultListView.ID);
-               view.retrieveResults();
-               ProcessListView pView = (ProcessListView) HandlerUtil
-                               .getActiveWorkbenchWindow(event).getActivePage()
-                               .findView(ProcessListView.ID);
-               pView.retrieveResults();
-               return null;
-       }
-
-}
diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/ResultListViewRefreshHandler.java b/eclipse/plugins/org.argeo.slc.client.ui/src/org/argeo/slc/client/ui/commands/ResultListViewRefreshHandler.java
new file mode 100644 (file)
index 0000000..23fa879
--- /dev/null
@@ -0,0 +1,19 @@
+package org.argeo.slc.client.ui.commands;
+
+import org.argeo.slc.client.ui.views.ResultListView;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class ResultListViewRefreshHandler extends AbstractHandler {
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               ResultListView view = (ResultListView) HandlerUtil
+                               .getActiveWorkbenchWindow(event).getActivePage()
+                               .findView(ResultListView.ID);
+               view.retrieveResults();
+               return null;
+       }
+
+}
index 6189591cb4c98c39cd2467f3edf082066a62663b..094a9b9103be48765cb21318ba29bf4f8da63530 100644 (file)
@@ -54,17 +54,22 @@ public class TestManagerServiceAdapter implements TreeTestResultListener {
 
                // TODO : clean this -> pb of thread && commandID hardCoded.
                // We force the refresh of the list view.
-               ClientUiPlugin.getDefault().getWorkbench().getDisplay().syncExec(
-                               new Runnable() {
+               ClientUiPlugin.getDefault().getWorkbench().getDisplay()
+                               .syncExec(new Runnable() {
                                        public void run() {
                                                IHandlerService handlerService = (IHandlerService) ClientUiPlugin
-                                                               .getDefault().getWorkbench().getService(
-                                                                               IHandlerService.class);
+                                                               .getDefault().getWorkbench()
+                                                               .getService(IHandlerService.class);
                                                try {
                                                        handlerService
                                                                        .executeCommand(
                                                                                        "org.argeo.slc.client.ui.RefreshResultList",
                                                                                        null);
+                                                       handlerService
+                                                                       .executeCommand(
+                                                                                       "org.argeo.slc.client.ui.RefreshProcessList",
+                                                                                       null);
+
                                                } catch (Exception e) {
                                                        e.printStackTrace();
                                                        throw new SlcException(
@@ -74,7 +79,7 @@ public class TestManagerServiceAdapter implements TreeTestResultListener {
                                        }
                                }
 
-               );
+                               );
 
        }
 
index b0b1d2067528b3995b8e45289c86c3761fb9483f..de85192810cd5da93c4dec1c726a341e881a235e 100644 (file)
@@ -2,8 +2,6 @@ package org.argeo.slc.client.ui.views;
 
 import java.util.List;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.argeo.slc.client.core.TableContent;
 import org.argeo.slc.process.SlcExecution;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
@@ -20,7 +18,7 @@ import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.ui.part.ViewPart;
 
 public class ProcessListView extends ViewPart {
-       private final static Log log = LogFactory.getLog(ProcessListView.class);
+       // private final static Log log = LogFactory.getLog(ProcessListView.class);
 
        public static final String ID = "org.argeo.slc.client.ui.processListView";
 
@@ -29,9 +27,6 @@ public class ProcessListView extends ViewPart {
        // IoC
        private TableContent tableContent;
 
-       // tests
-       private List<SlcExecution> slcExecutions;
-
        public void createPartControl(Composite parent) {
                Table table = createTable(parent);
                viewer = new TableViewer(table);
@@ -111,14 +106,7 @@ public class ProcessListView extends ViewPart {
        }
 
        public void retrieveResults() {
-               try {
-                       tableContent.setContent();
-                       viewer.setInput(tableContent.getContent());
-                       // viewer.refresh();
-               } catch (Exception e) {
-                       // TODO Auto-generated catch block
-                       e.printStackTrace();
-               }
+               viewer.setInput(tableContent.getContent());
        }
 
        // IoC
@@ -126,332 +114,4 @@ public class ProcessListView extends ViewPart {
                this.tableContent = tableContent;
        }
 
-}
-// package org.argeo.slc.client.ui.views;
-//
-// import java.util.List;
-//
-// import org.apache.commons.logging.Log;
-// import org.apache.commons.logging.LogFactory;
-// import org.argeo.slc.core.test.tree.ResultAttributes;
-// import org.argeo.slc.dao.process.SlcExecutionDao;
-// import org.argeo.slc.process.SlcExecution;
-// import org.eclipse.jface.viewers.IContentProvider;
-// import org.eclipse.jface.viewers.IStructuredContentProvider;
-// import org.eclipse.jface.viewers.ITableLabelProvider;
-// import org.eclipse.jface.viewers.LabelProvider;
-// import org.eclipse.jface.viewers.TableViewer;
-// import org.eclipse.jface.viewers.Viewer;
-// import org.eclipse.swt.SWT;
-// import org.eclipse.swt.graphics.Image;
-// import org.eclipse.swt.layout.GridData;
-// import org.eclipse.swt.widgets.Composite;
-// import org.eclipse.swt.widgets.Table;
-// import org.eclipse.swt.widgets.TableColumn;
-// import org.eclipse.ui.part.ViewPart;
-//
-// public class ProcessListView extends ViewPart {
-// private final static Log log = LogFactory.getLog(ProcessListView.class);
-//
-// public static final String ID = "org.argeo.slc.client.ui.processListView";
-//
-// private TableViewer viewer;
-//
-// // IoC
-// // We use external content & label provider to encapsulate them in an AOP
-// // proxy;
-// // In order to solve hibernate transaction issue.
-// private IContentProvider contentProvider;
-// private ITableLabelProvider tableLabelProvider;
-//
-// // private SessionFactory sessionFactory;
-//
-// private SlcExecutionDao slcExecutionDao;
-//
-// public void createPartControl(Composite parent) {
-// Table table = createTable(parent);
-// viewer = new TableViewer(table);
-// viewer.setContentProvider(this.contentProvider);
-// viewer.setLabelProvider(this.tableLabelProvider);
-// viewer.setInput(getViewSite());
-// }
-//
-// protected Table createTable(Composite parent) {
-// int style = SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL
-// | SWT.FULL_SELECTION | SWT.HIDE_SELECTION;
-//
-// Table table = new Table(parent, style);
-//
-// GridData gridData = new GridData(GridData.FILL_BOTH);
-// gridData.grabExcessVerticalSpace = true;
-// gridData.grabExcessHorizontalSpace = true;
-// gridData.horizontalSpan = 3;
-// table.setLayoutData(gridData);
-//
-// table.setLinesVisible(true);
-// table.setHeaderVisible(true);
-//
-// TableColumn column = new TableColumn(table, SWT.LEFT, 0);
-// column.setText("Date");
-// column.setWidth(200);
-//
-// column = new TableColumn(table, SWT.LEFT, 1);
-// column.setText("Host");
-// column.setWidth(100);
-//
-// column = new TableColumn(table, SWT.LEFT, 2);
-// column.setText("Id");
-// column.setWidth(300);
-//
-// column = new TableColumn(table, SWT.LEFT, 3);
-// column.setText("Status");
-// column.setWidth(100// package org.argeo.slc.client.ui.views;
-//
-// import java.util.List;
-//
-// import org.apache.commons.logging.Log;
-// import org.apache.commons.logging.LogFactory;
-// import org.argeo.slc.core.test.tree.ResultAttributes;
-// import org.argeo.slc.dao.process.SlcExecutionDao;
-// import org.argeo.slc.process.SlcExecution;
-// import org.eclipse.jface.viewers.IContentProvider;
-// import org.eclipse.jface.viewers.IStructuredContentProvider;
-// import org.eclipse.jface.viewers.ITableLabelProvider;
-// import org.eclipse.jface.viewers.LabelProvider;
-// import org.eclipse.jface.viewers.TableViewer;
-// import org.eclipse.jface.viewers.Viewer;
-// import org.eclipse.swt.SWT;
-// import org.eclipse.swt.graphics.Image;
-// import org.eclipse.swt.layout.GridData;
-// import org.eclipse.swt.widgets.Composite;
-// import org.eclipse.swt.widgets.Table;
-// import org.eclipse.swt.widgets.TableColumn;
-// import org.eclipse.ui.part.ViewPart;
-//
-// public class ProcessListView extends ViewPart {
-// private final static Log log = LogFactory.getLog(ProcessListView.class);
-//
-// public static final String ID = "org.argeo.slc.client.ui.processListView";
-//
-// private TableViewer viewer;
-//
-// // IoC
-// // We use external content & label provider to encapsulate them in an AOP
-// // proxy;
-// // In order to solve hibernate transaction issue.
-// private IContentProvider contentProvider;
-// private ITableLabelProvider tableLabelProvider;
-//
-// // private SessionFactory sessionFactory;
-//
-// private SlcExecutionDao slcExecutionDao;
-//
-// public void createPartControl(Composite parent) {
-// Table table = createTable(parent);
-// viewer = new TableViewer(table);
-// viewer.setContentProvider(this.contentProvider);
-// viewer.setLabelProvider(this.tableLabelProvider);
-// viewer.setInput(getViewSite());
-// }
-//
-// protected Table createTable(Composite parent) {
-// int style = SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL
-// | SWT.FULL_SELECTION | SWT.HIDE_SELECTION;
-//
-// Table table = new Table(parent, style);
-//
-// GridData gridData = new GridData(GridData.FILL_BOTH);
-// gridData.grabExcessVerticalSpace = true;
-// gridData.grabExcessHorizontalSpace = true;
-// gridData.horizontalSpan = 3;
-// table.setLayoutData(gridData);
-//
-// table.setLinesVisible(true);
-// table.setHeaderVisible(true);
-//
-// TableColumn column = new TableColumn(table, SWT.LEFT, 0);
-// column.setText("Date");
-// column.setWidth(200);
-//
-// column = new TableColumn(table, SWT.LEFT, 1);
-// column.setText("Host");
-// column.setWidth(100);
-//
-// column = new TableColumn(table, SWT.LEFT, 2);
-// column.setText("Id");
-// column.setWidth(300);
-//
-// column = new TableColumn(table, SWT.LEFT, 3);
-// column.setText("Status");
-// column.setWidth(100);
-//
-// return table;
-// }
-//
-// protected static class ViewContentProvider implements
-// IStructuredContentProvider {
-//
-// public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
-// }
-//
-// public void dispose() {
-// }
-//
-// @SuppressWarnings("unchecked")
-// public Object[] getElements(Object obj) {
-// if (obj instanceof List) {
-// return ((List<ResultAttributes>) obj).toArray();
-// } else {
-// return new Object[0];
-// }
-// }
-// }
-//
-// protected class ViewLabelProvider extends LabelProvider implements
-// ITableLabelProvider {
-// public String getColumnText(Object obj, int index) {
-// // log.debug(sessionFactory.getClass().toString());
-//
-// SlcExecution se = (SlcExecution) obj;
-// switch (index) {
-//
-// case 0:
-// return getText(se.getStartDate());
-// case 1:
-// return se.getHost();
-// case 2:
-// return se.getUuid();
-// case 3:
-// return se.currentStep().getType();
-// }
-// return getText(obj);
-// }
-//
-// public Image getColumnImage(Object obj, int index) {
-// return null;
-// }
-//
-// }
-//
-// public void setFocus() {
-// viewer.getControl().setFocus();
-// }
-//
-// public void retrieveResults() {
-// try {
-// List<SlcExecution> lst = slcExecutionDao.listSlcExecutions();
-//
-// if (log.isDebugEnabled())
-// log.debug("Result attributes count: " + lst.size());
-// viewer.setInput(lst);
-// // viewer.refresh();
-// } catch (Exception e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// }
-// }
-//
-// // IoC
-// public void setSlcExecutionDao(SlcExecutionDao slcExecutionDao) {
-// this.slcExecutionDao = slcExecutionDao;
-// }
-//
-// public void setContentProvider(IContentProvider contentProvider) {
-// this.contentProvider = contentProvider;
-// }
-//
-// public void setTableLabelProvider(ITableLabelProvider tableLabelProvider) {
-// this.tableLabelProvider = tableLabelProvider;
-// }
-//
-// // public void setSessionFactory(SessionFactory sessionFactory) {
-// // this.sessionFactory = sessionFactory;
-// // }
-//
-// }
-// );
-//
-// return table;
-// }
-//
-// protected static class ViewContentProvider implements
-// IStructuredContentProvider {
-//
-// public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
-// }
-//
-// public void dispose() {
-// }
-//
-// @SuppressWarnings("unchecked")
-// public Object[] getElements(Object obj) {
-// if (obj instanceof List) {
-// return ((List<ResultAttributes>) obj).toArray();
-// } else {
-// return new Object[0];
-// }
-// }
-// }
-//
-// protected class ViewLabelProvider extends LabelProvider implements
-// ITableLabelProvider {
-// public String getColumnText(Object obj, int index) {
-// // log.debug(sessionFactory.getClass().toString());
-//
-// SlcExecution se = (SlcExecution) obj;
-// switch (index) {
-//
-// case 0:
-// return getText(se.getStartDate());
-// case 1:
-// return se.getHost();
-// case 2:
-// return se.getUuid();
-// case 3:
-// return se.currentStep().getType();
-// }
-// return getText(obj);
-// }
-//
-// public Image getColumnImage(Object obj, int index) {
-// return null;
-// }
-//
-// }
-//
-// public void setFocus() {
-// viewer.getControl().setFocus();
-// }
-//
-// public void retrieveResults() {
-// try {
-// List<SlcExecution> lst = slcExecutionDao.listSlcExecutions();
-//
-// if (log.isDebugEnabled())
-// log.debug("Result attributes count: " + lst.size());
-// viewer.setInput(lst);
-// // viewer.refresh();
-// } catch (Exception e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// }
-// }
-//
-// // IoC
-// public void setSlcExecutionDao(SlcExecutionDao slcExecutionDao) {
-// this.slcExecutionDao = slcExecutionDao;
-// }
-//
-// public void setContentProvider(IContentProvider contentProvider) {
-// this.contentProvider = contentProvider;
-// }
-//
-// public void setTableLabelProvider(ITableLabelProvider tableLabelProvider) {
-// this.tableLabelProvider = tableLabelProvider;
-// }
-//
-// // public void setSessionFactory(SessionFactory sessionFactory) {
-// // this.sessionFactory = sessionFactory;
-// // }
-//
-// }
+}
\ No newline at end of file