public class AppCreator extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
AppCreator.Builder |
| Modifier and Type | Field and Description |
|---|---|
protected Map<Class<?>,Object> |
outcomes |
| Modifier and Type | Method and Description |
|---|---|
static AppCreator.Builder |
builder()
Returns an instance of a builder that can be used to initialize an application creator.
|
void |
close() |
Path |
createWorkDir(String... names)
Creates a directory from a path relative to the creator's work directory.
|
Path |
getAppJar()
User application JAR file
|
AppModelResolver |
getArtifactResolver()
Artifact resolver which can be used to resolve application dependencies.
|
<T> T |
getOutcome(Class<T> outcomeType)
Returns an already resolved outcome or null in case the outcome is not available yet.
|
Path |
getWorkDir()
Work directory used by the phases to store various data.
|
Path |
getWorkPath(String... names)
Creates a path object from path relative to the creator's work directory.
|
boolean |
isAvailable(Class<?> outcomeType)
Checks whether an outcome of the type is already available, i.e.
|
<T> AppCreator |
pushOutcome(Class<T> type,
T value)
Pushes an outcome of a specific type which can be used by phases that depend on it.
|
<T> AppCreator |
pushOutcome(T outcome)
This method simply calls
pushOutcome(outcome.getClass(), outcome) |
<T> T |
resolveOutcome(Class<T> outcomeType)
Resolve a phase outcome of a specific type.
|
public static AppCreator.Builder builder()
public Path getWorkDir()
public AppModelResolver getArtifactResolver()
public Path getAppJar() throws AppCreatorException
AppCreatorExceptionpublic <T> T resolveOutcome(Class<T> outcomeType) throws AppCreatorException
outcomeType - type of the outcome to deliverAppCreatorException - in case of a failurepublic boolean isAvailable(Class<?> outcomeType)
outcomeType - type of the outcomepublic <T> T getOutcome(Class<T> outcomeType)
outcomeType - type of the outcomepublic <T> AppCreator pushOutcome(T outcome) throws AppCreatorException
pushOutcome(outcome.getClass(), outcome)outcome - outcome instanceAppCreatorException - in case an outcome of this type is already availablepublic <T> AppCreator pushOutcome(Class<T> type, T value) throws AppCreatorException
type - type of the outcomevalue - outcome instanceAppCreatorException - in case an outcome of this type is already availablepublic Path createWorkDir(String... names) throws AppCreatorException
names - represents a path relative to the creator's work directoryAppCreatorException - in case the directory could not be createdpublic Path getWorkPath(String... names)
names - represents a path relative to the creator's work directorypublic void close()
close in interface AutoCloseableCopyright © 2019 JBoss by Red Hat. All rights reserved.