Package org.jppf.execute
Interface ExecutorChannel<T>
- Type Parameters:
T- type of task bundle.
- All Superinterfaces:
AutoCloseable
Execution context associated with a channel serving its state.
- Author:
- Martin JANDA
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a execution status listener to this channel's list of listeners.Bundler<?>checkBundler(JPPFBundlerFactory bundlerFactory, JPPFContext jppfContext) Check whether the bundler held by this context is up to date by comparison with the specified bundler.
If it is not, then it is replaced with a copy of the specified bundler, with a timestamp taken at creation time.Bundler<?>Get the bundler used to schedule tasks for the corresponding node.Get the unique ID for the connection.intGet the number of jobs currently being processed by this channel.Get the execution status of this channel.Get the management information.default intGet the maximum number of jobs that can be processed concurrently by this channel.Get the monitor object used for synchronization.Get the system information.getUuid()Get the unique identifier of the client.booleanisActive()Determine whether this channel is active.default booleanDetermine whether this channel is asynchronous, i.e. it can handle mmultiple jobs concurrently.booleanisLocal()Determine whether this channel is local (for an in-JVM node).voidRemove a execution status listener from this channel's list of listeners.Future<?>Submit bundle for execution on corresponding node.Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
getUuid
String getUuid()Get the unique identifier of the client.- Returns:
- the uuid as a string.
-
getConnectionUuid
String getConnectionUuid()Get the unique ID for the connection.- Returns:
- the connection id.
-
getBundler
Bundler<?> getBundler()Get the bundler used to schedule tasks for the corresponding node.- Returns:
- a
Bundlerinstance.
-
checkBundler
Check whether the bundler held by this context is up to date by comparison with the specified bundler.
If it is not, then it is replaced with a copy of the specified bundler, with a timestamp taken at creation time.- Parameters:
bundlerFactory- the load-balancer factory.jppfContext- execution context.- Returns:
- the (possibly new) bundle for this executor channel.
-
getSystemInformation
JPPFSystemInformation getSystemInformation()Get the system information.- Returns:
- a
JPPFSystemInformationinstance.
-
getManagementInfo
JPPFManagementInfo getManagementInfo()Get the management information.- Returns:
- a
JPPFManagementInfoinstance.
-
submit
Submit bundle for execution on corresponding node.- Parameters:
bundle- the task bundle to submit.- Returns:
- a
JPPFFuture. - Throws:
Exception- if any error occurs.
-
isLocal
boolean isLocal()Determine whether this channel is local (for an in-JVM node).- Returns:
trueif the channel is local,falseotherwise.
-
getExecutionStatus
ExecutorStatus getExecutionStatus()Get the execution status of this channel.- Returns:
- a
ExecutorStatusenumerated value.
-
addExecutionStatusListener
Add a execution status listener to this channel's list of listeners.- Parameters:
listener- the listener to add to the list.
-
removeExecutionStatusListener
Remove a execution status listener from this channel's list of listeners.- Parameters:
listener- the listener to remove from the list.
-
getMonitor
Object getMonitor()Get the monitor object used for synchronization.- Returns:
- an
Objectinstance.
-
isActive
boolean isActive()Determine whether this channel is active.- Returns:
trueif the channel is active,falseif it is inactive.
-
isAsynchronous
default boolean isAsynchronous()Determine whether this channel is asynchronous, i.e. it can handle mmultiple jobs concurrently.- Returns:
trueif the channel is asynchronous,falseif it is synchronous.
-
getMaxJobs
default int getMaxJobs()Get the maximum number of jobs that can be processed concurrently by this channel.- Returns:
- the maximum number of jobs as an
intvalue.
-
getCurrentNbJobs
int getCurrentNbJobs()Get the number of jobs currently being processed by this channel.- Returns:
- the current number of jobs as an
intvalue.
-