Package org.jppf.client
Interface JobManager
- All Known Implementing Classes:
JobManagerClient
public interface JobManager
Interface for an asynchronous job submission manager.
- Author:
- Laurent Cohen
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCancel the job with the specified id.voidclose()Close this job manager and all the resources it uses.Get the list of available connections.Get a listener to the status of the managed connections.org.jppf.load.balancer.LoadBalancingInformationGet the current load-balancer settings.booleanDetermine whether there is a client connection available for execution.booleanDetermine whether local execution is enabled on this client.voidreset()Reset this job manager.resubmitJob(JPPFJob job) Add an existing job back into the execution queue.voidsetLoadBalancerSettings(String algorithm, Properties parameters) Change the load balancer settings for the client.voidsetLocalExecutionEnabled(boolean localExecutionEnabled) Specify whether local execution is enabled on this client.Add a job to the execution queue.submitJob(JPPFJob job, JobStatusListener listener) Add a task job to the execution queue.
-
Method Details
-
submitJob
Add a job to the execution queue.- Parameters:
job- encapsulation of the execution data.- Returns:
- the unique id of the job.
-
submitJob
Add a task job to the execution queue.- Parameters:
job- encapsulation of the execution data.listener- an optional listener to receive job status change notifications, may be null.- Returns:
- the unique id of the job.
-
resubmitJob
Add an existing job back into the execution queue.- Parameters:
job- encapsulation of the execution data.- Returns:
- the unique id of the job.
-
hasAvailableConnection
boolean hasAvailableConnection()Determine whether there is a client connection available for execution.- Returns:
- true if at least one connection is available, false otherwise.
-
isLocalExecutionEnabled
boolean isLocalExecutionEnabled()Determine whether local execution is enabled on this client.- Returns:
trueif local execution is enabled,falseotherwise.
-
setLocalExecutionEnabled
void setLocalExecutionEnabled(boolean localExecutionEnabled) Specify whether local execution is enabled on this client.- Parameters:
localExecutionEnabled-trueto enable local execution,falseotherwise
-
getAvailableConnections
Vector<JPPFClientConnection> getAvailableConnections()Get the list of available connections.- Returns:
- a vector of connections instances.
-
getClientConnectionStatusListener
ClientConnectionStatusListener getClientConnectionStatusListener()Get a listener to the status of the managed connections.- Returns:
- a
ClientConnectionStatusListenerinstance.
-
close
void close()Close this job manager and all the resources it uses. -
reset
void reset()Reset this job manager. -
cancelJob
Cancel the job with the specified id.- Parameters:
jobId- the id of the job to cancel.- Returns:
- a
truewhen cancel was successfulfalseotherwise. - Throws:
Exception- if any error occurs.
-
getLoadBalancerSettings
org.jppf.load.balancer.LoadBalancingInformation getLoadBalancerSettings()Get the current load-balancer settings.- Returns:
- a
LoadBalancingInformationinstance, which encapsulates a load-balancing alfgorithm name, along with its parameters.
-
setLoadBalancerSettings
Change the load balancer settings for the client.- Parameters:
algorithm- the name of load-balancing alogrithm to use.parameters- the algorithm's parameters, if any. The parmeter names are assumed no to be prefixed.- Throws:
Exception- if any error occurs or if the algorithm name isnullor not known.
-