Skip to content
Permalink
Browse files
[DOSGI-262] Allow to also publish external intents using IntentsProvi…
…der interface
  • Loading branch information
cschneider committed Apr 11, 2017
1 parent 042b8a7 commit 1fbc19490f2af1d29905e90993c13e4215790110
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 4 deletions.
@@ -109,7 +109,14 @@ public synchronized List<Object> getRequiredIntents(Set<String> requiredIntents)
} 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);
}
@@ -44,7 +44,13 @@
-->

<dependencies>
<!-- Pax Exam -->
<dependency>
<groupId>org.apache.cxf.dosgi</groupId>
<artifactId>cxf-dosgi-common</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Pax Exam -->
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-atinject_1.0_spec</artifactId>
@@ -208,7 +214,7 @@
<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>depends-maven-plugin</artifactId>
<version>1.3.1</version>
<version>1.4.0</version>
<executions>
<execution>
<id>generate-depends-file</id>
@@ -25,6 +25,7 @@

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 @@ private static InputStream getCustomIntentBundle() {
return TinyBundles.bundle() //
.add(CustomIntentActivator.class) //
.add(CustomFeature.class) //
.add(CustomFeatureProvider.class) //
.add(ChangeTitleInterceptor.class) //
.add(DummyTaskServiceImpl.class) //
.set(Constants.BUNDLE_SYMBOLICNAME, "CustomIntent") //
@@ -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());
}

}
@@ -32,7 +32,7 @@ public class CustomIntentActivator implements BundleActivator {
public void start(BundleContext context) throws Exception {
Dictionary<String, String> props = new Hashtable<String, String>();
props.put("org.apache.cxf.dosgi.IntentName", "myIntent");
context.registerService(CustomFeature.class, new CustomFeature(), props);
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");

0 comments on commit 1fbc194

Please sign in to comment.