You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jo...@apache.org on 2017/07/08 14:28:06 UTC

svn commit: r1801289 - in /geronimo/components/config/trunk: ./ impl/ impl/src/main/java/org/apache/geronimo/config/ impl/src/main/java/org/apache/geronimo/config/converters/

Author: johndament
Date: Sat Jul  8 14:28:06 2017
New Revision: 1801289

URL: http://svn.apache.org/viewvc?rev=1801289&view=rev
Log:
Updating based on latest TCK changes (offsets, instant converters).  Switching back to released OWB for now, JARs not signed.

Added:
    geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/InstantConverter.java
    geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/OffsetDateTimeConverter.java
    geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/OffsetTimeConverter.java
Modified:
    geronimo/components/config/trunk/impl/pom.xml
    geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/ConfigImpl.java
    geronimo/components/config/trunk/pom.xml

Modified: geronimo/components/config/trunk/impl/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/pom.xml?rev=1801289&r1=1801288&r2=1801289&view=diff
==============================================================================
--- geronimo/components/config/trunk/impl/pom.xml (original)
+++ geronimo/components/config/trunk/impl/pom.xml Sat Jul  8 14:28:06 2017
@@ -179,7 +179,7 @@
                 <dependency>
                     <groupId>org.jboss.arquillian.container</groupId>
                     <artifactId>arquillian-weld-embedded</artifactId>
-                    <version>2.0.0.Beta4</version>
+                    <version>2.0.0-SNAPSHOT</version>
                     <scope>test</scope>
                 </dependency>
                 <dependency>

Modified: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/ConfigImpl.java
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/ConfigImpl.java?rev=1801289&r1=1801288&r2=1801289&view=diff
==============================================================================
--- geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/ConfigImpl.java (original)
+++ geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/ConfigImpl.java Sat Jul  8 14:28:06 2017
@@ -19,9 +19,12 @@ package org.apache.geronimo.config;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 import java.time.Duration;
+import java.time.Instant;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -35,19 +38,22 @@ import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import org.apache.geronimo.config.converters.BooleanConverter;
+import org.apache.geronimo.config.converters.DoubleConverter;
 import org.apache.geronimo.config.converters.DurationConverter;
+import org.apache.geronimo.config.converters.FloatConverter;
+import org.apache.geronimo.config.converters.InstantConverter;
+import org.apache.geronimo.config.converters.IntegerConverter;
 import org.apache.geronimo.config.converters.LocalDateConverter;
 import org.apache.geronimo.config.converters.LocalDateTimeConverter;
 import org.apache.geronimo.config.converters.LocalTimeConverter;
+import org.apache.geronimo.config.converters.LongConverter;
+import org.apache.geronimo.config.converters.OffsetDateTimeConverter;
+import org.apache.geronimo.config.converters.OffsetTimeConverter;
 import org.apache.geronimo.config.converters.StringConverter;
 import org.eclipse.microprofile.config.Config;
 import org.eclipse.microprofile.config.spi.ConfigSource;
 import org.eclipse.microprofile.config.spi.Converter;
-import org.apache.geronimo.config.converters.BooleanConverter;
-import org.apache.geronimo.config.converters.DoubleConverter;
-import org.apache.geronimo.config.converters.FloatConverter;
-import org.apache.geronimo.config.converters.IntegerConverter;
-import org.apache.geronimo.config.converters.LongConverter;
 
 import javax.annotation.Priority;
 import javax.enterprise.inject.Typed;
@@ -81,6 +87,9 @@ public class ConfigImpl implements Confi
         converters.put(LocalTime.class, LocalTimeConverter.INSTANCE);
         converters.put(LocalDate.class, LocalDateConverter.INSTANCE);
         converters.put(LocalDateTime.class, LocalDateTimeConverter.INSTANCE);
+        converters.put(OffsetTime.class, OffsetTimeConverter.INSTANCE);
+        converters.put(OffsetDateTime.class, OffsetDateTimeConverter.INSTANCE);
+        converters.put(Instant.class, InstantConverter.INSTANCE);
     }
 
 

