You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2014/12/12 14:05:52 UTC
[1/2] incubator-tamaya git commit: TAMAYA-4: Removed compile scope
for log4j in core module. TAMAYA-19: Modularized aspects in project build.
Repository: incubator-tamaya
Updated Branches:
refs/heads/master 5d1a1fa13 -> 1391fa85e
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/managed/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java
----------------------------------------------------------------------
diff --git a/modules/managed/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java b/modules/managed/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java
deleted file mode 100644
index 381d43a..0000000
--- a/modules/managed/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java
+++ /dev/null
@@ -1,176 +0,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.
- */
-package org.apache.tamaya.management;
-
-
-import org.apache.tamaya.ConfigException;
-import org.apache.tamaya.AggregationPolicy;
-
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Managed bean interface for accessing environment data.
- */
-public interface ManagedConfigMBean {
- /**
- * Get the names current the configuration's defined.
- *
- * @return the names current the configuration's defined.
- */
- public Set<String> getConfigurationNames();
-
- /**
- * Get a general configuration info descriptor in JSON format for a configuration
- * type in the following form:
- * <pre>
- * tbd
- * </pre>
- *
- * @param configName the configuration name, not null.
- * @return a JSON formatted meta-information.
- */
- public String getConfigurationInfo(String configName);
-
- /**
- * Allows to determine if a configuration current a given type is available (accessible) in the
- * given environment context.
- *
- * @param configName the configuration name, not null.
- * @param envType the environment context, not null.
- * @param envContext the environment context, not null.
- * @return true, if such a configuration is accessible.
- */
- public boolean isConfigurationAvailable(String configName, String envType, String envContext);
-
- /**
- * Allows to determine if a configuration current a given type is loaded in the
- * given environment context.
- *
- * @param configName the configuration name, not null.
- * @param envType the environment context, not null.
- * @param envContext the environment context, not null.
- * @return true, if such a configuration is accessible.
- */
- public boolean isConfigurationLoaded(String configName, String envType, String envContext);
-
- /**
- * Accesses a configuration current a given type as Map.
- *
- * @param configName the configuration name, not null.
- * @param envType the environment context, not null.
- * @param envContext the environment context, not null.
- * @return true, if such a configuration is accessible.
- * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded.
- */
- public Map<String, String> getConfiguration(String configName, String envType, String envContext)
- throws ConfigException;
-
- /**
- * Accesses a configuration values for current a given config area as Map.
- * @param area the target area key, not null.
- * @param configName the configuration name, not null.
- * @param envType the environment context, not null.
- * @param envContext the environment context, not null.
- * @return the key/values found, including the recursive child values.
- * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded.
- */
- public Map<String, String> getRecursiveConfigValues(String area, String configName, String envType, String envContext)
- throws ConfigException;
-
- /**
- * Accesses a configuration values for current a given config area as Map.
- * @param area the target area key, not null.
- * @param configName the configuration name, not null.
- * @param envType the environment context, not null.
- * @param envContext the environment context, not null.
- * @return the key/values found, not transitive.
- * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded.
- */
- public Map<String, String> getConfigValues(String area, String configName, String envType, String envContext)
- throws ConfigException;
-
- /**
- * Updates a configuration current a given type.
- *
- * @param configName the configuration name, not null.
- * @param envType the environment context, not null.
- * @param envContext the environment context, not null.
- * @param values the values to be changed.
- * @param aggregationPolicy the aggregation Policy to be used.
- * @return the configuration after the changesd have been applied.
- * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded, or not
- * mutable.
- */
- public Map<String, String> updateConfiguration(String configName, String envType, String envContext, Map<String, String> values, AggregationPolicy aggregationPolicy)
- throws ConfigException;
-
- /**
- * Access a JSON formatted info on a configuration loaded in the form as
- * <pre>
- * tbd
- * </pre>
- * @param configName the configuration name, not null.
- * @param envType the environment context, not null.
- * @param envContext the environment context, not null.
- * @return the JSON formatted info, never null.
- * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded
- */
- public String getConfigurationInfo(String configName, String envType, String envContext);
-
- /**
- * Access the defined areas for a given configuration.
- * @param configName the configuration name, not null.
- * @param envContext the environment context, not null.
- * @return the areas defined (only returning the areas that contain properties).
- * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded
- */
- public Set<String> getAreas(String configName, String envType, String envContext);
-
- /**
- * Access the transitive areas for a given configuration.
- * @param configName the configuration name, not null.
- * @param envType the environment context, not null.
- * @param envContext the environment context, not null.
- * @return the transitive areas defined.
- * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded
- */
- public Set<String> getTransitiveAreas(String configName, String envType, String envContext);
-
- /**
- * Allows to determine if an area is existing.
- * @param area the target area key, not null.
- * @param configName the configuration name, not null.
- * @param envType the environment context, not null.
- * @param envContext the environment context, not null.
- * @return true, if such an area exists (the area may be empty).
- */
- public boolean isAreaExisting(String area, String configName, String envType, String envContext);
-
- /**
- * Allows to determine if an area is empty.
- * @param area the target area key, not null.
- * @param configName the configuration name, not null.
- * @param envType the environment context, not null.
- * @param envContext the environment context, not null.
- * @return true, if such an area exists and is not empty.
- */
- public boolean isAreaEmpty(String area, String configName, String envType, String envContext);
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java
----------------------------------------------------------------------
diff --git a/modules/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java b/modules/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java
deleted file mode 100644
index 7caff90..0000000
--- a/modules/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java
+++ /dev/null
@@ -1,69 +0,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.
- */
-package org.apache.tamaya.management;
-
-import org.apache.tamaya.Environment;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-
-/**
- * MBean implementation for accessing environment data.
- * Created by Anatole on 24.11.2014.
- */
-public class ManagedEnvironment implements ManagedEnvironmentMBean{
-
- @Override
- public List<String> getEnvironmentHierarchy() {
- return Environment.getEnvironmentHierarchy();
- }
-
- @Override
- public String getEnvironmentInfo(String environmentContext) {
- try {
- // TODO
- return "EnvironmentInfo {}";
- }
- catch(Exception e){
- // TODO logging
- return "EnvironmentInfo{}";
- }
- }
-
- @Override
- public Map<String, String> getEnvironment(String environmentType, String context) {
- try {
- Optional<Environment> env = Environment.getInstance(environmentType, context);
- if (env.isPresent()) {
- return env.get().toMap();
- }
- } catch (Exception e) {
- // TODO logging
- }
- return Collections.emptyMap();
- }
-
- @Override
- public String getEnvironmentInfo() {
- // TODO
- return "EnvironmentInfo {}";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java
----------------------------------------------------------------------
diff --git a/modules/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java b/modules/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java
deleted file mode 100644
index 5d86700..0000000
--- a/modules/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java
+++ /dev/null
@@ -1,89 +0,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.
- */
-package org.apache.tamaya.management;
-
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Managed bean interface for accessing environment data.
- */
-public interface ManagedEnvironmentMBean {
-
- /**
- * Returns the current environment hierarchy defined.
- * @see org.apache.tamaya.Environment#getEnvironmentType()
- * @see org.apache.tamaya.Environment#getEnvironmentHierarchy()
- * @return the current environment type hierarchy defined, never null.
- */
- public List<String> getEnvironmentHierarchy();
-
- /**
- * Get the common environment information in JSON format, which has the following form:
- * <pre>
- * Environment {
- * id: "system:VM,domain:test",
- * metaInfo {
- * a: "aValue",
- * b: "bValue"
- * }
- * entries{
- * val1: "value1",
- * val2: "value2",
- * }
- * }
- * </pre>
- * @see org.apache.tamaya.Environment
- * @param environmentContext the identifier to access the environment instance
- * @return the environment JSON info, or null, if no such environment is accessible.
- */
- public String getEnvironmentInfo(String environmentContext);
-
- /**
- * Access the given environment as Map. the {@code environmentContext} is added to the
- * map using the key {@code __environmentId}.
- * @param environmentContext the identifier to access the environment instance
- * @param context the context, not null.
- * @return a map with the currently defined environment keys and values.
- */
- public Map<String,String> getEnvironment(String environmentContext, String context);
-
- /**
- * Get a general JSON info on the currently available environments current the form:
- * <pre>
- * EnvironmentInfo{
- * host: "hostName",
- * ipAddress: "111.112.123.123",
- * typeHierarchy: {"system", "domain", "ear", "war", "saas-scope", "tenant"}
- * environments {
- * Environment {
- * id: "system:VM,domain:test",
- * ...
- * },
- * ...
- * }
- * }
- * </pre>
- * @return
- */
- public String getEnvironmentInfo();
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/managed/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/modules/managed/src/main/resources/META-INF/beans.xml b/modules/managed/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index adee378..0000000
--- a/modules/managed/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?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 current 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.
--->
-<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
-
-</beans>
-
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/managed/src/test/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/modules/managed/src/test/resources/META-INF/beans.xml b/modules/managed/src/test/resources/META-INF/beans.xml
deleted file mode 100644
index adee378..0000000
--- a/modules/managed/src/test/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?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 current 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.
--->
-<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
-
-</beans>
-
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/metamodel/pom.xml
----------------------------------------------------------------------
diff --git a/modules/metamodel/pom.xml b/modules/metamodel/pom.xml
deleted file mode 100644
index 6bd6002..0000000
--- a/modules/metamodel/pom.xml
+++ /dev/null
@@ -1,101 +0,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/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.tamaya</groupId>
- <artifactId>tamaya-modules</artifactId>
- <version>0.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>tamaya-ext-metamodel</artifactId>
- <name>Apache Tamaya Module - Configuration Metamodels</name>
- <packaging>jar</packaging>
-
- <properties>
- <jdkVersion>1.8</jdkVersion>
- <maven.compile.targetLevel>${jdkVersion}</maven.compile.targetLevel>
- <maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>prepare-agent</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>${maven.compile.sourceLevel}</source>
- <target>${maven.compile.targetLevel}</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.asciidoctor</groupId>
- <artifactId>asciidoctor-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>output-html</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>process-asciidoc</goal>
- </goals>
- <configuration>
- <outputDirectory>target/docs</outputDirectory>
- <sourceHighlighter>highlightjs</sourceHighlighter>
- <!-- coderay -->
- <backend>html</backend>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>tamaya-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>tamaya-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/metamodel/src/main/java/metamodel/DefaultConfigProvider.java
----------------------------------------------------------------------
diff --git a/modules/metamodel/src/main/java/metamodel/DefaultConfigProvider.java b/modules/metamodel/src/main/java/metamodel/DefaultConfigProvider.java
deleted file mode 100644
index cef6408..0000000
--- a/modules/metamodel/src/main/java/metamodel/DefaultConfigProvider.java
+++ /dev/null
@@ -1,55 +0,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.
- */
-package main.java.metamodel;
-
-import org.apache.tamaya.core.experimental.ConfigurationBuilder;
-import org.apache.tamaya.core.spi.ConfigurationProviderSpi;
-
-/**
- * Created by Anatole on 30.09.2014.
- */
-public class DefaultConfigProvider implements ConfigurationProviderSpi{
-
- private Configuration config;
-
- @Override
- public String getConfigName(){
- return "default";
- }
-
- @Override
- public Configuration getConfiguration(){
- if(config == null){
- config = ConfigBuilder.create(getConfigName()
- .addPaths(
- "classpath*:META-INF/config/**/*.xml", "classpath*:META-INF/config/**/*.properties",
- "classpath*:META-INF/config/**/*.init")
- .addPaths("classpath*:META-INF/config/**/*.xml", "classpath*:META-INF/config/**/*.properties",
- "classpath*:META-INF/config/**/*.init")
- addConfig(AggregationPolicy.IGNORE_DUPLICATES(),
- ConfigBuilder.create("Default Configuration")
- .addPaths("classpath*:META-INF/config/**/*.xml",
- "classpath*:META-INF/config/**/*" + ".properties",
- "classpath*:META-INF/config/**/*.ini").build())
- .addConfig(AggregationPolicy.IGNORE_DUPLICATES(), Configuration.fromEnvironmentProperties(),
- Configuration.fromSystemProperties()).build();
- }
- return config;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi
----------------------------------------------------------------------
diff --git a/modules/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi b/modules/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi
deleted file mode 100644
index 5865575..0000000
--- a/modules/metamodel/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi
+++ /dev/null
@@ -1,19 +0,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 current 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.
-#
-org.apache.tamaya.ext.metamodel.DefaultConfigProvider
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/metamodels/pom.xml
----------------------------------------------------------------------
diff --git a/modules/metamodels/pom.xml b/modules/metamodels/pom.xml
new file mode 100644
index 0000000..23e2339
--- /dev/null
+++ b/modules/metamodels/pom.xml
@@ -0,0 +1,45 @@
+<!--
+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 current 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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tamaya.ext</groupId>
+ <artifactId>tamaya-ext-all</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <groupId>org.apache.tamaya.metamodels</groupId>
+ <artifactId>tamaya-metamodels-all</artifactId>
+ <name>Apache Tamaya Modules Metamodels</name>
+ <packaging>pom</packaging>
+
+ <properties>
+ <github.global.server>github</github.global.server>
+ <jdkVersion>1.8</jdkVersion>
+ <maven.compile.targetLevel>${jdkVersion}</maven.compile.targetLevel>
+ <maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
+ </properties>
+
+ <modules>
+ <module>simple</module>
+ </modules>
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/metamodels/simple/pom.xml
----------------------------------------------------------------------
diff --git a/modules/metamodels/simple/pom.xml b/modules/metamodels/simple/pom.xml
new file mode 100644
index 0000000..792a045
--- /dev/null
+++ b/modules/metamodels/simple/pom.xml
@@ -0,0 +1,73 @@
+<!--
+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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tamaya.metamodels</groupId>
+ <artifactId>tamaya-metamodels-all</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>tamaya-metamodel-simple</artifactId>
+ <name>Apache Tamaya Modules Metamodels - Simple</name>
+ <description>Simple Tamaya Metamodel, e.g. feasible for SE commandline tools and simple use cases.</description>
+ <packaging>jar</packaging>
+
+ <properties>
+ <jdkVersion>1.8</jdkVersion>
+ <maven.compile.targetLevel>${jdkVersion}</maven.compile.targetLevel>
+ <maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${maven.compile.sourceLevel}</source>
+ <target>${maven.compile.targetLevel}</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/metamodels/simple/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi
----------------------------------------------------------------------
diff --git a/modules/metamodels/simple/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi b/modules/metamodels/simple/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi
new file mode 100644
index 0000000..5865575
--- /dev/null
+++ b/modules/metamodels/simple/src/main/resources/META-INF/services/org.apache.tamaya.core.spi.ConfigurationProviderSpi
@@ -0,0 +1,19 @@
+#
+# 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 current 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.
+#
+org.apache.tamaya.ext.metamodel.DefaultConfigProvider
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/pom.xml
----------------------------------------------------------------------
diff --git a/modules/pom.xml b/modules/pom.xml
index 978bc81..695dc59 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -26,8 +26,9 @@ under the License.
<version>0.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
- <artifactId>tamaya-modules</artifactId>
- <name>Apache Tamaya - Modules</name>
+ <artifactId>tamaya-ext-all</artifactId>
+ <groupId>org.apache.tamaya.ext</groupId>
+ <name>Apache Tamaya Modules</name>
<packaging>pom</packaging>
<properties>
@@ -51,8 +52,8 @@ under the License.
</dependencies>
<modules>
- <module>cdi</module>
- <module>managed</module>
+ <module>metamodels</module>
+ <module>integration</module>
</modules>
</project>
[2/2] incubator-tamaya git commit: TAMAYA-4: Removed compile scope
for log4j in core module. TAMAYA-19: Modularized aspects in project build.
Posted by an...@apache.org.
TAMAYA-4: Removed compile scope for log4j in core module.
TAMAYA-19: Modularized aspects in project build.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/1391fa85
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/1391fa85
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/1391fa85
Branch: refs/heads/master
Commit: 1391fa85edf090b95a036bef25784d7be2ad7199
Parents: 5d1a1fa
Author: anatole <an...@apache.org>
Authored: Fri Dec 12 14:05:44 2014 +0100
Committer: anatole <an...@apache.org>
Committed: Fri Dec 12 14:05:44 2014 +0100
----------------------------------------------------------------------
api/.gitignore | 2 +
core/pom.xml | 20 +--
modules/cdi/pom.xml | 178 -------------------
.../ext/cdi/ConfigurationExtension.java | 81 ---------
.../cdi/src/main/resources/META-INF/beans.xml | 24 ---
.../javax.enterprise.inject.spi.Extension | 19 --
.../java/metamodel/ext/cdi/ConfiguredClass.java | 132 --------------
.../java/metamodel/ext/cdi/ConfiguredTest.java | 52 ------
.../metamodel/ext/cdi/TestConfigProvider.java | 65 -------
.../cdi/src/test/resources/META-INF/beans.xml | 24 ---
modules/integration/cdi/pom.xml | 178 +++++++++++++++++++
.../ext/cdi/ConfigurationExtension.java | 81 +++++++++
.../cdi/src/main/resources/META-INF/beans.xml | 24 +++
.../javax.enterprise.inject.spi.Extension | 19 ++
.../java/metamodel/ext/cdi/ConfiguredClass.java | 132 ++++++++++++++
.../java/metamodel/ext/cdi/ConfiguredTest.java | 52 ++++++
.../metamodel/ext/cdi/TestConfigProvider.java | 65 +++++++
.../cdi/src/test/resources/META-INF/beans.xml | 24 +++
modules/integration/managed/pom.xml | 71 ++++++++
.../apache/tamaya/management/ManagedConfig.java | 95 ++++++++++
.../tamaya/management/ManagedConfigMBean.java | 176 ++++++++++++++++++
.../tamaya/management/ManagedEnvironment.java | 69 +++++++
.../management/ManagedEnvironmentMBean.java | 89 ++++++++++
.../src/main/resources/META-INF/beans.xml | 24 +++
.../src/test/resources/META-INF/beans.xml | 24 +++
modules/integration/pom.xml | 45 +++++
modules/managed/pom.xml | 71 --------
.../apache/tamaya/management/ManagedConfig.java | 95 ----------
.../tamaya/management/ManagedConfigMBean.java | 176 ------------------
.../tamaya/management/ManagedEnvironment.java | 69 -------
.../management/ManagedEnvironmentMBean.java | 89 ----------
.../src/main/resources/META-INF/beans.xml | 24 ---
.../src/test/resources/META-INF/beans.xml | 24 ---
modules/metamodel/pom.xml | 101 -----------
.../java/metamodel/DefaultConfigProvider.java | 55 ------
...che.tamaya.core.spi.ConfigurationProviderSpi | 19 --
modules/metamodels/pom.xml | 45 +++++
modules/metamodels/simple/pom.xml | 73 ++++++++
...che.tamaya.core.spi.ConfigurationProviderSpi | 19 ++
modules/pom.xml | 9 +-
40 files changed, 1313 insertions(+), 1321 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/api/.gitignore
----------------------------------------------------------------------
diff --git a/api/.gitignore b/api/.gitignore
index 3b54384..919c63a 100644
--- a/api/.gitignore
+++ b/api/.gitignore
@@ -14,3 +14,5 @@ atlassian-ide-plugin.xml
.sonar-ide.properties
*.patch
*.log
+
+tamaya-api.iml
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index 79d401c..85ef679 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -72,25 +72,6 @@ under the License.
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.asciidoctor</groupId>
- <artifactId>asciidoctor-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>output-html</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>process-asciidoc</goal>
- </goals>
- <configuration>
- <outputDirectory>target/docs</outputDirectory>
- <sourceHighlighter>highlightjs</sourceHighlighter>
- <!-- coderay -->
- <backend>html</backend>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
<dependencies>
@@ -108,6 +89,7 @@ under the License.
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/cdi/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cdi/pom.xml b/modules/cdi/pom.xml
deleted file mode 100644
index b7e6191..0000000
--- a/modules/cdi/pom.xml
+++ /dev/null
@@ -1,178 +0,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 current 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">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.tamaya</groupId>
- <artifactId>tamaya-modules</artifactId>
- <version>0.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>tamaya-ext-cdi</artifactId>
- <name>Apache Tamaya Module - CDI Integration</name>
- <packaging>jar</packaging>
-
- <properties>
- <owb.version>1.5.0-SNAPSHOT</owb.version>
- <weld.version>2.2.7.Final</weld.version>
- <geronimo-jcdi-1.1-spec.version>1.0-SNAPSHOT</geronimo-jcdi-1.1-spec.version>
- <geronimo-interceptor-1.2-spec.version>1.0-SNAPSHOT</geronimo-interceptor-1.2-spec.version>
- <geronimo-atinject-1.0-spec.version>1.0</geronimo-atinject-1.0-spec.version>
- <bval.version>0.5</bval.version>
- <ds.version>1.1.0</ds.version>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>prepare-agent</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>tamaya-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jcdi_1.1_spec</artifactId>
- <version>${geronimo-jcdi-1.1-spec.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.deltaspike.modules</groupId>
- <artifactId>deltaspike-test-control-module-api</artifactId>
- <version>${ds.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.deltaspike.modules</groupId>
- <artifactId>deltaspike-test-control-module-impl</artifactId>
- <version>${ds.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <profiles>
- <profile>
- <id>OWB</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <dependencies>
- <!-- OWB specific dependencies-->
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-atinject_1.0_spec</artifactId>
- <version>${geronimo-atinject-1.0-spec.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-interceptor_1.2_spec</artifactId>
- <version>${geronimo-interceptor-1.2-spec.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-annotation_1.2_spec</artifactId>
- <version>1.0.MR2-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-el_2.2_spec</artifactId>
- <version>1.0.2</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.openwebbeans</groupId>
- <artifactId>openwebbeans-impl</artifactId>
- <version>${owb.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.openwebbeans</groupId>
- <artifactId>openwebbeans-spi</artifactId>
- <version>${owb.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.openwebbeans</groupId>
- <artifactId>openwebbeans-resource</artifactId>
- <version>${owb.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.bval</groupId>
- <artifactId>bval-jsr303</artifactId>
- <version>${bval.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.deltaspike.cdictrl</groupId>
- <artifactId>deltaspike-cdictrl-owb</artifactId>
- <version>${ds.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>Weld</id>
- <dependencies>
- <dependency>
- <groupId>org.jboss.weld.se</groupId>
- <artifactId>weld-se</artifactId>
- <version>${weld.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.deltaspike.cdictrl</groupId>
- <artifactId>deltaspike-cdictrl-weld</artifactId>
- <version>${ds.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/cdi/src/main/java/main/java/metamodel/ext/cdi/ConfigurationExtension.java
----------------------------------------------------------------------
diff --git a/modules/cdi/src/main/java/main/java/metamodel/ext/cdi/ConfigurationExtension.java b/modules/cdi/src/main/java/main/java/metamodel/ext/cdi/ConfigurationExtension.java
deleted file mode 100644
index 5044398..0000000
--- a/modules/cdi/src/main/java/main/java/metamodel/ext/cdi/ConfigurationExtension.java
+++ /dev/null
@@ -1,81 +0,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.
- */
-package main.java.metamodel.ext.cdi;
-
-import org.apache.tamaya.core.internal.inject.ConfigurationInjector;
-import org.apache.tamaya.core.internal.inject.ConfiguredType;
-
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.Vetoed;
-import javax.enterprise.inject.spi.*;
-import java.util.*;
-
-/**
- * CDI portable extension that integrates {@link org.apache.tamaya.core.internal.inject.ConfigurationInjector}
- * with CDI by adding configuration features to CDI (config enable CDI beans).
- */
-@Vetoed
-public final class ConfigurationExtension implements Extension {
-
- public <T> void initializeConfiguredFields(final @Observes ProcessInjectionTarget<T> pit) {
- final AnnotatedType<T> at = pit.getAnnotatedType();
- if (!ConfiguredType.isConfigured(at.getJavaClass())) {
- return;
- }
- final ConfiguredType configuredType = ConfigurationInjector.registerType(at.getJavaClass());
-
- final InjectionTarget<T> it = pit.getInjectionTarget();
- InjectionTarget<T> wrapped = new InjectionTarget<T>() {
- @Override
- public void inject(T instance, CreationalContext<T> ctx) {
- it.inject(instance, ctx);
- ConfigurationInjector.configure(instance);
- }
-
- @Override
- public void postConstruct(T instance) {
- it.postConstruct(instance);
- }
-
- @Override
- public void preDestroy(T instance) {
- it.dispose(instance);
- }
-
- @Override
- public void dispose(T instance) {
- it.dispose(instance);
- }
-
- @Override
- public Set<InjectionPoint> getInjectionPoints() {
- return it.getInjectionPoints();
- }
-
- @Override
- public T produce(CreationalContext<T> ctx) {
- return it.produce(ctx);
- }
- };
- pit.setInjectionTarget(wrapped);
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/cdi/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/modules/cdi/src/main/resources/META-INF/beans.xml b/modules/cdi/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index adee378..0000000
--- a/modules/cdi/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?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 current 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.
--->
-<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
-
-</beans>
-
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
----------------------------------------------------------------------
diff --git a/modules/cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/modules/cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
deleted file mode 100644
index 8fa1976..0000000
--- a/modules/cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
+++ /dev/null
@@ -1,19 +0,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 current 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.
-#
-main.java.metamodel.ext.cdi.ConfigurationExtension
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredClass.java
----------------------------------------------------------------------
diff --git a/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredClass.java b/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredClass.java
deleted file mode 100644
index e610085..0000000
--- a/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredClass.java
+++ /dev/null
@@ -1,132 +0,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 current 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 main.java.metamodel.ext.cdi;
-
-import org.apache.tamaya.annotation.ConfigChangeListener;
-import org.apache.tamaya.annotation.ConfiguredProperty;
-import org.apache.tamaya.annotation.DefaultValue;
-import org.apache.tamaya.annotation.WithConfig;
-
-import javax.inject.Singleton;
-import java.beans.PropertyChangeEvent;
-import java.math.BigDecimal;
-
-/**
- * Created by Anatole on 08.09.2014.
- */
-@Singleton
-public class ConfiguredClass{
-
- @WithConfig("test")
- @ConfiguredProperty
- private String testProperty;
-
- @ConfiguredProperty("a.b.c.key1")
- @ConfiguredProperty("a.b.c.key2")
- @ConfiguredProperty("a.b.c.key3")
- @DefaultValue("The current \\${JAVA_HOME} env property is ${env:JAVA_HOME}.")
- String value1;
-
- @WithConfig("test")
- @ConfiguredProperty("foo")
- @ConfiguredProperty("a.b.c.key2")
- private String value2;
-
- @ConfiguredProperty
- @DefaultValue("N/A")
- private String runtimeVersion;
-
- @ConfiguredProperty
- @DefaultValue("${sys:java.version}")
- private String javaVersion2;
-
- @ConfiguredProperty
- @DefaultValue("5")
- private Integer int1;
-
- @WithConfig("test")
- @ConfiguredProperty
- private int int2;
-
- @WithConfig("test")
- @ConfiguredProperty
- private boolean booleanT;
-
- @WithConfig("test")
- @ConfiguredProperty("BD")
- private BigDecimal bigNumber;
-
- @WithConfig("test")
- @ConfiguredProperty("double1")
- private double doubleValue;
-
- @ConfigChangeListener
- public void changeListener1(PropertyChangeEvent configChange){
- // will be called
- }
-
- public String getTestProperty() {
- return testProperty;
- }
-
- public String getValue1() {
- return value1;
- }
-
- public String getValue2() {
- return value2;
- }
-
- public String getRuntimeVersion() {
- return runtimeVersion;
- }
-
- public String getJavaVersion2() {
- return javaVersion2;
- }
-
- public Integer getInt1() {
- return int1;
- }
-
- public int getInt2() {
- return int2;
- }
-
- public boolean isBooleanT() {
- return booleanT;
- }
-
- public BigDecimal getBigNumber() {
- return bigNumber;
- }
-
- public double getDoubleValue() {
- return doubleValue;
- }
-
- public String toString(){
- return super.toString() + ": testProperty="+testProperty+", value1="+value1+", value2="+value2
- +", int1="+int1+", int2="+int2+", booleanT="+booleanT+", bigNumber="+bigNumber
- +", runtimeVersion="+runtimeVersion+", javaVersion2="+javaVersion2;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredTest.java
----------------------------------------------------------------------
diff --git a/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredTest.java b/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredTest.java
deleted file mode 100644
index 5f09194..0000000
--- a/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredTest.java
+++ /dev/null
@@ -1,52 +0,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 current 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 main.java.metamodel.ext.cdi;
-
-import org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner;
-import org.hamcrest.MatcherAssert;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.enterprise.inject.spi.CDI;
-
-import static org.hamcrest.core.Is.is;
-
-/**
- * Created by Anatole on 08.09.2014.
- */
-@RunWith(CdiTestRunner.class)
-public class ConfiguredTest{
-
- @Ignore
- @Test
- public void testInjection(){
- ConfiguredClass item = CDI.current().select(ConfiguredClass.class).get();
- System.out.println("********************************************");
- System.out.println(item);
- System.out.println("********************************************");
-
- double actual = 1234.5678;
-
- MatcherAssert.assertThat(item.getDoubleValue(), is(actual));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/TestConfigProvider.java
----------------------------------------------------------------------
diff --git a/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/TestConfigProvider.java b/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/TestConfigProvider.java
deleted file mode 100644
index c345929..0000000
--- a/modules/cdi/src/test/java/main/java/metamodel/ext/cdi/TestConfigProvider.java
+++ /dev/null
@@ -1,65 +0,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 current 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 main.java.metamodel.ext.cdi;
-
-import org.apache.tamaya.Configuration;
-import org.apache.tamaya.MetaInfoBuilder;
-import org.apache.tamaya.PropertyProviderBuilder;
-import org.apache.tamaya.core.spi.ConfigurationProviderSpi;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Created by Anatole on 29.09.2014.
- */
-public class TestConfigProvider implements ConfigurationProviderSpi
-{
-
- private Configuration testConfig;
-
- public TestConfigProvider(){
- final Map<String,String> config = new HashMap<>();
- config.put("a.b.c.key1", "value current a.b.c.key1");
- config.put("a.b.c.key2", "value current a.b.c.key2");
- config.put("a.b.key3", "value current a.b.key3");
- config.put("a.b.key4", "value current a.b.key4");
- config.put("a.key5", "value current a.key5");
- config.put("a.key6", "value current a.key6");
- config.put("int1", "123456");
- config.put("int2", "111222");
- config.put("testProperty", "testPropertyValue!");
- config.put("booleanT", "true");
- config.put("double1", "1234.5678");
- config.put("BD", "123456789123456789123456789123456789.123456789123456789123456789123456789");
- config.put("testProperty", "value current testProperty");
- config.put("runtimeVersion", "${java.version}");
- testConfig = PropertyProviderBuilder.create("test").addMap(config).build().toConfiguration();
- }
-
- @Override
- public String getConfigName(){
- return "test";
- }
-
- @Override
- public Configuration getConfiguration(){
- return testConfig;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/cdi/src/test/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/modules/cdi/src/test/resources/META-INF/beans.xml b/modules/cdi/src/test/resources/META-INF/beans.xml
deleted file mode 100644
index adee378..0000000
--- a/modules/cdi/src/test/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?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 current 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.
--->
-<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
-
-</beans>
-
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/cdi/pom.xml
----------------------------------------------------------------------
diff --git a/modules/integration/cdi/pom.xml b/modules/integration/cdi/pom.xml
new file mode 100644
index 0000000..1909bcc
--- /dev/null
+++ b/modules/integration/cdi/pom.xml
@@ -0,0 +1,178 @@
+<!--
+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 current 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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tamaya.integration</groupId>
+ <artifactId>tamaya-integration-all</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>tamaya-cdi</artifactId>
+ <name>Apache Tamaya Modules Integration - CDI</name>
+ <packaging>jar</packaging>
+
+ <properties>
+ <owb.version>1.5.0-SNAPSHOT</owb.version>
+ <weld.version>2.2.7.Final</weld.version>
+ <geronimo-jcdi-1.1-spec.version>1.0-SNAPSHOT</geronimo-jcdi-1.1-spec.version>
+ <geronimo-interceptor-1.2-spec.version>1.0-SNAPSHOT</geronimo-interceptor-1.2-spec.version>
+ <geronimo-atinject-1.0-spec.version>1.0</geronimo-atinject-1.0-spec.version>
+ <bval.version>0.5</bval.version>
+ <ds.version>1.1.0</ds.version>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tamaya</groupId>
+ <artifactId>tamaya-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jcdi_1.1_spec</artifactId>
+ <version>${geronimo-jcdi-1.1-spec.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.deltaspike.modules</groupId>
+ <artifactId>deltaspike-test-control-module-api</artifactId>
+ <version>${ds.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.deltaspike.modules</groupId>
+ <artifactId>deltaspike-test-control-module-impl</artifactId>
+ <version>${ds.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <profiles>
+ <profile>
+ <id>OWB</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <dependencies>
+ <!-- OWB specific dependencies-->
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-atinject_1.0_spec</artifactId>
+ <version>${geronimo-atinject-1.0-spec.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-interceptor_1.2_spec</artifactId>
+ <version>${geronimo-interceptor-1.2-spec.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-annotation_1.2_spec</artifactId>
+ <version>1.0.MR2-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-el_2.2_spec</artifactId>
+ <version>1.0.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-impl</artifactId>
+ <version>${owb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-spi</artifactId>
+ <version>${owb.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-resource</artifactId>
+ <version>${owb.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.bval</groupId>
+ <artifactId>bval-jsr303</artifactId>
+ <version>${bval.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.deltaspike.cdictrl</groupId>
+ <artifactId>deltaspike-cdictrl-owb</artifactId>
+ <version>${ds.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>Weld</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.weld.se</groupId>
+ <artifactId>weld-se</artifactId>
+ <version>${weld.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.deltaspike.cdictrl</groupId>
+ <artifactId>deltaspike-cdictrl-weld</artifactId>
+ <version>${ds.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/cdi/src/main/java/main/java/metamodel/ext/cdi/ConfigurationExtension.java
----------------------------------------------------------------------
diff --git a/modules/integration/cdi/src/main/java/main/java/metamodel/ext/cdi/ConfigurationExtension.java b/modules/integration/cdi/src/main/java/main/java/metamodel/ext/cdi/ConfigurationExtension.java
new file mode 100644
index 0000000..5044398
--- /dev/null
+++ b/modules/integration/cdi/src/main/java/main/java/metamodel/ext/cdi/ConfigurationExtension.java
@@ -0,0 +1,81 @@
+/*
+ * 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 main.java.metamodel.ext.cdi;
+
+import org.apache.tamaya.core.internal.inject.ConfigurationInjector;
+import org.apache.tamaya.core.internal.inject.ConfiguredType;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Vetoed;
+import javax.enterprise.inject.spi.*;
+import java.util.*;
+
+/**
+ * CDI portable extension that integrates {@link org.apache.tamaya.core.internal.inject.ConfigurationInjector}
+ * with CDI by adding configuration features to CDI (config enable CDI beans).
+ */
+@Vetoed
+public final class ConfigurationExtension implements Extension {
+
+ public <T> void initializeConfiguredFields(final @Observes ProcessInjectionTarget<T> pit) {
+ final AnnotatedType<T> at = pit.getAnnotatedType();
+ if (!ConfiguredType.isConfigured(at.getJavaClass())) {
+ return;
+ }
+ final ConfiguredType configuredType = ConfigurationInjector.registerType(at.getJavaClass());
+
+ final InjectionTarget<T> it = pit.getInjectionTarget();
+ InjectionTarget<T> wrapped = new InjectionTarget<T>() {
+ @Override
+ public void inject(T instance, CreationalContext<T> ctx) {
+ it.inject(instance, ctx);
+ ConfigurationInjector.configure(instance);
+ }
+
+ @Override
+ public void postConstruct(T instance) {
+ it.postConstruct(instance);
+ }
+
+ @Override
+ public void preDestroy(T instance) {
+ it.dispose(instance);
+ }
+
+ @Override
+ public void dispose(T instance) {
+ it.dispose(instance);
+ }
+
+ @Override
+ public Set<InjectionPoint> getInjectionPoints() {
+ return it.getInjectionPoints();
+ }
+
+ @Override
+ public T produce(CreationalContext<T> ctx) {
+ return it.produce(ctx);
+ }
+ };
+ pit.setInjectionTarget(wrapped);
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/cdi/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/modules/integration/cdi/src/main/resources/META-INF/beans.xml b/modules/integration/cdi/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..adee378
--- /dev/null
+++ b/modules/integration/cdi/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,24 @@
+<?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 current 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.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
+
+</beans>
+
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
----------------------------------------------------------------------
diff --git a/modules/integration/cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/modules/integration/cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
new file mode 100644
index 0000000..8fa1976
--- /dev/null
+++ b/modules/integration/cdi/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
@@ -0,0 +1,19 @@
+#
+# 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 current 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.
+#
+main.java.metamodel.ext.cdi.ConfigurationExtension
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredClass.java
----------------------------------------------------------------------
diff --git a/modules/integration/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredClass.java b/modules/integration/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredClass.java
new file mode 100644
index 0000000..e610085
--- /dev/null
+++ b/modules/integration/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredClass.java
@@ -0,0 +1,132 @@
+/*
+ *
+ * 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 current 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 main.java.metamodel.ext.cdi;
+
+import org.apache.tamaya.annotation.ConfigChangeListener;
+import org.apache.tamaya.annotation.ConfiguredProperty;
+import org.apache.tamaya.annotation.DefaultValue;
+import org.apache.tamaya.annotation.WithConfig;
+
+import javax.inject.Singleton;
+import java.beans.PropertyChangeEvent;
+import java.math.BigDecimal;
+
+/**
+ * Created by Anatole on 08.09.2014.
+ */
+@Singleton
+public class ConfiguredClass{
+
+ @WithConfig("test")
+ @ConfiguredProperty
+ private String testProperty;
+
+ @ConfiguredProperty("a.b.c.key1")
+ @ConfiguredProperty("a.b.c.key2")
+ @ConfiguredProperty("a.b.c.key3")
+ @DefaultValue("The current \\${JAVA_HOME} env property is ${env:JAVA_HOME}.")
+ String value1;
+
+ @WithConfig("test")
+ @ConfiguredProperty("foo")
+ @ConfiguredProperty("a.b.c.key2")
+ private String value2;
+
+ @ConfiguredProperty
+ @DefaultValue("N/A")
+ private String runtimeVersion;
+
+ @ConfiguredProperty
+ @DefaultValue("${sys:java.version}")
+ private String javaVersion2;
+
+ @ConfiguredProperty
+ @DefaultValue("5")
+ private Integer int1;
+
+ @WithConfig("test")
+ @ConfiguredProperty
+ private int int2;
+
+ @WithConfig("test")
+ @ConfiguredProperty
+ private boolean booleanT;
+
+ @WithConfig("test")
+ @ConfiguredProperty("BD")
+ private BigDecimal bigNumber;
+
+ @WithConfig("test")
+ @ConfiguredProperty("double1")
+ private double doubleValue;
+
+ @ConfigChangeListener
+ public void changeListener1(PropertyChangeEvent configChange){
+ // will be called
+ }
+
+ public String getTestProperty() {
+ return testProperty;
+ }
+
+ public String getValue1() {
+ return value1;
+ }
+
+ public String getValue2() {
+ return value2;
+ }
+
+ public String getRuntimeVersion() {
+ return runtimeVersion;
+ }
+
+ public String getJavaVersion2() {
+ return javaVersion2;
+ }
+
+ public Integer getInt1() {
+ return int1;
+ }
+
+ public int getInt2() {
+ return int2;
+ }
+
+ public boolean isBooleanT() {
+ return booleanT;
+ }
+
+ public BigDecimal getBigNumber() {
+ return bigNumber;
+ }
+
+ public double getDoubleValue() {
+ return doubleValue;
+ }
+
+ public String toString(){
+ return super.toString() + ": testProperty="+testProperty+", value1="+value1+", value2="+value2
+ +", int1="+int1+", int2="+int2+", booleanT="+booleanT+", bigNumber="+bigNumber
+ +", runtimeVersion="+runtimeVersion+", javaVersion2="+javaVersion2;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredTest.java
----------------------------------------------------------------------
diff --git a/modules/integration/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredTest.java b/modules/integration/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredTest.java
new file mode 100644
index 0000000..5f09194
--- /dev/null
+++ b/modules/integration/cdi/src/test/java/main/java/metamodel/ext/cdi/ConfiguredTest.java
@@ -0,0 +1,52 @@
+/*
+ * 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 current 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 main.java.metamodel.ext.cdi;
+
+import org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner;
+import org.hamcrest.MatcherAssert;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.enterprise.inject.spi.CDI;
+
+import static org.hamcrest.core.Is.is;
+
+/**
+ * Created by Anatole on 08.09.2014.
+ */
+@RunWith(CdiTestRunner.class)
+public class ConfiguredTest{
+
+ @Ignore
+ @Test
+ public void testInjection(){
+ ConfiguredClass item = CDI.current().select(ConfiguredClass.class).get();
+ System.out.println("********************************************");
+ System.out.println(item);
+ System.out.println("********************************************");
+
+ double actual = 1234.5678;
+
+ MatcherAssert.assertThat(item.getDoubleValue(), is(actual));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/cdi/src/test/java/main/java/metamodel/ext/cdi/TestConfigProvider.java
----------------------------------------------------------------------
diff --git a/modules/integration/cdi/src/test/java/main/java/metamodel/ext/cdi/TestConfigProvider.java b/modules/integration/cdi/src/test/java/main/java/metamodel/ext/cdi/TestConfigProvider.java
new file mode 100644
index 0000000..c345929
--- /dev/null
+++ b/modules/integration/cdi/src/test/java/main/java/metamodel/ext/cdi/TestConfigProvider.java
@@ -0,0 +1,65 @@
+/*
+ * 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 current 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 main.java.metamodel.ext.cdi;
+
+import org.apache.tamaya.Configuration;
+import org.apache.tamaya.MetaInfoBuilder;
+import org.apache.tamaya.PropertyProviderBuilder;
+import org.apache.tamaya.core.spi.ConfigurationProviderSpi;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by Anatole on 29.09.2014.
+ */
+public class TestConfigProvider implements ConfigurationProviderSpi
+{
+
+ private Configuration testConfig;
+
+ public TestConfigProvider(){
+ final Map<String,String> config = new HashMap<>();
+ config.put("a.b.c.key1", "value current a.b.c.key1");
+ config.put("a.b.c.key2", "value current a.b.c.key2");
+ config.put("a.b.key3", "value current a.b.key3");
+ config.put("a.b.key4", "value current a.b.key4");
+ config.put("a.key5", "value current a.key5");
+ config.put("a.key6", "value current a.key6");
+ config.put("int1", "123456");
+ config.put("int2", "111222");
+ config.put("testProperty", "testPropertyValue!");
+ config.put("booleanT", "true");
+ config.put("double1", "1234.5678");
+ config.put("BD", "123456789123456789123456789123456789.123456789123456789123456789123456789");
+ config.put("testProperty", "value current testProperty");
+ config.put("runtimeVersion", "${java.version}");
+ testConfig = PropertyProviderBuilder.create("test").addMap(config).build().toConfiguration();
+ }
+
+ @Override
+ public String getConfigName(){
+ return "test";
+ }
+
+ @Override
+ public Configuration getConfiguration(){
+ return testConfig;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/cdi/src/test/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/modules/integration/cdi/src/test/resources/META-INF/beans.xml b/modules/integration/cdi/src/test/resources/META-INF/beans.xml
new file mode 100644
index 0000000..adee378
--- /dev/null
+++ b/modules/integration/cdi/src/test/resources/META-INF/beans.xml
@@ -0,0 +1,24 @@
+<?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 current 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.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
+
+</beans>
+
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/managed/pom.xml
----------------------------------------------------------------------
diff --git a/modules/integration/managed/pom.xml b/modules/integration/managed/pom.xml
new file mode 100644
index 0000000..3b4f5bc
--- /dev/null
+++ b/modules/integration/managed/pom.xml
@@ -0,0 +1,71 @@
+<!--
+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 current 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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tamaya.integration</groupId>
+ <artifactId>tamaya-integration-all</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>tamaya-integration-managed</artifactId>
+ <name>Apache Tamaya Modules Integration - Java Management Extensions</name>
+ <packaging>jar</packaging>
+
+ <properties>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tamaya-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>tamaya-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedConfig.java
----------------------------------------------------------------------
diff --git a/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedConfig.java b/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedConfig.java
new file mode 100644
index 0000000..681c02b
--- /dev/null
+++ b/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedConfig.java
@@ -0,0 +1,95 @@
+/*
+ * 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.tamaya.management;
+
+import org.apache.tamaya.ConfigException;
+import org.apache.tamaya.AggregationPolicy;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Created by Anatole on 24.11.2014.
+ */
+public class ManagedConfig implements ManagedConfigMBean{
+ @Override
+ public Set<String> getConfigurationNames() {
+ return null;
+ }
+
+ @Override
+ public String getConfigurationInfo(String configName) {
+ return null;
+ }
+
+ @Override
+ public boolean isConfigurationAvailable(String configName, String envType, String context) {
+ return false;
+ }
+
+ @Override
+ public boolean isConfigurationLoaded(String configName, String envType, String context) {
+ return false;
+ }
+
+ @Override
+ public Map<String, String> getConfiguration(String configName, String envType, String context) throws ConfigException {
+ return null;
+ }
+
+ @Override
+ public Map<String, String> getRecursiveConfigValues(String area, String configName, String envType, String context) throws ConfigException {
+ return null;
+ }
+
+ @Override
+ public Map<String, String> getConfigValues(String area, String configName, String envType, String context) throws ConfigException {
+ return null;
+ }
+
+ @Override
+ public Map<String, String> updateConfiguration(String configName, String envType, String context, Map<String, String> values, AggregationPolicy aggregationPolicy) throws ConfigException {
+ return null;
+ }
+
+ @Override
+ public String getConfigurationInfo(String configName, String envType, String context) {
+ return null;
+ }
+
+ @Override
+ public Set<String> getAreas(String configName, String envType, String context) {
+ return null;
+ }
+
+ @Override
+ public Set<String> getTransitiveAreas(String configName, String envType, String context) {
+ return null;
+ }
+
+ @Override
+ public boolean isAreaExisting(String area, String configName, String envType, String context) {
+ return false;
+ }
+
+ @Override
+ public boolean isAreaEmpty(String area, String configName, String envType, String context) {
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java
----------------------------------------------------------------------
diff --git a/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java b/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java
new file mode 100644
index 0000000..381d43a
--- /dev/null
+++ b/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedConfigMBean.java
@@ -0,0 +1,176 @@
+/*
+ * 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.tamaya.management;
+
+
+import org.apache.tamaya.ConfigException;
+import org.apache.tamaya.AggregationPolicy;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Managed bean interface for accessing environment data.
+ */
+public interface ManagedConfigMBean {
+ /**
+ * Get the names current the configuration's defined.
+ *
+ * @return the names current the configuration's defined.
+ */
+ public Set<String> getConfigurationNames();
+
+ /**
+ * Get a general configuration info descriptor in JSON format for a configuration
+ * type in the following form:
+ * <pre>
+ * tbd
+ * </pre>
+ *
+ * @param configName the configuration name, not null.
+ * @return a JSON formatted meta-information.
+ */
+ public String getConfigurationInfo(String configName);
+
+ /**
+ * Allows to determine if a configuration current a given type is available (accessible) in the
+ * given environment context.
+ *
+ * @param configName the configuration name, not null.
+ * @param envType the environment context, not null.
+ * @param envContext the environment context, not null.
+ * @return true, if such a configuration is accessible.
+ */
+ public boolean isConfigurationAvailable(String configName, String envType, String envContext);
+
+ /**
+ * Allows to determine if a configuration current a given type is loaded in the
+ * given environment context.
+ *
+ * @param configName the configuration name, not null.
+ * @param envType the environment context, not null.
+ * @param envContext the environment context, not null.
+ * @return true, if such a configuration is accessible.
+ */
+ public boolean isConfigurationLoaded(String configName, String envType, String envContext);
+
+ /**
+ * Accesses a configuration current a given type as Map.
+ *
+ * @param configName the configuration name, not null.
+ * @param envType the environment context, not null.
+ * @param envContext the environment context, not null.
+ * @return true, if such a configuration is accessible.
+ * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded.
+ */
+ public Map<String, String> getConfiguration(String configName, String envType, String envContext)
+ throws ConfigException;
+
+ /**
+ * Accesses a configuration values for current a given config area as Map.
+ * @param area the target area key, not null.
+ * @param configName the configuration name, not null.
+ * @param envType the environment context, not null.
+ * @param envContext the environment context, not null.
+ * @return the key/values found, including the recursive child values.
+ * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded.
+ */
+ public Map<String, String> getRecursiveConfigValues(String area, String configName, String envType, String envContext)
+ throws ConfigException;
+
+ /**
+ * Accesses a configuration values for current a given config area as Map.
+ * @param area the target area key, not null.
+ * @param configName the configuration name, not null.
+ * @param envType the environment context, not null.
+ * @param envContext the environment context, not null.
+ * @return the key/values found, not transitive.
+ * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded.
+ */
+ public Map<String, String> getConfigValues(String area, String configName, String envType, String envContext)
+ throws ConfigException;
+
+ /**
+ * Updates a configuration current a given type.
+ *
+ * @param configName the configuration name, not null.
+ * @param envType the environment context, not null.
+ * @param envContext the environment context, not null.
+ * @param values the values to be changed.
+ * @param aggregationPolicy the aggregation Policy to be used.
+ * @return the configuration after the changesd have been applied.
+ * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded, or not
+ * mutable.
+ */
+ public Map<String, String> updateConfiguration(String configName, String envType, String envContext, Map<String, String> values, AggregationPolicy aggregationPolicy)
+ throws ConfigException;
+
+ /**
+ * Access a JSON formatted info on a configuration loaded in the form as
+ * <pre>
+ * tbd
+ * </pre>
+ * @param configName the configuration name, not null.
+ * @param envType the environment context, not null.
+ * @param envContext the environment context, not null.
+ * @return the JSON formatted info, never null.
+ * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded
+ */
+ public String getConfigurationInfo(String configName, String envType, String envContext);
+
+ /**
+ * Access the defined areas for a given configuration.
+ * @param configName the configuration name, not null.
+ * @param envContext the environment context, not null.
+ * @return the areas defined (only returning the areas that contain properties).
+ * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded
+ */
+ public Set<String> getAreas(String configName, String envType, String envContext);
+
+ /**
+ * Access the transitive areas for a given configuration.
+ * @param configName the configuration name, not null.
+ * @param envType the environment context, not null.
+ * @param envContext the environment context, not null.
+ * @return the transitive areas defined.
+ * @throws org.apache.tamaya.ConfigException If the configuration is not yet loaded
+ */
+ public Set<String> getTransitiveAreas(String configName, String envType, String envContext);
+
+ /**
+ * Allows to determine if an area is existing.
+ * @param area the target area key, not null.
+ * @param configName the configuration name, not null.
+ * @param envType the environment context, not null.
+ * @param envContext the environment context, not null.
+ * @return true, if such an area exists (the area may be empty).
+ */
+ public boolean isAreaExisting(String area, String configName, String envType, String envContext);
+
+ /**
+ * Allows to determine if an area is empty.
+ * @param area the target area key, not null.
+ * @param configName the configuration name, not null.
+ * @param envType the environment context, not null.
+ * @param envContext the environment context, not null.
+ * @return true, if such an area exists and is not empty.
+ */
+ public boolean isAreaEmpty(String area, String configName, String envType, String envContext);
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java
----------------------------------------------------------------------
diff --git a/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java b/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java
new file mode 100644
index 0000000..7caff90
--- /dev/null
+++ b/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironment.java
@@ -0,0 +1,69 @@
+/*
+ * 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.tamaya.management;
+
+import org.apache.tamaya.Environment;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+/**
+ * MBean implementation for accessing environment data.
+ * Created by Anatole on 24.11.2014.
+ */
+public class ManagedEnvironment implements ManagedEnvironmentMBean{
+
+ @Override
+ public List<String> getEnvironmentHierarchy() {
+ return Environment.getEnvironmentHierarchy();
+ }
+
+ @Override
+ public String getEnvironmentInfo(String environmentContext) {
+ try {
+ // TODO
+ return "EnvironmentInfo {}";
+ }
+ catch(Exception e){
+ // TODO logging
+ return "EnvironmentInfo{}";
+ }
+ }
+
+ @Override
+ public Map<String, String> getEnvironment(String environmentType, String context) {
+ try {
+ Optional<Environment> env = Environment.getInstance(environmentType, context);
+ if (env.isPresent()) {
+ return env.get().toMap();
+ }
+ } catch (Exception e) {
+ // TODO logging
+ }
+ return Collections.emptyMap();
+ }
+
+ @Override
+ public String getEnvironmentInfo() {
+ // TODO
+ return "EnvironmentInfo {}";
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java
----------------------------------------------------------------------
diff --git a/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java b/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java
new file mode 100644
index 0000000..5d86700
--- /dev/null
+++ b/modules/integration/managed/src/main/java/org/apache/tamaya/management/ManagedEnvironmentMBean.java
@@ -0,0 +1,89 @@
+/*
+ * 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.tamaya.management;
+
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Managed bean interface for accessing environment data.
+ */
+public interface ManagedEnvironmentMBean {
+
+ /**
+ * Returns the current environment hierarchy defined.
+ * @see org.apache.tamaya.Environment#getEnvironmentType()
+ * @see org.apache.tamaya.Environment#getEnvironmentHierarchy()
+ * @return the current environment type hierarchy defined, never null.
+ */
+ public List<String> getEnvironmentHierarchy();
+
+ /**
+ * Get the common environment information in JSON format, which has the following form:
+ * <pre>
+ * Environment {
+ * id: "system:VM,domain:test",
+ * metaInfo {
+ * a: "aValue",
+ * b: "bValue"
+ * }
+ * entries{
+ * val1: "value1",
+ * val2: "value2",
+ * }
+ * }
+ * </pre>
+ * @see org.apache.tamaya.Environment
+ * @param environmentContext the identifier to access the environment instance
+ * @return the environment JSON info, or null, if no such environment is accessible.
+ */
+ public String getEnvironmentInfo(String environmentContext);
+
+ /**
+ * Access the given environment as Map. the {@code environmentContext} is added to the
+ * map using the key {@code __environmentId}.
+ * @param environmentContext the identifier to access the environment instance
+ * @param context the context, not null.
+ * @return a map with the currently defined environment keys and values.
+ */
+ public Map<String,String> getEnvironment(String environmentContext, String context);
+
+ /**
+ * Get a general JSON info on the currently available environments current the form:
+ * <pre>
+ * EnvironmentInfo{
+ * host: "hostName",
+ * ipAddress: "111.112.123.123",
+ * typeHierarchy: {"system", "domain", "ear", "war", "saas-scope", "tenant"}
+ * environments {
+ * Environment {
+ * id: "system:VM,domain:test",
+ * ...
+ * },
+ * ...
+ * }
+ * }
+ * </pre>
+ * @return
+ */
+ public String getEnvironmentInfo();
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/managed/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/modules/integration/managed/src/main/resources/META-INF/beans.xml b/modules/integration/managed/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..adee378
--- /dev/null
+++ b/modules/integration/managed/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,24 @@
+<?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 current 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.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
+
+</beans>
+
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/managed/src/test/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/modules/integration/managed/src/test/resources/META-INF/beans.xml b/modules/integration/managed/src/test/resources/META-INF/beans.xml
new file mode 100644
index 0000000..adee378
--- /dev/null
+++ b/modules/integration/managed/src/test/resources/META-INF/beans.xml
@@ -0,0 +1,24 @@
+<?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 current 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.
+-->
+<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
+
+</beans>
+
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/integration/pom.xml
----------------------------------------------------------------------
diff --git a/modules/integration/pom.xml b/modules/integration/pom.xml
new file mode 100644
index 0000000..44d1a43
--- /dev/null
+++ b/modules/integration/pom.xml
@@ -0,0 +1,45 @@
+<!--
+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 current 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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tamaya.ext</groupId>
+ <artifactId>tamaya-ext-all</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <groupId>org.apache.tamaya.integration</groupId>
+ <artifactId>tamaya-integration-all</artifactId>
+ <name>Apache Tamaya Modules Integration</name>
+ <packaging>pom</packaging>
+
+ <properties>
+ <github.global.server>github</github.global.server>
+ <jdkVersion>1.8</jdkVersion>
+ <maven.compile.targetLevel>${jdkVersion}</maven.compile.targetLevel>
+ <maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
+ </properties>
+
+ <modules>
+ <module>cdi</module>
+ </modules>
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/managed/pom.xml
----------------------------------------------------------------------
diff --git a/modules/managed/pom.xml b/modules/managed/pom.xml
deleted file mode 100644
index 53575d8..0000000
--- a/modules/managed/pom.xml
+++ /dev/null
@@ -1,71 +0,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 current 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">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.tamaya</groupId>
- <artifactId>tamaya-modules</artifactId>
- <version>0.1-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>tamaya-ext-managed</artifactId>
- <name>Apache Tamaya Module - Management Beans</name>
- <packaging>jar</packaging>
-
- <properties>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>prepare-agent</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>tamaya-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>tamaya-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/1391fa85/modules/managed/src/main/java/org/apache/tamaya/management/ManagedConfig.java
----------------------------------------------------------------------
diff --git a/modules/managed/src/main/java/org/apache/tamaya/management/ManagedConfig.java b/modules/managed/src/main/java/org/apache/tamaya/management/ManagedConfig.java
deleted file mode 100644
index 681c02b..0000000
--- a/modules/managed/src/main/java/org/apache/tamaya/management/ManagedConfig.java
+++ /dev/null
@@ -1,95 +0,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.
- */
-package org.apache.tamaya.management;
-
-import org.apache.tamaya.ConfigException;
-import org.apache.tamaya.AggregationPolicy;
-
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Created by Anatole on 24.11.2014.
- */
-public class ManagedConfig implements ManagedConfigMBean{
- @Override
- public Set<String> getConfigurationNames() {
- return null;
- }
-
- @Override
- public String getConfigurationInfo(String configName) {
- return null;
- }
-
- @Override
- public boolean isConfigurationAvailable(String configName, String envType, String context) {
- return false;
- }
-
- @Override
- public boolean isConfigurationLoaded(String configName, String envType, String context) {
- return false;
- }
-
- @Override
- public Map<String, String> getConfiguration(String configName, String envType, String context) throws ConfigException {
- return null;
- }
-
- @Override
- public Map<String, String> getRecursiveConfigValues(String area, String configName, String envType, String context) throws ConfigException {
- return null;
- }
-
- @Override
- public Map<String, String> getConfigValues(String area, String configName, String envType, String context) throws ConfigException {
- return null;
- }
-
- @Override
- public Map<String, String> updateConfiguration(String configName, String envType, String context, Map<String, String> values, AggregationPolicy aggregationPolicy) throws ConfigException {
- return null;
- }
-
- @Override
- public String getConfigurationInfo(String configName, String envType, String context) {
- return null;
- }
-
- @Override
- public Set<String> getAreas(String configName, String envType, String context) {
- return null;
- }
-
- @Override
- public Set<String> getTransitiveAreas(String configName, String envType, String context) {
- return null;
- }
-
- @Override
- public boolean isAreaExisting(String area, String configName, String envType, String context) {
- return false;
- }
-
- @Override
- public boolean isAreaEmpty(String area, String configName, String envType, String context) {
- return false;
- }
-}