Giter VIP home page Giter VIP logo

furnace's Introduction

furnace

Lightweight Modular Service Container - Based Maven and JBoss Modules. It's easier than OSGi :)

Usage

First, include the Furnace dependency in your project:

<dependency>
   <groupId>org.jboss.forge.furnace</groupId>
   <artifactId>furnace-se</artifactId>
   <version>${version.furnace}</version>
</dependency>

Then configure the container and start it:

Furnace furnace = FurnaceFactory.getFurnace()
furnace.addRepository(AddonRepositoryMode.MUTABLE, new File(OperatingSystemUtils.getUserForgeDir(), "addons"));

To install addons, you will need to add the following dependencies to your project:

<dependency>
   <groupId>org.jboss.forge.furnace</groupId>
   <artifactId>furnace-manager</artifactId>
   <version>${version.furnace}</version>
</dependency>

<dependency>
   <groupId>org.jboss.forge.furnace</groupId>
   <artifactId>furnace-manager-resolver-maven</artifactId>
   <version>${version.furnace}</version>
</dependency>

Then create a new AddonManager:

AddonManager manager = new AddonManagerImpl(furnace, new MavenAddonDependencyResolver())

Once you have an AddonManager instance, you can begin to install addons (You can do this while Furnace is running):

InstallRequest request = manager.install(AddonId.from("org.example:my-addon", "1.0.0.Final"));
request.perform();

Don't forget to start Furnace:

Future<Furnace> future = furnace.startAsync();
future.get(); // wait for Furnace to start, before continuing.

Once this is done, you'll now be able to request services from Furnace's AddonRegistry, and utilize the functionality of the addons you've installed:

MyServiceType instance = furnace.getAddonRegistry().getServices(MyServiceType.class).get();

Of course, addons can be pre-bundled into a project using the Furnace Maven Plugin, making it much simpler (and faster) to run your application:

<plugin>
   <groupId>org.jboss.forge.furnace</groupId>
   <artifactId>furnace-maven-plugin</artifactId>
   <version>${version.furnace}</version>
   <executions>
      <execution>
         <id>deploy-addons</id>
         <phase>prepare-package</phase>
         <goals>
            <goal>addon-install</goal>
         </goals>
         <inherited>false</inherited>
         <configuration>
            <addonRepository>${basedir}/addon-repository</addonRepository>
            <addonIds>
               <addonId>org.example:my-addon,1.0.0.Final</addonId>
            </addonIds>
         </configuration>
      </execution>
   </executions>
</plugin>

To learn more about writing addons, see the full documentation here: https://github.com/forge/core#developing-an-addon

furnace's People

Contributors

adam-wyluda avatar aslakknutsen avatar danielsoro avatar gastaldi avatar lincolnthree avatar vineetreynolds avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.