A SpringBoot inspired project for JAX-RS and CDI.
Java
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
pom.xml

README.md

forseti

Build Status

Forseti is a SpringBoot inspired project for JAX-RS and CDI. It has Jersey and Weld implementations embedded, running on top of Jetty 9.

To start working with forseti, just define a JAX-RS endpoint, like:

@Path("/test")
public class MyEndpoint {
    @Inject
    private BeanSample beanSample;

    @GET
    public Response get() {
        return beanSample.getResponse();
    }
}

and, start your server just using:

public class Runner{
    public static void main(String [] args){
        Forseti.run(Runner.class, "com.newbesources", "/applicationRoot", "/rs/*");
    }
}

You can define also the server port (default is 8080):

Forseti.run(Runner.class, "com.newbesources", "/applicationRoot", "/rs/*", 8080);

If you prefer, you can define the attributes using the @Runner annotation:

@Runner(endpointScanPackage = "com.newbesources",
        applicationRoot = "/applicationRoot",
        jaxRsPath = "/rs/*", port = 8080)
public class Runner{
    public static void main(String [] args){
        Forseti.run(Runner.class);
    }
}

Access: `http://localhost:8080/applicationRoot/rs/test and your @GET resource will be called.

Forseti is still under development, but, if you want to use it in your maven application, just add this to your pom.xml:

<repositories>
    <repository>
        <id>public</id>
        <name>public</name>
        <url>https://oss.sonatype.org/content/groups/public</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.newbesources</groupId>
        <artifactId>forseti</artifactId>
        <version>0.0.2-20140912.195202-4</version>
    </dependency>
</dependencies>

And you will be able to use Forseti.