View Javadoc

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