org.jbpm.pvm.internal.job
Class JobImpl

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

public abstract class JobImpl
extends java.lang.Object
implements Command<java.lang.Boolean>, 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  java.lang.Object configuration
           
protected  Lob configurationBytes
           
protected  long dbid
           
protected  int dbversion
           
protected  java.util.Date dueDate
          date until which the command should not be executed for async messages, this due date should be set to null.
protected  java.lang.String exception
          stack trace of the exception that occurred during command execution.
protected  ExecutionImpl execution
          the execution (if any) for this job
protected  boolean isExclusive
          specifies if this jobImpl can be executed concurrently with other jobs for the same execution.
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.
protected  java.lang.String state
          job state.
static java.lang.String STATE_ACQUIRED
           
static java.lang.String STATE_ERROR
           
static java.lang.String STATE_SUSPENDED
           
static java.lang.String STATE_WAITING
           
 
Constructor Summary
JobImpl()
           
 
Method Summary
 void acquire(java.lang.String lockOwner, java.util.Date lockExpirationTime)
           
 Descriptor getCommandDescriptor()
           
 java.lang.Object getConfiguration()
           
 long getDbid()
           
 java.util.Date getDuedate()
          Deprecated. 
 java.util.Date getDueDate()
           
 java.lang.String getException()
           
 ExecutionImpl getExecution()
           
 java.lang.String getId()
           
 java.util.Date getLockExpirationTime()
           
 java.lang.String getLockOwner()
           
 ExecutionImpl getProcessInstance()
           
 int getRetries()
           
 boolean isExclusive()
           
 void release()
           
 void resume()
           
 void setCommandDescriptor(Descriptor commandDescriptor)
           
 void setConfiguration(java.lang.Object configuration)
           
 void setDbid(long id)
           
 void setDuedate(java.util.Date duedate)
          Deprecated. call setDueDate(Date) instead
 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 suspend()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jbpm.api.cmd.Command
execute
 

Field Detail

STATE_WAITING

public static final java.lang.String STATE_WAITING
See Also:
Constant Field Values

STATE_ACQUIRED

public static final java.lang.String STATE_ACQUIRED
See Also:
Constant Field Values

STATE_ERROR

public static final java.lang.String STATE_ERROR
See Also:
Constant Field Values

STATE_SUSPENDED

public static final java.lang.String STATE_SUSPENDED
See Also:
Constant Field Values

dbid

protected long dbid

dbversion

protected int dbversion

dueDate

protected java.util.Date dueDate
date until which the command should not be executed for async messages, this due date should be set to null.


state

protected java.lang.String state
job state.


execution

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


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.


configurationBytes

protected Lob configurationBytes

configuration

protected java.lang.Object configuration

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)

acquire

public void acquire(java.lang.String lockOwner,
                    java.util.Date lockExpirationTime)

release

public void release()

setRetries

public void setRetries(int retries)

suspend

public void suspend()

resume

public void resume()

getConfiguration

public java.lang.Object getConfiguration()

setConfiguration

public void setConfiguration(java.lang.Object configuration)

getId

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

getDbid

public long getDbid()

setDbid

public void setDbid(long id)

getLockOwner

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

getDueDate

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

setDueDate

public void setDueDate(java.util.Date dueDate)

getDuedate

@Deprecated
public java.util.Date getDuedate()
Deprecated. 

Specified by:
getDuedate in interface Job

setDuedate

@Deprecated
public void setDuedate(java.util.Date duedate)
Deprecated. call setDueDate(Date) instead


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

setExclusive

public void setExclusive(boolean isExclusive)

setLockOwner

public void setLockOwner(java.lang.String jobExecutorName)

getProcessInstance

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

setException

public void setException(java.lang.String exception)

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 © 2010 JBoss Community. All Rights Reserved.