nextgrid.api.builder
Interface POMBuilder<T>

Type Parameters:
T - The type used in the implementation methods

public interface POMBuilder<T>

ProcessBuilder type.

Author:
Rodrigo Ruiz

Method Summary
 T fromPOM(Process process)
          Converts a POM instance into another model type.
 java.lang.Class<T> getModelType()
          Gets the class of the supported model.
 java.net.URI getURI()
          Gets an URI that allows builder lookup by "id".
 java.util.Collection<Process> importAllFrom(java.io.InputStream is)
          Imports all processes contained in the given source.
 java.util.Collection<Process> importAllFrom(java.net.URI uri)
          Imports all processes contained in the given source.
 Process importFrom(java.io.File src)
          Imports a POM from the given source.
 Process importFrom(java.io.InputStream is)
          Imports a POM from an input stream.
 Process importFrom(java.net.URI src)
          Imports a POM from the given source.
 Process importFrom(java.net.URL src)
          Imports a POM from the given source.
 Process toPOM(T model)
          Converts a model into a POM instance.
 

Method Detail

getModelType

java.lang.Class<T> getModelType()
Gets the class of the supported model.

This method is used by the discovery mechanism to map model types to builder implementations.

Returns:
A model class

getURI

java.net.URI getURI()
Gets an URI that allows builder lookup by "id".

Returns:
An URI for this builder type

fromPOM

T fromPOM(Process process)
          throws BuildException
Converts a POM instance into another model type.

The model type is implementation dependent.

Parameters:
process - The source POM instance
Returns:
The resulting model
Throws:
BuildException - If an error occurs

toPOM

Process toPOM(T model)
              throws BuildException
Converts a model into a POM instance.

The model type is implementation dependent.

Parameters:
model - The source model
Returns:
The resulting POM instance
Throws:
BuildException - If an error occurs

importFrom

Process importFrom(java.io.File src)
                   throws java.io.IOException,
                          BuildException
Imports a POM from the given source.

Parameters:
src - The source to import
Returns:
The POM workflow root process
Throws:
java.io.IOException - If an error occurs while reading the file
BuildException - If an error occurs while translating the model

importFrom

Process importFrom(java.net.URL src)
                   throws java.io.IOException,
                          BuildException
Imports a POM from the given source.

Parameters:
src - The source to import
Returns:
The POM workflow root process
Throws:
java.io.IOException - If an error occurs while reading the file
BuildException - If an error occurs while translating the model

importFrom

Process importFrom(java.net.URI src)
                   throws java.io.IOException,
                          BuildException
Imports a POM from the given source.

Parameters:
src - The source to import
Returns:
The POM workflow root process
Throws:
java.io.IOException - If an error occurs while reading the file
BuildException - If an error occurs while translating the model

importFrom

Process importFrom(java.io.InputStream is)
                   throws java.io.IOException,
                          BuildException
Imports a POM from an input stream.

Parameters:
is - A stream to read from
Returns:
The POM workflow root process
Throws:
java.io.IOException - If an error occurs while reading the file
BuildException - If an error occurs while translating the model

importAllFrom

java.util.Collection<Process> importAllFrom(java.net.URI uri)
                                            throws java.io.IOException,
                                                   BuildException
Imports all processes contained in the given source.

Parameters:
uri - The source to import
Returns:
A collection of POM workflow roots
Throws:
java.io.IOException - If an I/O error occurs while reading the source
BuildException - If an error occurs while translating the models

importAllFrom

java.util.Collection<Process> importAllFrom(java.io.InputStream is)
                                            throws java.io.IOException,
                                                   BuildException
Imports all processes contained in the given source.

Parameters:
is - The source to import
Returns:
A collection of POM workflow roots
Throws:
java.io.IOException - If an I/O error occurs while reading the source
BuildException - If an error occurs while translating the models


Copyright © 2006-2008 Grid Systems, S.A.. All Rights Reserved.