Package org.apache.felix.gogo.runtime
Class CommandSessionImpl.JobImpl
- java.lang.Object
-
- org.apache.felix.gogo.runtime.CommandSessionImpl.JobImpl
-
- All Implemented Interfaces:
java.lang.Runnable
,Job
- Enclosing class:
- CommandSessionImpl
class CommandSessionImpl.JobImpl extends java.lang.Object implements Job, java.lang.Runnable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.felix.service.command.Job
Job.Status, Job.Utils
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Job>
children
private java.lang.CharSequence
command
private java.util.concurrent.Future<?>
future
private int
id
private CommandSessionImpl.JobImpl
parent
private java.util.List<Pipe>
pipes
private Pipe.Result
result
private Job.Status
status
-
Constructor Summary
Constructors Constructor Description JobImpl(int id, CommandSessionImpl.JobImpl parent, java.lang.CharSequence command)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Job child)
(package private) void
addPipe(Pipe pipe)
void
background()
java.lang.CharSequence
command()
protected void
done()
void
foreground()
int
id()
void
interrupt()
Job
parent()
java.util.List<Process>
processes()
Pipe.Result
result()
void
run()
CommandSession
session()
private void
setStatus(Job.Status newStatus)
private void
setStatus(Job.Status newStatus, boolean callListeners)
Pipe.Result
start(Job.Status status)
Start the job.Job.Status
status()
void
suspend()
-
-
-
Field Detail
-
id
private final int id
-
parent
private final CommandSessionImpl.JobImpl parent
-
command
private final java.lang.CharSequence command
-
pipes
private final java.util.List<Pipe> pipes
-
children
private final java.util.List<Job> children
-
status
private Job.Status status
-
future
private java.util.concurrent.Future<?> future
-
result
private Pipe.Result result
-
-
Constructor Detail
-
JobImpl
public JobImpl(int id, CommandSessionImpl.JobImpl parent, java.lang.CharSequence command)
-
-
Method Detail
-
addPipe
void addPipe(Pipe pipe)
-
status
public Job.Status status()
-
background
public void background()
- Specified by:
background
in interfaceJob
-
foreground
public void foreground()
- Specified by:
foreground
in interfaceJob
-
done
protected void done()
-
setStatus
private void setStatus(Job.Status newStatus)
-
setStatus
private void setStatus(Job.Status newStatus, boolean callListeners)
-
result
public Pipe.Result result()
-
start
public Pipe.Result start(Job.Status status) throws java.lang.InterruptedException
Start the job. If the job is started in foreground, waits for the job to finish or to be suspended or moved to background.- Parameters:
status
- the desired job status- Returns:
null
if the job has been suspended or moved to background,- Throws:
java.lang.InterruptedException
-
session
public CommandSession session()
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
add
public void add(Job child)
-
-