public class LocalWorker extends UnicastRemoteObject implements RemoteSingleRun
Worker
instance the
handling of actually running a workflow.DirectoryDelegate
,
FileDelegate
,
WorkerCore
,
Serialized Formref
Modifier | Constructor and Description |
---|---|
protected |
LocalWorker(String executeWorkflowCommand,
byte[] workflow,
UsageRecordReceiver urReceiver,
UUID id,
Map<String,String> seedEnvironment,
List<String> javaParams,
WorkerFactory workerFactory) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(RemoteListener listener)
Add a listener to the run.
|
void |
destroy()
Kill off this run, removing all resources which it consumes.
|
Date |
getFinishTimestamp() |
String |
getInputBaclavaFile() |
List<RemoteInput> |
getInputs() |
List<RemoteListener> |
getListeners() |
List<String> |
getListenerTypes()
Get the types of listener supported by this run.
|
String |
getOutputBaclavaFile() |
RemoteSecurityContext |
getSecurityContext() |
Date |
getStartTimestamp() |
RemoteStatus |
getStatus() |
RemoteDirectory |
getWorkingDirectory() |
RemoteInput |
makeInput(String name)
Create an input assignment.
|
RemoteListener |
makeListener(String type,
String configuration)
Create a listener that can be attached to this run.
|
void |
ping()
A do-nothing method, used to check the general reachability of the
workflow run.
|
void |
setGenerateProvenance(boolean prov)
Sets whether we should generate provenance information from a run.
|
void |
setInputBaclavaFile(String filename)
Sets the Baclava file to use for all inputs.
|
void |
setInteractionServiceDetails(URL feed,
URL webdav,
URL publish)
Configures the details to use when setting up the workflow run's
connnection to the interaction feed.
|
void |
setOutputBaclavaFile(String filename)
Sets where the output of the run is to be written to.
|
void |
setStatus(RemoteStatus newStatus)
Set the status of the run, which should cause it to move into the given
state.
|
clone, exportObject, exportObject, exportObject, unexportObject
getClientHost, getLog, setLog
protected LocalWorker(String executeWorkflowCommand, byte[] workflow, UsageRecordReceiver urReceiver, UUID id, Map<String,String> seedEnvironment, List<String> javaParams, WorkerFactory workerFactory) throws RemoteException, ImplementationException
executeWorkflowCommand
- The script used to execute workflows.workflow
- The workflow to execute.workerClass
- The class to instantiate as our local representative of the
run.urReceiver
- The remote class to report the generated usage record(s) to.id
- The UUID to use, or null if we are to invent one.seedEnvironment
- The key/value pairs to seed the worker subprocess environment
with.javaParams
- Parameters to pass to the worker subprocess java runtime
itself.workerFactory
- How to make instances of the low-level worker objects.RemoteException
- If registration of the worker fails.ImplementationException
- If something goes wrong during local setup.public void destroy() throws ImplementationException
RemoteSingleRun
destroy
in interface RemoteSingleRun
ImplementationException
- If something goes horribly wrong when destroying the run.public void addListener(RemoteListener listener) throws RemoteException, ImplementationException
RemoteSingleRun
addListener
in interface RemoteSingleRun
listener
- The listener to add.RemoteException
- If anything goes wrong with the communication.ImplementationException
- If something goes wrong when adding the listener.public String getInputBaclavaFile()
getInputBaclavaFile
in interface RemoteSingleRun
public List<RemoteInput> getInputs() throws RemoteException
getInputs
in interface RemoteSingleRun
RemoteException
- If anything goes wrong with the communication.public List<String> getListenerTypes()
RemoteSingleRun
getListenerTypes
in interface RemoteSingleRun
public List<RemoteListener> getListeners()
getListeners
in interface RemoteSingleRun
public String getOutputBaclavaFile()
getOutputBaclavaFile
in interface RemoteSingleRun
public RemoteSecurityContext getSecurityContext() throws RemoteException, ImplementationException
getSecurityContext
in interface RemoteSingleRun
RemoteException
- If anything goes wrong with the communication.ImplementationException
- If something goes wrong when getting the context.public RemoteStatus getStatus()
getStatus
in interface RemoteSingleRun
public RemoteDirectory getWorkingDirectory()
getWorkingDirectory
in interface RemoteSingleRun
public RemoteInput makeInput(String name) throws RemoteException
RemoteSingleRun
makeInput
in interface RemoteSingleRun
name
- The name of the port that this will be an input for.RemoteException
- If anything goes wrong with the communication.public RemoteListener makeListener(String type, String configuration) throws RemoteException
RemoteSingleRun
makeListener
in interface RemoteSingleRun
type
- The type name of the listener to create; it must be one of the
names returned by the RemoteSingleRun.getListenerTypes()
operation.configuration
- The configuration document for this listener. The nature of
the contents of this are determined by the type.RemoteException
- If anything goes wrong with the communication.public void setInputBaclavaFile(String filename) throws RemoteException
RemoteSingleRun
setInputBaclavaFile
in interface RemoteSingleRun
filename
- The filename to use. Must not start with a / or
contain any .. segments. Will be interpreted relative
to the run's working directory.RemoteException
- If anything goes wrong with the communication.public void setOutputBaclavaFile(String filename) throws RemoteException
RemoteSingleRun
setOutputBaclavaFile
in interface RemoteSingleRun
filename
- Where to write the Baclava file (or null to cause the
output to be written to individual files); overwrites any
previous setting of this value.RemoteException
- If anything goes wrong with the communication.public void setGenerateProvenance(boolean prov)
RemoteSingleRun
setGenerateProvenance
in interface RemoteSingleRun
prov
- Boolean flag, true for do the generation. Must be set before
starting the run for this to have an effect.public void setStatus(RemoteStatus newStatus) throws IllegalStateTransitionException, RemoteException, ImplementationException, StillWorkingOnItException
RemoteSingleRun
setStatus
in interface RemoteSingleRun
newStatus
- The state to try to change to.IllegalStateTransitionException
- If the requested state change is impossible. (Note that it is
always legal to set the status to the current status.)RemoteException
- If anything goes wrong with the communication.ImplementationException
- If something goes horribly wrong on the back end.StillWorkingOnItException
- If the startup time of the workflow implementation exceeds a
built-in threshold.public Date getFinishTimestamp()
getFinishTimestamp
in interface RemoteSingleRun
public Date getStartTimestamp()
getStartTimestamp
in interface RemoteSingleRun
public void setInteractionServiceDetails(URL feed, URL webdav, URL publish)
RemoteSingleRun
setInteractionServiceDetails
in interface RemoteSingleRun
feed
- The location of the interaction feed. If null,
defaults from the factory will be used instead.webdav
- The location used for pushing web pages to support the feed.
If null, a default from the factory will be used
instead.publish
- Where to actually publish to, if this needs to be
different from the location presented in the published HTML
and Feed entries. Necessary in complex network scenarios.public void ping()
RemoteSingleRun
ping
in interface RemoteSingleRun
Copyright © 2015–2018 The Apache Software Foundation. All rights reserved.