T - Oplet type.I - Data container type for input tuples.O - Data container type for output tuples.public class Invocation<T extends Oplet<I,O>,I,O>
extends java.lang.Object
implements java.lang.AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ID_PREFIX
Prefix used by oplet unique identifiers.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Invocation(java.lang.String id,
T oplet,
int inputCount,
int outputCount) |
| Modifier and Type | Method and Description |
|---|---|
int |
addOutput()
Adds a new output.
|
void |
close() |
void |
disconnect(int port)
Disconnects the specified port by connecting to a no-op
Consumer implementation. |
java.lang.String |
getId()
Returns the unique identifier associated with this
Invocation. |
java.util.List<? extends Consumer<I>> |
getInputs()
Returns the list of input stream forwarders for this invocation.
|
T |
getOplet()
Returns the oplet associated with this
Invocation. |
int |
getOutputCount()
Returns the number of outputs for this invocation.
|
void |
initialize(JobContext job,
RuntimeServices services)
Initialize the invocation.
|
void |
setTarget(int port,
Consumer<O> target)
Disconnects the specified port and reconnects it to the specified target.
|
void |
start()
Start the oplet.
|
public static final java.lang.String ID_PREFIX
protected Invocation(java.lang.String id,
T oplet,
int inputCount,
int outputCount)
public java.lang.String getId()
Invocation.public T getOplet()
Invocation.public int getOutputCount()
public int addOutput()
public void disconnect(int port)
Consumer implementation.port - the port indexpublic void setTarget(int port,
Consumer<O> target)
port - index of the port which is reconnectedtarget - target the port gets connected topublic java.util.List<? extends Consumer<I>> getInputs()
public void initialize(JobContext job, RuntimeServices services)
job - the context of the current jobservices - service provider for this invocationpublic void start()
public void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.ExceptionCopyright IBM 2015,2016 - 2f6ad0e-20160307-0902