You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2019/10/02 08:00:24 UTC

[isis] branch v2 updated: ISIS-2158: remove isis system environment SPI

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch v2
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/v2 by this push:
     new a291c12  ISIS-2158: remove isis system environment SPI
a291c12 is described below

commit a291c124b81c2d60dab601d2d72d74b3327ed880
Author: Andi Huber <ah...@apache.org>
AuthorDate: Wed Oct 2 10:00:16 2019 +0200

    ISIS-2158: remove isis system environment SPI
---
 .../isis/commons/internal/context/_Context.java    |  4 +--
 .../environment/IsisSystemEnvironmentPlugin.java   | 42 ----------------------
 2 files changed, 1 insertion(+), 45 deletions(-)

diff --git a/core/commons/src/main/java/org/apache/isis/commons/internal/context/_Context.java b/core/commons/src/main/java/org/apache/isis/commons/internal/context/_Context.java
index 978835f..ece5d05 100644
--- a/core/commons/src/main/java/org/apache/isis/commons/internal/context/_Context.java
+++ b/core/commons/src/main/java/org/apache/isis/commons/internal/context/_Context.java
@@ -30,7 +30,6 @@ import org.apache.isis.commons.collections.Bin;
 import org.apache.isis.commons.internal.base._Casts;
 import org.apache.isis.commons.internal.collections._Lists;
 import org.apache.isis.commons.internal.plugins.environment.IsisSystemEnvironment;
-import org.apache.isis.commons.internal.plugins.environment.IsisSystemEnvironmentPlugin;
 
 import static org.apache.isis.commons.internal.base._NullSafe.stream;
 import static org.apache.isis.commons.internal.base._With.ifPresentElseGet;
@@ -358,8 +357,7 @@ public final class _Context {
 
     /** framework internal, exposed by IsisContext */
     public static IsisSystemEnvironment getEnvironment() {
-        return getOrElse(IsisSystemEnvironment.class, 
-                IsisSystemEnvironmentPlugin.get()::getIsisSystemEnvironment);
+        return getOrElse(IsisSystemEnvironment.class, ()->IsisSystemEnvironment.DEFAULT); 
     }
 
     /** framework internal, shortcut for convenience */
diff --git a/core/commons/src/main/java/org/apache/isis/commons/internal/plugins/environment/IsisSystemEnvironmentPlugin.java b/core/commons/src/main/java/org/apache/isis/commons/internal/plugins/environment/IsisSystemEnvironmentPlugin.java
deleted file mode 100644
index b83018f..0000000
--- a/core/commons/src/main/java/org/apache/isis/commons/internal/plugins/environment/IsisSystemEnvironmentPlugin.java
+++ /dev/null
@@ -1,42 +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.isis.commons.internal.plugins.environment;
-
-import org.apache.isis.commons.internal.context._Plugin;
-
-public interface IsisSystemEnvironmentPlugin {
-
-    // -- INTERFACE
-
-    public IsisSystemEnvironment getIsisSystemEnvironment();
-
-
-    // -- PLUGIN LOOKUP
-
-    public static IsisSystemEnvironmentPlugin get() {
-        return _Plugin.getOrElse(IsisSystemEnvironmentPlugin.class,
-                ambiguousPlugins->{
-                    throw _Plugin.ambiguityNonRecoverable(IsisSystemEnvironmentPlugin.class, ambiguousPlugins);
-                },
-                ()->{
-                    return IsisSystemEnvironment::getDefault;
-                });
-    }
-
-}