001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.reef.wake;
020
021import org.apache.reef.tang.annotations.Name;
022import org.apache.reef.tang.annotations.NamedParameter;
023import org.apache.reef.wake.rx.Observer;
024
025import java.util.concurrent.ExecutorService;
026
027/**
028 * Configuration options for Wake Stage.
029 */
030public final class StageConfiguration {
031
032  @NamedParameter(doc = "The stage name.")
033  public static final class StageName implements Name<String> {
034  }
035
036  @NamedParameter(doc = "The event handler for the stage.")
037  public static final class StageHandler implements Name<EventHandler<?>> {
038  }
039
040  @NamedParameter(doc = "The error handler for the stage.")
041  public static final class ErrorHandler implements Name<EventHandler<Throwable>> {
042  }
043
044  @NamedParameter(doc = "The number of threads for the stage.")
045  public static final class NumberOfThreads implements Name<Integer> {
046  }
047
048  @NamedParameter(doc = "The capacity for the stage.")
049  public static final class Capacity implements Name<Integer> {
050  }
051
052  @NamedParameter(doc = "The executor service for the stage.")
053  public static final class StageExecutorService implements Name<ExecutorService> {
054  }
055
056  @NamedParameter(doc = "The initial delay for periodic events of the timer stage.")
057  public static final class TimerInitialDelay implements Name<Long> {
058  }
059
060  @NamedParameter(doc = "The period for periodic events of the timer stage.")
061  public static final class TimerPeriod implements Name<Long> {
062  }
063
064  @NamedParameter(doc = "The observer for the stage.")
065  public static final class StageObserver implements Name<Observer<?>> {
066  }
067
068}