org.yawlfoundation.yawl.engine
Class ObserverGatewayController

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

public class ObserverGatewayController
extends Object

Class which encapsulates the management and processing of InterfaceB event observers.

Author:
Andrew Hastie, Michael Adams (for 2.2)
Created/Last Date:
23-Aug-2005

Constructor Summary
ObserverGatewayController()
          Constructor
 
Method Summary
protected  void announce(Set<YAnnouncement> announcements)
          Announce a set of work item notifications to the relevant observers
protected  void announce(YAnnouncement announcement)
          Announce a work item notification to the relevant observers
 void notifyCaseCancellation(Set<YAWLServiceReference> services, YIdentifier id)
          Notify environment that the engine has cancelled a case
 void notifyCaseCompletion(Set<YAWLServiceReference> services, YIdentifier caseID, org.jdom.Document caseData)
          Notify a case completion to all registered gateways.
 void notifyCaseCompletion(YAWLServiceReference service, YIdentifier caseID, org.jdom.Document caseData)
          Notify the case completion to a particular service that has registered as a completion observer for this case when the case was launched.
 void notifyCaseResumption(YIdentifier caseID, Set<YAWLServiceReference> services)
          Notify the case is resumption
 void notifyCaseStarting(Set<YAWLServiceReference> services, YSpecificationID specID, YIdentifier caseID, String launchingService, boolean delayed)
          Notify a case completion to all registered gateways.
 void notifyCaseSuspended(YIdentifier caseID, Set<YAWLServiceReference> services)
          Notify the case is suspended
 void notifyCaseSuspending(YIdentifier caseID, Set<YAWLServiceReference> services)
          Notify the case is suspending
 void notifyEngineInitialised(Set<YAWLServiceReference> services, int maxWaitSeconds)
          Notify the engine has completed initialisation and is running
 void notifyWorkItemStatusChange(Set<YAWLServiceReference> services, YWorkItem workItem, YWorkItemStatus oldStatus, YWorkItemStatus newStatus)
          Notify of a change of status for a work item to all registered gateways.
 void shutdownObserverGateways()
          Invoke finalisation processing on all observer gateways and the ExecutorService used to execute calls to them (called when the Engine servlet is being destroyed).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObserverGatewayController

public ObserverGatewayController()
Constructor

Method Detail

announce

protected void announce(Set<YAnnouncement> announcements)
Announce a set of work item notifications to the relevant observers

Parameters:
announcements - the Set of announcements

announce

protected void announce(YAnnouncement announcement)
Announce a work item notification to the relevant observers

Parameters:
announcement - the announcement

notifyCaseCompletion

public void notifyCaseCompletion(YAWLServiceReference service,
                                 YIdentifier caseID,
                                 org.jdom.Document caseData)
Notify the case completion to a particular service that has registered as a completion observer for this case when the case was launched.

Parameters:
service - the service to notify
caseID - the completing case identifier
caseData - the final case data document

notifyCaseStarting

public void notifyCaseStarting(Set<YAWLServiceReference> services,
                               YSpecificationID specID,
                               YIdentifier caseID,
                               String launchingService,
                               boolean delayed)
Notify a case completion to all registered gateways.

Parameters:
services - a set of the current engine-registered services
specID - the specification id for thestarted case
caseID - the completing case identifier
launchingService - the service that launched the case
delayed - true if this is a delayed case launch, false if immediate

notifyCaseCompletion

public void notifyCaseCompletion(Set<YAWLServiceReference> services,
                                 YIdentifier caseID,
                                 org.jdom.Document caseData)
Notify a case completion to all registered gateways.

Parameters:
services - a set of the current engine-registered services
caseID - the completing case identifier
caseData - the final case data document

notifyWorkItemStatusChange

public void notifyWorkItemStatusChange(Set<YAWLServiceReference> services,
                                       YWorkItem workItem,
                                       YWorkItemStatus oldStatus,
                                       YWorkItemStatus newStatus)
Notify of a change of status for a work item to all registered gateways.

Parameters:
services - a set of the current engine-registered services
workItem - the work item that has changed status
oldStatus - previous status
newStatus - new status

notifyCaseSuspending

public void notifyCaseSuspending(YIdentifier caseID,
                                 Set<YAWLServiceReference> services)
Notify the case is suspending

Parameters:
caseID - the suspending case identifier
services - a set of the current engine-registered services

notifyCaseSuspended

public void notifyCaseSuspended(YIdentifier caseID,
                                Set<YAWLServiceReference> services)
Notify the case is suspended

Parameters:
caseID - the suspended case identifier
services - a set of the current engine-registered services

notifyCaseResumption

public void notifyCaseResumption(YIdentifier caseID,
                                 Set<YAWLServiceReference> services)
Notify the case is resumption

Parameters:
caseID - the resuming case identifier
services - a set of the current engine-registered services

notifyEngineInitialised

public void notifyEngineInitialised(Set<YAWLServiceReference> services,
                                    int maxWaitSeconds)
Notify the engine has completed initialisation and is running

Parameters:
services - all services registered with the engine
maxWaitSeconds - the maximum seconds to wait for services to be contactable

notifyCaseCancellation

public void notifyCaseCancellation(Set<YAWLServiceReference> services,
                                   YIdentifier id)
Notify environment that the engine has cancelled a case

Parameters:
services - - all services registered with the engine
id - - the case identifier

shutdownObserverGateways

public void shutdownObserverGateways()
Invoke finalisation processing on all observer gateways and the ExecutorService used to execute calls to them (called when the Engine servlet is being destroyed). Do in same thread to avoid issues where webapp is closed before gateways can complete their termination processing.



Copyright © 2004-2012 The YAWL Foundation.