Skip to content

Commit

Permalink
Fixed loading Furnace.
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-wyluda committed May 26, 2014
1 parent 9269708 commit 43c39d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
import org.jboss.forge.addon.ui.command.CommandFactory;
import org.jboss.forge.addon.ui.controller.CommandControllerFactory;
import org.jboss.forge.furnace.Furnace;
import org.jboss.forge.furnace.proxy.ClassLoaderAdapterBuilder;
import org.jboss.forge.furnace.repositories.AddonRepositoryMode;
import org.jboss.forge.furnace.se.BootstrapClassLoader;
import org.jboss.forge.furnace.se.FurnaceFactory;
import org.jboss.forge.furnace.services.Imported;
import org.jboss.forge.furnace.util.OperatingSystemUtils;
Expand All @@ -32,10 +30,9 @@
*/
public class ForgeService implements ApplicationComponent
{
private transient ClassLoader classLoader;
private transient Furnace furnace;

private ForgeService()
ForgeService()
{
}

Expand All @@ -61,12 +58,12 @@ public String getComponentName()

public void start()
{
furnace.start(classLoader);
furnace.start();
}

public void startAsync()
{
furnace.startAsync(classLoader);
furnace.startAsync();
}

public void stop()
Expand Down Expand Up @@ -109,19 +106,7 @@ private void createFurnace()
// MODULES-136
System.setProperty("modules.ignore.jdk.factory", "true");

final BootstrapClassLoader loader = new BootstrapClassLoader("bootpath");
try
{
Class<?> bootstrapType = loader
.loadClass("org.jboss.forge.furnace.FurnaceImpl");
furnace = (Furnace) ClassLoaderAdapterBuilder.callingLoader(FurnaceFactory.class.getClassLoader())
.delegateLoader(loader)
.enhance(bootstrapType.newInstance(), Furnace.class);
}
catch (Exception e)
{
throw new RuntimeException(e);
}
furnace = FurnaceFactory.getInstance();
}

private void initializeAddonRepositories()
Expand Down
25 changes: 7 additions & 18 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,15 @@
]]>
</change-notes>

<!-- please see http://confluence.jetbrains.net/display/IDEADEV/Build+Number+Ranges for description -->
<idea-version since-build="107.105"/>

<!-- please see http://confluence.jetbrains.net/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products
on how to target different products -->
<!-- uncomment to enable plugin in all products
<depends>com.intellij.modules.lang</depends>
-->
<!--<depends>com.intellij.properties</depends>-->

<project-components>
<!-- Add your project components here -->
</project-components>
<application-components>
<component>
<implementation-class>org.jboss.forge.plugin.idea.service.ForgeService</implementation-class>
</component>
</application-components>

<actions>
<!-- Add your actions here -->
<action id="org.jboss.forge.idea.show_commands"
class="org.jboss.forge.plugin.idea.action.ShowCommandListAction"
text="Show Forge Commands">
Expand All @@ -43,13 +36,9 @@
</actions>

<extensions defaultExtensionNs="com.intellij">
<!-- Add your extensions here -->
<applicationConfigurable implementation="org.jboss.forge.plugin.idea.extensions.ForgePreferencePage"/>

<applicationService serviceInterface="org.jboss.forge.plugin.idea.service.ForgeService"
serviceImplementation="org.jboss.forge.plugin.idea.service.ForgeService"/>

<applicationService serviceInterface="org.jboss.forge.plugin.idea.service.UIService"
serviceImplementation="org.jboss.forge.plugin.idea.service.UIService"/>
<!--<applicationService serviceInterface="org.jboss.forge.plugin.idea.service.ForgeService"-->
<!--serviceImplementation="org.jboss.forge.plugin.idea.service.ForgeService"/>-->
</extensions>
</idea-plugin>

0 comments on commit 43c39d0

Please sign in to comment.