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 /** 033 * The stage name. 034 */ 035 @NamedParameter(doc = "The stage name.") 036 public static final class StageName implements Name<String> { 037 } 038 039 /** 040 * The event handler for the stage. 041 */ 042 @NamedParameter(doc = "The event handler for the stage.") 043 public static final class StageHandler implements Name<EventHandler<?>> { 044 } 045 046 /** 047 * The error handler for the stage. 048 */ 049 @NamedParameter(doc = "The error handler for the stage.") 050 public static final class ErrorHandler implements Name<EventHandler<Throwable>> { 051 } 052 053 /** 054 * The number of threads for the stage. 055 */ 056 @NamedParameter(doc = "The number of threads for the stage.") 057 public static final class NumberOfThreads implements Name<Integer> { 058 } 059 060 /** 061 * The capacity for the stage. 062 */ 063 @NamedParameter(doc = "The capacity for the stage.") 064 public static final class Capacity implements Name<Integer> { 065 } 066 067 /** 068 * The executor service for the stage. 069 */ 070 @NamedParameter(doc = "The executor service for the stage.") 071 public static final class StageExecutorService implements Name<ExecutorService> { 072 } 073 074 /** 075 * The initial delay for periodic events of the timer stage. 076 */ 077 @NamedParameter(doc = "The initial delay for periodic events of the timer stage.") 078 public static final class TimerInitialDelay implements Name<Long> { 079 } 080 081 /** 082 * The period for periodic events of the timer stage. 083 */ 084 @NamedParameter(doc = "The period for periodic events of the timer stage.") 085 public static final class TimerPeriod implements Name<Long> { 086 } 087 088 /** 089 * The observer for the stage. 090 */ 091 @NamedParameter(doc = "The observer for the stage.") 092 public static final class StageObserver implements Name<Observer<?>> { 093 } 094 095}