org.yawlfoundation.yawl.engine
Class YAnnouncer

java.lang.Object
  extended by org.yawlfoundation.yawl.engine.YAnnouncer

public class YAnnouncer
extends Object

Handles the announcement of engine-generated events to the environment.

Author:
Michael Adams
Created/Last Date:
10/04/2010

Constructor Summary
protected YAnnouncer(YEngine engine)
           
 
Method Summary
protected  void addInterfaceXListener(InterfaceX_EngineSideClient listener)
           
protected  void addInterfaceXListener(String uri)
           
 void announceCancelledWorkItem(YWorkItem item)
          Called by a workitem when it is cancelled.
protected  void announceCaseCancellation(YIdentifier id, Set<YAWLServiceReference> services)
          Called by the engine when a case is cancelled.
protected  void announceCaseCompletion(YAWLServiceReference service, YIdentifier caseID, org.jdom.Document caseData)
          Called by a case's net runner when it completes.
protected  void announceCaseResumption(YIdentifier id, Set<YAWLServiceReference> services)
          Called by the engine when a case has resumed from suspension.
protected  void announceCaseStart(YSpecificationID specID, YIdentifier caseID, String launchingService, boolean delayed)
           
protected  void announceCaseSuspended(YIdentifier id, Set<YAWLServiceReference> services)
          Called by the engine when a case has suspended.
protected  void announceCaseSuspending(YIdentifier id, Set<YAWLServiceReference> services)
          Called by the engine when a case is suspending.
protected  void announceCheckCaseConstraints(YSpecificationID specID, String caseID, String data, boolean preCheck)
           
protected  void announceCheckWorkItemConstraints(YWorkItem item, org.jdom.Document data, boolean preCheck)
           
protected  void announceEngineInitialisationCompletion(Set<YAWLServiceReference> services, int maxWaitSeconds)
          Called by the engine when its initialisation is complete.
 void announceTimerExpiryEvent(YWorkItem item)
          Called by YWorkItemTimer when a work item's timer expires.
protected  void announceTimeServiceExpiry(YWorkItem item, List timeOutTaskIds)
           
protected  void announceToGateways(Set<YAnnouncement> announcements)
          Called by the engine each time a net runner advances a case, resulting in the enabling and/or cancelling of one or more work items.
protected  void announceWorkItemStatusChange(YWorkItem item, YWorkItemStatus oldStatus, YWorkItemStatus newStatus)
          Called by a workitem when it has a change of status.
protected  YAnnouncement createAnnouncement(YAWLServiceReference ys, YWorkItem item, YEngineEvent event)
           
protected  YAnnouncement createAnnouncement(YWorkItem item, YEngineEvent event)
           
protected  AnnouncementContext getAnnouncementContext()
           
 ObserverGatewayController getObserverGatewayController()
           
protected  boolean hasInterfaceXListeners()
           
 int reannounceEnabledWorkItems()
          Causes the engine to re-announce all workitems which are in an "enabled" state.
protected  int reannounceExecutingWorkItems()
          Causes the engine to re-announce all workitems which are in an "executing" state.
protected  int reannounceFiredWorkItems()
          Causes the engine to re-announce all workitems which are in an "fired" state.
protected  void reannounceWorkItem(YWorkItem workItem)
          Causes the engine to re-announce a specific workitem regardless of state.
 void registerInterfaceBObserverGateway(ObserverGateway gateway)
           
 void rejectAnnouncedEnabledTask(YWorkItem item)
           
protected  boolean removeInterfaceXListener(InterfaceX_EngineSideClient listener)
           
protected  boolean removeInterfaceXListener(String uri)
           
protected  void shutdownInterfaceXListeners()
           
protected  void shutdownObserverGateways()
          Called by the engine when it begins to shutdown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YAnnouncer

protected YAnnouncer(YEngine engine)
Method Detail

getObserverGatewayController

public ObserverGatewayController getObserverGatewayController()

registerInterfaceBObserverGateway

public void registerInterfaceBObserverGateway(ObserverGateway gateway)
                                       throws YAWLException
Throws:
YAWLException

getAnnouncementContext

protected AnnouncementContext getAnnouncementContext()

addInterfaceXListener

protected void addInterfaceXListener(InterfaceX_EngineSideClient listener)

addInterfaceXListener

protected void addInterfaceXListener(String uri)

removeInterfaceXListener

protected boolean removeInterfaceXListener(InterfaceX_EngineSideClient listener)

removeInterfaceXListener

protected boolean removeInterfaceXListener(String uri)

hasInterfaceXListeners

protected boolean hasInterfaceXListeners()

shutdownInterfaceXListeners

protected void shutdownInterfaceXListeners()

announceEngineInitialisationCompletion

protected void announceEngineInitialisationCompletion(Set<YAWLServiceReference> services,
                                                      int maxWaitSeconds)
Called by the engine when its initialisation is complete. Broadcast to all registered services and gateways.

