underwrap

A very thin wrapper of Undertow and Resteasy

License

License

Categories

Categories

Data
GroupId

GroupId

com.treasuredata
ArtifactId

ArtifactId

underwrap
Last Version

Last Version

0.1.8
Release Date

Release Date

Type

Type

jar
Description

Description

underwrap
A very thin wrapper of Undertow and Resteasy
Project URL

Project URL

https://github.com/treasure-data/underwrap
Source Code Management

Source Code Management

https://github.com/treasure-data/underwrap

Download underwrap

How to add to project

<!-- https://jarcasting.com/artifacts/com.treasuredata/underwrap/ -->
<dependency>
    <groupId>com.treasuredata</groupId>
    <artifactId>underwrap</artifactId>
    <version>0.1.8</version>
</dependency>
// https://jarcasting.com/artifacts/com.treasuredata/underwrap/
implementation 'com.treasuredata:underwrap:0.1.8'
// https://jarcasting.com/artifacts/com.treasuredata/underwrap/
implementation ("com.treasuredata:underwrap:0.1.8")
'com.treasuredata:underwrap:jar:0.1.8'
<dependency org="com.treasuredata" name="underwrap" rev="0.1.8">
  <artifact name="underwrap" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.treasuredata', module='underwrap', version='0.1.8')
)
libraryDependencies += "com.treasuredata" % "underwrap" % "0.1.8"
[com.treasuredata/underwrap "0.1.8"]

Dependencies

compile (5)

Group / Artifact Type Version
com.google.guava : guava jar 22.0
org.slf4j : slf4j-api jar 1.7.22
net.jodah : failsafe jar 1.0.4
org.jboss.resteasy : resteasy-undertow jar 3.1.3.Final
io.undertow : undertow-servlet jar 1.4.15.Final

test (3)

Group / Artifact Type Version
junit : junit jar 4.11
org.hamcrest : hamcrest-all jar 1.3
org.mockito : mockito-all jar 1.10.19

Project Modules

There are no modules declared in this project.

Underwrap

A very thin wrapper of Undertow and Resteasy

Usage

Maven

pom.xml

<dependencies>
    <dependency>
        <groupId>com.treasuredata</groupId>
        <artifactId>underwrap</artifactId>
        <version>0.1.4</version>
    </dependency>
</dependencies>

Gradle

build.gradle

dependencies {
    compile 'com.treasuredata:underwrap:0.1.4'
}

Example

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Context;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class UnderwrapExample
{
    public static void main(String[] args)
    {
        UnderwrapServer server = new UnderwrapServer(MyApplication.class);
        Map<Class, Object> contextMqp =  new HashMap<>();
        contextMqp.put(String.class, "This is UnderwrapExample");
        server.start(contextMqp, null,
                serverBuild -> {
                    serverBuild.addHttpListener(8080, "0.0.0.0");
                }
        );
    }

    public static class MyApplication
        extends UnderwrapServer.UnderwrapApplication
    {
        @Override
        protected void registerResources(Set<Class<?>> classes)
        {
            classes.add(Resources.class);
        }
    }

    @Path("/")
    public static class Resources
    {
        private final String comment;

        public Resources(@Context String comment)
        {
            this.comment = comment;
        }

        @GET
        @Path("/hello")
        public String hello()
        {
            return "Hello! " + comment;
        }
    }
}
com.treasuredata

Treasure Data

Most companies say they love open source. We also LIVE it.

Versions

Version
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4