diff options
Diffstat (limited to 'container-jersey2/src/main/java/com/yahoo')
3 files changed, 44 insertions, 0 deletions
diff --git a/container-jersey2/src/main/java/com/yahoo/container/jaxrs/annotation/Component.java b/container-jersey2/src/main/java/com/yahoo/container/jaxrs/annotation/Component.java new file mode 100644 index 00000000000..0dc18350bb0 --- /dev/null +++ b/container-jersey2/src/main/java/com/yahoo/container/jaxrs/annotation/Component.java @@ -0,0 +1,17 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.container.jaxrs.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotation for injecting jdisc container components into jaxrs resources and providers + * @author tonytv + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PARAMETER) +public @interface Component {} + + diff --git a/container-jersey2/src/main/java/com/yahoo/container/jaxrs/annotation/package-info.java b/container-jersey2/src/main/java/com/yahoo/container/jaxrs/annotation/package-info.java new file mode 100644 index 00000000000..4adb642ddeb --- /dev/null +++ b/container-jersey2/src/main/java/com/yahoo/container/jaxrs/annotation/package-info.java @@ -0,0 +1,10 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +/** + * @author tonytv + */ +@PublicApi +@ExportPackage +package com.yahoo.container.jaxrs.annotation; + +import com.yahoo.api.annotations.PublicApi; +import com.yahoo.osgi.annotation.ExportPackage; diff --git a/container-jersey2/src/main/java/com/yahoo/container/servlet/jersey/util/ResourceConfigUtil.java b/container-jersey2/src/main/java/com/yahoo/container/servlet/jersey/util/ResourceConfigUtil.java new file mode 100644 index 00000000000..e1246d0a125 --- /dev/null +++ b/container-jersey2/src/main/java/com/yahoo/container/servlet/jersey/util/ResourceConfigUtil.java @@ -0,0 +1,17 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.container.servlet.jersey.util; + +import org.glassfish.jersey.server.ResourceConfig; + +/** + * @author tonytv + */ +public class ResourceConfigUtil { + /** + * Solves ambiguous reference to overloaded definition, see + * http://stackoverflow.com/questions/3313929/how-do-i-disambiguate-in-scala-between-methods-with-vararg-and-without + */ + public static void registerComponent(ResourceConfig config, Object component) { + config.register(component); + } +} |