-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some beginning experiments with groovy
- Loading branch information
Showing
6 changed files
with
54 additions
and
14 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
Empty file.
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
35 changes: 35 additions & 0 deletions
35
ext/groovy/src/main/java/org/jboss/windup/ext/groovy/GroovyDSLSupport.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,35 @@ | ||
package org.jboss.windup.ext.groovy; | ||
|
||
import javax.enterprise.event.Observes; | ||
|
||
import org.jboss.forge.furnace.Furnace; | ||
import org.jboss.forge.furnace.event.PostStartup; | ||
import org.jboss.forge.furnace.services.Imported; | ||
import org.jboss.windup.graph.GraphContext; | ||
import org.jboss.windup.util.exception.WindupException; | ||
|
||
public class GroovyDSLSupport | ||
{ | ||
private static Furnace furnace; | ||
|
||
public void setFurnace(@Observes PostStartup event, Furnace furnace) | ||
{ | ||
GroovyDSLSupport.furnace = furnace; | ||
} | ||
|
||
private static GraphContext getGraphContext() | ||
{ | ||
Imported<GraphContext> contexts = furnace.getAddonRegistry().getServices(GraphContext.class); | ||
return contexts.get(); | ||
} | ||
|
||
public static void registerInterest(String className, String importance, String hint) | ||
{ | ||
GraphContext graphContext = GroovyDSLSupport.getGraphContext(); | ||
|
||
if (graphContext == null) | ||
{ | ||
throw new WindupException("Failed miserably"); | ||
} | ||
} | ||
} |
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