com.ibm.bpe.api
Class TimerSpecification

java.lang.Object
  extended by com.ibm.bpe.api.TimerSpecification
All Implemented Interfaces:
java.io.Serializable

public final class TimerSpecification
extends java.lang.Object
implements java.io.Serializable

Describes options that can be used to set timers. For example, you can use this specification when rescheduling the expiration time of a waiting activity.

Since:
7.0
See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
           
static TimerSpecification TIMER_SPECIFICATION_IMMEDIATE
          An out-of-the-box timer specification that can be used as a timer that is triggered immediately.
static TimerSpecification TIMER_SPECIFICATION_INFINITE
          An out-of-the-box timer specification that can be used as a timer that is never triggered.
static int TYPE_DEADLINE
          Symbolic constant for the type of a timer specification that uses a deadline.
static int TYPE_DURATION
          Symbolic constant for the type of a timer specification that uses a duration.
static int TYPE_IMMEDIATE
          Symbolic constant for the type of a timer specification that is triggered immediately.
static int TYPE_INFINITE
          Symbolic constant for the type of a timer specification that is never triggered, that is, no timer is set up.
static int TYPE_TIMEOUT
          Symbolic constant for the type of a timer specification that uses a timeout.
 
Constructor Summary
TimerSpecification()
          Default constructor that sets up an infinite time, that is, no timer is set up.
TimerSpecification(java.util.Calendar deadline)
          Constructor that uses a deadline as timer specification.
TimerSpecification(java.lang.Integer duration)
          Constructor that uses a duration as timer specification.
TimerSpecification(java.lang.String timeoutExpression, java.lang.String calendarName, java.lang.String JNDINameOfCalendar)
          Constructor that uses a timeout expression as timer specification.
 
Method Summary
 java.lang.String getCalendarName()
          Returns the name of the calendar used for the timeout expression.
 java.util.Calendar getDeadline()
          Returns the deadline specification.
 java.lang.Integer getDuration()
          Returns the duration specification in seconds.
 java.lang.String getJNDINameOfCalendar()
          Returns the JNDI name of a user-defined calendar used for the timeout expression.
 java.lang.String getTimeoutExpression()
          Returns a calendar specific timeout expression.
 int getType()
          Returns the type of the timer specification.
 java.lang.String toString()
          Returns a string representation of the TimerSpecification object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

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

TYPE_IMMEDIATE

public static final int TYPE_IMMEDIATE
Symbolic constant for the type of a timer specification that is triggered immediately.

See Also:
Constant Field Values

TYPE_DURATION

public static final int TYPE_DURATION
Symbolic constant for the type of a timer specification that uses a duration.

See Also:
Constant Field Values

TYPE_DEADLINE

public static final int TYPE_DEADLINE
Symbolic constant for the type of a timer specification that uses a deadline.

See Also:
Constant Field Values

TYPE_TIMEOUT

public static final int TYPE_TIMEOUT
Symbolic constant for the type of a timer specification that uses a timeout.

See Also:
Constant Field Values

TYPE_INFINITE

public static final int TYPE_INFINITE
Symbolic constant for the type of a timer specification that is never triggered, that is, no timer is set up.

See Also:
Constant Field Values

TIMER_SPECIFICATION_IMMEDIATE

public static final TimerSpecification TIMER_SPECIFICATION_IMMEDIATE
An out-of-the-box timer specification that can be used as a timer that is triggered immediately.


TIMER_SPECIFICATION_INFINITE

public static final TimerSpecification TIMER_SPECIFICATION_INFINITE
An out-of-the-box timer specification that can be used as a timer that is never triggered.

Constructor Detail

TimerSpecification

public TimerSpecification()
Default constructor that sets up an infinite time, that is, no timer is set up.


TimerSpecification

public TimerSpecification(java.lang.Integer duration)
                   throws EngineParameterNullException
Constructor that uses a duration as timer specification.

Parameters:
duration - The duration in seconds that may pass until, for example, an activity instance expires.
Throws:
EngineParameterNullException

TimerSpecification

public TimerSpecification(java.util.Calendar deadline)
                   throws EngineParameterNullException
Constructor that uses a deadline as timer specification.

Parameters:
deadline - The time up to which an object is in some state, for example, the time an activity instance is waiting for an event. When the specified time has been reached, the object changes its state. For example, a waiting activity continues navigation, that is, returns to the running state.
Throws:
EngineParameterNullException

TimerSpecification

public TimerSpecification(java.lang.String timeoutExpression,
                          java.lang.String calendarName,
                          java.lang.String JNDINameOfCalendar)
                   throws EngineParameterNullException
Constructor that uses a timeout expression as timer specification.

Parameters:
timeoutExpression - A calendar specific expression that is used to calculate the time up to when an object is in some state. When the specified time has been reached, the object changes its state. For example, a waiting activity continues navigation, that is, returns to the running state.
calendarName - The name of a user-provided calendar. If the JNDI name of the calendar is not specified, the name may be "SIMPLE" or "CRON" to select one of WebSphere's calendars. If neither a calendar name nor a JNDI name is specified, then the WebSphere default calendar (SIMPLE) is used.
JNDINameOfCalendar - The JNDI name of the EJB providing the user's calendar; may be null so that one of WebSphere's calendars is used.
Throws:
EngineParameterNullException
Method Detail

getDuration

public java.lang.Integer getDuration()
Returns the duration specification in seconds. Returns null if a duration has not been specified.

Returns:
The duration specification.

getDeadline

public java.util.Calendar getDeadline()
Returns the deadline specification. Returns null if a deadline has not been specified.

Returns:
The deadline specification.

getTimeoutExpression

public java.lang.String getTimeoutExpression()
Returns a calendar specific timeout expression. Returns null if a timeout expression has not been specified.

For details on calendars refer to the WebSphere Application Server documentation.

Returns:
The timeout expression.

getCalendarName

public java.lang.String getCalendarName()
Returns the name of the calendar used for the timeout expression. If not set, null is returned and the WebSphere default calendar is used. If a JNDI name for a user-defined calendar is specified, then the calendar name is the name of a method implementing that user-defined calendar - see getJNDINameOfCalendar.

For details on calendars refer to the WebSphere Application Server documentation.

Returns:
The name of the calendar used for the timeout expression.

getJNDINameOfCalendar

public java.lang.String getJNDINameOfCalendar()
Returns the JNDI name of a user-defined calendar used for the timeout expression. If not set, null is returned and a WebSphere supported calendar is used - see getCalendarName.

For details on calendars refer to the WebSphere Application Server documentation.

Returns:
The JNDI name of the calendar used for the timeout expression.

getType

public int getType()
Returns the type of the timer specification.

Returns:
The type of the timer specification,
"TYPE_DURATION" means that a duration is set as timer specification.
"TYPE_DEADLINE" means that a deadline is set as timer specification.
"TYPE_TIMEOUT" means that a timeout expression is set as timer specification.
"TYPE_INFINITE" means that no timer is set up.
"TYPE_IMMEDIATE" means that the timeout occurs immediately.

toString

public java.lang.String toString()
Returns a string representation of the TimerSpecification object.

Overrides:
toString in class java.lang.Object
Returns:
String - A string representation of the object.