Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 79b95e94b -> 9813df38f
[CXF-6176] Minor update to get providers registered on the bus shared between multiple JAXRS factories Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/9813df38 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/9813df38 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/9813df38 Branch: refs/heads/3.0.x-fixes Commit: 9813df38f7e5dd7d4443ce98560a8514c5777753 Parents: 79b95e9 Author: Sergey Beryozkin <[email protected]> Authored: Wed Dec 24 17:55:40 2014 +0000 Committer: Sergey Beryozkin <[email protected]> Committed: Wed Dec 24 17:59:06 2014 +0000 ---------------------------------------------------------------------- .../cxf/jaxrs/provider/ProviderFactory.java | 2 +- .../systest/jaxrs/security/oauth2/server.xml | 27 ++++++++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/9813df38/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java index 934a652..7500eca 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java @@ -457,7 +457,7 @@ public abstract class ProviderFactory { protected void setBusProviders() { List<Object> extensions = new LinkedList<Object>(); - final String alreadySetProp = "bus.providers.set"; + final String alreadySetProp = "bus.providers.set." + this.hashCode(); if (bus.getProperty(alreadySetProp) == null) { addBusExtension(extensions, MessageBodyReader.class, http://git-wip-us.apache.org/repos/asf/cxf/blob/9813df38/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/server.xml ---------------------------------------------------------------------- diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/server.xml b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/server.xml index e1a06e3..f3f6fbe 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/server.xml +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/server.xml @@ -17,13 +17,34 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> -<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:cxf="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs" xsi:schemaLocation=" http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd "> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:http="http://cxf.apache.org/transports/http/configuration" + xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration" + xmlns:sec="http://cxf.apache.org/configuration/security" + xmlns:cxf="http://cxf.apache.org/core" + xmlns:jaxrs="http://cxf.apache.org/jaxrs" + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation="http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd + http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd + http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd + http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd + http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd"> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <cxf:bus> <cxf:features> <cxf:logging/> </cxf:features> + <cxf:properties> + <entry key="org.apache.cxf.jaxrs.bus.providers" value-ref="busProviders"/> + </cxf:properties> </cxf:bus> + <!-- providers --> + <util:list id="busProviders"> + <ref bean="oauthJson"/> + </util:list> <httpj:engine-factory id="port-9095-tls-config"> <httpj:engine port="${testutil.ports.jaxrs-oauth2}"> <httpj:tlsServerParameters> @@ -59,9 +80,6 @@ under the License. <jaxrs:serviceBeans> <ref bean="serviceBean"/> </jaxrs:serviceBeans> - <jaxrs:providers> - <ref bean="oauthJson"/> - </jaxrs:providers> <jaxrs:properties> <entry key="ws-security.signature.properties" value="org/apache/cxf/systest/jaxrs/security/alice.properties"/> </jaxrs:properties> @@ -71,7 +89,6 @@ under the License. <ref bean="serviceBean"/> </jaxrs:serviceBeans> <jaxrs:providers> - <ref bean="oauthJson"/> <ref bean="samlAuthHandler"/> </jaxrs:providers> <jaxrs:properties>
