This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 59a36a7fb55014c20f3e8bbb34e791e83f124e72 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue Mar 24 12:11:13 2020 +0100 CAMEL-14775: camel-cxf - Move OSGi blueprint out into camel-cxf-blueprint --- components/camel-cxf/pom.xml | 2 + .../blueprint/AbstractBeanDefinitionParser.java | 62 ------- .../cxf/blueprint/CxfBlueprintEndpoint.java | 80 --------- .../cxf/blueprint/CxfNamespaceHandler.java | 75 --------- .../cxf/blueprint/EndpointDefinitionParser.java | 107 ------------ .../cxf/blueprint/RsClientBlueprintBean.java | 95 ----------- .../cxf/blueprint/RsClientDefinitionParser.java | 93 ----------- .../cxf/blueprint/RsServerBlueprintBean.java | 101 ------------ .../cxf/blueprint/RsServerDefinitionParser.java | 95 ----------- .../cxf/jaxrs/CxfRsBlueprintEndpoint.java | 94 ----------- .../camel/component/cxf/jaxrs/CxfRsComponent.java | 22 ++- .../CxfRsEndpointFactoryBean.java} | 23 ++- .../DefaultCxfRsEndpointFactoryBean.java} | 20 +-- .../resources/OSGI-INF/blueprint/camel-cxf.xml | 31 ---- .../main/resources/schema/blueprint/camel-cxf.xsd | 179 --------------------- 15 files changed, 36 insertions(+), 1043 deletions(-) diff --git a/components/camel-cxf/pom.xml b/components/camel-cxf/pom.xml index 79904fa..4c1a020 100644 --- a/components/camel-cxf/pom.xml +++ b/components/camel-cxf/pom.xml @@ -53,6 +53,8 @@ javax.xml.stream*;version="[0.0,2)", javax.xml.ws*;version="[0.0,3.0)", org.apache.camel.*;${camel.osgi.import.camel.version}, + org.apache.camel.component.cxf.blueprint;${camel.osgi.import.camel.version};resolution:=optional, + org.apache.camel.component.cxf.jaxrs.blueprint;${camel.osgi.import.camel.version};resolution:=optional, org.springframework*;version="${spring-version-range}";resolution:=optional, org.apache.cxf.*;version="${cxf-version-range}", ${camel.osgi.import.defaults}, diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/AbstractBeanDefinitionParser.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/AbstractBeanDefinitionParser.java deleted file mode 100644 index 84c857b..0000000 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/AbstractBeanDefinitionParser.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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.camel.component.cxf.blueprint; - -import java.util.StringTokenizer; - -import org.w3c.dom.Element; - -import org.apache.aries.blueprint.ParserContext; -import org.apache.aries.blueprint.mutable.MutableBeanMetadata; -import org.apache.cxf.common.util.StringUtils; -import org.apache.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser; -import org.osgi.service.blueprint.reflect.BeanMetadata; - -public class AbstractBeanDefinitionParser extends AbstractBPBeanDefinitionParser { - public static String getIdOrName(Element elem) { - String id = elem.getAttribute("id"); - - if (null == id || "".equals(id)) { - String names = elem.getAttribute("name"); - if (null != names) { - StringTokenizer st = new StringTokenizer(names, ","); - if (st.countTokens() > 0) { - id = st.nextToken(); - } - } - } - return id; - } - - public MutableBeanMetadata createBeanMetadata(Element element, ParserContext context, Class<?> runtimeClass) { - MutableBeanMetadata answer = context.createMetadata(MutableBeanMetadata.class); - answer.setRuntimeClass(runtimeClass); - answer.addProperty("blueprintContainer", createRef(context, "blueprintContainer")); - answer.addProperty("bundleContext", createRef(context, "blueprintBundleContext")); - // set the Bean scope to be prototype, so we can get a new instance per looking up - answer.setScope(BeanMetadata.SCOPE_PROTOTYPE); - - if (!StringUtils.isEmpty(getIdOrName(element))) { - answer.setId(getIdOrName(element)); - } else { - // TODO we may need to throw exception for it - answer.setId("camel.cxf.endpoint." + runtimeClass.getSimpleName() + "." + context.generateId()); - } - return answer; - } - -} diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/CxfBlueprintEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/CxfBlueprintEndpoint.java deleted file mode 100644 index 205b879..0000000 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/CxfBlueprintEndpoint.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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.camel.component.cxf.blueprint; - -import org.apache.camel.blueprint.BlueprintCamelContext; -import org.apache.camel.component.cxf.CxfComponent; -import org.apache.camel.component.cxf.CxfEndpoint; -import org.apache.cxf.BusFactory; -import org.osgi.framework.BundleContext; -import org.osgi.service.blueprint.container.BlueprintContainer; - -public class CxfBlueprintEndpoint extends CxfEndpoint { - - private BlueprintContainer blueprintContainer; - private BundleContext bundleContext; - private BlueprintCamelContext blueprintCamelContext; - - public CxfBlueprintEndpoint(String address, BundleContext context) { - super(address, (CxfComponent)null); - bundleContext = context; - } - - public void destroy() { - // Clean up the BusFactory's defaultBus - // This method is not called magically, blueprint - // needs you to set the destroy-method. - BusFactory.setDefaultBus(null); - BusFactory.setThreadDefaultBus(null); - } - - @Override - public void setServiceClass(String n) throws ClassNotFoundException { - setServiceClass(bundleContext.getBundle().loadClass(n)); - } - - // Package private methods - // ------------------------------------------------------------------------- - - public BlueprintContainer getBlueprintContainer() { - return blueprintContainer; - } - - public void setBlueprintContainer(BlueprintContainer blueprintContainer) { - this.blueprintContainer = blueprintContainer; - } - - public BundleContext getBundleContext() { - return bundleContext; - } - - public void setBundleContext(BundleContext bundleContext) { - this.bundleContext = bundleContext; - } - - public BlueprintCamelContext getBlueprintCamelContext() { - return blueprintCamelContext; - } - - public void setBlueprintCamelContext(BlueprintCamelContext blueprintCamelContext) { - this.blueprintCamelContext = blueprintCamelContext; - } - - public CxfBlueprintEndpoint getBean() { - return this; - } -} diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/CxfNamespaceHandler.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/CxfNamespaceHandler.java deleted file mode 100644 index daf240a..0000000 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/CxfNamespaceHandler.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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.camel.component.cxf.blueprint; - -import java.net.URL; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -import org.apache.aries.blueprint.ParserContext; -import org.apache.cxf.helpers.BaseNamespaceHandler; -import org.osgi.service.blueprint.reflect.ComponentMetadata; -import org.osgi.service.blueprint.reflect.Metadata; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class CxfNamespaceHandler extends BaseNamespaceHandler { - private static final Logger LOG = LoggerFactory.getLogger(CxfNamespaceHandler.class); - - @Override - public URL getSchemaLocation(String s) { - if ("http://camel.apache.org/schema/blueprint/cxf".equals(s)) { - return getClass().getClassLoader().getResource("schema/blueprint/camel-cxf.xsd"); - } - return super.findCoreSchemaLocation(s); - } - - @Override - @SuppressWarnings({"rawtypes"}) - public Set<Class> getManagedClasses() { - return new HashSet<>(Arrays.asList(CxfNamespaceHandler.class)); - } - - @Override - public Metadata parse(Element element, ParserContext context) { - Metadata answer = null; - String s = element.getLocalName(); - if ("cxfEndpoint".equals(s)) { - LOG.debug("parsing the cxfEndpoint element"); - answer = new EndpointDefinitionParser().parse(element, context); - } - if ("rsClient".equals(s)) { - LOG.debug("parsing the rsClient element"); - answer = new RsClientDefinitionParser().parse(element, context); - } - if ("rsServer".equals(s)) { - LOG.debug("parsing the rsServer element"); - answer = new RsServerDefinitionParser().parse(element, context); - } - - return answer; - } - - @Override - public ComponentMetadata decorate(Node node, ComponentMetadata componentMetadata, ParserContext parserContext) { - return null; - } -} diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/EndpointDefinitionParser.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/EndpointDefinitionParser.java deleted file mode 100644 index d288f0b..0000000 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/EndpointDefinitionParser.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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.camel.component.cxf.blueprint; - -import javax.xml.namespace.QName; - -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; - -import org.apache.aries.blueprint.ParserContext; -import org.apache.aries.blueprint.mutable.MutableBeanMetadata; -import org.apache.cxf.common.util.StringUtils; -import org.apache.cxf.helpers.DOMUtils; -import org.osgi.framework.BundleContext; -import org.osgi.service.blueprint.reflect.Metadata; - -public class EndpointDefinitionParser extends AbstractBeanDefinitionParser { - - public Metadata parse(Element element, ParserContext context) { - MutableBeanMetadata endpointConfig = createBeanMetadata(element, context, CxfBlueprintEndpoint.class); - - NamedNodeMap atts = element.getAttributes(); - - String bus = null; - String address = null; - - for (int i = 0; i < atts.getLength(); i++) { - Attr node = (Attr) atts.item(i); - String val = node.getValue(); - String pre = node.getPrefix(); - String name = node.getLocalName(); - if ("bus".equals(name)) { - bus = val; - } else if ("address".equals(name)) { - address = val; - } else if (isAttribute(pre, name)) { - if ("endpointName".equals(name) || "serviceName".equals(name)) { - if (isPlaceHolder(val)) { - endpointConfig.addProperty(name + "String", createValue(context, val)); - } else { - QName q = parseQName(element, val); - endpointConfig.addProperty(name, createValue(context, q)); - } - } else if ("depends-on".equals(name)) { - endpointConfig.addDependsOn(val); - } else if (!"name".equals(name)) { - endpointConfig.addProperty(name, createValue(context, val)); - } - } - } - - Element elem = DOMUtils.getFirstElement(element); - while (elem != null) { - String name = elem.getLocalName(); - if ("properties".equals(name)) { - Metadata map = parseMapData(context, endpointConfig, elem); - endpointConfig.addProperty(name, map); - } else if ("binding".equals(name)) { - setFirstChildAsProperty(elem, context, endpointConfig, "bindingConfig"); - } else if ("inInterceptors".equals(name) || "inFaultInterceptors".equals(name) || "outInterceptors".equals(name) - || "outFaultInterceptors".equals(name) || "features".equals(name) || "schemaLocations".equals(name) || "handlers".equals(name)) { - Metadata list = parseListData(context, endpointConfig, elem); - endpointConfig.addProperty(name, list); - } else { - setFirstChildAsProperty(elem, context, endpointConfig, name); - } - - elem = DOMUtils.getNextElement(elem); - } - if (StringUtils.isEmpty(bus)) { - bus = "cxf"; - } - //Will create a bus if needed... - - endpointConfig.addProperty("bus", getBusRef(context, bus)); - endpointConfig.setDestroyMethod("destroy"); - endpointConfig.addArgument(createValue(context, address), String.class.getName(), 0); - endpointConfig.addArgument(createRef(context, "blueprintBundleContext"), - BundleContext.class.getName(), 1); - - return endpointConfig; - } - - private static boolean isPlaceHolder(String value) { - if (value != null && (value.startsWith("${") && value.endsWith("}") - || value.startsWith("{{") && value.endsWith("}}"))) { - return true; - } - return false; - } - -} diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientBlueprintBean.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientBlueprintBean.java deleted file mode 100644 index 5b00526..0000000 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientBlueprintBean.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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.camel.component.cxf.blueprint; - -import java.util.HashMap; - -import org.apache.camel.component.cxf.NullFaultListener; -import org.apache.cxf.ext.logging.LoggingFeature; -import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean; -import org.apache.cxf.logging.FaultListener; -import org.osgi.framework.BundleContext; -import org.osgi.service.blueprint.container.BlueprintContainer; - -public class RsClientBlueprintBean extends JAXRSClientFactoryBean implements BlueprintSupport, Cloneable { - private BlueprintContainer blueprintContainer; - private BundleContext bundleContext; - private int loggingSizeLimit; - private LoggingFeature loggingFeature; - - @Override - public BlueprintContainer getBlueprintContainer() { - return blueprintContainer; - } - - @Override - public void setBlueprintContainer(BlueprintContainer blueprintContainer) { - this.blueprintContainer = blueprintContainer; - } - - @Override - public BundleContext getBundleContext() { - return bundleContext; - } - - @Override - public void setBundleContext(BundleContext bundleContext) { - this.bundleContext = bundleContext; - } - - public boolean isLoggingFeatureEnabled() { - return loggingFeature != null; - } - - public void setLoggingFeatureEnabled(boolean loggingFeatureEnabled) { - if (loggingFeature != null) { - getFeatures().remove(loggingFeature); - loggingFeature = null; - } - if (loggingFeatureEnabled) { - loggingFeature = new LoggingFeature(); - if (getLoggingSizeLimit() > 0) { - loggingFeature.setLimit(getLoggingSizeLimit()); - } - getFeatures().add(loggingFeature); - } - - } - - public int getLoggingSizeLimit() { - return loggingSizeLimit; - } - - public void setLoggingSizeLimit(int loggingSizeLimit) { - this.loggingSizeLimit = loggingSizeLimit; - if (loggingFeature != null) { - if (loggingSizeLimit > 0) { - loggingFeature.setLimit(loggingSizeLimit); - } - } - } - - public void setSkipFaultLogging(boolean skipFaultLogging) { - if (skipFaultLogging) { - if (this.getProperties() == null) { - this.setProperties(new HashMap<String, Object>()); - } - this.getProperties().put(FaultListener.class.getName(), new NullFaultListener()); - } - } - -} diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientDefinitionParser.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientDefinitionParser.java deleted file mode 100644 index 52351bc..0000000 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientDefinitionParser.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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.camel.component.cxf.blueprint; - -import java.util.List; - -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; - -import org.apache.aries.blueprint.ParserContext; -import org.apache.aries.blueprint.mutable.MutableBeanMetadata; -import org.apache.aries.blueprint.mutable.MutablePassThroughMetadata; -import org.apache.cxf.common.util.StringUtils; -import org.apache.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser; -import org.apache.cxf.helpers.DOMUtils; -import org.apache.cxf.jaxrs.model.UserResource; -import org.apache.cxf.jaxrs.utils.ResourceUtils; -import org.osgi.service.blueprint.reflect.Metadata; - -public class RsClientDefinitionParser extends AbstractBeanDefinitionParser { - - public Metadata parse(Element element, ParserContext context) { - MutableBeanMetadata beanMetadata = createBeanMetadata(element, context, RsClientBlueprintBean.class); - NamedNodeMap atts = element.getAttributes(); - - String bus = null; - for (int i = 0; i < atts.getLength(); i++) { - Attr node = (Attr) atts.item(i); - String val = node.getValue(); - String pre = node.getPrefix(); - String name = node.getLocalName(); - if ("bus".equals(name)) { - bus = val; - } else if (isAttribute(pre, name)) { - if ("depends-on".equals(name)) { - beanMetadata.addDependsOn(val); - } else if (!"name".equals(name)) { - beanMetadata.addProperty(name, AbstractBPBeanDefinitionParser.createValue(context, val)); - } - } - } - - for (Element elem = DOMUtils.getFirstElement(element); elem != null; elem = DOMUtils.getNextElement(elem)) { - String name = elem.getLocalName(); - if ("properties".equals(name) || "headers".equals(name)) { - Metadata map = parseMapData(context, beanMetadata, elem); - beanMetadata.addProperty(name, map); - } else if ("binding".equals(name)) { - setFirstChildAsProperty(elem, context, beanMetadata, "bindingConfig"); - } else if ("inInterceptors".equals(name) || "inFaultInterceptors".equals(name) || "outInterceptors".equals(name) - || "outFaultInterceptors".equals(name) || "features".equals(name) || "schemaLocations".equals(name) || "handlers".equals(name)) { - Metadata list = parseListData(context, beanMetadata, elem); - beanMetadata.addProperty(name, list); - } else if ("features".equals(name) || "providers".equals(name) - || "schemaLocations".equals(name) || "modelBeans".equals(name)) { - Metadata list = parseListData(context, beanMetadata, elem); - beanMetadata.addProperty(name, list); - } else if ("model".equals(name)) { - List<UserResource> resources = ResourceUtils.getResourcesFromElement(elem); - MutablePassThroughMetadata value = context.createMetadata(MutablePassThroughMetadata.class); - value.setObject(resources); - beanMetadata.addProperty(name, value); - } else { - setFirstChildAsProperty(elem, context, beanMetadata, name); - } - } - - if (StringUtils.isEmpty(bus)) { - bus = "cxf"; - } - //Will create a bus if needed... - - beanMetadata.addProperty("bus", getBusRef(context, bus)); - return beanMetadata; - } - - -} diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsServerBlueprintBean.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsServerBlueprintBean.java deleted file mode 100644 index 64fb07a..0000000 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsServerBlueprintBean.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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.camel.component.cxf.blueprint; - -import java.util.HashMap; - -import org.apache.camel.component.cxf.NullFaultListener; -import org.apache.cxf.feature.LoggingFeature; -import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; -import org.apache.cxf.logging.FaultListener; -import org.osgi.framework.BundleContext; -import org.osgi.service.blueprint.container.BlueprintContainer; - -public class RsServerBlueprintBean extends JAXRSServerFactoryBean implements BlueprintSupport, Cloneable { - - private BlueprintContainer blueprintContainer; - private BundleContext bundleContext; - private LoggingFeature loggingFeature; - private int loggingSizeLimit; - - @Override - public BlueprintContainer getBlueprintContainer() { - return blueprintContainer; - } - - @Override - public void setBlueprintContainer(BlueprintContainer blueprintContainer) { - this.blueprintContainer = blueprintContainer; - } - - @Override - public BundleContext getBundleContext() { - return bundleContext; - } - - @Override - public void setBundleContext(BundleContext bundleContext) { - this.bundleContext = bundleContext; - } - - public boolean isLoggingFeatureEnabled() { - return loggingFeature != null; - } - - public void setLoggingFeatureEnabled(boolean loggingFeatureEnabled) { - if (loggingFeature != null) { - getFeatures().remove(loggingFeature); - loggingFeature = null; - } - if (loggingFeatureEnabled) { - if (getLoggingSizeLimit() > 0) { - loggingFeature = new LoggingFeature(getLoggingSizeLimit()); - } else { - loggingFeature = new LoggingFeature(); - } - getFeatures().add(loggingFeature); - } - - } - - public int getLoggingSizeLimit() { - return loggingSizeLimit; - } - - public void setLoggingSizeLimit(int loggingSizeLimit) { - this.loggingSizeLimit = loggingSizeLimit; - if (loggingFeature != null) { - getFeatures().remove(loggingFeature); - if (loggingSizeLimit > 0) { - loggingFeature = new LoggingFeature(loggingSizeLimit); - } else { - loggingFeature = new LoggingFeature(); - } - getFeatures().add(loggingFeature); - } - } - - public void setSkipFaultLogging(boolean skipFaultLogging) { - if (skipFaultLogging) { - if (this.getProperties() == null) { - this.setProperties(new HashMap<String, Object>()); - } - this.getProperties().put(FaultListener.class.getName(), new NullFaultListener()); - } - } - -} diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsServerDefinitionParser.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsServerDefinitionParser.java deleted file mode 100644 index acbc086..0000000 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsServerDefinitionParser.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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.camel.component.cxf.blueprint; - -import java.util.List; - -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; - -import org.apache.aries.blueprint.ParserContext; -import org.apache.aries.blueprint.mutable.MutableBeanMetadata; -import org.apache.aries.blueprint.mutable.MutablePassThroughMetadata; -import org.apache.cxf.common.util.StringUtils; -import org.apache.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser; -import org.apache.cxf.helpers.DOMUtils; -import org.apache.cxf.jaxrs.model.UserResource; -import org.apache.cxf.jaxrs.utils.ResourceUtils; -import org.osgi.service.blueprint.reflect.Metadata; - -public class RsServerDefinitionParser extends AbstractBeanDefinitionParser { - - public Metadata parse(Element element, ParserContext context) { - MutableBeanMetadata beanMetadata = createBeanMetadata(element, context, RsServerBlueprintBean.class); - NamedNodeMap atts = element.getAttributes(); - - String bus = null; - for (int i = 0; i < atts.getLength(); i++) { - Attr node = (Attr) atts.item(i); - String val = node.getValue(); - String pre = node.getPrefix(); - String name = node.getLocalName(); - if ("bus".equals(name)) { - bus = val; - } else if (isAttribute(pre, name)) { - if ("depends-on".equals(name)) { - beanMetadata.addDependsOn(val); - } else if (!"name".equals(name)) { - beanMetadata.addProperty(name, AbstractBPBeanDefinitionParser.createValue(context, val)); - } - } - } - - for (Element elem = DOMUtils.getFirstElement(element); elem != null; elem = DOMUtils.getNextElement(elem)) { - String name = elem.getLocalName(); - if ("properties".equals(name) - || "extensionMappings".equals(name) - || "languageMappings".equals(name)) { - Metadata map = parseMapData(context, beanMetadata, elem); - beanMetadata.addProperty(name, map); - } else if ("binding".equals(name)) { - setFirstChildAsProperty(elem, context, beanMetadata, "bindingConfig"); - } else if ("inInterceptors".equals(name) || "inFaultInterceptors".equals(name) || "outInterceptors".equals(name) - || "outFaultInterceptors".equals(name) || "features".equals(name) || "schemaLocations".equals(name) || "handlers".equals(name)) { - Metadata list = parseListData(context, beanMetadata, elem); - beanMetadata.addProperty(name, list); - } else if ("features".equals(name) || "providers".equals(name) - || "schemaLocations".equals(name) || "modelBeans".equals(name) - || "serviceBeans".equals(name)) { - Metadata list = parseListData(context, beanMetadata, elem); - beanMetadata.addProperty(name, list); - } else if ("model".equals(name)) { - List<UserResource> resources = ResourceUtils.getResourcesFromElement(elem); - MutablePassThroughMetadata value = context.createMetadata(MutablePassThroughMetadata.class); - value.setObject(resources); - beanMetadata.addProperty(name, value); - } else { - setFirstChildAsProperty(elem, context, beanMetadata, name); - } - } - - if (StringUtils.isEmpty(bus)) { - bus = "cxf"; - } - //Will create a bus if needed... - - beanMetadata.addProperty("bus", getBusRef(context, bus)); - return beanMetadata; - } - -} diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java deleted file mode 100644 index ddf6c35..0000000 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsBlueprintEndpoint.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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.camel.component.cxf.jaxrs; - -import org.apache.camel.Component; -import org.apache.camel.blueprint.BlueprintCamelContext; -import org.apache.camel.component.cxf.blueprint.BlueprintSupport; -import org.apache.camel.component.cxf.blueprint.RsClientBlueprintBean; -import org.apache.camel.component.cxf.blueprint.RsServerBlueprintBean; -import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean; -import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; -import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean; -import org.osgi.framework.BundleContext; -import org.osgi.service.blueprint.container.BlueprintContainer; -import org.springframework.util.ReflectionUtils; - -public class CxfRsBlueprintEndpoint extends CxfRsEndpoint { - private AbstractJAXRSFactoryBean bean; - private BlueprintContainer blueprintContainer; - private BundleContext bundleContext; - private BlueprintCamelContext blueprintCamelContext; - - public CxfRsBlueprintEndpoint(Component comp, String uri, AbstractJAXRSFactoryBean bean) { - super(uri, comp); - this.bean = bean; - setAddress(bean.getAddress()); - // update the sfb address by resolving the properties - bean.setAddress(getAddress()); - BlueprintSupport support = (BlueprintSupport)bean; - setBlueprintContainer(support.getBlueprintContainer()); - setBundleContext(support.getBundleContext()); - } - - public BlueprintContainer getBlueprintContainer() { - return blueprintContainer; - } - - public void setBlueprintContainer(BlueprintContainer blueprintContainer) { - this.blueprintContainer = blueprintContainer; - } - - public BundleContext getBundleContext() { - return bundleContext; - } - - public void setBundleContext(BundleContext bundleContext) { - this.bundleContext = bundleContext; - } - - public BlueprintCamelContext getBlueprintCamelContext() { - return blueprintCamelContext; - } - - public void setBlueprintCamelContext(BlueprintCamelContext blueprintCamelContext) { - this.blueprintCamelContext = blueprintCamelContext; - } - - @Override - protected JAXRSServerFactoryBean newJAXRSServerFactoryBean() { - checkBeanType(bean, JAXRSServerFactoryBean.class); - return (RsServerBlueprintBean)bean; - } - - @Override - protected JAXRSClientFactoryBean newJAXRSClientFactoryBean() { - checkBeanType(bean, JAXRSClientFactoryBean.class); - return newInstanceWithCommonProperties(); - } - - private RsClientBlueprintBean newInstanceWithCommonProperties() { - RsClientBlueprintBean cfb = new RsClientBlueprintBean(); - - if (bean instanceof RsClientBlueprintBean) { - ReflectionUtils.shallowCopyFieldState(bean, cfb); - } - - return cfb; - } - -} diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java index 7836551..7676135 100644 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java +++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java @@ -23,7 +23,6 @@ import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.Endpoint; import org.apache.camel.SSLContextParametersAware; -import org.apache.camel.component.cxf.blueprint.BlueprintSupport; import org.apache.camel.component.cxf.common.message.CxfConstants; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.annotations.Component; @@ -54,8 +53,14 @@ public class CxfRsComponent extends HeaderFilterStrategyComponent implements SSL } @Override - protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { + protected void doStart() throws Exception { + super.doStart(); + + // lookup + } + @Override + protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { CxfRsEndpoint answer; Object value = parameters.remove("setDefaultBus"); @@ -66,7 +71,6 @@ public class CxfRsComponent extends HeaderFilterStrategyComponent implements SSL } } - if (remaining.startsWith(CxfConstants.SPRING_CONTEXT_ENDPOINT)) { // Get the bean from the Spring context String beanId = remaining.substring(CxfConstants.SPRING_CONTEXT_ENDPOINT.length()); @@ -76,11 +80,17 @@ public class CxfRsComponent extends HeaderFilterStrategyComponent implements SSL AbstractJAXRSFactoryBean bean = CamelContextHelper.mandatoryLookup(getCamelContext(), beanId, AbstractJAXRSFactoryBean.class); - if (bean instanceof BlueprintSupport) { - answer = new CxfRsBlueprintEndpoint(this, remaining, bean); + + CxfRsEndpointFactoryBean factory = null; + if (bean.getClass().getName().contains("blueprint")) { + // use blueprint + Class<CxfRsEndpointFactoryBean> clazz = getCamelContext().getClassResolver().resolveMandatoryClass("org.apache.camel.component.cxf.jaxrs.blueprint.CxfRsBlueprintEndpointFactoryBean", CxfRsEndpointFactoryBean.class); + factory = getCamelContext().getInjector().newInstance(clazz); } else { - answer = new CxfRsSpringEndpoint(this, remaining, bean); + factory = new DefaultCxfRsEndpointFactoryBean(); } + answer = factory.createEndpoint(this, remaining, bean); + // Apply Spring bean properties (including # notation referenced bean). Note that the // Spring bean properties values can be overridden by property defined in URI query. // The super class (DefaultComponent) will invoke "setProperties" after this method diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/BlueprintSupport.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointFactoryBean.java similarity index 65% copy from components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/BlueprintSupport.java copy to components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointFactoryBean.java index c6118d6..50eb48a 100644 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/BlueprintSupport.java +++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpointFactoryBean.java @@ -14,19 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.cxf.blueprint; +package org.apache.camel.component.cxf.jaxrs; -import org.osgi.framework.BundleContext; -import org.osgi.service.blueprint.container.BlueprintContainer; +import org.apache.camel.Component; +import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean; -public interface BlueprintSupport { - - void setBlueprintContainer(BlueprintContainer blueprintContainer); - - BlueprintContainer getBlueprintContainer(); - - BundleContext getBundleContext(); - - void setBundleContext(BundleContext bundleContext); +/** + * SPI factory bean for creating {@link CxfRsEndpoint}. + */ +public interface CxfRsEndpointFactoryBean { + + CxfRsEndpoint createEndpoint(Component component, String uri, AbstractJAXRSFactoryBean bean) throws Exception; -} +} \ No newline at end of file diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/BlueprintSupport.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsEndpointFactoryBean.java similarity index 65% rename from components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/BlueprintSupport.java rename to components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsEndpointFactoryBean.java index c6118d6..995a251 100644 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/BlueprintSupport.java +++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/DefaultCxfRsEndpointFactoryBean.java @@ -14,19 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.component.cxf.blueprint; +package org.apache.camel.component.cxf.jaxrs; -import org.osgi.framework.BundleContext; -import org.osgi.service.blueprint.container.BlueprintContainer; +import org.apache.camel.Component; +import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean; -public interface BlueprintSupport { - - void setBlueprintContainer(BlueprintContainer blueprintContainer); - - BlueprintContainer getBlueprintContainer(); - - BundleContext getBundleContext(); - - void setBundleContext(BundleContext bundleContext); +public class DefaultCxfRsEndpointFactoryBean implements CxfRsEndpointFactoryBean { + @Override + public CxfRsEndpoint createEndpoint(Component component, String uri, AbstractJAXRSFactoryBean bean) throws Exception { + return new CxfRsSpringEndpoint(component, uri, bean); + } } diff --git a/components/camel-cxf/src/main/resources/OSGI-INF/blueprint/camel-cxf.xml b/components/camel-cxf/src/main/resources/OSGI-INF/blueprint/camel-cxf.xml deleted file mode 100644 index ab14595..0000000 --- a/components/camel-cxf/src/main/resources/OSGI-INF/blueprint/camel-cxf.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?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. - ---> -<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 https://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" value="http://camel.apache.org/schema/blueprint/cxf"/> - </service-properties> - <bean class="org.apache.camel.component.cxf.blueprint.CxfNamespaceHandler"/> - </service> -</blueprint> diff --git a/components/camel-cxf/src/main/resources/schema/blueprint/camel-cxf.xsd b/components/camel-cxf/src/main/resources/schema/blueprint/camel-cxf.xsd deleted file mode 100644 index fe9d99b..0000000 --- a/components/camel-cxf/src/main/resources/schema/blueprint/camel-cxf.xsd +++ /dev/null @@ -1,179 +0,0 @@ -<?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="http://camel.apache.org/schema/blueprint/cxf" - 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://camel.apache.org/schema/blueprint/cxf" - elementFormDefault="qualified" - attributeFormDefault="unqualified" - xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"> - - <xsd:import namespace="http://www.osgi.org/xmlns/blueprint/v1.0.0" schemaLocation="https://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:element name="cxfEndpoint"> - <xsd:complexType> - <xsd:complexContent> - <xsd:extension base="beans:Tcomponent"> - <xsd:all> - <xsd:element name="binding" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="dataBinding" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="features" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="inInterceptors" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="inFaultInterceptors" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="outInterceptors" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="outFaultInterceptors" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="handlers" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="properties" type="beans:Tmap" minOccurs="0"/> - <xsd:element name="schemaLocations" type="schemasType" minOccurs="0"/> - <xsd:element name="serviceBean" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="serviceFactory" type="xsd:anyType" minOccurs="0"/> - </xsd:all> - <!-- xsd:attributeGroup ref="cxf-beans:beanAttributes"/--> - <xsd:attribute name="address" type="xsd:string"/> - <xsd:attribute name="bindingId" type="xsd:string"/> - <xsd:attribute name="bus" type="xsd:string"/> - <xsd:attribute name="serviceClass" type="xsd:string"/> - <xsd:attribute name="transportId" type="xsd:string"/> - <xsd:attribute name="wsdlURL" type="xsd:string"/> - <xsd:attribute name="endpointName" type="xsd:QName"/> - <xsd:attribute name="serviceName" type="xsd:QName"/> - <xsd:attribute name="loggingFeatureEnabled" type="xsd:boolean"/> - <xsd:attribute name="loggingSizeLimit" type="xsd:integer" /> - <xsd:attribute name="continuationTimeout" type="xsd:long" /> - <xsd:attribute name="publishedEndpointUrl" type="xsd:string" /> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - - <xsd:element name="rsServer"> - <xsd:complexType> - <xsd:complexContent> - <xsd:extension base="beans:Tcomponent"> - <xsd:all> - <xsd:element name="executor" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="features" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="binding" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="inInterceptors" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="inFaultInterceptors" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="invoker" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="outInterceptors" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="outFaultInterceptors" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="properties" type="beans:Tmap" minOccurs="0"/> - <xsd:element name="serviceBeans" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="modelBeans" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="model" type="model" minOccurs="0"/> - <xsd:element name="providers" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="extensionMappings" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="languageMappings" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="schemaLocations" type="schemasType" minOccurs="0"/> - </xsd:all> - <!-- xsd:attributeGroup ref="cxf-beans:beanAttributes"/--> - <xsd:attribute name="address" type="xsd:string"/> - <xsd:attribute name="bus" type="xsd:string"/> - <xsd:attribute name="serviceClass" type="xsd:string"/> - <xsd:attribute name="transportId" type="xsd:string"/> - <xsd:attribute name="modelRef" type="xsd:string"/> - <xsd:attribute name="bindingId" type="xsd:string"/> - <xsd:attribute name="staticSubresourceResolution" type="xsd:boolean"/> - <xsd:attribute name="loggingFeatureEnabled" type="xsd:boolean"/> - <xsd:attribute name="loggingSizeLimit" type="xsd:integer" /> - <xsd:attribute name="publishedEndpointUrl" type="xsd:string" /> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - - <xsd:element name="rsClient"> - <xsd:complexType> - <xsd:complexContent> - <xsd:extension base="beans:Tcomponent"> - <xsd:all> - <xsd:element name="executor" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="features" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="binding" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="inInterceptors" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="inFaultInterceptors" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="outInterceptors" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="outFaultInterceptors" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="properties" type="beans:Tmap" minOccurs="0"/> - <xsd:element name="providers" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="modelBeans" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="model" type="model" minOccurs="0"/> - <xsd:element name="headers" type="xsd:anyType" minOccurs="0"/> - <xsd:element name="schemaLocations" type="schemasType" minOccurs="0"/> - </xsd:all> - <!-- xsd:attributeGroup ref="cxf-beans:beanAttributes"/--> - <xsd:attribute name="address" type="xsd:string"/> - <xsd:attribute name="serviceClass" type="xsd:string"/> - <xsd:attribute name="inheritHeaders" type="xsd:boolean"/> - <xsd:attribute name="bus" type="xsd:string"/> - <xsd:attribute name="transportId" type="xsd:string"/> - <xsd:attribute name="bindingId" type="xsd:string"/> - <xsd:attribute name="modelRef" type="xsd:string"/> - <xsd:attribute name="username" type="xsd:string"/> - <xsd:attribute name="password" type="xsd:string"/> - <xsd:attribute name="loggingFeatureEnabled" type="xsd:boolean"/> - <xsd:attribute name="loggingSizeLimit" type="xsd:integer" /> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - - <xsd:complexType name="schemasType"> - <xsd:sequence> - <xsd:element name="schemaLocation" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> - </xsd:sequence> - </xsd:complexType> - - <xsd:complexType name="model"> - <xsd:sequence> - <xsd:element name="resource" minOccurs="0" maxOccurs="unbounded"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="operation" minOccurs="0" maxOccurs="unbounded"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="param" minOccurs="0" maxOccurs="unbounded"> - <xsd:complexType> - <xsd:attribute name="name" type="xsd:string"/> - <xsd:attribute name="type" type="xsd:string"/> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string"/> - <xsd:attribute name="path" type="xsd:string"/> - <xsd:attribute name="verb" type="xsd:string"/> - <xsd:attribute name="consumes" type="xsd:string"/> - <xsd:attribute name="produces" type="xsd:string"/> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string"/> - <xsd:attribute name="path" type="xsd:string"/> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - <xsd:attribute name="id" type="xsd:string"/> - </xsd:complexType> -</xsd:schema>