Consider the use case of n inbound channel adapters polling a shared resource with one being active at a time.
Use ZooKeeper to maintain the state - use curator's LeaderLatch or LeaderSelector abstraction (XD uses the latter).
For example, an <int-zk:leader-inbound-channel-adapter/> could emit a message when elected leader. The message can be transformed and routed to a control-bus to start one or more channel adapters.
Similarly when leadership is lost (or not gained) stop the adapter(s).
Also, to solve the issue "Leader Election and External Resources" in chapter 5 of O'Reilly's "ZooKeeper", also add a ZkFenceAwarePollerAdvice to the poller(s) (or code directly in SPCA) such that the poller can check to verify that this instance really is still the master at the time of the poll.
The leader adapter can pass the czxid of the node in a header of the @adapter.start() message.