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

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

public abstract class JobImpl<T>
extends java.lang.Object
implements Command<T>, java.io.Serializable, Job

See Also:
Serialized Form

Field Summary
protected  Descriptor commandDescriptor
          a command that can be used as the behaviour of this job
protected  long dbid
           
protected  int dbversion
           
protected  java.util.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  java.lang.String exception
          stack trace of the exception that occurred during command execution.
protected  ExecutionImpl execution
          the execution (if any) for this jobImpl
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  java.util.Date lockExpirationTime
          the time the lock on this jobImpl expires.
protected  java.lang.String lockOwner
          name of the jobImpl executor name that has locked this jobImpl.
protected  ExecutionImpl processInstance
          the process instance
protected  int retries
          number of attempts left to try.
 
Constructor Summary
JobImpl()
           
 
Method Summary
 Descriptor getCommandDescriptor()
           
 long getDbid()
           
 java.util.Date getDueDate()
           
 java.lang.String getException()
           
 ExecutionImpl getExecution()
           
 java.util.Date getLockExpirationTime()
           
 java.lang.String getLockOwner()
           
 ExecutionImpl getProcessInstance()
           
 int getRetries()
           
 boolean isExclusive()
           
 boolean isSuspended()
           
 void setCommandDescriptor(Descriptor commandDescriptor)
           
 void setDbid(long id)
           
 void setDueDate(java.util.Date dueDate)
           
 void setException(java.lang.String exception)
           
 void setExclusive(boolean isExclusive)
           
 void setExecution(ExecutionImpl execution)
           
 void setLockExpirationTime(java.util.Date lockExpirationTime)
           
 void setLockOwner(java.lang.String jobExecutorName)
           
 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.bonita.pvm.internal.cmd.Command
execute
 

Field Detail

dbid

protected long dbid

dbversion

protected int dbversion

dueDate

protected java.util.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 java.lang.String lockOwner
name of the jobImpl executor name that has locked this jobImpl.


lockExpirationTime

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


exception

protected java.lang.String 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.


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)

getLockOwner

public java.lang.String getLockOwner()
Specified by:
getLockOwner in interface Job

isSuspended

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

getDueDate

public java.util.Date getDueDate()
Specified by:
getDueDate in interface Job

setDueDate

public void setDueDate(java.util.Date dueDate)

getException

public java.lang.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(java.lang.String exception)

setExclusive

public void setExclusive(boolean isExclusive)

setLockOwner

public void setLockOwner(java.lang.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 java.util.Date getLockExpirationTime()
Specified by:
getLockExpirationTime in interface Job

setLockExpirationTime

public void setLockExpirationTime(java.util.Date lockExpirationTime)

getCommandDescriptor

public Descriptor getCommandDescriptor()

setCommandDescriptor

public void setCommandDescriptor(Descriptor commandDescriptor)


Copyright © 2009 OW2 Consortium. All Rights Reserved.