org.ow2.orchestra.pvm.internal.job
Class JobImpl<T>

java.lang.Object
  extended by org.ow2.orchestra.pvm.internal.job.JobImpl<T>
All Implemented Interfaces:
Serializable, Command<T>, Job
Direct Known Subclasses:
MessageImpl, TimerImpl

public abstract class JobImpl<T>
extends Object
implements Command<T>, Serializable, Job

See Also:
Serialized Form

Nested Class Summary
static class JobImpl.JobException
           
 
Field Summary
protected  Descriptor commandDescriptor
          a command that can be used as the behaviour of this job
protected  long dbid
           
protected  int dbversion
           
protected  long delay
           
protected  Date dueDate
          date until which the command should not be executed this date is set to the current time It should be modified only for timers Warning: if you modify this, be sure to wake the JobExecutor when the jobImpl is supposed to be executed
protected  JobImpl.JobException exception
          stack trace of the exception that occurred during command execution.
protected  ExecutionImpl execution
          the execution (if any) for this jobImpl
protected  boolean isDefaultRetries
           
protected  boolean isExclusive
          specifies if this jobImpl can be executed concurrently with other jobs for the same execution.
protected  boolean isSuspended
          suspended jobs will not execute.
protected  Date lockExpirationTime
          the time the lock on this jobImpl expires.
protected  String lockOwner
          name of the jobImpl executor name that has locked this jobImpl.
protected  int priority
           
protected  ExecutionImpl processInstance
          the process instance
protected  int retries
          number of attempts left to try.
 
Constructor Summary
JobImpl()
           
 
Method Summary
 Descriptor getCommandDescriptor()
           
 long getDbid()
           
 int getDbversion()
           
 long getDelay()
           
 Date getDueDate()
           
 String getException()
           
 ExecutionImpl getExecution()
           
 Date getLockExpirationTime()
           
 String getLockOwner()
           
 int getPriority()
           
 ExecutionImpl getProcessInstance()
           
 int getRetries()
           
 boolean isDefaultRetries()
           
 boolean isExclusive()
           
 boolean isSuspended()
           
 void setCommandDescriptor(Descriptor commandDescriptor)
           
 void setDbid(long id)
           
 void setDelay(long delay)
           
 void setDueDate(Date dueDate)
           
 void setException(String exception)
           
 void setExclusive(boolean isExclusive)
           
 void setExecution(ExecutionImpl execution)
           
 void setLockExpirationTime(Date lockExpirationTime)
           
 void setLockOwner(String jobExecutorName)
           
 void setPriority(int priority)
           
 void setRetries(int retries)
           
 void setSuspended(boolean isSuspended)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ow2.orchestra.pvm.internal.cmd.Command
execute
 

Field Detail

dbid

protected long dbid

dbversion

protected int dbversion

priority

protected int priority

dueDate

protected Date dueDate
date until which the command should not be executed this date is set to the current time It should be modified only for timers Warning: if you modify this, be sure to wake the JobExecutor when the jobImpl is supposed to be executed


isSuspended

protected boolean isSuspended
suspended jobs will not execute.


execution

protected ExecutionImpl execution
the execution (if any) for this jobImpl


processInstance

protected ExecutionImpl processInstance
the process instance


isExclusive

protected boolean isExclusive
specifies if this jobImpl can be executed concurrently with other jobs for the same execution.


lockOwner

protected String lockOwner
name of the jobImpl executor name that has locked this jobImpl.


lockExpirationTime

protected Date lockExpirationTime
the time the lock on this jobImpl expires.


exception

protected JobImpl.JobException exception
stack trace of the exception that occurred during command execution.


retries

protected int retries
number of attempts left to try. Should be decremented each time an exception occurs during command execution.


isDefaultRetries

protected boolean isDefaultRetries

delay

protected long delay

commandDescriptor

protected Descriptor commandDescriptor
a command that can be used as the behaviour of this job

Constructor Detail

JobImpl

public JobImpl()
Method Detail

setExecution

public void setExecution(ExecutionImpl execution)

getDbid

public long getDbid()
Specified by:
getDbid in interface Job

setDbid

public void setDbid(long id)

getDbversion

public int getDbversion()
Returns:
the dbversion

getLockOwner

public String getLockOwner()
Specified by:
getLockOwner in interface Job

isSuspended

public boolean isSuspended()
Specified by:
isSuspended in interface Job

getDueDate

public Date getDueDate()
Specified by:
getDueDate in interface Job

setDueDate

public void setDueDate(Date dueDate)

getException

public String getException()
Specified by:
getException in interface Job

getRetries

public int getRetries()
Specified by:
getRetries in interface Job

isExclusive

public boolean isExclusive()
Specified by:
isExclusive in interface Job

getExecution

public ExecutionImpl getExecution()
Specified by:
getExecution in interface Job

setException

public void setException(String exception)

setExclusive

public void setExclusive(boolean isExclusive)

setLockOwner

public void setLockOwner(String jobExecutorName)

setRetries

public void setRetries(int retries)

setSuspended

public void setSuspended(boolean isSuspended)

getProcessInstance

public ExecutionImpl getProcessInstance()
Specified by:
getProcessInstance in interface Job

getLockExpirationTime

public Date getLockExpirationTime()
Specified by:
getLockExpirationTime in interface Job

setLockExpirationTime

public void setLockExpirationTime(Date lockExpirationTime)

getCommandDescriptor

public Descriptor getCommandDescriptor()

setCommandDescriptor

public void setCommandDescriptor(Descriptor commandDescriptor)

isDefaultRetries

public boolean isDefaultRetries()
Returns:
the isDefaultRetries

getDelay

public long getDelay()
Returns:

setDelay

public void setDelay(long delay)
Parameters:
delay - the delay to set

getPriority

public int getPriority()
Specified by:
getPriority in interface Job

setPriority

public void setPriority(int priority)
Parameters:
priority - the priority to set


Copyright © 2011 OW2 Consortium. All Rights Reserved.