Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
GERONIMO-6651 GERONIMO-6652 osgi bundle - tests to do + spec 1.2 upgrade
- Loading branch information
Showing
22 changed files
with
669 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -29,4 +29,9 @@ static Container get() { | ||
} | ||
return iterator.next(); | ||
} | ||
|
||
@FunctionalInterface | ||
interface Unwrappable { | ||
Object unwrap(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,91 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
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/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>geronimo-opentracing-parent</artifactId> | ||
<groupId>org.apache.geronimo</groupId> | ||
<version>1.0.1-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>geronimo-opentracing-osgi</artifactId> | ||
<packaging>bundle</packaging> | ||
<name>Geronimo OpenTracing :: OSGi</name> | ||
|
||
<properties> | ||
<geronimo-opentracing.Automatic-Module-Name>org.apache.geronimo.opentracing.osgi</geronimo-opentracing.Automatic-Module-Name> | ||
|
||
<pax.exam.version>4.12.0</pax.exam.version> | ||
<slf4j.version>1.7.25</slf4j.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.osgi</groupId> | ||
<artifactId>org.osgi.core</artifactId> | ||
<version>6.0.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.osgi</groupId> | ||
<artifactId>osgi.cmpn</artifactId> | ||
<version>6.0.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.geronimo</groupId> | ||
<artifactId>geronimo-opentracing-common</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.ops4j.pax.exam</groupId> | ||
<artifactId>pax-exam-junit4</artifactId> | ||
<version>${pax.exam.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.ops4j.pax.exam</groupId> | ||
<artifactId>pax-exam-container-karaf</artifactId> | ||
<version>${pax.exam.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.ops4j.pax.url</groupId> | ||
<artifactId>pax-url-aether</artifactId> | ||
<version>1.6.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
<version>${slf4j.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-simple</artifactId> | ||
<version>${slf4j.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,46 @@ | ||
/* | ||
* 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.geronimo.microprofile.opentracing.osgi; | ||
|
||
import static java.util.Optional.ofNullable; | ||
|
||
import java.io.IOException; | ||
|
||
import org.apache.geronimo.microprofile.opentracing.common.config.GeronimoOpenTracingConfig; | ||
import org.osgi.service.cm.Configuration; | ||
import org.osgi.service.cm.ConfigurationAdmin; | ||
|
||
public class ConfigAdminOpenTracingConfig implements GeronimoOpenTracingConfig { | ||
private volatile Configuration delegate; | ||
|
||
public ConfigAdminOpenTracingConfig() { | ||
ofNullable(OpenTracingActivator.INSTANCES.get(ConfigurationAdmin.class)) | ||
.map(ConfigurationAdmin.class::cast) | ||
.ifPresent(admin -> { | ||
try { | ||
delegate = admin.getConfiguration("geronimo.opentracing"); | ||
} catch (final IOException e) { | ||
throw new IllegalArgumentException(e); | ||
} | ||
}); | ||
} | ||
|
||
@Override | ||
public String read(final String value, final String def) { | ||
return ofNullable(delegate).map(c -> c.getProperties().get(value)).map(String::valueOf).orElse(def); | ||
} | ||
} |
Oops, something went wrong.