Added: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/InstantConverter.java
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/InstantConverter.java?rev=1801289&view=auto
==============================================================================
--- geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/InstantConverter.java (added)
+++ geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/InstantConverter.java Sat Jul  8 14:28:06 2017
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.config.converters;
+
+import org.eclipse.microprofile.config.spi.Converter;
+
+import javax.annotation.Priority;
+import javax.enterprise.inject.Vetoed;
+import java.time.Instant;
+import java.time.format.DateTimeParseException;
+
+/**
+ * @author <a href="mailto:johndament@apache.org">John D. Ament</a>
+ */
+@Priority(1)
+@Vetoed
+public class InstantConverter implements Converter<Instant> {
+
+    public static final InstantConverter INSTANCE = new InstantConverter();
+
+    @Override
+    public Instant convert(String value) {
+        if (value != null) {
+            try {
+                return Instant.parse(value);
+            }
+            catch (DateTimeParseException dtpe) {
+                throw new IllegalArgumentException(dtpe);
+            }
+        }
+        return null;
+    }
+}

Added: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/OffsetDateTimeConverter.java
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/OffsetDateTimeConverter.java?rev=1801289&view=auto
==============================================================================
--- geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/OffsetDateTimeConverter.java (added)
+++ geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/OffsetDateTimeConverter.java Sat Jul  8 14:28:06 2017
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.config.converters;
+
+import org.eclipse.microprofile.config.spi.Converter;
+
+import javax.annotation.Priority;
+import javax.enterprise.inject.Vetoed;
+import java.time.OffsetDateTime;
+import java.time.format.DateTimeParseException;
+
+/**
+ * @author <a href="mailto:johndament@apache.org">John D. Ament</a>
+ */
+@Priority(1)
+@Vetoed
+public class OffsetDateTimeConverter implements Converter<OffsetDateTime>{
+
+    public static final OffsetDateTimeConverter INSTANCE = new OffsetDateTimeConverter();
+
+    @Override
+    public OffsetDateTime convert(String value) {
+        if (value != null) {
+            try {
+                return OffsetDateTime.parse(value);
+            }
+            catch (DateTimeParseException dtpe) {
+                throw new IllegalArgumentException(dtpe);
+            }
+        }
+        return null;
+    }
+}

Added: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/OffsetTimeConverter.java
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/OffsetTimeConverter.java?rev=1801289&view=auto
==============================================================================
--- geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/OffsetTimeConverter.java (added)
+++ geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/converters/OffsetTimeConverter.java Sat Jul  8 14:28:06 2017
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.config.converters;
+
+import java.time.OffsetTime;
+import java.time.format.DateTimeParseException;
+
+import javax.annotation.Priority;
+import javax.enterprise.inject.Vetoed;
+
+import org.eclipse.microprofile.config.spi.Converter;
+
+/**
+ * @author <a href="mailto:johndament@apache.org">John D. Ament</a>
+ */
+@Priority(1)
+@Vetoed
+public class OffsetTimeConverter implements Converter<OffsetTime> {
+
+    public static final OffsetTimeConverter INSTANCE = new OffsetTimeConverter();
+
+    @Override
+    public OffsetTime convert(String value) {
+        if (value != null) {
+            try {
+                return OffsetTime.parse(value);
+            }
+            catch (DateTimeParseException dtpe) {
+                throw new IllegalArgumentException(dtpe);
+            }
+        }
+        return null;
+    }
+}

Modified: geronimo/components/config/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/pom.xml?rev=1801289&r1=1801288&r2=1801289&view=diff
==============================================================================
--- geronimo/components/config/trunk/pom.xml (original)
+++ geronimo/components/config/trunk/pom.xml Sat Jul  8 14:28:06 2017
@@ -45,7 +45,7 @@
         <maven.compiler.source>1.8</maven.compiler.source>
         <maven.compiler.target>1.8</maven.compiler.target>
         <microprofile-config.version>1.0-SNAPSHOT</microprofile-config.version>
-        <owb.version>1.7.4-SNAPSHOT</owb.version>
+        <owb.version>1.7.3</owb.version>
         <arquillian.version>1.1.13.Final</arquillian.version>
     </properties>