SMILA 1.0 API documentation

org.eclipse.smila.processing.bpel.internal
Class ZkUpdateWatcher

java.lang.Object
  extended by org.eclipse.smila.processing.bpel.internal.ZkUpdateWatcher
All Implemented Interfaces:
WorkflowUpdateWatcher

public class ZkUpdateWatcher
extends java.lang.Object
implements WorkflowUpdateWatcher

Uses ZooKeeper to coordinate workflow updating in a SMILA cluster.


Constructor Summary
ZkUpdateWatcher()
           
 
Method Summary
protected  void activate()
          activate the service.
 void checkWorkflowVersions()
          compare cluster versions of workflows with local versions and update local deployment.
 void initialize()
          connect to Zookeeper and create root node.
 void registerProcessor(WorkflowProcessor processor)
          register a workflow processor to be notified on updates.
 void setZkService(ZooKeeperService zkService)
          service reference bind method.
 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 unsetZkService(ZooKeeperService zkService)
          service reference unbind method.
 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

ZkUpdateWatcher

public ZkUpdateWatcher()
Method Detail

setZkService

public void setZkService(ZooKeeperService zkService)
service reference bind method.


unsetZkService

public void unsetZkService(ZooKeeperService zkService)
service reference unbind method.


registerProcessor

public void registerProcessor(WorkflowProcessor processor)
Description copied from interface: WorkflowUpdateWatcher
register a workflow processor to be notified on updates.

Specified by:
registerProcessor in interface WorkflowUpdateWatcher

activate

protected void activate()
activate the service.


initialize

public void initialize()
                throws KeeperException
connect to Zookeeper and create root node.

Throws:
KeeperException

startWatching

public boolean startWatching()
Description copied from interface: WorkflowUpdateWatcher
install a ZK watch on the root node to get notifications about changes.

Specified by:
startWatching in interface WorkflowUpdateWatcher
Returns:
true if watched was installed successfully

stopWatching

public void stopWatching()
Description copied from interface: WorkflowUpdateWatcher
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.

Specified by:
stopWatching in interface WorkflowUpdateWatcher

startPolling

public void startPolling()
Description copied from interface: WorkflowUpdateWatcher
start polling for updates.

Specified by:
startPolling in interface WorkflowUpdateWatcher

startPolling

public void startPolling(int pollIntervalSeconds)
Description copied from interface: WorkflowUpdateWatcher
start polling for updates with custom interval.

Specified by:
startPolling in interface WorkflowUpdateWatcher

stopPolling

public void stopPolling()
Description copied from interface: WorkflowUpdateWatcher
stop polling for updates.

Specified by:
stopPolling in interface WorkflowUpdateWatcher

workflowLoadedOnStart

public void workflowLoadedOnStart(java.lang.String workflowName,
                                  java.lang.String timestamp)
                           throws ProcessingException
Description copied from interface: WorkflowUpdateWatcher
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.

Specified by:
workflowLoadedOnStart in interface WorkflowUpdateWatcher
Throws:
ProcessingException

workflowUpdated

public void workflowUpdated(java.lang.String workflowName,
                            java.lang.String timestamp)
                     throws ProcessingException
Description copied from interface: WorkflowUpdateWatcher
Send update notification, call on custom workflow creation or update.

Specified by:
workflowUpdated in interface WorkflowUpdateWatcher
Throws:
ProcessingException

workflowDeleted

public void workflowDeleted(java.lang.String workflowName)
                     throws ProcessingException
Description copied from interface: WorkflowUpdateWatcher
Send delete notification, call on custom workflow remove.

Specified by:
workflowDeleted in interface WorkflowUpdateWatcher
Throws:
ProcessingException

checkWorkflowVersions

public void checkWorkflowVersions()
Description copied from interface: WorkflowUpdateWatcher
compare cluster versions of workflows with local versions and update local deployment.

Specified by:
checkWorkflowVersions in interface WorkflowUpdateWatcher

SMILA 1.0 API documentation