// Path: src/main/java/com/github/fzakaria/waterflow/Activities.java
// public abstract class Activities {
// 
//     protected final Logger log = LoggerFactory.getLogger(getClass());
// 
//     @Nullable
//     private ActivityContext activityContext;
// 
//     public ActivityContext activityContext() {
//         return activityContext;
//     }
// 
//     public Activities activityContext(ActivityContext activityContext) {
//         this.activityContext = activityContext;
//         return this;
//     }
// 
//     /**
//      * Record a heartbeat on SWF.
//      * @param details information to be recorded
//      */
//     protected void recordHeartbeat(String details) {
//         Preconditions.checkNotNull(activityContext, "ActivityContext should have been set.");
//         final String taskToken = activityContext().task().getTaskToken();
//         try {
//             final RecordActivityTaskHeartbeatRequest request =
//                     RecordActivityTaskHeartbeatRequestBuilder.builder()
//                             .taskToken(taskToken).details(Details.of(details)).build();
//             activityContext().service().recordActivityTaskHeartbeat(request);
//         } catch (Throwable e) {
//             log.warn("Failed to record heartbeat: " + taskToken + ", " + details, e);
//             throw e;
//         }
//     }
// 
// }


import com.github.fzakaria.waterflow.Activities;
import com.github.fzakaria.waterflow.immutable.Name;
import org.immutables.value.Value;
import java.util.List;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadFactory;
import java.util.stream.IntStream;
import static java.lang.String.format;
import static java.util.stream.Collectors.toList;
package com.github.fzakaria.waterflow.poller;




/**
 * A helper class that facilitates running multiple {@link ActivityPoller} for a given {@link ScheduledThreadPoolExecutor}
 * A helpful {@link ThreadFactory} is set which names the threads with 'ACTIVITY'
 *
 */
@Value.Immutable
public abstract class ActivityPollerPool extends BasePollerPool<ActivityPoller> {

// Path: src/main/java/com/github/fzakaria/waterflow/Activities.java
// public abstract class Activities {
// 
//     protected final Logger log = LoggerFactory.getLogger(getClass());
// 
//     @Nullable
//     private ActivityContext activityContext;
// 
//     public ActivityContext activityContext() {
//         return activityContext;
//     }
// 
//     public Activities activityContext(ActivityContext activityContext) {
//         this.activityContext = activityContext;
//         return this;
//     }
// 
//     /**
//      * Record a heartbeat on SWF.
//      * @param details information to be recorded
//      */
//     protected void recordHeartbeat(String details) {
//         Preconditions.checkNotNull(activityContext, "ActivityContext should have been set.");
//         final String taskToken = activityContext().task().getTaskToken();
//         try {
//             final RecordActivityTaskHeartbeatRequest request =
//                     RecordActivityTaskHeartbeatRequestBuilder.builder()
//                             .taskToken(taskToken).details(Details.of(details)).build();
//             activityContext().service().recordActivityTaskHeartbeat(request);
//         } catch (Throwable e) {
//             log.warn("Failed to record heartbeat: " + taskToken + ", " + details, e);
//             throw e;
//         }
//     }
// 
// }


// Path: src/main/java/com/github/fzakaria/waterflow/poller/ActivityPollerPool.java
import com.github.fzakaria.waterflow.Activities;
import com.github.fzakaria.waterflow.immutable.Name;
import org.immutables.value.Value;
import java.util.List;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadFactory;
import java.util.stream.IntStream;
import static java.lang.String.format;
import static java.util.stream.Collectors.toList;

package com.github.fzakaria.waterflow.poller;




/**
 * A helper class that facilitates running multiple {@link ActivityPoller} for a given {@link ScheduledThreadPoolExecutor}
 * A helpful {@link ThreadFactory} is set which names the threads with 'ACTIVITY'
 *
 */
@Value.Immutable
public abstract class ActivityPollerPool extends BasePollerPool<ActivityPoller> {

    public abstract List<Activities> activities();