|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.smila.taskworker.io.IODataObjects
org.eclipse.smila.taskworker.output.Outputs
public class Outputs
Returned by TaskContext.getOutputs() this class provides access to the data
objects associated by a task to the output slots of a worker. It can create different kinds of Output
wrappers on these data objects that make access for the workers easier. You can create only a single output wrapper
for each data object. On the second call, only null will be returned.
StreamOutput,
RecordOutput,
KvoOutput,
AppendableOutput| Field Summary |
|---|
| Fields inherited from class org.eclipse.smila.taskworker.io.IODataObjects |
|---|
_dataObjects, _ioData |
| Constructor Summary | |
|---|---|
Outputs(java.util.Map<java.lang.String,java.util.List<BulkInfo>> dataObjects,
ObjectStoreService objectStore)
|
|
| Method Summary | ||
|---|---|---|
void |
abortAll()
Abort all open data objects, if necessary. |
|
void |
addOutputCounters(java.util.Map<java.lang.String,java.lang.Number> counters)
aggregate counters of output slots. |
|
protected boolean |
canCreate(java.lang.String slotName,
int index)
check if index is valid for slotname and no input object has yet been created for this object. |
|
void |
commitAll()
Commit all open data objects, if necessary. |
|
|
getAsOutput(java.lang.String slotName,
java.lang.Class<T> inputClass)
Generic method to create output wrapper for the first data object in a slot. |
|
|
getAsOutput(java.lang.String slotName,
int index,
java.lang.Class<T> outputClass)
Generic method to create output wrappers. |
|
RecordOutput |
getAsRecordOutput(java.lang.String slotName)
|
|
RecordOutput |
getAsRecordOutput(java.lang.String slotName,
int index)
|
|
StreamOutput |
getAsStreamOutput(java.lang.String slotName)
|
|
StreamOutput |
getAsStreamOutput(java.lang.String slotName,
int index)
|
|
BulkInfo |
getDataObject(java.lang.String slotName,
int index)
|
|
protected boolean |
isMultiple(java.lang.String slotName)
|
|
void |
setOutputModes(java.util.Map<java.lang.String,java.util.Collection<OutputMode>> outputModes)
|
|
| Methods inherited from class org.eclipse.smila.taskworker.io.IODataObjects |
|---|
addCounters, getDataObject, getDataObjectCount, getIOData, getObjectStore, putIOData |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Outputs(java.util.Map<java.lang.String,java.util.List<BulkInfo>> dataObjects,
ObjectStoreService objectStore)
dataObjects - The data objectsobjectStore - The reference to the object store service| Method Detail |
|---|
public void setOutputModes(java.util.Map<java.lang.String,java.util.Collection<OutputMode>> outputModes)
outputModes - the output modes for the output slots.
public <T extends Output> T getAsOutput(java.lang.String slotName,
java.lang.Class<T> inputClass)
getAsOutput(String, int, Class) for details, this method just calls this method with
index = 0
java.lang.IllegalArgumentException - if the outputClass cannot be instantiated.
public <T extends Output> T getAsOutput(java.lang.String slotName,
int index,
java.lang.Class<T> outputClass)
Output can be used as well as custom
defined class if you need it (be sure to implement the necessary constructor). For example, to get an
Key-Value-Object wrapper for the first object in slot "kvoOutputSlot", use
KvoOutput kvo = taskContext.getOutputs().getAsOutput("kvoOutputSlot", KvoOutput.class);
java.lang.IllegalArgumentException - if the outputClass cannot be instantiated.StreamOutput,
RecordOutput,
KvoOutput,
AppendableOutput
public StreamOutput getAsStreamOutput(java.lang.String slotName,
int index)
slotName - The slot nameindex - The index
StreamOutput with given slot name and indexpublic StreamOutput getAsStreamOutput(java.lang.String slotName)
slotName - The slot name
StreamOutput with given slot name
public RecordOutput getAsRecordOutput(java.lang.String slotName,
int index)
slotName - The slot nameindex - The index
RecordOutput with given slot name and indexpublic RecordOutput getAsRecordOutput(java.lang.String slotName)
slotName - The slot name
RecordOutput with given slot name
public void commitAll()
throws ObjectStoreException,
java.io.IOException
ObjectStoreException
java.io.IOException
public void abortAll()
throws ObjectStoreException,
java.io.IOException
ObjectStoreException
java.io.IOExceptionpublic void addOutputCounters(java.util.Map<java.lang.String,java.lang.Number> counters)
protected boolean isMultiple(java.lang.String slotName)
protected boolean canCreate(java.lang.String slotName,
int index)
IODataObjects
canCreate in class IODataObjects
public BulkInfo getDataObject(java.lang.String slotName,
int index)
getDataObject in class IODataObjects
|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||