org.rhq.enterprise.server.xmlschema
Class AbstractScheduleType

java.lang.Object
  extended by org.rhq.enterprise.server.xmlschema.AbstractScheduleType
Direct Known Subclasses:
CronScheduleType, PeriodicScheduleType

public abstract class AbstractScheduleType
extends Object

Defines a type of schedule for a server plugin job. This also has a static factory that allows you to build concrete forms of schedule types.

Author:
John Mazzitelli

Constructor Summary
AbstractScheduleType(boolean concurrent, boolean clustered, String typeName)
          Builds the schedule type.
 
Method Summary
static AbstractScheduleType create(boolean concurrent, boolean clustered, String scheduleType, String scheduleTrigger)
          Factory method that creates a concrete schedule type object based on the given parameters.
abstract  String getScheduleTrigger()
          Returns the string form of the trigger that causes the job to be invoked.
 String getTypeName()
          The name that identifies this type of schedule.
 boolean isClustered()
          If true, the job may be executed on a server other than the one where the job was scheduled.
 boolean isConcurrent()
          If true, multiple jobs can execute at any one time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractScheduleType

public AbstractScheduleType(boolean concurrent,
                            boolean clustered,
                            String typeName)
Builds the schedule type.

Parameters:
concurrent - if true, multiple jobs can run concurrently. If false, only one scheduled job will run at any one time across the RHQ Server cloud.
clustered - if true, the job may be executed by a server other than the one where the job was scheduled
typeName - the name of the concrete schedule type (subclasses must provide this)
Method Detail

create

public static final AbstractScheduleType create(boolean concurrent,
                                                boolean clustered,
                                                String scheduleType,
                                                String scheduleTrigger)
Factory method that creates a concrete schedule type object based on the given parameters.

Parameters:
concurrent - if true, multiple jobs can run concurrently.
clustered - if true, the job may be executed by a server other than the one where the job was scheduled
scheduleType - the name of the concrete schedule type
scheduleTrigger - the string form of the schedule's trigger
Returns:
a new instance of the desired schedule type

getTypeName

public String getTypeName()
The name that identifies this type of schedule.

Returns:
type name string

isConcurrent

public boolean isConcurrent()
If true, multiple jobs can execute at any one time. If false, only a single job will be allowed to run at any one time (across all servers in the RHQ Server cloud). Even if the schedule is triggered multiple times, if a job is still running, any future jobs that are triggered will be delayed.

Returns:
concurrent flag

isClustered

public boolean isClustered()
If true, the job may be executed on a server other than the one where the job was scheduled. If false, the job will always be executed on the server where it was scheduled (it will be considered a non-clustered job). If this is false, isConcurrent() only affects the scheduler where the job is scheduled and to be executed. This means a non-clustered job may run at the same time on different machines, even if isConcurrent() is false. When isConcurrent() is false, and isClustered() is false, it means that job will not run concurrently on the box where it was scheduled. But if the job was scheduled multiple times on different boxes, those multiple jobs can run concurrently because they are on different boxes. A job should not be clustered if it must run on all servers at the same regular schedule.

Returns:
clustered flag

getScheduleTrigger

public abstract String getScheduleTrigger()
Returns the string form of the trigger that causes the job to be invoked.

Returns:
a string that describes the trigger of the schedule


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.