Parameters:
services - the set of currently registered services
maxWaitSeconds - timeout to announce to each service before giving up

announceCaseCancellation

protected void announceCaseCancellation(YIdentifier id,
                                        Set<YAWLServiceReference> services)
Called by the engine when a case is cancelled. Broadcast to all registered services and gateways.

Parameters:
id - the identifier of the cancelled case
services - the set of currently registered services

announceTimerExpiryEvent

public void announceTimerExpiryEvent(YWorkItem item)
Called by YWorkItemTimer when a work item's timer expires. Announced only to the designated service or gateway.

Parameters:
item - the work item that has had its timer expire

announceCaseSuspending

protected void announceCaseSuspending(YIdentifier id,
                                      Set<YAWLServiceReference> services)
Called by the engine when a case is suspending. Broadcast to all registered services and gateways.

Parameters:
id - the identifier of the suspending case
services - the set of currently registered services

announceCaseSuspended

protected void announceCaseSuspended(YIdentifier id,
                                     Set<YAWLServiceReference> services)
Called by the engine when a case has suspended. Broadcast to all registered services and gateways.

Parameters:
id - the identifier of the suspended case
services - the set of currently registered services

announceCaseResumption

protected void announceCaseResumption(YIdentifier id,
                                      Set<YAWLServiceReference> services)
Called by the engine when a case has resumed from suspension. Broadcast to all registered services and gateways.

Parameters:
id - the identifier of the resumed case
services - the set of currently registered services

announceCaseStart

protected void announceCaseStart(YSpecificationID specID,
                                 YIdentifier caseID,
                                 String launchingService,
                                 boolean delayed)

announceCaseCompletion

protected void announceCaseCompletion(YAWLServiceReference service,
                                      YIdentifier caseID,
                                      org.jdom.Document caseData)
Called by a case's net runner when it completes. Announced only to the designated service or gateway when the 'service' parameter is not null, otherwise it is broadcast to all registered services and gateways.

Parameters:
service - the name of the service or gateway to announce the case completion to. If null, the event will be announced to all registered services and gateways
caseID - the identifier of the completed case
caseData - the final output data for the case

announceWorkItemStatusChange

protected void announceWorkItemStatusChange(YWorkItem item,
                                            YWorkItemStatus oldStatus,
                                            YWorkItemStatus newStatus)
Called by a workitem when it has a change of status. Broadcast to all registered services and gateways.

Parameters:
item - the work item that has had a change of status
oldStatus - the previous status of the work item
newStatus - the new status of the workitem

announceCancelledWorkItem

public void announceCancelledWorkItem(YWorkItem item)
Called by a workitem when it is cancelled. Announced only to the designated service or gateway.

Parameters:
item - the work item that has had a change of status

shutdownObserverGateways

protected void shutdownObserverGateways()
Called by the engine when it begins to shutdown. Broadcast to all registered services and gateways.


announceToGateways

protected void announceToGateways(Set<YAnnouncement> announcements)
Called by the engine each time a net runner advances a case, resulting in the enabling and/or cancelling of one or more work items.

Parameters:
announcements - A set of work item enabling or cancellation events

createAnnouncement

protected YAnnouncement createAnnouncement(YAWLServiceReference ys,
                                           YWorkItem item,
                                           YEngineEvent event)

createAnnouncement

protected YAnnouncement createAnnouncement(YWorkItem item,
                                           YEngineEvent event)

rejectAnnouncedEnabledTask

public void rejectAnnouncedEnabledTask(YWorkItem item)

announceCheckWorkItemConstraints

protected void announceCheckWorkItemConstraints(YWorkItem item,
                                                org.jdom.Document data,
                                                boolean preCheck)

announceCheckCaseConstraints

protected void announceCheckCaseConstraints(YSpecificationID specID,
                                            String caseID,
                                            String data,
                                            boolean preCheck)

announceTimeServiceExpiry

protected void announceTimeServiceExpiry(YWorkItem item,
                                         List timeOutTaskIds)

reannounceEnabledWorkItems

public int reannounceEnabledWorkItems()
                               throws YStateException
Causes the engine to re-announce all workitems which are in an "enabled" state.

Returns:
The number of enabled workitems that were reannounced
Throws:
YStateException

reannounceExecutingWorkItems

protected int reannounceExecutingWorkItems()
                                    throws YStateException
Causes the engine to re-announce all workitems which are in an "executing" state.

Returns:
The number of executing workitems that were reannounced
Throws:
YStateException

reannounceFiredWorkItems

protected int reannounceFiredWorkItems()
                                throws YStateException
Causes the engine to re-announce all workitems which are in an "fired" state.

Returns:
The number of fired workitems that were reannounced
Throws:
YStateException

reannounceWorkItem

protected void reannounceWorkItem(YWorkItem workItem)
                           throws YStateException
Causes the engine to re-announce a specific workitem regardless of state.

Throws:
YStateException


Copyright © 2004-2012 The YAWL Foundation.