I
- Tuple type of input streamsO
- Tuple type of output streamspublic abstract class AbstractContext<I,O> extends java.lang.Object implements OpletContext<I,O>
OpletContext
interface.Constructor and Description |
---|
AbstractContext(JobContext job,
RuntimeServices services) |
Modifier and Type | Method and Description |
---|---|
JobContext |
getJobContext()
Get the job hosting this oplet.
|
<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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getId, getInputCount, getOutputContext, getOutputCount, getOutputs
public AbstractContext(JobContext job, RuntimeServices services)
public <T> T getService(java.lang.Class<T> serviceClass)
OpletContext
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
getService
in interface OpletContext<I,O>
T
- service class typeserviceClass
- Type of the service required.serviceClass
if the
container this invocation runs in supports that service,
otherwise null
.public JobContext getJobContext()
OpletContext
getJobContext
in interface OpletContext<I,O>
JobContext
hosting this oplet invocation.public 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.
uniquify
in interface OpletContext<I,O>
name
- name (possibly non-unique)Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641