-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored Spacelift, added TaskFactory
* Now using Spacelift as entry point * Ability to register factories * Automatic registration of tasks * Removed Arquillian related events
- Loading branch information
Showing
76 changed files
with
606 additions
and
1,695 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
spacelift-api/src/main/java/org/arquillian/spacelift/Spacelift.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package org.arquillian.spacelift; | ||
|
||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
|
||
import org.arquillian.spacelift.Invokable.InvocationException; | ||
import org.arquillian.spacelift.execution.ExecutionServiceFactory; | ||
import org.arquillian.spacelift.task.InjectTask; | ||
import org.arquillian.spacelift.task.Task; | ||
import org.arquillian.spacelift.task.TaskRegistry; | ||
|
||
public class Spacelift { | ||
|
||
public static <IN, OUT, TASK extends Task<? super IN, OUT>> TASK task(Class<TASK> taskDef) { | ||
return new SpaceliftInstance().registry().find(taskDef); | ||
} | ||
|
||
public static <IN, OUT, TASK extends Task<? super IN, OUT>> TASK task(IN input, Class<TASK> taskDef) { | ||
@SuppressWarnings("unchecked") | ||
InjectTask<IN> task = new SpaceliftInstance().registry().find(InjectTask.class); | ||
return task.passToNext(input).then(taskDef); | ||
} | ||
|
||
@SuppressWarnings({ "unchecked" }) | ||
public static class SpaceliftInstance { | ||
private static final Logger log = Logger.getLogger(Spacelift.class.getName()); | ||
|
||
private static ExecutionServiceFactory lastFactory; | ||
private static TaskRegistry registry; | ||
static { | ||
try { | ||
lastFactory = ImplementationLoader.implementationOf(ExecutionServiceFactory.class); | ||
} catch (InvocationException e) { | ||
log.log(Level.SEVERE, | ||
"Unable to find default implemenation of {0} on classpath, make sure that you set one programatically.", | ||
ExecutionServiceFactory.class.getName()); | ||
} | ||
try { | ||
registry = ImplementationLoader.implementationOf(TaskRegistry.class); | ||
// register inject task for chaining | ||
registry.register(InjectTask.class); | ||
} catch (InvocationException e) { | ||
log.log(Level.SEVERE, | ||
"Unable to find default implemenation of {0} on classpath, make sure that you set one programatically.", | ||
TaskRegistry.class.getName()); | ||
} | ||
} | ||
|
||
public TaskRegistry registry() { | ||
return registry; | ||
} | ||
|
||
public ExecutionServiceFactory service() { | ||
return lastFactory; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 0 additions & 95 deletions
95
spacelift-api/src/main/java/org/arquillian/spacelift/execution/Tasks.java
This file was deleted.
Oops, something went wrong.
73 changes: 0 additions & 73 deletions
73
spacelift-api/src/main/java/org/arquillian/spacelift/installation/Installation.java
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
spacelift-api/src/main/java/org/arquillian/spacelift/installation/InstallationContext.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.