This is an automated email from the ASF dual-hosted git repository. amichai pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cxf-dosgi.git
commit 5c1e2c963efca73af157339532a68e08f44e7075 Author: Amichai Rothman <amic...@apache.org> AuthorDate: Tue May 28 14:49:53 2019 +0300 Remove leading whitespace --- buildtools/cxf-checkstyle-suppressions.xml | 6 +++--- buildtools/cxf-checkstyle.xml | 8 ++++---- .../apache/cxf/dosgi/common/endpoint/ServerEndpoint.java | 2 +- .../apache/cxf/dosgi/common/intent/IntentManager.java | 2 +- .../cxf/dosgi/common/intent/impl/IntentManagerImpl.java | 16 ++++++++-------- .../apache/cxf/dosgi/common/proxy/ExceptionMapper.java | 6 +++--- .../dosgi/common/intent/impl/IntentManagerImplTest.java | 2 +- .../dosgi/common/proxy/ServiceInvocationHandlerTest.java | 4 ++-- .../cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java | 2 +- .../decorator/ServiceDecoratorBundleListenerTest.java | 2 +- .../dosgi/dsw/decorator/ServiceDecoratorImplTest.java | 2 +- distribution/features/src/main/resources/features.xml | 2 +- distribution/multi-bundle/pom.xml | 2 +- distribution/repository/pom.xml | 2 +- itests/multi-bundle/pom.xml | 12 ++++++------ .../apache/cxf/dosgi/itests/multi/AbstractDosgiTest.java | 14 +++++++------- .../apache/cxf/dosgi/itests/multi/TestCustomIntent.java | 2 +- .../apache/cxf/dosgi/itests/multi/TestExportPolicy.java | 4 ++-- .../apache/cxf/dosgi/itests/multi/TestExportService.java | 8 ++++---- .../itests/multi/customintent/CustomIntentActivator.java | 2 +- parent/pom.xml | 6 +++--- pom.xml | 6 +++--- provider-rs/pom.xml | 4 ++-- .../apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java | 8 ++++---- .../dsw/handlers/rest/provider/RsProviderCustomTest.java | 2 +- .../cxf/dosgi/dsw/handlers/rest/provider/Task.java | 4 ++-- .../dosgi/dsw/handlers/rest/simple/RsProviderTest.java | 8 ++++---- .../apache/cxf/dosgi/dsw/handlers/rest/simple/Task.java | 4 ++-- provider-ws/pom.xml | 2 +- .../org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java | 12 ++++++------ .../apache/cxf/dosgi/dsw/handlers/ws/WsdlSupport.java | 2 +- release_notes.md | 4 ++-- samples/features/src/main/resources/features.xml | 6 +++--- samples/pom.xml | 2 +- samples/repository/pom.xml | 4 ++-- .../java/org/apache/cxf/dosgi/samples/rest/Task.java | 2 +- .../org/apache/cxf/dosgi/samples/rest/TaskResource.java | 2 +- .../dosgi/samples/rest/client/TaskResourceCommand.java | 4 ++-- .../cxf/dosgi/samples/rest/impl/JacksonIntent.java | 2 +- .../cxf/dosgi/samples/rest/impl/TaskResourceImpl.java | 2 +- .../cxf/dosgi/samples/rest/impl/TaskResourceImpl.java | 2 +- samples/soap/api/pom.xml | 2 +- .../java/org/apache/cxf/dosgi/samples/soap/Task.java | 2 +- .../org/apache/cxf/dosgi/samples/soap/TaskService.java | 2 +- samples/soap/client/pom.xml | 2 +- .../dosgi/samples/soap/client/TaskServiceCommand.java | 4 ++-- samples/soap/impl/pom.xml | 2 +- samples/soap/soap.bndrun | 2 +- samples/ssl/README.md | 4 ++-- samples/ssl/pom.xml | 2 +- 50 files changed, 105 insertions(+), 105 deletions(-) diff --git a/buildtools/cxf-checkstyle-suppressions.xml b/buildtools/cxf-checkstyle-suppressions.xml index b15b6ac..d27656f 100644 --- a/buildtools/cxf-checkstyle-suppressions.xml +++ b/buildtools/cxf-checkstyle-suppressions.xml @@ -10,9 +10,9 @@ 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 @@ -27,7 +27,7 @@ <suppress checks=".*" files=".+[\\\/]build[\\\/]src[\\\/].+\.java" /> - + <suppress checks=".*" files=".+[\\\/]contrib[\\\/].+\.java" /> diff --git a/buildtools/cxf-checkstyle.xml b/buildtools/cxf-checkstyle.xml index 521192b..9d54896 100644 --- a/buildtools/cxf-checkstyle.xml +++ b/buildtools/cxf-checkstyle.xml @@ -7,9 +7,9 @@ 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 @@ -25,14 +25,14 @@ Checks to make sure the code meets the CXF coding guidelines which are similar to the Sun guidelines at: http://java.sun.com/docs/codeconv/index.html - + It also enforces aa bunch of other "BestPractices like method lengths, if/try depths, etc... --> <module name="Checker"> <property name="severity" value="error"/> - + <!-- Checks whether files end with a new line. --> <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> <!-- diff --git a/common/src/main/java/org/apache/cxf/dosgi/common/endpoint/ServerEndpoint.java b/common/src/main/java/org/apache/cxf/dosgi/common/endpoint/ServerEndpoint.java index 080b1c5..a0ad662 100644 --- a/common/src/main/java/org/apache/cxf/dosgi/common/endpoint/ServerEndpoint.java +++ b/common/src/main/java/org/apache/cxf/dosgi/common/endpoint/ServerEndpoint.java @@ -32,7 +32,7 @@ public class ServerEndpoint implements Endpoint { this.desc = desc; this.server = server; } - + public Server getServer() { return this.server; } diff --git a/common/src/main/java/org/apache/cxf/dosgi/common/intent/IntentManager.java b/common/src/main/java/org/apache/cxf/dosgi/common/intent/IntentManager.java index de7a5fa..e98be90 100644 --- a/common/src/main/java/org/apache/cxf/dosgi/common/intent/IntentManager.java +++ b/common/src/main/java/org/apache/cxf/dosgi/common/intent/IntentManager.java @@ -29,7 +29,7 @@ public interface IntentManager { Set<String> getExported(Map<String, Object> sd); Set<String> getImported(Map<String, Object> sd); - + List<Object> getRequiredIntents(Set<String> requiredIntents); <T> List<T> getIntents(Class<? extends T> type, List<Object> intents); diff --git a/common/src/main/java/org/apache/cxf/dosgi/common/intent/impl/IntentManagerImpl.java b/common/src/main/java/org/apache/cxf/dosgi/common/intent/impl/IntentManagerImpl.java index 2571fef..779b76e 100644 --- a/common/src/main/java/org/apache/cxf/dosgi/common/intent/impl/IntentManagerImpl.java +++ b/common/src/main/java/org/apache/cxf/dosgi/common/intent/impl/IntentManagerImpl.java @@ -81,7 +81,7 @@ public class IntentManagerImpl implements IntentManager { }; tracker.open(); } - + @Deactivate public void deactivate() { tracker.close(); @@ -123,7 +123,7 @@ public class IntentManagerImpl implements IntentManager { } return intents; } - + public <T> T getIntent(Class<? extends T> type, List<Object> intents) { List<T> selectedIntents = getIntents(type, intents); if (selectedIntents.isEmpty()) { @@ -134,7 +134,7 @@ public class IntentManagerImpl implements IntentManager { } return (T)selectedIntents.iterator().next(); } - + public <T> List<T> getIntents(Class<? extends T> type, List<Object> intents) { List<T> result = new ArrayList<T>(); for (Object intent : intents) { @@ -162,7 +162,7 @@ public class IntentManagerImpl implements IntentManager { LOG.debug(msg, Arrays.toString(unsupportedIntents.toArray()), remainingSeconds); } } - + try { wait(1000); } catch (InterruptedException e) { @@ -188,7 +188,7 @@ public class IntentManagerImpl implements IntentManager { } return unsupportedIntents; } - + public Set<String> getExported(Map<String, Object> sd) { Set<String> allIntents = new HashSet<String>(); Collection<String> intents = PropertyHelper @@ -199,7 +199,7 @@ public class IntentManagerImpl implements IntentManager { allIntents.addAll(parseIntents(intents2)); return allIntents; } - + public List<Object> getIntentsFromService(Object serviceBean) { List<Object> intents = new ArrayList<>(); if (serviceBean instanceof IntentsProvider) { @@ -217,12 +217,12 @@ public class IntentManagerImpl implements IntentManager { } return intents; } - + public Set<String> getImported(Map<String, Object> sd) { Collection<String> intents = PropertyHelper.getMultiValueProperty(sd.get(RemoteConstants.SERVICE_INTENTS)); return new HashSet<String>(intents); } - + private static Collection<String> parseIntents(Collection<String> intents) { List<String> parsed = new ArrayList<String>(); for (String intent : intents) { diff --git a/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java b/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java index 2e3044b..4601d9c 100644 --- a/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java +++ b/common/src/main/java/org/apache/cxf/dosgi/common/proxy/ExceptionMapper.java @@ -29,11 +29,11 @@ import org.osgi.framework.ServiceException; public class ExceptionMapper { private static final String REMOTE_EXCEPTION_TYPE = "REMOTE"; private Map<Method, Set<Class<?>>> exceptionsMap = new HashMap<Method, Set<Class<?>>>(); - + public ExceptionMapper(Class<?> iType) { introspectTypeForExceptions(iType); } - + public Throwable mapException(Method m, Throwable ex) throws Throwable { Throwable cause = ex.getCause() == null ? ex : ex.getCause(); Set<Class<?>> excTypes = exceptionsMap.get(m); @@ -49,7 +49,7 @@ public class ExceptionMapper { } return new ServiceException(REMOTE_EXCEPTION_TYPE, ex); } - + private void introspectTypeForExceptions(Class<?> iType) { for (Method m : iType.getDeclaredMethods()) { addExceptions(m); diff --git a/common/src/test/java/org/apache/cxf/dosgi/common/intent/impl/IntentManagerImplTest.java b/common/src/test/java/org/apache/cxf/dosgi/common/intent/impl/IntentManagerImplTest.java index 4f55b54..3f8fdce 100644 --- a/common/src/test/java/org/apache/cxf/dosgi/common/intent/impl/IntentManagerImplTest.java +++ b/common/src/test/java/org/apache/cxf/dosgi/common/intent/impl/IntentManagerImplTest.java @@ -34,7 +34,7 @@ public class IntentManagerImplTest { Object feature = intents.iterator().next(); Assert.assertEquals(GZIPFeature.class, feature.getClass()); } - + @Test public void testIntentsFromIntentsProvider() { IntentManagerImpl im = new IntentManagerImpl(); diff --git a/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java index af31b4d..5b60075 100644 --- a/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java +++ b/common/src/test/java/org/apache/cxf/dosgi/common/proxy/ServiceInvocationHandlerTest.java @@ -82,11 +82,11 @@ public class ServiceInvocationHandlerTest { MySubService proxy = ProxyFactory.create(new MyServiceImpl(), MySubService.class); proxy.throwException2(); } - + @Test(expected = IOException.class) public void testInheritedException() throws IOException { MySubService proxy = ProxyFactory.create(new MyServiceImpl(), MySubService.class); proxy.throwException1(); } - + } diff --git a/decorator/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java b/decorator/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java index 20130c3..cf0ada7 100644 --- a/decorator/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java +++ b/decorator/src/main/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImpl.java @@ -44,7 +44,7 @@ public class ServiceDecoratorImpl implements ServiceDecorator { public ServiceDecoratorImpl() { parser = new DecorationParser(); } - + public void decorate(ServiceReference<?> sref, Map<String, Object> target) { for (Rule matcher : decorations) { matcher.apply(sref, target); diff --git a/decorator/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorBundleListenerTest.java b/decorator/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorBundleListenerTest.java index 1ca33fc..1b09bea 100644 --- a/decorator/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorBundleListenerTest.java +++ b/decorator/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorBundleListenerTest.java @@ -52,7 +52,7 @@ public class ServiceDecoratorBundleListenerTest { Bundle b = EasyMock.createMock(Bundle.class); EasyMock.replay(b); - + ServiceDecoratorBundleListener listener = new ServiceDecoratorBundleListener(serviceDecorator); assertEquals("Precondition failed", 0, called.size()); diff --git a/decorator/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImplTest.java b/decorator/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImplTest.java index 1b4a44d..da8928a 100644 --- a/decorator/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImplTest.java +++ b/decorator/src/test/java/org/apache/cxf/dosgi/dsw/decorator/ServiceDecoratorImplTest.java @@ -143,7 +143,7 @@ public class ServiceDecoratorImplTest extends TestCase { assertDecorate(serviceProps, EMPTY, RES_SD_1); } - + private void assertDecorate(final Map<String, Object> serviceProps, Map<String, Object> expected, URL... resources) { Map<String, Object> actual = testDecorate(serviceProps, resources); diff --git a/distribution/features/src/main/resources/features.xml b/distribution/features/src/main/resources/features.xml index 435e610..ab57657 100644 --- a/distribution/features/src/main/resources/features.xml +++ b/distribution/features/src/main/resources/features.xml @@ -19,7 +19,7 @@ <feature>cxf-databinding-aegis</feature> <bundle>mvn:${project.groupId}/cxf-dosgi-provider-ws/${project.version}</bundle> </feature> - + <feature name="cxf-dosgi-provider-rs" version="${project.version}"> <feature>cxf-dosgi-common</feature> <feature>cxf-jaxrs</feature> diff --git a/distribution/multi-bundle/pom.xml b/distribution/multi-bundle/pom.xml index 6f1924f..ff35945 100644 --- a/distribution/multi-bundle/pom.xml +++ b/distribution/multi-bundle/pom.xml @@ -264,7 +264,7 @@ </execution> </executions> </plugin> - + <!-- Unzip the archive created by bnd export plugin. To then repackage it in the assembly phase --> <plugin> <artifactId>maven-antrun-plugin</artifactId> diff --git a/distribution/repository/pom.xml b/distribution/repository/pom.xml index 1a1691b..e3e591c 100644 --- a/distribution/repository/pom.xml +++ b/distribution/repository/pom.xml @@ -16,7 +16,7 @@ <version>${aries.rsa.version}</version> <type>pom</type> </dependency> - + <!-- Workaround for missing dependency in rsa repo --> <dependency> <groupId>org.fusesource.jansi</groupId> diff --git a/itests/multi-bundle/pom.xml b/itests/multi-bundle/pom.xml index 2329529..facde78 100644 --- a/itests/multi-bundle/pom.xml +++ b/itests/multi-bundle/pom.xml @@ -32,11 +32,11 @@ <artifactId>cxf-dosgi-itests-multibundle</artifactId> <packaging>jar</packaging> <name>CXF DOSGi Integration Tests Multi-Bundle</name> - + <properties> <topDirectoryLocation>../..</topDirectoryLocation> </properties> - + <!-- When changing code make sure to run the distro before testing or you will be testing the old code. @@ -82,7 +82,7 @@ <artifactId>pax-exam-link-mvn</artifactId> <scope>test</scope> </dependency> - + <dependency> <groupId>org.ops4j.pax.url</groupId> <artifactId>pax-url-aether</artifactId> @@ -152,7 +152,7 @@ </exclusion> </exclusions> </dependency> - + <!-- Samples --> <dependency> <groupId>org.apache.cxf.dosgi.samples</groupId> @@ -206,7 +206,7 @@ </execution> </executions> </plugin> - + <plugin> <groupId>org.apache.servicemix.tooling</groupId> <artifactId>depends-maven-plugin</artifactId> @@ -220,7 +220,7 @@ </execution> </executions> </plugin> - + </plugins> </build> </project> diff --git a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/AbstractDosgiTest.java b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/AbstractDosgiTest.java index 673a2f6..2c14c84 100644 --- a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/AbstractDosgiTest.java +++ b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/AbstractDosgiTest.java @@ -59,19 +59,19 @@ public class AbstractDosgiTest { static final String HTTP_HOST = "localhost"; // can specify specific bound IP static final String HTTP_BASE_URI = "http://" + HTTP_HOST + ":" + HTTP_PORT; private static final int TIMEOUT = 20; - + @Inject BundleContext bundleContext; - + @BeforeClass public static void log() { System.out.println("-----------------------------------------------------------------"); } - + public <T> T tryTo(String message, Callable<T> func) throws TimeoutException { return tryTo(message, func, 5000); } - + public <T> T tryTo(String message, Callable<T> func, long timeout) throws TimeoutException { Throwable lastException = null; long startTime = System.currentTimeMillis(); @@ -256,7 +256,7 @@ public class AbstractDosgiTest { .put("clientPort", "" + ZK_PORT) // .asOption(); } - + protected static Option configLogging() { return ConfigurationAdminOptions.configurationFolder(new File("src/test/resources/cfg")); } @@ -265,7 +265,7 @@ public class AbstractDosgiTest { return mavenBundle().groupId("org.apache.cxf.dosgi.samples") .artifactId("cxf-dosgi-samples-soap-api").versionAsInProject(); } - + protected static MavenArtifactProvisionOption taskServiceImpl() { return mavenBundle().groupId("org.apache.cxf.dosgi.samples") .artifactId("cxf-dosgi-samples-soap-impl").versionAsInProject(); @@ -296,7 +296,7 @@ public class AbstractDosgiTest { mavenBundle("org.ops4j.pax.tinybundles", "tinybundles").versionAsInProject(), mavenBundle("biz.aQute.bnd", "biz.aQute.bndlib").versionAsInProject(), - + systemProperty("org.osgi.service.http.port").value("" + HTTP_PORT), systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"), // systemProperty("pax.exam.osgi.unresolved.fail").value("true"), // diff --git a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestCustomIntent.java b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestCustomIntent.java index 814066a..06eafd4 100644 --- a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestCustomIntent.java +++ b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestCustomIntent.java @@ -61,7 +61,7 @@ public class TestCustomIntent extends AbstractDosgiTest { return taskService.get(1); } }); - + Assert.assertEquals("changed", task.getTitle()); } diff --git a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestExportPolicy.java b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestExportPolicy.java index c55dc97..d7ba62d 100644 --- a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestExportPolicy.java +++ b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestExportPolicy.java @@ -38,11 +38,11 @@ import org.ops4j.pax.exam.util.Filter; @RunWith(PaxExam.class) @ExamReactorStrategy(PerClass.class) public class TestExportPolicy extends AbstractDosgiTest { - + @Inject @Filter("(name=cxf)") ExportPolicy policy; - + @Configuration public static Option[] configure() throws Exception { return new Option[] // diff --git a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestExportService.java b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestExportService.java index 6e54d6f..ba2b2a5 100644 --- a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestExportService.java +++ b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestExportService.java @@ -50,7 +50,7 @@ public class TestExportService extends AbstractDosgiTest { private static final String SERVICE_URI = HTTP_BASE_URI + "/cxf/taskservice"; private static final String REST_SERVICE_URI = HTTP_BASE_URI + "/cxf/tasks"; - + private static final String GREETER_ZOOKEEPER_NODE = // "/osgi/service_registry/http:##localhost:8181#cxf#taskservice"; @@ -76,7 +76,7 @@ public class TestExportService extends AbstractDosgiTest { Task task = taskService.get(1); Assert.assertEquals("Buy some coffee", task.getTitle()); } - + @Test public void testRESTCall() throws Exception { waitWebPage(REST_SERVICE_URI); @@ -94,7 +94,7 @@ public class TestExportService extends AbstractDosgiTest { String swaggerJson = swaggerClient.get(String.class); Assert.assertEquals("{\"swagger\":\"2.0\"", swaggerJson.substring(0, 16)); } - + @Test public void testDiscoveryExport() throws Exception { ZooKeeper zk = createZookeeperClient(); @@ -112,7 +112,7 @@ public class TestExportService extends AbstractDosgiTest { return db.parse(wsdlURL.openStream()); } }); - + Element el = doc.getDocumentElement(); Assert.assertEquals("definitions", el.getLocalName()); Assert.assertEquals("http://schemas.xmlsoap.org/wsdl/", el.getNamespaceURI()); diff --git a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/CustomIntentActivator.java b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/CustomIntentActivator.java index 8c99ddb..7765ef3 100644 --- a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/CustomIntentActivator.java +++ b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/CustomIntentActivator.java @@ -33,7 +33,7 @@ public class CustomIntentActivator implements BundleActivator { Dictionary<String, String> props = new Hashtable<String, String>(); props.put("org.apache.cxf.dosgi.IntentName", "myIntent"); context.registerService(CustomFeatureProvider.class, new CustomFeatureProvider(), props); - + Dictionary<String, String> props2 = new Hashtable<String, String>(); props2.put(RemoteConstants.SERVICE_EXPORTED_CONFIGS, "org.apache.cxf.ws"); props2.put("org.apache.cxf.ws.address", "/taskservice"); diff --git a/parent/pom.xml b/parent/pom.xml index 951752b..7c6d958 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -140,7 +140,7 @@ </dependency> </dependencies> </dependencyManagement> - + <dependencies> <dependency> <groupId>org.slf4j</groupId> @@ -157,7 +157,7 @@ <version>1.3.0</version> <scope>provided</scope> </dependency> - + <dependency> <groupId>org.osgi</groupId> <artifactId>org.osgi.service.component.annotations</artifactId> @@ -170,7 +170,7 @@ <version>1.2.1</version> <scope>provided</scope> </dependency> - + <!-- Just for the remote service admin spec --> <dependency> <groupId>org.apache.aries.rsa</groupId> diff --git a/pom.xml b/pom.xml index 17826a1..e5f5b82 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ --> <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> - + <parent> <groupId>org.apache</groupId> <artifactId>apache</artifactId> @@ -32,7 +32,7 @@ <packaging>pom</packaging> <name>CXF DOSGi main</name> - + <scm> <connection>scm:git:http://gitbox.apache.org/repos/asf/cxf-dosgi.git</connection> <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/cxf-dosgi.git</developerConnection> @@ -90,7 +90,7 @@ <build> <defaultGoal>install</defaultGoal> - + <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/provider-rs/pom.xml b/provider-rs/pom.xml index 5336bc0..202e229 100644 --- a/provider-rs/pom.xml +++ b/provider-rs/pom.xml @@ -41,7 +41,7 @@ <artifactId>cxf-dosgi-common</artifactId> <version>${project.version}</version> </dependency> - + <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-core</artifactId> @@ -57,7 +57,7 @@ <artifactId>cxf-rt-rs-client</artifactId> <version>${cxf.version}</version> </dependency> - + <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-databinding-jaxb</artifactId> diff --git a/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java b/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java index 160f185..c87b2f9 100644 --- a/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java +++ b/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java @@ -74,12 +74,12 @@ public class RsProvider extends BaseDistributionProvider implements Distribution public void setHttpServiceManager(HttpServiceManager httpServiceManager) { this.httpServiceManager = httpServiceManager; } - + @Reference public void setIntentManager(IntentManager intentManager) { this.intentManager = intentManager; } - + public String[] getSupportedTypes() { return new String[] {RsConstants.RS_CONFIG_TYPE}; } @@ -163,7 +163,7 @@ public class RsProvider extends BaseDistributionProvider implements Distribution if (binding != null) { factory.setBindingConfig(binding); } - + List<Object> providers = new ArrayList<Object>(); for (Object intent : intents) { if (isProvider(intent)) { @@ -172,7 +172,7 @@ public class RsProvider extends BaseDistributionProvider implements Distribution } factory.setProviders(providers); } - + private boolean isProvider(Object intent) { return intent.getClass().getAnnotation(Provider.class) != null // || (intent instanceof ExceptionMapper) // diff --git a/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/provider/RsProviderCustomTest.java b/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/provider/RsProviderCustomTest.java index 5198371..2bb31bd 100644 --- a/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/provider/RsProviderCustomTest.java +++ b/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/provider/RsProviderCustomTest.java @@ -54,7 +54,7 @@ public class RsProviderCustomTest { rsProvider.setIntentManager(intentManager); TaskServiceImpl taskService = new TaskServiceImpl(); BundleContext callingContext = EasyMock.createMock(BundleContext.class); - + Map<String, Object> props = new HashMap<>(); props.put(Constants.OBJECTCLASS, new String[]{TaskService.class.getName()}); String serviceAddress = "http://localhost:9181/"; diff --git a/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/provider/Task.java b/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/provider/Task.java index d45dee6..9011aa4 100644 --- a/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/provider/Task.java +++ b/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/provider/Task.java @@ -23,7 +23,7 @@ public class Task { public Task() { } - + public Task(String name) { this.name = name; } @@ -31,7 +31,7 @@ public class Task { public String getName() { return name; } - + public void setName(String name) { this.name = name; } diff --git a/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/simple/RsProviderTest.java b/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/simple/RsProviderTest.java index adc3df6..379a880 100644 --- a/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/simple/RsProviderTest.java +++ b/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/simple/RsProviderTest.java @@ -49,22 +49,22 @@ public class RsProviderTest { rsProvider.setIntentManager(intentManager); TaskServiceImpl taskService = new TaskServiceImpl(); BundleContext callingContext = EasyMock.createMock(BundleContext.class); - + Map<String, Object> props = new HashMap<>(); props.put(Constants.OBJECTCLASS, new String[]{TaskService.class.getName()}); String serviceAddress = "http://localhost:9181/"; props.put(RsConstants.RS_ADDRESS_PROPERTY, serviceAddress); Class<?>[] ifaces = new Class[]{TaskService.class}; - + try (Endpoint endpoint = rsProvider.exportService(taskService, callingContext, props, ifaces)) { Assert.assertEquals(serviceAddress, endpoint.description().getId()); - + Task task1 = WebClient.create(serviceAddress).path("/task").get(Task.class); Assert.assertEquals("test", task1.getName()); - + TaskService proxy = (TaskService)rsProvider.importEndpoint(TaskService.class.getClassLoader(), callingContext, ifaces, endpoint.description()); Task task = proxy.getTask(); diff --git a/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/simple/Task.java b/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/simple/Task.java index 23c6c8a..cc1760a 100644 --- a/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/simple/Task.java +++ b/provider-rs/src/test/java/org/apache/cxf/dosgi/dsw/handlers/rest/simple/Task.java @@ -26,7 +26,7 @@ public class Task { public Task() { } - + public Task(String name) { this.name = name; } @@ -34,7 +34,7 @@ public class Task { public String getName() { return name; } - + public void setName(String name) { this.name = name; } diff --git a/provider-ws/pom.xml b/provider-ws/pom.xml index 5d37eb6..93b6c4c 100644 --- a/provider-ws/pom.xml +++ b/provider-ws/pom.xml @@ -41,7 +41,7 @@ <artifactId>cxf-dosgi-common</artifactId> <version>${project.version}</version> </dependency> - + <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-core</artifactId> diff --git a/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java b/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java index 0c953c4..7584f02 100644 --- a/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java +++ b/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java @@ -74,12 +74,12 @@ public class WsProvider extends BaseDistributionProvider implements Distribution public void setHttpServiceManager(HttpServiceManager httpServiceManager) { this.httpServiceManager = httpServiceManager; } - + @Reference public void setIntentManager(IntentManager intentManager) { this.intentManager = intentManager; } - + @Activate public void activate(BundleContext context) { this.bundleContext = context; @@ -128,7 +128,7 @@ public class WsProvider extends BaseDistributionProvider implements Distribution factory.setDataBinding(dataBinding); } BindingConfiguration binding = copy(intentManager.getIntent(BindingConfiguration.class, intents)); - + if (binding != null) { factory.setBindingConfig(binding); } @@ -194,7 +194,7 @@ public class WsProvider extends BaseDistributionProvider implements Distribution throw new RuntimeException("Error exporting service with adress " + completeEndpointAddress, e); } } - + private void applyIntents(List<Object> intents, AbstractEndpointFactory factory) { List<Feature> features = intentManager.getIntents(Feature.class, intents); factory.setFeatures(features); @@ -207,7 +207,7 @@ public class WsProvider extends BaseDistributionProvider implements Distribution factory.setBindingConfig(binding); } } - + protected EndpointDescription createEndpointDesc(Map<String, Object> props, String[] importedConfigs, String address, Collection<String> intents) { return super.createEndpointDesc(props, importedConfigs, WsConstants.WS_ADDRESS_PROPERTY, address, intents); @@ -230,7 +230,7 @@ public class WsProvider extends BaseDistributionProvider implements Distribution LOG.info("Using a default address: " + address); return address; } - + protected String getClientAddress(Map<String, Object> sd) { return PropertyHelper.getFirstNonEmptyStringProperty(sd, WsConstants.WS_ADDRESS_PROPERTY, RemoteConstants.ENDPOINT_ID); diff --git a/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsdlSupport.java b/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsdlSupport.java index 83794c5..83b8e8e 100644 --- a/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsdlSupport.java +++ b/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsdlSupport.java @@ -32,7 +32,7 @@ public final class WsdlSupport { private WsdlSupport() { } - + public static void setWsdlProperties(AbstractWSDLBasedEndpointFactory factory, // BundleContext context, // Map<String, Object> sd) { diff --git a/release_notes.md b/release_notes.md index 5542ca2..1c70343 100644 --- a/release_notes.md +++ b/release_notes.md @@ -31,7 +31,7 @@ Release Notes - CXF Distributed OSGi * [DOSGI-261] - Sample for rest with jackson provider * [DOSGI-266] - Support for org.apache.cxf.jaxrs.ext.ContextProvider * [DOSGI-270] - Create sample for swagger documentation - + 2.1.0 ===== @@ -121,7 +121,7 @@ Release Notes - CXF Distributed OSGi * Improvement * [DOSGI-220] - Upgrade to cxf 3.1.1 - + 1.6.0 ===== diff --git a/samples/features/src/main/resources/features.xml b/samples/features/src/main/resources/features.xml index 6d62713..187b7b5 100644 --- a/samples/features/src/main/resources/features.xml +++ b/samples/features/src/main/resources/features.xml @@ -8,14 +8,14 @@ <bundle>mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-soap-api/${project.version}</bundle> <bundle>mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-soap-impl/${project.version}</bundle> </feature> - + <feature name="cxf-dosgi-sample-soap-client" version="${project.version}"> <feature>cxf-dosgi-provider-ws</feature> <feature>aries-rsa-discovery-zookeeper</feature> <bundle>mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-soap-api/${project.version}</bundle> <bundle>mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-soap-client/${project.version}</bundle> </feature> - + <feature name="cxf-dosgi-sample-rest-impl" version="${project.version}"> <feature>cxf-dosgi-provider-rs</feature> <feature>aries-rsa-discovery-zookeeper-server</feature> @@ -25,7 +25,7 @@ <bundle>mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-rest-api/${project.version}</bundle> <bundle>mvn:org.apache.cxf.dosgi.samples/cxf-dosgi-samples-rest-impl/${project.version}</bundle> </feature> - + <feature name="cxf-dosgi-sample-rest-client" version="${project.version}"> <feature>cxf-dosgi-provider-rs</feature> <feature>aries-rsa-discovery-zookeeper</feature> diff --git a/samples/pom.xml b/samples/pom.xml index 9f49646..3fdd9fc 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -33,7 +33,7 @@ <relativePath>../parent/pom.xml</relativePath> </parent> - + <properties> <topDirectoryLocation>..</topDirectoryLocation> </properties> diff --git a/samples/repository/pom.xml b/samples/repository/pom.xml index 5726293..0fc1e54 100644 --- a/samples/repository/pom.xml +++ b/samples/repository/pom.xml @@ -113,7 +113,7 @@ <artifactId>jline</artifactId> <version>3.10.0</version> </dependency> - + <!-- rsa --> <dependency> <groupId>org.apache.cxf.dosgi</groupId> @@ -141,7 +141,7 @@ <artifactId>cxf-dosgi-samples-rest-client</artifactId> <version>${project.version}</version> </dependency> - + </dependencies> <build> diff --git a/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/Task.java b/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/Task.java index 6ae15a1..6decde1 100644 --- a/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/Task.java +++ b/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/Task.java @@ -29,7 +29,7 @@ public class Task { String description; Date dueDate; boolean finished; - + public Task() { } diff --git a/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/TaskResource.java b/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/TaskResource.java index 07a6ae7..7976f75 100644 --- a/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/TaskResource.java +++ b/samples/rest/api/src/main/java/org/apache/cxf/dosgi/samples/rest/TaskResource.java @@ -49,7 +49,7 @@ public interface TaskResource { @ApiOperation(value = "Add task") @POST void add(Task task); - + @ApiOperation(value = "Update existing task") @PUT @Path("/{id}") diff --git a/samples/rest/client/src/main/java/org/apache/cxf/dosgi/samples/rest/client/TaskResourceCommand.java b/samples/rest/client/src/main/java/org/apache/cxf/dosgi/samples/rest/client/TaskResourceCommand.java index e84bc97..76ee6c3 100644 --- a/samples/rest/client/src/main/java/org/apache/cxf/dosgi/samples/rest/client/TaskResourceCommand.java +++ b/samples/rest/client/src/main/java/org/apache/cxf/dosgi/samples/rest/client/TaskResourceCommand.java @@ -46,12 +46,12 @@ public class TaskResourceCommand { System.out.println(line); } } - + public void add(Integer id, String title) { Task task = new Task(id, title, ""); taskService.add(task); } - + public void delete(Integer id) { taskService.delete(id); } diff --git a/samples/rest/impl-jackson/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/JacksonIntent.java b/samples/rest/impl-jackson/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/JacksonIntent.java index 63674e4..8649be0 100644 --- a/samples/rest/impl-jackson/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/JacksonIntent.java +++ b/samples/rest/impl-jackson/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/JacksonIntent.java @@ -39,5 +39,5 @@ public class JacksonIntent implements IntentsProvider { public List<?> getIntents() { return Arrays.asList((Object)new JacksonJaxbJsonProvider()); } - + } diff --git a/samples/rest/impl-jackson/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/TaskResourceImpl.java b/samples/rest/impl-jackson/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/TaskResourceImpl.java index 7753ea3..eca3bc7 100644 --- a/samples/rest/impl-jackson/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/TaskResourceImpl.java +++ b/samples/rest/impl-jackson/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/TaskResourceImpl.java @@ -66,7 +66,7 @@ public class TaskResourceImpl implements TaskResource, IntentsProvider { task.setDescription(""); add(task); } - + @Override public Task get(Integer id) { return taskMap.get(id); diff --git a/samples/rest/impl/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/TaskResourceImpl.java b/samples/rest/impl/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/TaskResourceImpl.java index 1ee6f4c..e8c3e92 100644 --- a/samples/rest/impl/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/TaskResourceImpl.java +++ b/samples/rest/impl/src/main/java/org/apache/cxf/dosgi/samples/rest/impl/TaskResourceImpl.java @@ -67,7 +67,7 @@ public class TaskResourceImpl implements TaskResource, IntentsProvider { public void add(Task task) { taskMap.put(task.getId(), task); } - + @Override public void update(Integer id, Task task) { taskMap.put(id, task); diff --git a/samples/soap/api/pom.xml b/samples/soap/api/pom.xml index 4523a30..0125b69 100644 --- a/samples/soap/api/pom.xml +++ b/samples/soap/api/pom.xml @@ -30,7 +30,7 @@ <version>2.4.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> - + <properties> <topDirectoryLocation>..</topDirectoryLocation> </properties> diff --git a/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/Task.java b/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/Task.java index a689ed4..2609f4c 100644 --- a/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/Task.java +++ b/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/Task.java @@ -29,7 +29,7 @@ public class Task { String description; Date dueDate; boolean finished; - + public Task() { } diff --git a/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/TaskService.java b/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/TaskService.java index 45face5..d37643e 100644 --- a/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/TaskService.java +++ b/samples/soap/api/src/main/java/org/apache/cxf/dosgi/samples/soap/TaskService.java @@ -29,6 +29,6 @@ public interface TaskService { void addOrUpdate(Task task); void delete(Integer id); - + Collection<Task> getAll(); } diff --git a/samples/soap/client/pom.xml b/samples/soap/client/pom.xml index aba9906..9c96e70 100644 --- a/samples/soap/client/pom.xml +++ b/samples/soap/client/pom.xml @@ -21,7 +21,7 @@ <version>2.4.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> - + <properties> <topDirectoryLocation>..</topDirectoryLocation> </properties> diff --git a/samples/soap/client/src/main/java/org/apache/cxf/dosgi/samples/soap/client/TaskServiceCommand.java b/samples/soap/client/src/main/java/org/apache/cxf/dosgi/samples/soap/client/TaskServiceCommand.java index a249d38..81b5572 100644 --- a/samples/soap/client/src/main/java/org/apache/cxf/dosgi/samples/soap/client/TaskServiceCommand.java +++ b/samples/soap/client/src/main/java/org/apache/cxf/dosgi/samples/soap/client/TaskServiceCommand.java @@ -48,12 +48,12 @@ public class TaskServiceCommand { System.out.println(line); } } - + public void add(Integer id, String title) { Task task = new Task(id, title, ""); taskService.addOrUpdate(task); } - + public void delete(Integer id) { taskService.delete(id); } diff --git a/samples/soap/impl/pom.xml b/samples/soap/impl/pom.xml index 486455b..4de4aae 100644 --- a/samples/soap/impl/pom.xml +++ b/samples/soap/impl/pom.xml @@ -29,7 +29,7 @@ <version>2.4.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> - + <properties> <topDirectoryLocation>..</topDirectoryLocation> </properties> diff --git a/samples/soap/soap.bndrun b/samples/soap/soap.bndrun index e31bce0..653dada 100644 --- a/samples/soap/soap.bndrun +++ b/samples/soap/soap.bndrun @@ -13,7 +13,7 @@ org.apache.felix.http.jettyEnabled=true,\ org.osgi.framework.bootdelegation=com.sun.*,\ org.osgi.framework.system.packages.extra='sun.misc,javax.xml.bind.annotation;version=2.2.1,javax.xml.bind;version=2.2.1' - + # felix.cm.loglevel=4,\ # felix.fileinstall.dir=./etc,\ # felix.fileinstall.noInitialDelay=true,\ diff --git a/samples/ssl/README.md b/samples/ssl/README.md index feb5563..ac53836 100644 --- a/samples/ssl/README.md +++ b/samples/ssl/README.md @@ -24,12 +24,12 @@ We want the karaf HttpService to be secured by https and require a client certif keytool -export -rfc -keystore etc/keystores/client.jks -storepass password -alias clientkey -file client.cer keytool -import -trustcacerts -keystore etc/keystores/keystore.jks -storepass password -alias clientkey -file client.cer - + # Export server cert keytool -exportcert -storepass password -keystore etc/keystores/keystore.jks -alias serverKey -file server.cert # Import server cert into client store keytool -importcert -storepass password -keystore etc/keystores/client.jks -alias serverKey -file server.cert - + - Copy thes files in etc to the karaf etc dir - Copy the keystores (*.jks) into the karaf etc directory. diff --git a/samples/ssl/pom.xml b/samples/ssl/pom.xml index bcbd690..d0e2025 100644 --- a/samples/ssl/pom.xml +++ b/samples/ssl/pom.xml @@ -30,7 +30,7 @@ <version>2.4.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> - + <dependencies> <dependency> <groupId>org.osgi</groupId>