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 2018/11/25 13:33:42 UTC
[isis] 01/02: ISIS-2039: simplify helloworld
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch 2039-Redesign_of_Config
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 902bd9d1d94e2b93734c9b8b2e75e7f50f7664f9
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sun Nov 25 08:52:45 2018 +0100
ISIS-2039: simplify helloworld
Task-Url: https://issues.apache.org/jira/browse/ISIS-2039
---
.../org.apache.isis.core.commons.config.AppConfig | 2 +-
.../domainapp/application/HelloWorldAppConfig.java | 37 ----------------------
.../application/HelloWorldAppManifest.java | 10 +++++-
3 files changed, 10 insertions(+), 39 deletions(-)
diff --git a/example/application/helloworld/src/main/java/META-INF/services/org.apache.isis.core.commons.config.AppConfig b/example/application/helloworld/src/main/java/META-INF/services/org.apache.isis.core.commons.config.AppConfig
index 6730008..1756fe8 100644
--- a/example/application/helloworld/src/main/java/META-INF/services/org.apache.isis.core.commons.config.AppConfig
+++ b/example/application/helloworld/src/main/java/META-INF/services/org.apache.isis.core.commons.config.AppConfig
@@ -1 +1 @@
-domainapp.application.HelloWorldAppConfig
\ No newline at end of file
+domainapp.application.HelloWorldAppManifest
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/java/domainapp/application/HelloWorldAppConfig.java b/example/application/helloworld/src/main/java/domainapp/application/HelloWorldAppConfig.java
deleted file mode 100644
index 948a356..0000000
--- a/example/application/helloworld/src/main/java/domainapp/application/HelloWorldAppConfig.java
+++ /dev/null
@@ -1,37 +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 domainapp.application;
-
-import javax.enterprise.inject.Produces;
-
-import org.apache.isis.core.commons.config.AppConfig;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-
-/**
- * Tells the ServiceLoader which AppManifest to use to bootstrap the Application.
- */
-public class HelloWorldAppConfig implements AppConfig {
-
- @Produces
- public IsisConfiguration isisConfiguration () {
- return IsisConfiguration.buildFromAppManifest(new HelloWorldAppManifest());
- }
-
-}
-
diff --git a/example/application/helloworld/src/main/java/domainapp/application/HelloWorldAppManifest.java b/example/application/helloworld/src/main/java/domainapp/application/HelloWorldAppManifest.java
index 1e5baa9..622cd18 100644
--- a/example/application/helloworld/src/main/java/domainapp/application/HelloWorldAppManifest.java
+++ b/example/application/helloworld/src/main/java/domainapp/application/HelloWorldAppManifest.java
@@ -19,13 +19,15 @@
package domainapp.application;
import org.apache.isis.applib.AppManifestAbstract2;
+import org.apache.isis.core.commons.config.AppConfig;
+import org.apache.isis.core.commons.config.IsisConfiguration;
import domainapp.dom.HelloWorldModule;
/**
* Bootstrap the application.
*/
-public class HelloWorldAppManifest extends AppManifestAbstract2 {
+public class HelloWorldAppManifest extends AppManifestAbstract2 implements AppConfig {
public static final Builder BUILDER = Builder
.forModule(new HelloWorldModule())
@@ -36,4 +38,10 @@ public class HelloWorldAppManifest extends AppManifestAbstract2 {
super(BUILDER);
}
+ // Tells the ServiceLoader which AppManifest to use to bootstrap the Configuration.
+ @Override
+ public IsisConfiguration isisConfiguration () {
+ return IsisConfiguration.buildFromAppManifest(new HelloWorldAppManifest());
+ }
+
}