diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec/CommandLauncher.java b/proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec/CommandLauncher.java new file mode 100644 index 000000000..b5906f09e --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec/CommandLauncher.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.myrmidon.framework.exec; + +import java.io.IOException; +import org.apache.myrmidon.api.TaskException; + +/** + * This is the interface implemented by objects which are capable of + * lauching a native command. Each different implementation is likely + * to have a different strategy or be restricted to specific platform. + * + *

It is expected that the user will get a reference to the + * CommandLauncher most appropriate for their environment.

+ * + * @author Peter Donald + * @version $Revision$ $Date$ + */ +public interface CommandLauncher +{ + /** + * Execute the specified native command. + * + * @param metaData the native command to execute + * @return the Process launched by the CommandLauncher + * @exception IOException is thrown when the native code can not + * launch the application for some reason. Usually due + * to the command not being fully specified and not in + * the PATH env var. + * @exception TaskException if the command launcher detects that + * it can not execute the native command for some reason. + */ + Process exec( ExecMetaData metaData ) + throws IOException, TaskException; +}