Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Commit 996c725

Browse files
author
Petr Bouda
committed
JERSEY-2591: Documentation of a package scan inheritance
Change-Id: I62e5dffae423bb0c1b3734d07b27657d6ef5ffb3
1 parent 669aecc commit 996c725

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

core-server/src/main/java/org/glassfish/jersey/server/ResourceConfig.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import java.util.logging.Level;
5252
import java.util.logging.Logger;
5353

54+
import javax.ws.rs.Path;
5455
import javax.ws.rs.RuntimeType;
5556
import javax.ws.rs.core.Application;
5657
import javax.ws.rs.core.Configurable;
@@ -646,6 +647,9 @@ public final ResourceConfig setClassLoader(final ClassLoader classLoader) {
646647
/**
647648
* Adds array of package names which will be used to scan for components.
648649
* <p/>
650+
* Package scanning ignores inheritance and therefore {@link Path} annotation
651+
* on parent classes and interfaces will be ignored.
652+
* <p/>
649653
* Packages will be scanned recursively, including all nested packages.
650654
*
651655
* @param packages array of package names.
@@ -658,7 +662,10 @@ public final ResourceConfig packages(final String... packages) {
658662

659663
/**
660664
* Adds array of package names which will be used to scan for components.
661-
*
665+
* <p/>
666+
* Package scanning ignores an inheritance and therefore {@link Path} annotation
667+
* on parent classes and interfaces will be ignored.
668+
* <p/>
662669
* @param recursive defines whether any nested packages in the collection of specified
663670
* package names should be recursively scanned (value of {@code true})
664671
* as part of the package scanning or not (value of {@code false}).

docs/src/main/docbook/deployment.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,13 @@
101101
<literal>getClasses</literal>. For example, the following application class that extends from
102102
&lit.jersey.server.ResourceConfig; scans during deployment for JAX-RS components in packages
103103
<literal>org.foo.rest</literal> and <literal>org.bar.rest</literal>:
104-
104+
<note>
105+
<para>
106+
<emphasis>Package scanning</emphasis> ignores an inheritance and therefore &lit.jaxrs.Path; annotation
107+
on parent classes and interfaces will be ignored. These classes won't be registered as the JAX-RS component
108+
classes.
109+
</para>
110+
</note>
105111
<example>
106112
<title>Reusing Jersey implementation in your custom application model</title>
107113
<programlisting language="java" linenumbering="numbered">public class MyApplication extends ResourceConfig {

0 commit comments

Comments
 (0)