getNextEvent()

Retrieves the next event object from the eventsToProcess vector.

Syntax

public CWConnectorEvent getNextEvent();

Parameters

None.

Return values

A CWConnectorEvent object for the next Ready-for-Poll event. If the eventsToProcess vector is empty, the method returns null.

Exceptions

InvalidStatusChangeException
Thrown when the event status is being changed to an invalid status value for the application.
StatusChangeFailedException
Thrown when the status change from READY_FOR_POLL to IN_PROGRESS fails.

Notes

The getNextEvent() method checks the eventsToProcess vector for events that currently have the READY_FOR_POLL status. If it finds the such an event in this vector, the method takes the following actions:

  1. Get the next event to process from the eventsToProcess vector. The fetchEvents() method determines the order in which event objects are stored in the eventsToProcess vector.
  2. Change its event status to IN_PROGRESS.
  3. Return the event to the caller.

The eventsToProcess vector is initialized with either the fetchEvents() or setEventsToProcess() method.

Note:
The getNextEvent() method is usually called from the poll method, pollForEvents().

See also

fetchEvents(),, pollForEvents(),, setEventsToProcess()

Copyright IBM Corp. 1997, 2004