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.driver.task; 020 021import org.apache.reef.annotations.Provided; 022import org.apache.reef.annotations.audience.DriverSide; 023import org.apache.reef.annotations.audience.Public; 024import org.apache.reef.runtime.common.evaluator.task.defaults.DefaultCloseHandler; 025import org.apache.reef.runtime.common.evaluator.task.defaults.DefaultDriverMessageHandler; 026import org.apache.reef.runtime.common.evaluator.task.defaults.DefaultSuspendHandler; 027import org.apache.reef.tang.annotations.Name; 028import org.apache.reef.tang.annotations.NamedParameter; 029import org.apache.reef.task.TaskMessageSource; 030import org.apache.reef.task.events.*; 031import org.apache.reef.wake.EventHandler; 032 033import java.util.Set; 034 035/** 036 * Configuration parameters for the TaskConfiguration class. 037 */ 038@Public 039@DriverSide 040@Provided 041public final class TaskConfigurationOptions { 042 043 @NamedParameter(default_value = "Unnamed Task", doc = "The Identifier of the Task") 044 public static final class Identifier implements Name<String> { 045 } 046 047 @NamedParameter(doc = "The memento to be used for the Task.") 048 public final class Memento implements Name<String> { 049 } 050 051 @NamedParameter(doc = "TaskMessageSource instances.") 052 public final class TaskMessageSources implements Name<Set<TaskMessageSource>> { 053 } 054 055 @NamedParameter(doc = "The set of event handlers for the TaskStart event.") 056 public final class StartHandlers implements Name<Set<EventHandler<TaskStart>>> { 057 } 058 059 @NamedParameter(doc = "The set of event handlers for the TaskStop event.") 060 public final class StopHandlers implements Name<Set<EventHandler<TaskStop>>> { 061 } 062 063 @NamedParameter(doc = "The event handler that receives the close event", 064 default_class = DefaultCloseHandler.class) 065 public final class CloseHandler implements Name<EventHandler<CloseEvent>> { 066 } 067 068 @NamedParameter(doc = "The event handler that receives the suspend event", 069 default_class = DefaultSuspendHandler.class) 070 public final class SuspendHandler implements Name<EventHandler<SuspendEvent>> { 071 } 072 073 @NamedParameter(doc = "The event handler that receives messages from the driver", 074 default_class = DefaultDriverMessageHandler.class) 075 public final class MessageHandler implements Name<EventHandler<DriverMessage>> { 076 } 077}