Author: dkulp
Date: Wed Apr 6 21:28:49 2011
New Revision: 1089633
URL: http://svn.apache.org/viewvc?rev=1089633&view=rev
Log:
[CXF-3441] Add support for Blueprint for policies
Modified patch from Johan Edstrom applied.
Added:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/ExternalAttachmentProviderBPDefinitionParser.java
(with props)
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyBPDefinitionParser.java
(with props)
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyBPHandler.java
(with props)
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyEngineBPDefinitionParser.java
(with props)
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyFeatureBPDefinitionParser.java
(with props)
cxf/trunk/rt/ws/policy/src/main/resources/OSGI-INF/
cxf/trunk/rt/ws/policy/src/main/resources/OSGI-INF/blueprint/
cxf/trunk/rt/ws/policy/src/main/resources/OSGI-INF/blueprint/policy.xml
(with props)
cxf/trunk/rt/ws/policy/src/main/resources/schemas/blueprint/
cxf/trunk/rt/ws/policy/src/main/resources/schemas/blueprint/policy.xsd
(with props)
Modified:
cxf/trunk/rt/ws/policy/pom.xml
Modified: cxf/trunk/rt/ws/policy/pom.xml
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/pom.xml?rev=1089633&r1=1089632&r2=1089633&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/pom.xml (original)
+++ cxf/trunk/rt/ws/policy/pom.xml Wed Apr 6 21:28:49 2011
@@ -32,6 +32,14 @@
<dependencies>
<dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<scope>provided</scope>
Added:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/ExternalAttachmentProviderBPDefinitionParser.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/ExternalAttachmentProviderBPDefinitionParser.java?rev=1089633&view=auto
==============================================================================
---
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/ExternalAttachmentProviderBPDefinitionParser.java
(added)
+++
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/ExternalAttachmentProviderBPDefinitionParser.java
Wed Apr 6 21:28:49 2011
@@ -0,0 +1,58 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.policy.blueprint;
+
+import org.w3c.dom.Element;
+
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.apache.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser;
+import org.apache.cxf.ws.policy.attachment.external.ExternalAttachmentProvider;
+import org.osgi.service.blueprint.reflect.BeanProperty;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+public class ExternalAttachmentProviderBPDefinitionParser extends
AbstractBPBeanDefinitionParser {
+
+ public Metadata parse(Element element, ParserContext context) {
+
+ MutableBeanMetadata attachmentProvider =
context.createMetadata(MutableBeanMetadata.class);
+ attachmentProvider.setRuntimeClass(ExternalAttachmentProvider.class);
+ if (hasBusProperty()) {
+ boolean foundBus = false;
+ for (BeanProperty bp : attachmentProvider.getProperties()) {
+ if ("bus".equals(bp.getName())) {
+ foundBus = true;
+ }
+ }
+ if (!foundBus) {
+ attachmentProvider.addProperty("bus", getBusRef(context,
"cxf"));
+ }
+ }
+
+ parseAttributes(element, context, attachmentProvider);
+ parseChildElements(element, context, attachmentProvider);
+ return attachmentProvider;
+ }
+
+ @Override
+ protected boolean hasBusProperty() {
+ return true;
+ }
+}
Propchange:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/ExternalAttachmentProviderBPDefinitionParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/ExternalAttachmentProviderBPDefinitionParser.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyBPDefinitionParser.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyBPDefinitionParser.java?rev=1089633&view=auto
==============================================================================
---
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyBPDefinitionParser.java
(added)
+++
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyBPDefinitionParser.java
Wed Apr 6 21:28:49 2011
@@ -0,0 +1,68 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.policy.blueprint;
+
+import java.util.UUID;
+import java.util.concurrent.Callable;
+import org.w3c.dom.Element;
+
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.apache.aries.blueprint.mutable.MutablePassThroughMetadata;
+import org.apache.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser;
+import org.apache.cxf.ws.policy.PolicyBean;
+import org.apache.cxf.ws.policy.PolicyConstants;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+public class PolicyBPDefinitionParser extends AbstractBPBeanDefinitionParser {
+
+ public Metadata parse(Element element, ParserContext context) {
+ MutablePassThroughMetadata factory =
context.createMetadata(MutablePassThroughMetadata.class);
+ factory.setId(resolveId(element, context) +
UUID.randomUUID().toString());
+
+ PolicyBean policyBean = new PolicyBean();
+ policyBean.setElement(element);
+ factory.setObject(new PassThroughCallable<Object>(policyBean));
+
+ MutableBeanMetadata resourceBean =
context.createMetadata(MutableBeanMetadata.class);
+ resourceBean.setId(resolveId(element, context));
+ resourceBean.setFactoryComponent(factory);
+ resourceBean.setFactoryMethod("call");
+
+ return resourceBean;
+ }
+
+ protected String resolveId(Element element, ParserContext ctx) {
+ return element.getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
PolicyConstants.WSU_ID_ATTR_NAME);
+ }
+
+ public static class PassThroughCallable<T> implements Callable<T> {
+
+ private T value;
+
+ public PassThroughCallable(T value) {
+ this.value = value;
+ }
+
+ public T call() throws Exception {
+ return value;
+ }
+ }
+}
Propchange:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyBPDefinitionParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyBPDefinitionParser.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyBPHandler.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyBPHandler.java?rev=1089633&view=auto
==============================================================================
---
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyBPHandler.java
(added)
+++
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyBPHandler.java
Wed Apr 6 21:28:49 2011
@@ -0,0 +1,71 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.policy.blueprint;
+
+import java.net.URL;
+import java.util.Set;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import org.apache.aries.blueprint.NamespaceHandler;
+import org.apache.aries.blueprint.ParserContext;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+public class PolicyBPHandler implements NamespaceHandler {
+
+ public URL getSchemaLocation(String s) {
+ //Say yes to various schemas.
+
+ if ("http://cxf.apache.org/policy".equals(s)) {
+ return
getClass().getClassLoader().getResource("/schemas/blueprint/policy.xsd");
+ } else if ("http://www.w3.org/ns/ws-policy".equals(s)) {
+ return
getClass().getClassLoader().getResource("/schemas/ws-policy-200702.xsd");
+ } else if ("http://www.w3.org/2006/07/ws-policy".equals(s)) {
+ return
getClass().getClassLoader().getResource("/schemas/ws-policy-200607.xsd");
+ } else if ("http://schemas.xmlsoap.org/ws/2004/09/policy".equals(s)) {
+ return
getClass().getClassLoader().getResource("/schemas/ws-policy-200409.xsd");
+ }
+
+ return null;
+ }
+
+ public Set<Class> getManagedClasses() {
+ return null;
+ }
+
+ public Metadata parse(Element element, ParserContext context) {
+
+ String s = element.getLocalName();
+ if ("policies".equals(s)) {
+ return new PolicyFeatureBPDefinitionParser().parse(element,
context);
+ } else if ("engine".equals(s)) {
+ return new PolicyEngineBPDefinitionParser().parse(element,
context);
+ } else if ("externalAttachment".equals(s)) {
+ return new
ExternalAttachmentProviderBPDefinitionParser().parse(element, context);
+ }
+
+ return null;
+ }
+
+ public ComponentMetadata decorate(Node node, ComponentMetadata
componentMetadata, ParserContext context) {
+ return null;
+ }
+}
Propchange:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyBPHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyBPHandler.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyEngineBPDefinitionParser.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyEngineBPDefinitionParser.java?rev=1089633&view=auto
==============================================================================
---
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyEngineBPDefinitionParser.java
(added)
+++
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyEngineBPDefinitionParser.java
Wed Apr 6 21:28:49 2011
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.policy.blueprint;
+
+import org.w3c.dom.Element;
+
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.apache.cxf.Bus;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser;
+import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.ws.policy.AlternativeSelector;
+import org.apache.cxf.ws.policy.PolicyEngine;
+import org.apache.cxf.ws.policy.PolicyEngineImpl;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+public class PolicyEngineBPDefinitionParser extends
AbstractBPBeanDefinitionParser {
+
+ public Metadata parse(Element element, ParserContext context) {
+ MutableBeanMetadata policyEngineConfig =
context.createMetadata(MutableBeanMetadata.class);
+
+ policyEngineConfig.setRuntimeClass(PolicyEngineConfig.class);
+
+ String bus = element.getAttribute("bus");
+ if (StringUtils.isEmpty(bus)) {
+ bus = "cxf";
+ }
+ policyEngineConfig.addArgument(getBusRef(context, bus),
Bus.class.getName(), 0);
+
+ parseAttributes(element, context, policyEngineConfig);
+ parseChildElements(element, context, policyEngineConfig);
+
+ policyEngineConfig.setId(PolicyEngineConfig.class.getName() +
context.generateId());
+
+ return policyEngineConfig;
+ }
+
+ @Override
+ protected void mapElement(ParserContext ctx, MutableBeanMetadata bean,
Element el, String name) {
+ if ("alternativeSelector".equals(name)) {
+ setFirstChildAsProperty(el, ctx, bean, name);
+ }
+ }
+
+ public static class PolicyEngineConfig extends AbstractFeature {
+
+ private PolicyEngineImpl engine;
+
+ public PolicyEngineConfig(Bus bus) {
+ engine = (PolicyEngineImpl) bus.getExtension(PolicyEngine.class);
+ }
+
+ public boolean getEnabled() {
+ return engine.isEnabled();
+ }
+
+ public void setEnabled(boolean enabled) {
+ engine.setEnabled(enabled);
+ }
+
+ public boolean getIgnoreUnknownAssertions() {
+ return engine.isIgnoreUnknownAssertions();
+ }
+
+ public void setIgnoreUnknownAssertions(boolean
ignoreUnknownAssertions) {
+ engine.setIgnoreUnknownAssertions(ignoreUnknownAssertions);
+ }
+
+ public AlternativeSelector getAlternativeSelector() {
+ return engine.getAlternativeSelector();
+ }
+
+ public void setAlternativeSelector(AlternativeSelector
alternativeSelector) {
+ engine.setAlternativeSelector(alternativeSelector);
+ }
+ }
+}
Propchange:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyEngineBPDefinitionParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyEngineBPDefinitionParser.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyFeatureBPDefinitionParser.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyFeatureBPDefinitionParser.java?rev=1089633&view=auto
==============================================================================
---
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyFeatureBPDefinitionParser.java
(added)
+++
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyFeatureBPDefinitionParser.java
Wed Apr 6 21:28:49 2011
@@ -0,0 +1,70 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.policy.blueprint;
+
+import java.util.List;
+import org.w3c.dom.Element;
+
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.apache.aries.blueprint.mutable.MutableCollectionMetadata;
+import org.apache.aries.blueprint.mutable.MutablePassThroughMetadata;
+import org.apache.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser;
+import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.ws.policy.WSPolicyFeature;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+public class PolicyFeatureBPDefinitionParser extends
AbstractBPBeanDefinitionParser {
+
+ public Metadata parse(Element element, ParserContext context) {
+
+ MutableCollectionMetadata ps =
context.createMetadata(MutableCollectionMetadata.class);
+ ps.setCollectionClass(List.class);
+
+ MutableCollectionMetadata prs =
context.createMetadata(MutableCollectionMetadata.class);
+ ps.setCollectionClass(List.class);
+
+ MutableBeanMetadata cxfBean =
context.createMetadata(MutableBeanMetadata.class);
+ cxfBean.setRuntimeClass(WSPolicyFeature.class);
+
+ Element elem = DOMUtils.getFirstElement(element);
+ while (elem != null) {
+ if ("Policy".equals(elem.getLocalName())) {
+ ps.addValue(createElement(context, elem));
+ } else if ("PolicyReference".equals(elem.getLocalName())) {
+ prs.addValue(createElement(context, elem));
+ }
+ elem = DOMUtils.getNextElement(elem);
+ }
+ cxfBean.addProperty("policyElements", ps);
+ cxfBean.addProperty("policyReferenceElements", prs);
+
+ super.parseChildElements(element, context, cxfBean);
+
+ return cxfBean;
+ }
+
+ public static Metadata createElement(ParserContext context, Element value)
{
+ MutablePassThroughMetadata anElement =
context.createMetadata(MutablePassThroughMetadata.class);
+ anElement.setObject(value);
+ return anElement;
+ }
+
+}
Propchange:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyFeatureBPDefinitionParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/PolicyFeatureBPDefinitionParser.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/rt/ws/policy/src/main/resources/OSGI-INF/blueprint/policy.xml
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/resources/OSGI-INF/blueprint/policy.xml?rev=1089633&view=auto
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/resources/OSGI-INF/blueprint/policy.xml
(added)
+++ cxf/trunk/rt/ws/policy/src/main/resources/OSGI-INF/blueprint/policy.xml Wed
Apr 6 21:28:49 2011
@@ -0,0 +1,38 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <service interface="org.apache.aries.blueprint.NamespaceHandler">
+ <service-properties>
+ <entry key="osgi.service.blueprint.namespace">
+ <list>
+ <value>http://cxf.apache.org/policy</value>
+ <value>http://www.w3.org/ns/ws-policy</value>
+ <value>http://www.w3.org/2006/07/ws-policy</value>
+ <value>http://schemas.xmlsoap.org/ws/2004/09/policy</value>
+ </list>
+ </entry>
+ </service-properties>
+ <bean class="org.apache.cxf.ws.policy.blueprint.PolicyBPHandler"/>
+ </service>
+</blueprint>
\ No newline at end of file
Propchange:
cxf/trunk/rt/ws/policy/src/main/resources/OSGI-INF/blueprint/policy.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/trunk/rt/ws/policy/src/main/resources/OSGI-INF/blueprint/policy.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
cxf/trunk/rt/ws/policy/src/main/resources/OSGI-INF/blueprint/policy.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: cxf/trunk/rt/ws/policy/src/main/resources/schemas/blueprint/policy.xsd
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/resources/schemas/blueprint/policy.xsd?rev=1089633&view=auto
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/resources/schemas/blueprint/policy.xsd
(added)
+++ cxf/trunk/rt/ws/policy/src/main/resources/schemas/blueprint/policy.xsd Wed
Apr 6 21:28:49 2011
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:beans="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:cxf-beans="http://cxf.apache.org/configuration/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ targetNamespace="http://cxf.apache.org/blueprint/policy"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified" >
+
+ <xsd:import namespace="http://www.osgi.org/xmlns/blueprint/v1.0.0"
schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"/>
+ <xsd:import namespace="http://cxf.apache.org/configuration/beans"
schemaLocation="http://cxf.apache.org/schemas/configuration/cxf-beans.xsd"/>
+
+ <xsd:annotation>
+ <xsd:documentation>
+ This schema defines features and beans to configure the CXF Policy
Framework.
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:element name="policies">
+ <xsd:annotation>
+ <xsd:documentation>
+ The policies feature enables and configures the CXF Policy Framework.
+ It can have any number of Policy or PolicyReference child elements.
+ When this feature applies to a client or service endpoint, these
policies
+ are merged with other policies attached to policy scope that contain
+ the policy subject to obtain the effective policy for the subject.
+ When this feature is applied to the bus, its policies are relevant to
all
+ client and server endpoints created on that bus.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="alternativeSelector" type="xsd:anyType"
minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+ The alternative selector to use when choosing one of multiple
policy alternatives.
+ The child element of this element must be a bean whose bean
class implements
+ org.apache.cxf.ws.policy.selector.AlternativeSelector, or a
reference to such a bean.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="ignoreUnknownAssertions" type="xsd:boolean"
default="false"/>
+ <xsd:attribute name="namespace" type="xsd:string"/>
+ <xsd:attribute name="id" type="xsd:string"/>
+ <xsd:attribute name="enabled" type="xsd:boolean"/>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="engine">
+ <xsd:complexType>
+ <xsd:all>
+ <xsd:element name="alternativeSelector" type="xsd:anyType"
minOccurs="0">
+ <xsd:annotation>
+ <xsd:documentation>
+ The alternative selector to use when choosing one of multiple
policy alternatives.
+ The child element of this element must be a bean whose bean
class implements
+ org.apache.cxf.ws.policy.selector.AlternativeSelector, or a
reference to such a bean.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:all>
+ <!-- xsd:attributeGroup ref="cxf-beans:beanAttributes"/-->
+ <xsd:attribute name="enabled" type="xsd:boolean" default="false">
+ <xsd:annotation>
+ <xsd:documentation>
+ The state of the policy engine.
+ If enabled, the policy interceptors will be added to the
interceptor
+ chains of all messages and faults, and in turn may add feature
specific
+ interceptors depending on the capabilities and requirements of
the
+ underlying message exchange.
+ By default, the engine is turned off.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="ignoreUnknownAssertions" type="xsd:boolean"
default="false">
+ <xsd:annotation>
+ <xsd:documentation>
+ Indicates how to handle assertions for which no
AssertionBuilders are registered.
+ By default, the policy engine throws an Exception upon
encoutering an
+ unknown assertion type. If this attribute is set to true, it
will only
+ log a warning.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="bus" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation>
+ The name of the bus to apply these settings
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="externalAttachment">
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="beans:Tcomponent">
+ <!-- xsd:attributeGroup ref="cxf-beans:beanAttributes"/-->
+ <xsd:attribute name="location" type="xsd:string"
default="http://www.w3.org/2006/07/ws-policy">
+ <xsd:annotation>
+ <xsd:documentation>
+ Location of the external attachment document.
+ It must be specified in form of a Spring Resource type
property, e.g.
+ classpath:etc/policies.xml or
file:/x1/resources/polcies.xml.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+</xsd:schema>
Propchange:
cxf/trunk/rt/ws/policy/src/main/resources/schemas/blueprint/policy.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
cxf/trunk/rt/ws/policy/src/main/resources/schemas/blueprint/policy.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange:
cxf/trunk/rt/ws/policy/src/main/resources/schemas/blueprint/policy.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml