Repository: cxf Updated Branches: refs/heads/master 621e3a799 -> 816e1a5ef
[CXF-5962] add a separate plain blueprint version Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/816e1a5e Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/816e1a5e Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/816e1a5e Branch: refs/heads/master Commit: 816e1a5ef4c0992a7d084a0529e42d9ad6a4a3c6 Parents: 621e3a7 Author: Akitoshi Yoshida <[email protected]> Authored: Fri Aug 22 16:11:51 2014 +0200 Committer: Akitoshi Yoshida <[email protected]> Committed: Fri Aug 22 16:12:37 2014 +0200 ---------------------------------------------------------------------- .../samples/logbrowser-blueprint/README.txt | 32 +++++++ .../samples/logbrowser-blueprint/pom.xml | 93 ++++++++++++++++++++ .../resources/OSGI-INF/blueprint/context.xml | 54 ++++++++++++ .../main/release/samples/logbrowser/README.txt | 10 ++- rt/management-web/pom.xml | 5 ++ 5 files changed, 191 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/816e1a5e/distribution/src/main/release/samples/logbrowser-blueprint/README.txt ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/logbrowser-blueprint/README.txt b/distribution/src/main/release/samples/logbrowser-blueprint/README.txt new file mode 100644 index 0000000..c7aa735 --- /dev/null +++ b/distribution/src/main/release/samples/logbrowser-blueprint/README.txt @@ -0,0 +1,32 @@ +Building and running the logbrowser-blueprint demo on Karaf +---------------------------------------------------- + +From the base directory of this sample (i.e., where this README file is +located), the pom.xml file is used to build and run the demo. + +Using either UNIX or Windows: + +0) Build the project by typing: + mvn clean install + +This sample project generates a bundle file which can be used in an OSGi container. + +Assuming you have a freshly intalled Apache Karaf-3.x, +1) Start Karaf and at its console, type(*Note) + feature:repo-add cxf 3.0.2 + feature:install cxf-management-web + install -s mvn:org.apache.cxf.samples/logbrowser-blueprint/3.0.2 + +2) Open browser and go to: + http://localhost:8181/cxf/samples/logbrowser/browser/LogBrowser.html + +3) Add a new endpoint with URL: + http://localhost:8181/cxf/samples/logbrowser/logs + +4) To generate custom log entry, run some CXF scenarios that write some logs. + +*Note: +- CXF version 3.0.2 is used in this example, but any verions that include this +sample code may be used. +- The default logging setting is set to org.apache.cxf:INFO. This can be changed +in the configuration file org.apache.cxf.samples.logbrowser.cfg file in etc/. http://git-wip-us.apache.org/repos/asf/cxf/blob/816e1a5e/distribution/src/main/release/samples/logbrowser-blueprint/pom.xml ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/logbrowser-blueprint/pom.xml b/distribution/src/main/release/samples/logbrowser-blueprint/pom.xml new file mode 100644 index 0000000..c99fddc --- /dev/null +++ b/distribution/src/main/release/samples/logbrowser-blueprint/pom.xml @@ -0,0 +1,93 @@ +<?xml version="1.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. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <artifactId>logbrowser-blueprint</artifactId> + <packaging>bundle</packaging> + <name>Apache CXF Samples LogBrowser Blueprint</name> + <description>Apacher CXF Samples LogBrowser Blueprint</description> + <parent> + <groupId>org.apache.cxf.samples</groupId> + <artifactId>cxf-samples</artifactId> + <version>3.1.0-SNAPSHOT</version> + <relativePath>..</relativePath> + </parent> + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <instructions> + <Bundle-SymbolicName>${project.groupId}.${project.artifactId};blueprint.aries.xml-validation:=false</Bundle-SymbolicName> + <Import-Package> + org.apache.cxf.jaxrs.servlet, + org.apache.abdera.parser.stax, + com.ctc.wstx.stax, + org.apache.abdera, + * + </Import-Package> + </instructions> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-management-web</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-rs-extension-providers</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-rs-extension-search</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-transports-http-jetty</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.abdera</groupId> + <artifactId>abdera-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.abdera</groupId> + <artifactId>abdera-parser</artifactId> + <exclusions> + <exclusion> + <groupId>org.apache.james</groupId> + <artifactId>apache-mime4j-core</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-webapp</artifactId> + </dependency> + </dependencies> +</project> http://git-wip-us.apache.org/repos/asf/cxf/blob/816e1a5e/distribution/src/main/release/samples/logbrowser-blueprint/src/main/resources/OSGI-INF/blueprint/context.xml ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/logbrowser-blueprint/src/main/resources/OSGI-INF/blueprint/context.xml b/distribution/src/main/release/samples/logbrowser-blueprint/src/main/resources/OSGI-INF/blueprint/context.xml new file mode 100644 index 0000000..43d5530 --- /dev/null +++ b/distribution/src/main/release/samples/logbrowser-blueprint/src/main/resources/OSGI-INF/blueprint/context.xml @@ -0,0 +1,54 @@ +<?xml version="1.0"?> +<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:cxf="http://cxf.apache.org/blueprint/core" + xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs" + xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0" + + 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/core http://cxf.apache.org/schemas/blueprint/core.xsd + http://cxf.apache.org/blueprint/jaxrs http://cxf.apache.org/schemas/blueprint/jaxrs.xsd + http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd"> + + <cm:property-placeholder id="props" persistent-id="org.apache.cxf.samples.logbrowser" update-strategy="reload"> + <cm:default-properties> + <cm:property name="logger" value="org.apache.cxf:INFO" /> + </cm:default-properties> + </cm:property-placeholder> + + <bean id="bs-sxs" class="org.apache.cxf.management.web.browser.bootstrapping.SimpleXMLSettingsStorage" /> + + <bean id="bs" class="org.apache.cxf.management.web.browser.bootstrapping.BootstrapStorage"> + <argument ref="bs-sxs" index="0"/> + </bean> + + <bean id="bs-sfp" class="org.apache.cxf.management.web.browser.bootstrapping.BootstrapStorage$StaticFileProvider" /> + + <bean id="bs-sp" class="org.apache.cxf.management.web.browser.bootstrapping.BootstrapStorage$SettingsProvider" /> + + <bean id="scp" class="org.apache.cxf.jaxrs.ext.search.SearchContextProvider" /> + + <bean id="aps" class="org.apache.cxf.management.web.logging.atom.AtomPullServer" init-method="init"> + <property name="loggers" value="${logger}"/> + </bean> + + <bean id="afp" class="org.apache.cxf.jaxrs.provider.atom.AtomFeedProvider" /> + + <bean id="aep" class="org.apache.cxf.jaxrs.provider.atom.AtomEntryProvider" /> + + <jaxrs:server id="serviceEndpoint" address="/samples/logbrowser"> + <jaxrs:serviceBeans> + <ref component-id="aps" /> + <ref component-id="bs" /> + </jaxrs:serviceBeans> + <jaxrs:providers> + <ref component-id="bs-sfp" /> + <ref component-id="bs-sp" /> + <ref component-id="scp" /> + <ref component-id="afp" /> + <ref component-id="aep" /> + </jaxrs:providers> + </jaxrs:server> + +</blueprint> http://git-wip-us.apache.org/repos/asf/cxf/blob/816e1a5e/distribution/src/main/release/samples/logbrowser/README.txt ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/logbrowser/README.txt b/distribution/src/main/release/samples/logbrowser/README.txt index 912ba46..454838f 100644 --- a/distribution/src/main/release/samples/logbrowser/README.txt +++ b/distribution/src/main/release/samples/logbrowser/README.txt @@ -25,10 +25,10 @@ or even in an OSGi container. Assuming you have a freshly intalled Apache Karaf-3.x, 1) Start Karaf and at its console, type(*Note) - feature:repo-add cxf 3.m.n + feature:repo-add cxf 3.0.2 feature:install war feature:install cxf-management-web - install -s mvn:org.apache.cxf.samples/logbrowser/3.1.0-SNAPSHOT/war + install -s mvn:org.apache.cxf.samples/logbrowser/3.0.2/war 2) Open browser and go to: http://localhost:8181/cxf-samples-logbrowser/log/browser/LogBrowser.html @@ -38,8 +38,12 @@ Assuming you have a freshly intalled Apache Karaf-3.x, http://localhost:8181/cxf-samples-logbrowser/customer-service.html *Note: -- 3.m.n corresponding the CXF's version numbers (e.g., 3.1.0, 3.0.2, etc) +- CXF version 3.0.2 is used in this example, but any verions that include this +sample code may be used. - As this web.xml registers two CXFServlets (one for the browsing the log and the other for providing the test service), OSGi system property org.apache.cxf.osgi.http.transport.disable must be set to false (in etc/system.properties) to allow these two servlets to be started. +However, this will disable the auto-registration of normal CXF endpoints. +To avoid this issue, use samples/logbrowser-blueprint which is compatible +with the normal CXF endpoints. http://git-wip-us.apache.org/repos/asf/cxf/blob/816e1a5e/rt/management-web/pom.xml ---------------------------------------------------------------------- diff --git a/rt/management-web/pom.xml b/rt/management-web/pom.xml index f4c2dc4..5769fad 100644 --- a/rt/management-web/pom.xml +++ b/rt/management-web/pom.xml @@ -171,6 +171,11 @@ {maven-resources}, static-content=${gwt.classes.dir}/static-content </Include-Resource> + <Export-Package> + org.apache.cxf.management.web.browser, + org.apache.cxf.management.web.browser*, + org.apache.cxf.management.web.logging.atom*, + </Export-Package> </instructions> </configuration> </plugin>
