2009-09-27 20:39:26 +02:00
|
|
|
package xsbti;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
2013-12-12 15:51:58 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A service to locate, install and modify "Components".
|
|
|
|
|
*
|
|
|
|
|
* A component is essentially a directory and a set of files attached to a unique string id.
|
|
|
|
|
*/
|
2009-09-27 20:39:26 +02:00
|
|
|
public interface ComponentProvider
|
|
|
|
|
{
|
2013-12-12 15:51:58 +01:00
|
|
|
/**
|
|
|
|
|
* @param id The component's id string.
|
|
|
|
|
* @return
|
|
|
|
|
* The "working directory" or base directory for the component. You should perform temporary work here for the component.
|
|
|
|
|
*/
|
2011-07-02 05:38:03 +02:00
|
|
|
public File componentLocation(String id);
|
2013-12-12 15:51:58 +01:00
|
|
|
/**
|
|
|
|
|
* Grab the current component definition.
|
|
|
|
|
*
|
|
|
|
|
* @param componentID The component's id string.
|
|
|
|
|
* @return
|
|
|
|
|
* The set of files attached to this component.
|
|
|
|
|
*/
|
2009-09-27 20:39:26 +02:00
|
|
|
public File[] component(String componentID);
|
2013-12-12 15:51:58 +01:00
|
|
|
/**
|
|
|
|
|
* This will define a new component using the files passed in.
|
|
|
|
|
*
|
|
|
|
|
* Note: The component will copy/move the files into a cache location. You should not use them directly, but
|
|
|
|
|
* look them up using the `component` method.
|
|
|
|
|
*
|
|
|
|
|
* @param componentID The component's id string
|
|
|
|
|
* @param components The set of files which defines the component.
|
|
|
|
|
*
|
|
|
|
|
* @throws BootException if the component is already defined.
|
|
|
|
|
*/
|
2009-09-27 20:39:26 +02:00
|
|
|
public void defineComponent(String componentID, File[] components);
|
2013-12-12 15:51:58 +01:00
|
|
|
/**
|
|
|
|
|
* Modify an existing component by adding files to it.
|
|
|
|
|
*
|
|
|
|
|
* @param componentID The component's id string
|
|
|
|
|
* @param components The set of new files to add to the component.
|
|
|
|
|
* @return true if any files were copied and false otherwise.
|
|
|
|
|
*
|
|
|
|
|
*/
|
2011-07-02 05:38:03 +02:00
|
|
|
public boolean addToComponent(String componentID, File[] components);
|
2013-12-12 15:51:58 +01:00
|
|
|
/**
|
|
|
|
|
* @return The lockfile you should use to ensure your component cache does not become corrupted.
|
|
|
|
|
* May return null if there is no lockfile for this provider.
|
|
|
|
|
*/
|
2009-10-11 04:01:03 +02:00
|
|
|
public File lockFile();
|
2009-09-27 20:39:26 +02:00
|
|
|
}
|