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. package org.apache.commons.launcher;
  17. import org.apache.tools.ant.BuildException;
  18. /**
  19. * An interface that provides a means for application developers to perform
  20. * dynamic configuration and error checking of the attributes and nested
  21. * elements associated with a "launch" task that connot be easily done within
  22. * the constraints of Ant.
  23. * <p>
  24. * An implementor of this interface can be attached to a "launch" task by
  25. * setting the following "launch" task attributes in the Launcher's XML
  26. * file:
  27. * <ul>
  28. * <li><code>filterclassname</code> - The name of the class that implements
  29. * this interface
  30. * <li><code>filterclasspath</code> - (Optional) The classpath for the class
  31. * that implements
  32. * </ul>
  33. *
  34. * @author Patrick Luby
  35. */
  36. public interface LaunchFilter {
  37. //----------------------------------------------------------------- Methods
  38. /**
  39. * Perform error checking and editing of the JVM command line arguments
  40. * that an instance of the {@link LaunchTask} class has constructed.
  41. * Implementors will receive an instance of the {@link LaunchCommand} from
  42. * the {@link LaunchTask} instance that invokes this method. The
  43. * implementor of this method can then retrieve and edit any of the
  44. * JVM command line arguments via the {@link LaunchCommand} class' public
  45. * methods.
  46. *
  47. * @param launchCommand a configured {@link LaunchCommand} instance
  48. * @throws BuildException if any errors occur
  49. */
  50. public void filter(LaunchCommand launchCommand) throws BuildException;
  51. }