I
- O
- public interface OpletContext<I,O> extends RuntimeServices
Oplet
's invocation context.
At execution time an oplet uses its invocation context to retrieve
provided services
,
output ports
for tuple submission
and job
information.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getId()
Get the unique identifier (within the running job)
for this oplet.
|
int |
getInputCount()
Get the number of connected inputs to this oplet.
|
JobContext |
getJobContext()
Get the job hosting this oplet.
|
int |
getOutputCount()
Get the number of connected outputs to this oplet.
|
java.util.List<? extends Consumer<O>> |
getOutputs()
Get the mechanism to submit tuples on an output port.
|
<T> T |
getService(java.lang.Class<T> serviceClass)
Get a service for this invocation.
|
java.lang.String |
uniquify(java.lang.String name)
Creates a unique name within the context of the current runtime.
|
java.lang.String getId()
<T> T getService(java.lang.Class<T> serviceClass)
These services must be provided by all implementations:
java.util.concurrent.ThreadFactory
- Thread factory, runtime code should
create new threads using this factory.
java.util.concurrent.ScheduledExecutorService
- Scheduler, runtime code should
execute asynchronous and repeating tasks using this scheduler.
Get a service for this oplet invocation. An invocation of an oplet may get access to services, which provide specific functionality, such as metrics.
getService
in interface RuntimeServices
serviceClass
- Type of the service required.serviceClass
if the
container this invocation runs in supports that service,
otherwise null
.int getInputCount()
int getOutputCount()
java.util.List<? extends Consumer<O>> getOutputs()
JobContext getJobContext()
JobContext
hosting this oplet invocation.java.lang.String uniquify(java.lang.String name)
The default implementation adds a suffix composed of the package
name of this interface, the current job and oplet identifiers,
all separated by periods ('.'
). Developers should use this
method to avoid name clashes when they store or register the name in
an external container or registry.
name
- name (possibly non-unique)Copyright IBM 2015,2016 - 2f6ad0e-20160307-0902