2 * Copyright (C) 2007-2012 Argeo GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.argeo
.slc
.core
.execution
;
18 import java
.util
.concurrent
.ArrayBlockingQueue
;
19 import java
.util
.concurrent
.BlockingQueue
;
21 import org
.argeo
.slc
.execution
.ExecutionProcess
;
22 import org
.argeo
.slc
.execution
.ExecutionStep
;
24 /** The thread group attached to a given {@link SlcExecution}. */
25 public class ProcessThreadGroup
extends ThreadGroup
{
26 // private final Authentication authentication;
27 private final static Integer STEPS_BUFFER_CAPACITY
= 5000;
29 private BlockingQueue
<ExecutionStep
> steps
= new ArrayBlockingQueue
<ExecutionStep
>(
30 STEPS_BUFFER_CAPACITY
);
32 private Boolean hadAnError
= false;
34 public ProcessThreadGroup(ExecutionProcess executionProcess
) {
35 super("SLC Process #" + executionProcess
.getUuid() + " thread group");
36 // this.authentication = SecurityContextHolder.getContext()
37 // .getAuthentication();
40 // public Authentication getAuthentication() {
41 // return authentication;
44 public void dispatchAddStep(ExecutionStep step
) {
45 // ExecutionProcess slcProcess = processThread.getProcess();
46 // List<ExecutionStep> steps = new ArrayList<ExecutionStep>();
48 // TODO clarify why we don't dispatch steps, must be a reason
49 // dispatchAddSteps(steps);
50 // slcProcess.addSteps(steps);
51 if (step
.getType().equals(ExecutionStep
.ERROR
))
56 // public void dispatchAddSteps(List<ExecutionStep> steps) {
57 // ExecutionProcess slcProcess = processThread.getProcess();
58 // executionModulesManager.dispatchAddSteps(slcProcess, steps);
61 public BlockingQueue
<ExecutionStep
> getSteps() {
65 public Boolean
hadAnError() {