1 package org.apache.continuum.builder.distributed.executor; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 import org.codehaus.plexus.taskqueue.Task; 23 import org.codehaus.plexus.taskqueue.TaskQueue; 24 25 public interface DistributedBuildTaskQueueExecutor 26 { 27 String ROLE = DistributedBuildTaskQueueExecutor.class.getName(); 28 29 /** 30 * Returns the build agent url of task queue executor 31 * 32 * @return the build agent url 33 */ 34 String getBuildAgentUrl(); 35 36 /** 37 * Sets the build agent url of this task queue executor 38 * 39 * @param buildAgentUrl 40 */ 41 void setBuildAgentUrl( String buildAgentUrl ); 42 43 /** 44 * Returns the currently executing task. 45 * 46 * @return the currently executing task. 47 */ 48 Task getCurrentTask(); 49 50 /** 51 * Cancels execution of this task, if it's currently running. 52 * Does NOT remove it from the associated queue! 53 * 54 * @param task The task to cancel 55 * @return true if the task was cancelled, false if the task was not executing. 56 */ 57 boolean cancelTask( Task task ); 58 59 /** 60 * Returns the task queue 61 * 62 * @return the TaskQueue of the task queue executor 63 */ 64 public TaskQueue getQueue(); 65 }