OSGI-INF.blueprint.blueprint.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quickstart-karaf-cxf-rest Show documentation
Show all versions of quickstart-karaf-cxf-rest Show documentation
RESTful WebService Example using JAX-RS with Karaf
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 2005-2015 Red Hat, Inc. Red Hat 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. --> <!-- This is the OSGi Blueprint XML file defining the CXF JAX-RS beans. Because the file is in the OSGI-INF/blueprint directory inside our JAR, it will be automatically activated as soon as the artifact is installed. The root element for any OSGi Blueprint file is 'blueprint' - you also see the namespace definitions for both the Blueprint and the CXF JAX-RS namespaces. --> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs" xmlns:cxf="http://cxf.apache.org/blueprint/core" xsi:schemaLocation=" http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://cxf.apache.org/blueprint/jaxrs http://cxf.apache.org/schemas/blueprint/jaxrs.xsd http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd"> <!-- The <jaxrs:server/> element sets up our JAX-RS services. It defines: - the server's address, '/crm', relative to the default CXF servlet URI with the default settings, the server will be running on 'http://localhost:8181/cxf/crm' - a list of service beans in this example, we refer to another bean defined in this Blueprint XML file with a <ref/> element --> <jaxrs:server id="customerService" address="/crm"> <jaxrs:serviceBeans> <ref component-id="customerSvc"/> </jaxrs:serviceBeans> </jaxrs:server> <cxf:bus> <cxf:features> <cxf:logging /> </cxf:features> </cxf:bus> <!-- We are using the OSGi Blueprint XML syntax to define a bean that we referred to in our JAX-RS server setup. This bean carries a set of JAX-RS annotations that allow its methods to be mapped to incoming requests. --> <bean id="customerSvc" class="io.fabric8.quickstarts.rest.CustomerService"/> </blueprint>