Job Context

  • Only applicable for Jobs

API Interface

  • Context Variable: job
//Returns running count of all jobs in the cluster
int count();

//Returns running count of a job in the cluster
int count(String jobId);

//Start a job
void start(String jobId);

//Stop a job
void stop(String jobId);
  • Context Variable: THIS
//Get the job name
String getName();

//Get the job ID
String getId();

//Is the job was cancelled
boolean isCancelled();

//Enum [ATOMIC | SCALABLE | DISTRIBUTED | NODE_SINGLETON | CLUSTER_SINGLETON ]
JobType getJobType();

//Get the instance ID
int getInstanceId();

//Get the session UUID
UUID getSessionId();

//Get the cluster node id where the job is running
UUID getNodeId();

//Get the cluster node consistent-id where the job is running
String getNodeConsistentId();

//Enum [GLOBAL | SYSTEM | DOMAIN]
JobInstanceType getJobInstanceType();

//Get the number of configured instances
int getInstances();

//Should start on platform startup
boolean isStartOnBoot();

//Should restart the job on code changes
boolean isRestartOnChange();

//Get the job started timestamp
long getBeginStamp();

//Is the job scheduled for running
boolean isRunning();

//Is the job stopped
boolean isStopped();

APIs Inherited From

Context Base

Related REST APIs

Create / Update Job
Get Job
Delete Job
Count Jobs
List Jobs
Set Job State
Count Running Jobs
List Running Jobs
Start Job
Restart Job
Stop Job
Count All Running Jobs