@Override protected void doStart() throws Exception { // validate StringHelper.notEmpty(lockMapName, "lockMapName", this); StringHelper.notEmpty(lockKey, "lockKey", this); StringHelper.notEmpty(lockValue, "lockValue", this); executorService = getCamelContext().getExecutorServiceManager().newSingleThreadExecutor(this, "HazelcastRoutePolicy"); locks = instance.getMap(lockMapName); future = executorService.submit(this::acquireLeadership); super.doStart(); }
@Override protected void doStart() throws Exception { ObjectHelper.notNull(camelContext, "camelContext"); ObjectHelper.notNull(clientUris, "clientUris"); if (client == null) { client = new EtcdClient(EtcdHelper.resolveURIs(camelContext, clientUris)); managedClient = true; } setLeader(tryTakeLeadership()); watch(); super.doStart(); }
@Override protected void doStart() throws Exception { super.doStart(); ObjectHelper.notNull(camelContext, "CamelContext"); ObjectHelper.notEmpty("groupName", groupName); String path = getCamelClusterPath(groupName); this.groupListener = new ZookeeperGroupListenerSupport(path, route.getEndpoint(), onLockOwned(), onDisconnected()); this.groupListener.setCamelContext(camelContext); this.groupListener.setCurator(curator); this.groupListener.setMaximumConnectionTimeout(maximumConnectionTimeout); this.groupListener.setZooKeeperUrl(zooKeeperUrl); this.groupListener.setZooKeeperPassword(zooKeeperPassword); ServiceHelper.startService(groupListener); log.info("Attempting to become master for endpoint: " + route.getEndpoint() + " in " + getCamelContext() + " with singletonID: " + getGroupName()); thisNodeState = createNodeState(); groupListener.updateState(thisNodeState); }