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
.execution
;
19 import java
.util
.List
;
22 * A local agent can run SLC processes. It is responsible for creating their
23 * threads and integrating them with various UIs. It typically wraps
24 * {@link ExecutionModulesManager} which is used to run flows synchronously at a
27 public interface SlcAgent
{
28 /** Agent unique identifier */
29 public String
getAgentUuid();
31 /** Execute / take part to this process */
32 public void process(ExecutionProcess process
);
35 * Asynchronously processes the flows defined as URIs, or interpret a single
36 * UUID URN as a scheduled or template process.
38 * @return the UUID of the process launched.
40 public String
process(List
<URI
> uris
);
42 /** Kills this process */
43 public void kill(String processUuid
);
46 * Wait for this process to finish. returns immediately if it does not
52 public void waitFor(String processUuid
, Long millis
);
55 * Describe all the flows provided by this execution module. Typically
56 * called in order to build a realized flow.
58 public ExecutionModuleDescriptor
getExecutionModuleDescriptor(
59 String moduleName
, String version
);
61 /** List all execution modules which can be processed by this agent. */
62 public List
<ExecutionModuleDescriptor
> listExecutionModuleDescriptors();
64 /** @return true if still alive. */
65 public boolean ping();