ws.ament.hammock:jaxrs-rest-tck

CDI Based MicroServices

License

License

GroupId

GroupId

ws.ament.hammock
ArtifactId

ArtifactId

jaxrs-rest-tck
Last Version

Last Version

2.1
Release Date

Release Date

Type

Type

jar
Description

Description

CDI Based MicroServices
Project URL

Project URL

https://github.com/hammock-project/hammock/wiki/jaxrs-rest-tck

Download jaxrs-rest-tck

How to add to project

<!-- https://jarcasting.com/artifacts/ws.ament.hammock/jaxrs-rest-tck/ -->
<dependency>
    <groupId>ws.ament.hammock</groupId>
    <artifactId>jaxrs-rest-tck</artifactId>
    <version>2.1</version>
</dependency>
// https://jarcasting.com/artifacts/ws.ament.hammock/jaxrs-rest-tck/
implementation 'ws.ament.hammock:jaxrs-rest-tck:2.1'
// https://jarcasting.com/artifacts/ws.ament.hammock/jaxrs-rest-tck/
implementation ("ws.ament.hammock:jaxrs-rest-tck:2.1")
'ws.ament.hammock:jaxrs-rest-tck:jar:2.1'
<dependency org="ws.ament.hammock" name="jaxrs-rest-tck" rev="2.1">
  <artifact name="jaxrs-rest-tck" type="jar" />
</dependency>
@Grapes(
@Grab(group='ws.ament.hammock', module='jaxrs-rest-tck', version='2.1')
)
libraryDependencies += "ws.ament.hammock" % "jaxrs-rest-tck" % "2.1"
[ws.ament.hammock/jaxrs-rest-tck "2.1"]

Dependencies

compile (5)

Group / Artifact Type Version
ws.ament.hammock : web-spi jar 2.1
junit : junit jar 4.12
org.jboss.arquillian.junit : arquillian-junit-container jar 1.2.0.Final
ws.ament.hammock : test-arquillian jar 2.1
io.rest-assured : rest-assured jar 3.0.6

provided (1)

Group / Artifact Type Version
org.apache.geronimo.specs : geronimo-jaxrs_2.0_spec jar 1.0-alpha-1

Project Modules

There are no modules declared in this project.

Hammock

Gitter chat Build Status Maven Central

Hammock

Building Microservices so easily you're laying in a Hammock!

Hammock is a simple to use framework for bootstrapping CDI, launching a web server and being able to deploy REST APIs. It takes a best practice approach to creating a runtime for you, so that you can focus on the important stuff.

Read through some of the basics to get started, or view the wiki

Getting Started

First, add some dependencies to your project. Easiest way to start is with a Micrprofile Distribution - Standard or Cochise

Using Maven

Containers bring in transitive dependencies to bring up your runtime.

Using Undertow, Weld, Apache Johnzon, CXF

<dependency>
    <groupId>ws.ament.hammock</groupId>
    <artifactId>dist-microprofile</artifactId>
    <version>2.1</version>
</dependency>

Using Apache Tomcat, OpenWebBeans, Johnzon, CXF

<dependency>
    <groupId>ws.ament.hammock</groupId>
    <artifactId>dist-microprofile-cochise</artifactId>
    <version>2.1</version>
</dependency>

Launching your first app

Now that you have your dependencies in order, you can launch your first app.

Using Hammock's Bootstrap

Hammock has a bootstrap class, ws.ament.hammock.Bootstrap which will start CDI for you. It uses implementations of Bootstrapper to start the appropriate container.

Using Your Container's Bootstrap

You can also bootstrap your container directly. Since Hammock is implemented as a suite of CDI components, no extra work is required.

Use your own Bootstrap

You may want your own bootstrap, to do some pre-flight checks. Just make sure you either initialize Hammock or Weld when you're done. Your main might look as simple as

public class CustomBootstrapper implements Bootstrapper {

    public void start() {
        new PreflightChecks().verify();
        new Weld().initialize();
    }

    public void stop() { }
}

Make sure you add this to the ServiceLoader

Executable JARs

You'll likely want to create an executable JAR. Just shade in all dependencies using your favorite build tool, and set the main class to your choice of main class. I recommend using Capsule

Configuration

Configuration is provided via Apache DeltaSpike. The default configuration uses port 8080 for your webserver and /tmp for your static file directory. You'll likely want to configure those for your project.

Security

Basic security support is available. Two CDI interceptors are in use, one for verifying a user is logged in and another for verifying roles. To make use of security, you'll need to implement the Identity interface and make it a bean to represent the user currently be acted upon, usually of RequestScope.

  • @LoggedIn annotate a class or method, and an interceptor will check that the user is logged in for this method invocation.
  • @HasAllRoles() annotate a class or method, and an interceptor will check that the current identity has all of the roles defined.

To add the security runtime to your app, just include this dependency.

<dependency>
    <groupId>ws.ament.hammock</groupId>
    <artifactId>security-spi</artifactId>
    <version>2.1</version>
</dependency>

Issue Tracking

Have a feature request? Or found an issue? Please use github issues to let us know!

ws.ament.hammock

Hammock

Versions

Version
2.1
2.0
1.5
1.3
1.2.1
1.2
1.1