T
- concrete type of ApplicationTaskContext
created by this factory@InterfaceStability.Evolving public interface ApplicationTaskContextFactory<T extends ApplicationTaskContext> extends java.io.Serializable
ApplicationTaskContext
instances for a SamzaApplication
during task
initialization.
Use ApplicationDescriptor.withApplicationTaskContextFactory(org.apache.samza.context.ApplicationTaskContextFactory<?>)
to provide the
ApplicationTaskContextFactory
. Use Context.getApplicationTaskContext()
to get the created
ApplicationTaskContext
instance for the current task.
The ApplicationTaskContextFactory
implementation must be Serializable
.
Modifier and Type | Method and Description |
---|---|
default T |
create(ExternalContext externalContext,
JobContext jobContext,
ContainerContext containerContext,
TaskContext taskContext,
ApplicationContainerContext applicationContainerContext)
Creates an instance of the application-defined
ApplicationTaskContext . |
default T |
create(JobContext jobContext,
ContainerContext containerContext,
TaskContext taskContext,
ApplicationContainerContext applicationContainerContext)
Deprecated.
|
default T create(ExternalContext externalContext, JobContext jobContext, ContainerContext containerContext, TaskContext taskContext, ApplicationContainerContext applicationContainerContext)
ApplicationTaskContext
.
Applications should implement this to provide a context for task initialization.
externalContext
- external context provided for the application; null if it was not providedjobContext
- framework-provided job contextcontainerContext
- framework-provided container contexttaskContext
- framework-provided task contextapplicationContainerContext
- application-defined container context; null if it was not providedApplicationTaskContext
@Deprecated default T create(JobContext jobContext, ContainerContext containerContext, TaskContext taskContext, ApplicationContainerContext applicationContainerContext)
create(ExternalContext, JobContext, ContainerContext, TaskContext, ApplicationContainerContext)
instead.
This is the same as
create(ExternalContext, JobContext, ContainerContext, TaskContext, ApplicationContainerContext)
, except it
does not provide access to external context.
This is being left here for backwards compatibility.
jobContext
- framework-provided job contextcontainerContext
- framework-provided container contexttaskContext
- framework-provided task contextapplicationContainerContext
- application-defined container context; null if it was not providedApplicationTaskContext
Deprecated: Applications should implement
create(ExternalContext, JobContext, ContainerContext, TaskContext, ApplicationContainerContext)
directly.
This is being left here for backwards compatibility.