From commits-return-46008-apmail-cxf-commits-archive=cxf.apache.org@cxf.apache.org Tue Apr 11 15:27:57 2017 Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CE60119C8B for ; Tue, 11 Apr 2017 15:27:57 +0000 (UTC) Received: (qmail 73219 invoked by uid 500); 11 Apr 2017 15:27:57 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 73142 invoked by uid 500); 11 Apr 2017 15:27:57 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 73133 invoked by uid 99); 11 Apr 2017 15:27:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Apr 2017 15:27:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 64EA1E00B4; Tue, 11 Apr 2017 15:27:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: cschneider@apache.org To: commits@cxf.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: cxf-dosgi git commit: [DOSGI-262] Allow to also publish external intents using IntentsProvider interface Date: Tue, 11 Apr 2017 15:27:57 +0000 (UTC) Repository: cxf-dosgi Updated Branches: refs/heads/master 042b8a784 -> 1fbc19490 [DOSGI-262] Allow to also publish external intents using IntentsProvider interface Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/1fbc1949 Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/1fbc1949 Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/1fbc1949 Branch: refs/heads/master Commit: 1fbc19490f2af1d29905e90993c13e4215790110 Parents: 042b8a7 Author: Christian Schneider Authored: Tue Apr 11 17:27:49 2017 +0200 Committer: Christian Schneider Committed: Tue Apr 11 17:27:49 2017 +0200 ---------------------------------------------------------------------- .../common/intent/impl/IntentManagerImpl.java | 9 +++++- itests/multi-bundle/pom.xml | 10 ++++-- .../dosgi/itests/multi/TestCustomIntent.java | 2 ++ .../customintent/CustomFeatureProvider.java | 33 ++++++++++++++++++++ .../customintent/CustomIntentActivator.java | 2 +- 5 files changed, 52 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1fbc1949/common/src/main/java/org/apache/cxf/dosgi/common/intent/impl/IntentManagerImpl.java ---------------------------------------------------------------------- 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 67d82a7..2571fef 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 @@ -109,7 +109,14 @@ public class IntentManagerImpl implements IntentManager { } catch (Exception e) { throw new RuntimeException(e); } - + } else if (intent instanceof IntentsProvider) { + try { + IntentsProvider provider = (IntentsProvider)intent; + List curIntents = provider.getIntents(); + intents.addAll(curIntents); + } catch (Exception e) { + throw new RuntimeException(e); + } } else { intents.add(intent); } http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1fbc1949/itests/multi-bundle/pom.xml ---------------------------------------------------------------------- diff --git a/itests/multi-bundle/pom.xml b/itests/multi-bundle/pom.xml index 72af8de..5e6aa0c 100644 --- a/itests/multi-bundle/pom.xml +++ b/itests/multi-bundle/pom.xml @@ -44,7 +44,13 @@ --> - + + org.apache.cxf.dosgi + cxf-dosgi-common + ${project.version} + + + org.apache.geronimo.specs geronimo-atinject_1.0_spec @@ -208,7 +214,7 @@ org.apache.servicemix.tooling depends-maven-plugin - 1.3.1 + 1.4.0 generate-depends-file http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1fbc1949/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/TestCustomIntent.java ---------------------------------------------------------------------- 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 2699b33..814066a 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 @@ -25,6 +25,7 @@ import java.util.concurrent.Callable; import org.apache.cxf.dosgi.itests.multi.customintent.ChangeTitleInterceptor; import org.apache.cxf.dosgi.itests.multi.customintent.CustomFeature; +import org.apache.cxf.dosgi.itests.multi.customintent.CustomFeatureProvider; import org.apache.cxf.dosgi.itests.multi.customintent.CustomIntentActivator; import org.apache.cxf.dosgi.samples.soap.Task; import org.apache.cxf.dosgi.samples.soap.TaskService; @@ -68,6 +69,7 @@ public class TestCustomIntent extends AbstractDosgiTest { return TinyBundles.bundle() // .add(CustomIntentActivator.class) // .add(CustomFeature.class) // + .add(CustomFeatureProvider.class) // .add(ChangeTitleInterceptor.class) // .add(DummyTaskServiceImpl.class) // .set(Constants.BUNDLE_SYMBOLICNAME, "CustomIntent") // http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1fbc1949/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/CustomFeatureProvider.java ---------------------------------------------------------------------- diff --git a/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/CustomFeatureProvider.java b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/CustomFeatureProvider.java new file mode 100644 index 0000000..f2b09a9 --- /dev/null +++ b/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/CustomFeatureProvider.java @@ -0,0 +1,33 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.dosgi.itests.multi.customintent; + +import java.util.Collections; +import java.util.List; + +import org.apache.cxf.dosgi.common.api.IntentsProvider; + +public class CustomFeatureProvider implements IntentsProvider { + + @Override + public List getIntents() { + return Collections.singletonList(new CustomFeature()); + } + +} http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/1fbc1949/itests/multi-bundle/src/test/java/org/apache/cxf/dosgi/itests/multi/customintent/CustomIntentActivator.java ---------------------------------------------------------------------- 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 a3e3feb..8c99ddb 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 @@ -32,7 +32,7 @@ public class CustomIntentActivator implements BundleActivator { public void start(BundleContext context) throws Exception { Dictionary props = new Hashtable(); props.put("org.apache.cxf.dosgi.IntentName", "myIntent"); - context.registerService(CustomFeature.class, new CustomFeature(), props); + context.registerService(CustomFeatureProvider.class, new CustomFeatureProvider(), props); Dictionary props2 = new Hashtable(); props2.put(RemoteConstants.SERVICE_EXPORTED_CONFIGS, "org.apache.cxf.ws");