com.bea.p13n.jobmanager
Interface JobManager

All Superinterfaces
IServiceAvailability

public interface JobManager
extends IServiceAvailability

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.
 
Methods inherited from interface com.bea.wlp.services.IServiceAvailability
isAvailable
 

Method Detail

createJobDefinition

void createJobDefinition(JobDefinition job)
                         throws JobManagerRuntimeException
Stores a new Job Definition in the Database. The EventJobDefinitions 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.


Copyright © 2011, Oracle. All rights reserved.