1 /* 2 * Copyright 1999-2004 The Apache Software Foundation. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.apache.commons.launcher; 18 19 import org.apache.tools.ant.BuildException; 20 21 /** 22 * An interface that provides a means for application developers to perform 23 * dynamic configuration and error checking of the attributes and nested 24 * elements associated with a "launch" task that connot be easily done within 25 * the constraints of Ant. 26 * <p> 27 * An implementor of this interface can be attached to a "launch" task by 28 * setting the following "launch" task attributes in the Launcher's XML 29 * file: 30 * <ul> 31 * <li><code>filterclassname</code> - The name of the class that implements 32 * this interface 33 * <li><code>filterclasspath</code> - (Optional) The classpath for the class 34 * that implements 35 * </ul> 36 * 37 * @author Patrick Luby 38 */ 39 public interface LaunchFilter { 40 41 //----------------------------------------------------------------- Methods 42 43 /** 44 * Perform error checking and editing of the JVM command line arguments 45 * that an instance of the {@link LaunchTask} class has constructed. 46 * Implementors will receive an instance of the {@link LaunchCommand} from 47 * the {@link LaunchTask} instance that invokes this method. The 48 * implementor of this method can then retrieve and edit any of the 49 * JVM command line arguments via the {@link LaunchCommand} class' public 50 * methods. 51 * 52 * @param launchCommand a configured {@link LaunchCommand} instance 53 * @throws BuildException if any errors occur 54 */ 55 public void filter(LaunchCommand launchCommand) throws BuildException; 56 57 } 58