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>childrenprivate java.lang.CharSequencecommandprivate java.util.concurrent.Future<?>futureprivate intidprivate CommandSessionImpl.JobImplparentprivate java.util.List<Pipe>pipesprivate Pipe.Resultresultprivate Job.Statusstatus
-
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 voidadd(Job child)(package private) voidaddPipe(Pipe pipe)voidbackground()java.lang.CharSequencecommand()protected voiddone()voidforeground()intid()voidinterrupt()Jobparent()java.util.List<Process>processes()Pipe.Resultresult()voidrun()CommandSessionsession()private voidsetStatus(Job.Status newStatus)private voidsetStatus(Job.Status newStatus, boolean callListeners)Pipe.Resultstart(Job.Status status)Start the job.Job.Statusstatus()voidsuspend()
-
-
-
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:
backgroundin interfaceJob
-
foreground
public void foreground()
- Specified by:
foregroundin 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:
nullif the job has been suspended or moved to background,- Throws:
java.lang.InterruptedException
-
session
public CommandSession session()
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
add
public void add(Job child)
-
-