SMILA (incubation) API documentation

org.eclipse.smila.processing.bpel
Class WorkflowUpdateWatcher

java.lang.Object
  extended by org.eclipse.smila.processing.bpel.WorkflowUpdateWatcher

public class WorkflowUpdateWatcher
extends java.lang.Object

Uses ZooKeeper to coordinate workflow updating in a SMILA cluster.


Constructor Summary
WorkflowUpdateWatcher(ZooKeeperService zkService, WorkflowProcessor processor)
          create instance.
 
Method Summary
 void checkWorkflowVersions()
          compare cluster versions of workflows with local versions and update local deployment.
 void startPolling()
          start polling for updates.
 void startPolling(int pollIntervalSeconds)
          start polling for updates with custom interval.
 boolean startWatching()
          install a ZK watch on the root node to get notifications about changes.
 void stopPolling()
          stop polling for updates.
 void stopWatching()
          stop watching: ZK watch on root node will not be reinstalled.
 void workflowDeleted(java.lang.String workflowName)
          Send delete notification, call on custom workflow remove.
 void workflowLoadedOnStart(java.lang.String workflowName, java.lang.String timestamp)
          Initialize notification structure for workflow, call on initial load on service start.
 void workflowUpdated(java.lang.String workflowName, java.lang.String timestamp)
          Send update notification, call on custom workflow creation or update.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkflowUpdateWatcher

public WorkflowUpdateWatcher(ZooKeeperService zkService,
                             WorkflowProcessor processor)
                      throws ProcessingException
create instance.

Throws:
ProcessingException - error initializing the root node.
Method Detail

startWatching

public boolean startWatching()
install a ZK watch on the root node to get notifications about changes.

Returns:
true if watched was installed successfully

stopWatching

public void stopWatching()
stop watching: ZK watch on root node will not be reinstalled. Does not remove a currently installed watch, so it's possible that remaining watches will still receive notifications after this call.


startPolling

public void startPolling()
start polling for updates.


startPolling

public void startPolling(int pollIntervalSeconds)
start polling for updates with custom interval.


stopPolling

public void stopPolling()
stop polling for updates.


workflowLoadedOnStart

public void workflowLoadedOnStart(java.lang.String workflowName,
                                  java.lang.String timestamp)
                           throws ProcessingException
Initialize notification structure for workflow, call on initial load on service start. Does not trigger notifications for other nodes, just ensure that the node is created.

Throws:
ProcessingException

workflowUpdated

public void workflowUpdated(java.lang.String workflowName,
                            java.lang.String timestamp)
                     throws ProcessingException
Send update notification, call on custom workflow creation or update.

Throws:
ProcessingException

workflowDeleted

public void workflowDeleted(java.lang.String workflowName)
                     throws ProcessingException
Send delete notification, call on custom workflow remove.

Throws:
ProcessingException

checkWorkflowVersions

public void checkWorkflowVersions()
compare cluster versions of workflows with local versions and update local deployment.


SMILA (incubation) API documentation