Overview | Package | Class | Use | Tree | Help
| HEADER
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.developmentontheedge.jobcontrol
Class AbstractJobControl

Direct Known Subclasses:
  ClassJobControl, FunctionJobControl

public abstract class AbstractJobControl
implements JobControl

AbstractJobControl is default implementation of JobControl interface. AbstractJobControl provides base functionality of all methods of JobControl

Constructor Summary
`AbstractJobControl(Category cat)` Constructs JobControl with specified Category
`AbstractJobControl(Category cat, JobControlListener listener)` Constructs JobControl with specified Category and JobControlListener

Method Summary
`void` | `addListener(JobControlListener listener)`
`void` | `begin()` Derived classes should call this method when they want to start controlled process
`void` | `checkStatus()` Tests status of job control.
`void` | `end()` Sets state defined by runStatus variable.
`void` | `fireValueChanged()` Notifies all listeners that value returned by getPreparedness() is changed
`static String` | `format(long time)` Converts time to the string
`static String` | `format(long time, String format)` Converts time to the specified format string
`long` | `getCreatedTime()`
`long` | `getElapsedTime()`
`long` | `getEndedTime()`
`int` | `getPreparedness()`
`long` | `getRemainedTime()`
`long` | `getStartedTime()`
`int` | `getStatus()`
`String` | `getTextStatus()`
`void` | `pause()` Sets status of job control to the JobControl.PAUSED state
`void` | `resultsAreReady()`
`void` | `resume()` Sets status of job control to the JobControl.RUNNING state
`void` | `run()` Starts the job control process
`void` | `setPreparedness(int percent)` Sets value of job Preparednes
`void` | `terminate()` Sets status of job control to the JobControl.TERMINATED_BY_REQUEST state

Constructor Detail

### AbstractJobControl

    public AbstractJobControl(Category cat)

  Constructs JobControl with specified Category
  Parameters:
    cat - log Category of log4j package

### AbstractJobControl

    public AbstractJobControl(Category cat, JobControlListener listener)

  Constructs JobControl with specified Category and JobControlListener
  Parameters:
    cat - log Category of log4j package
    listener - specified JobControlListener

Method Detail

### addListener

    public void addListener(JobControlListener listener)

### begin

    public void begin()

  Derived classes should call this method when they want to start controlled process

### checkStatus

    public void checkStatus()
                      throws JobControlException

  Tests status of job control. If controlled process is terminated throws JobControlException with status TERMINATED_BY_REQUEST Waits of resuming action, if isPaused variable is set.
  Throws:
    JobControlException

### end

    public void end()

  Sets state defined by runStatus variable. Notifies all listeners about state changing

### fireValueChanged

    public void fireValueChanged()

  Notifies all listeners that value returned by getPreparedness() is changed

### format

    public static String format(long time)

  Converts time to the string
  Parameters:
    time - Unix time
  Returns: converted string

### format

    public static String format(long time, String format)

  Converts time to the specified format string
  Parameters:
    time - Unix time
    format - convert format
  Returns: converted string
  See Also:
    SimpleDateFormat
  todo low function should standart formatter

### getCreatedTime

    public long getCreatedTime()

### getElapsedTime

    public long getElapsedTime()

### getEndedTime

    public long getEndedTime()

### getPreparedness

    public int getPreparedness()

### getRemainedTime

    public long getRemainedTime()

### getStartedTime

    public long getStartedTime()

### getStatus

    public int getStatus()

### getTextStatus

    public String getTextStatus()

### pause

    public void pause()

  Sets status of job control to the JobControl.PAUSED state

### resultsAreReady

    public void resultsAreReady()

### resume

    public void resume()

  Sets status of job control to the JobControl.RUNNING state

### run

    public void run()

  Starts the job control process

### setPreparedness

    public void setPreparedness(int percent)

  Sets value of job Preparednes
  Parameters:
    percent - percent of job Preparedness

### terminate

    public void terminate()

  Sets status of job control to the JobControl.TERMINATED_BY_REQUEST state

Association Links

to Class org.apache.log4j.Category

  The `log4j.Category` to print logs.

to Class java.util.Vector

Overview | Package | Class | Use | Tree | Help
| FOOTER
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

BOTTOM