package org.forgeide.producer;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;

import org.jboss.forge.furnace.Furnace;
import org.jboss.forge.furnace.se.FurnaceFactory;

/**
 * 
 * @author Shane Bryzak
 * 
 */
@ApplicationScoped
public class FurnaceProducer {

    private final Furnace furnace;

    public FurnaceProducer() {
        furnace = FurnaceFactory.getInstance();
        furnace.start();
    }

    @Produces
    public Furnace getFurnace() {
        return furnace;
    }
}

@@ -25,16 +25,52 @@
 ducer;%0A%0A
+import javax.annotation.PreDestroy;%0A
 import j
@@ -472,16 +472,21 @@
 ce.start
+Async
 ();%0A    
@@ -565,11 +565,86 @@
 e;%0A    %7D
+%0A%0A    @PreDestroy%0A    public void destroy() %7B%0A        furnace.stop();%0A    %7D
 %0A%7D%0A

fix threading