Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.jobmanager
Interface JobManager

    public interface JobManager

The `JobManager` interface provides for managing (CRUD) job definitions, scheduling jobs and managing their run histories.

Nested Class Summary
`static class` | `JobManager.JOB_STATUS` All the states a job can be in.

Method Summary
`void` | `createJobDefinition(JobDefinition job)` Stores a new Job Definition in the Database.
`void` | `deleteJobDefinition(String name)` Removes a job definition identified by the given name from the Database.
`JobDefinition` | `getJobDefinition(String name)` Retrieves the named Job Definition from the Database.
`void` | `updateJobDefinition(JobDefinition job)` Update an existing Job Definition in the Database.

Method Detail

### createJobDefinition

    void createJobDefinition(JobDefinition job)
                             throws JobManagerRuntimeException

  Stores a new Job Definition in the Database. The `EventJobDefinition`s are stored in the Database and they will be deleted automatically after the first run. The job definition is persistent and survives application or web application redeploys. The new job definition overwrites the old job definition with the same name.

  Example:

  `CalendarJobDefinition cal = new CalendarJobDefinition(name); cal.setGroup("MyJobGroup"); cal.setDescription("Test Job"); cal.setEnabled(true); cal.setJobClass("com.bea.qa.p13n.jobmanager.CalendarTestJob"); cal.setYear("2007"); cal.setMonth("5"); cal.setDay("5"); JobManagerService jobManagerService = Services.getService(JobManagerService.class); JobManager jobManager = jobManagerService.getJobManager(); // For web app scoped job manager, use getJobManager(servletContext); jobManager.createJobDefinition(cal);`

  Parameters
    `job` - Job Definition object to save.
  Throws
    `JobManagerRuntimeException` - if couldn't create the given job definition.

### getJobDefinition

    JobDefinition getJobDefinition(String name)
                                   throws JobManagerRuntimeException

  Retrieves the named Job Definition from the Database.

  Parameters
    `name` - Job definition's name
  Returns
    A job definition for the given name or null if not found in Database.
  Throws
    `JobManagerRuntimeException` - if an error occurs.

### updateJobDefinition

    void updateJobDefinition(JobDefinition job)
                             throws JobManagerRuntimeException

  Update an existing Job Definition in the Database.

  Parameters
    `job` - Must have been retrieved using the getJobDefinition method and altered in place.
  Throws
    `JobManagerRuntimeException` - if the given job couldn't be updated.

### deleteJobDefinition

    void deleteJobDefinition(String name)
                             throws JobManagerRuntimeException

  Removes a job definition identified by the given name from the Database.

  Parameters
    `name` - Job definition's name
  Throws
    `JobManagerRuntimeException` - if unable to delete a job for the given name.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.