Skip to content

Commit

Permalink
Move a bunch of interface and simple Pojos to a pytheas-api package
Browse files Browse the repository at this point in the history
Remove @Provider from all MessageBodyWriters and MessageBodyReaders
  • Loading branch information
elandau committed Aug 3, 2016
1 parent bc101df commit 986f673
Show file tree
Hide file tree
Showing 25 changed files with 36 additions and 26 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ Thumbs.db
# Gradle Files #
################
.gradle
.m2

# Build output directies
/target
Expand All @@ -63,3 +62,6 @@ atlassian-ide-plugin.xml

# NetBeans specific files/directories
.nbattrs

bin
test-output
23 changes: 19 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,41 @@ subprojects {

project(':pytheas-core') {
dependencies {
compile project(':pytheas-api')

compile 'javax.servlet:servlet-api:2.5'

compile 'commons-configuration:commons-configuration:1.8'

compile 'com.google.guava:guava:18.0'
compile 'com.google.inject.extensions:guice-servlet:4.0'
compile 'org.codehaus.jettison:jettison:1.3.7'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.google.code.findbugs:annotations:2.0.0'

compile 'com.sun.jersey:jersey-server:1.19'

compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
compile 'com.google.code.findbugs:annotations:2.0.0'

compile 'org.freemarker:freemarker:2.3.15'

compile 'com.netflix.archaius:archaius-core:0.7.3'
compile 'com.netflix.governator:governator:1.14.2'

compile 'com.github.stephenc.high-scale-lib:high-scale-lib:1.1.2'

compile 'commons-collections:commons-collections:3.2.1'
compile 'commons-codec:commons-codec:1.7'
compile 'com.github.stephenc.high-scale-lib:high-scale-lib:1.1.2'
compile 'commons-beanutils:commons-beanutils:1.9.1'
compile 'commons-io:commons-io:2.4'

runtime 'com.sun.jersey:jersey-servlet:1.19'
}
}

project(':pytheas-api') {
dependencies {
compile 'commons-configuration:commons-configuration:1.8'
compile 'com.google.guava:guava:18.0'
}
}

project(':pytheas-karyon') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@
*/
package com.netflix.explorers.providers;

import com.google.common.collect.Maps;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.netflix.explorers.Explorer;
import com.netflix.explorers.ExplorerManager;
import com.netflix.explorers.context.GlobalModelContext;
import com.netflix.explorers.context.RequestContext;
import com.netflix.explorers.model.EmptyExplorer;
import com.sun.jersey.api.view.Viewable;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
Expand All @@ -36,20 +49,6 @@
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.collect.Maps;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.netflix.explorers.Explorer;
import com.netflix.explorers.ExplorerManager;
import com.netflix.explorers.context.GlobalModelContext;
import com.netflix.explorers.context.RequestContext;
import com.netflix.explorers.model.EmptyExplorer;
import com.sun.jersey.api.view.Viewable;

import freemarker.cache.ClassTemplateLoader;
import freemarker.cache.MultiTemplateLoader;
Expand All @@ -60,7 +59,6 @@
import freemarker.template.TemplateModelException;

@Singleton
@Provider
public class FreemarkerTemplateProvider implements MessageBodyWriter<Viewable>
{
private static final Logger LOG = LoggerFactory.getLogger(FreemarkerTemplateProvider.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import com.netflix.explorers.annotations.ExplorerEntity;

@Consumes({"application/json"})
@Provider
public class JsonMessageBodyReader implements MessageBodyReader<Object> {
private final ObjectMapper mapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
* A MessageBodyWriter implementation that uses Jackson ObjectMapper to serialize objects to JSON.
*/
@Produces({"application/json"})
@Provider
public class JsonMessageBodyWriter implements MessageBodyWriter<Object> {

private final ObjectMapper mapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;

@Provider
class NaturalNotationContextResolver implements ContextResolver<JAXBContext> {
private JAXBContext context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
import java.io.PrintStream;
import java.util.List;


@Singleton
@Provider
public class WebApplicationExceptionMapper implements ExceptionMapper<WebApplicationException> {
private static final Logger LOG = LoggerFactory.getLogger(WebApplicationExceptionMapper.class);
private static List<Variant> supportedMediaTypes = Variant.mediaTypes(MediaType.APPLICATION_JSON_TYPE, MediaType.TEXT_HTML_TYPE).add().build();
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rootProject.name='pytheas'
include 'pytheas-core', 'pytheas-karyon', 'pytheas-helloworld'
include 'pytheas-core', 'pytheas-karyon', 'pytheas-helloworld', 'pytheas-api'

0 comments on commit 986f673

Please sign in to comment.