]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.jcr/src/org/argeo/slc/jcr/execution/JcrProcessThread.java
Remove old license headers
[gpl/argeo-slc.git] / org.argeo.slc.jcr / src / org / argeo / slc / jcr / execution / JcrProcessThread.java
index 56b97d02e7aa550a98e63126efb6a959195f9bd5..34860d0dd960873aab64b142ddaedcef524011fa 100644 (file)
@@ -22,6 +22,7 @@ import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
+import org.argeo.api.NodeConstants;
 import org.argeo.jcr.JcrUtils;
 import org.argeo.slc.SlcException;
 import org.argeo.slc.SlcNames;
@@ -33,8 +34,7 @@ import org.argeo.slc.runtime.ProcessThread;
 /** Where the actual execution takes place */
 public class JcrProcessThread extends ProcessThread implements SlcNames {
 
-       public JcrProcessThread(ThreadGroup processesThreadGroup,
-                       ExecutionModulesManager executionModulesManager,
+       public JcrProcessThread(ThreadGroup processesThreadGroup, ExecutionModulesManager executionModulesManager,
                        JcrExecutionProcess process) {
                super(processesThreadGroup, executionModulesManager, process);
        }
@@ -45,14 +45,11 @@ public class JcrProcessThread extends ProcessThread implements SlcNames {
                Session session = null;
                if (getProcess() instanceof JcrExecutionProcess)
                        try {
-                               session = ((JcrExecutionProcess) getProcess()).getRepository()
-                                               .login();
+                               session = ((JcrExecutionProcess) getProcess()).getRepository().login(NodeConstants.HOME_WORKSPACE);
 
-                               List<RealizedFlow> realizedFlows = getProcess()
-                                               .getRealizedFlows();
+                               List<RealizedFlow> realizedFlows = getProcess().getRealizedFlows();
                                for (RealizedFlow realizedFlow : realizedFlows) {
-                                       Node realizedFlowNode = session
-                                                       .getNode(((JcrRealizedFlow) realizedFlow).getPath());
+                                       Node realizedFlowNode = session.getNode(((JcrRealizedFlow) realizedFlow).getPath());
                                        setFlowStatus(realizedFlowNode, ExecutionProcess.RUNNING);
 
                                        try {
@@ -61,8 +58,7 @@ public class JcrProcessThread extends ProcessThread implements SlcNames {
                                                //
                                                execute(realizedFlow, true);
 
-                                               setFlowStatus(realizedFlowNode,
-                                                               ExecutionProcess.COMPLETED);
+                                               setFlowStatus(realizedFlowNode, ExecutionProcess.COMPLETED);
                                        } catch (RepositoryException e) {
                                                throw e;
                                        } catch (InterruptedException e) {
@@ -74,8 +70,7 @@ public class JcrProcessThread extends ProcessThread implements SlcNames {
                                        }
                                }
                        } catch (RepositoryException e) {
-                               throw new SlcException("Cannot process "
-                                               + getJcrExecutionProcess().getNodePath(), e);
+                               throw new SlcException("Cannot process " + getJcrExecutionProcess().getNodePath(), e);
                        } finally {
                                JcrUtils.logoutQuietly(session);
                        }
@@ -83,8 +78,7 @@ public class JcrProcessThread extends ProcessThread implements SlcNames {
                        super.process();
        }
 
-       protected void setFlowStatus(Node realizedFlowNode, String status)
-                       throws RepositoryException {
+       protected void setFlowStatus(Node realizedFlowNode, String status) throws RepositoryException {
                realizedFlowNode.setProperty(SLC_STATUS, status);
                realizedFlowNode.getSession().save();
        }