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/07/04 11:01:46 UTC

[isis] branch v2 updated: ISIS-2141 dropping module 'webserver'

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 c907c1c  ISIS-2141 dropping module 'webserver'
c907c1c is described below

commit c907c1ce40a0e0d31509791811e3103a086dd769
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Jul 4 13:01:40 2019 +0200

    ISIS-2141 dropping module 'webserver'
---
 core/legacy/webserver/config/isis.properties       |  17 ---
 core/legacy/webserver/pom.xml                      | 138 --------------------
 .../src/main/java/org/apache/isis/Dummy.java       |  32 -----
 .../src/main/java/org/apache/isis/WebServer.java   |  38 ------
 .../org/apache/isis/core/webserver/WebServer.java  | 142 ---------------------
 .../core/webserver/HelloWorldAppConfigTest.java    |  59 ---------
 6 files changed, 426 deletions(-)

diff --git a/core/legacy/webserver/config/isis.properties b/core/legacy/webserver/config/isis.properties
deleted file mode 100644
index 7a1f344..0000000
--- a/core/legacy/webserver/config/isis.properties
+++ /dev/null
@@ -1,17 +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.
-isis.appManifest=org.apache.isis.core.webserver.DummyAppManifest
\ No newline at end of file
diff --git a/core/legacy/webserver/pom.xml b/core/legacy/webserver/pom.xml
deleted file mode 100644
index dce8b62..0000000
--- a/core/legacy/webserver/pom.xml
+++ /dev/null
@@ -1,138 +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 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/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.isis.core</groupId>
-        <artifactId>isis</artifactId>
-        <version>${revision}</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>isis-webserver</artifactId>
-    <name>Apache Isis WebServer</name>
-
-    <properties>
-        <jar-plugin.automaticModuleName>org.apache.isis.webserver</jar-plugin.automaticModuleName>
-        <git-plugin.propertiesDir>org/apache/isis/webserver</git-plugin.propertiesDir>
-    </properties>
-
-    <build>
-        <resources>
-            <resource>
-                <filtering>false</filtering>
-                <directory>src/main/resources</directory>
-            </resource>
-            <resource>
-                <filtering>false</filtering>
-                <directory>src/main/java</directory>
-                <includes>
-                    <include>**</include>
-                </includes>
-                <excludes>
-                    <exclude>**/*.java</exclude>
-                </excludes>
-            </resource>
-        </resources>
-    </build>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.isis.core</groupId>
-            <artifactId>isis-runtime</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.eclipse.jetty</groupId>
-            <artifactId>jetty-servlet</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.eclipse.jetty</groupId>
-            <artifactId>jetty-webapp</artifactId>
-        </dependency>
-
-        <!-- command line options support  -->
-        <dependency>
-            <groupId>net.sf.jopt-simple</groupId>
-            <artifactId>jopt-simple</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.isis.core</groupId>
-            <artifactId>isis-plugins-jdo-datanucleus-5</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.isis.mavendeps</groupId>
-            <artifactId>isis-mavendeps-testing</artifactId>
-            <type>pom</type>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-    <profiles>
-        <profile>
-            <id>flatten</id>
-            <activation>
-                <property>
-                    <name>!skip.flatten</name>
-                </property>
-            </activation>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>flatten-maven-plugin</artifactId>
-                        <version>1.0.0</version>
-                        <executions>
-                            <execution>
-                                <id>flatten</id>
-                                <phase>process-resources</phase>
-                                <goals>
-                                    <goal>flatten</goal>
-                                </goals>
-                                <configuration>
-                                    <flattenMode>defaults</flattenMode>
-                                    <updatePomFile>true</updatePomFile>
-                                    <pomElements>
-                                        <name>resolve</name>
-                                        <description>resolve</description>
-                                        <dependencies>resolve</dependencies>
-                                    </pomElements>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>flatten.clean</id>
-                                <phase>clean</phase>
-                                <goals>
-                                    <goal>clean</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
-
-
-</project>
diff --git a/core/legacy/webserver/src/main/java/org/apache/isis/Dummy.java b/core/legacy/webserver/src/main/java/org/apache/isis/Dummy.java
deleted file mode 100644
index 1e0e48a..0000000
--- a/core/legacy/webserver/src/main/java/org/apache/isis/Dummy.java
+++ /dev/null
@@ -1,32 +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;
-
-/**
- * This is a dummy 'main' class that does nothing.  It is provided simply as a target for IntelliJ users
- * using the "before launch" feature as a means to perform JDO enhancement by way of a Maven goal.
- */
-public class Dummy {
-
-    public static void main(final String[] args) {
-        System.out.println("Hi there!");
-    }
-
-}
diff --git a/core/legacy/webserver/src/main/java/org/apache/isis/WebServer.java b/core/legacy/webserver/src/main/java/org/apache/isis/WebServer.java
deleted file mode 100644
index 78c7c7a..0000000
--- a/core/legacy/webserver/src/main/java/org/apache/isis/WebServer.java
+++ /dev/null
@@ -1,38 +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;
-
-public class WebServer {
-
-    public static void main(final String[] args) {
-        org.apache.isis.core.webserver.WebServer.main(args);
-    }
-
-    public static final class Constants {
-
-        private Constants() {
-        }
-
-        public static final String APP_MANIFEST_OPT = "m";
-        public static final String APP_MANIFEST_LONG_OPT = "manifest";
-
-
-    }
-}
diff --git a/core/legacy/webserver/src/main/java/org/apache/isis/core/webserver/WebServer.java b/core/legacy/webserver/src/main/java/org/apache/isis/core/webserver/WebServer.java
deleted file mode 100644
index 9e91a53..0000000
--- a/core/legacy/webserver/src/main/java/org/apache/isis/core/webserver/WebServer.java
+++ /dev/null
@@ -1,142 +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.core.webserver;
-
-import java.io.IOException;
-import java.util.Arrays;
-
-import org.apache.isis.commons.exceptions.IsisException;
-import org.apache.isis.commons.internal.context._Context;
-import org.apache.isis.commons.internal.exceptions._Exceptions;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.webapp.WebAppContext;
-
-import joptsimple.OptionParser;
-import joptsimple.OptionSet;
-import joptsimple.OptionSpec;
-import joptsimple.ValueConversionException;
-import joptsimple.ValueConverter;
-import lombok.extern.log4j.Log4j2;
-
-@Log4j2
-public class WebServer {
-
-    public static void main(final String[] args) {
-        new WebServer().run(args);
-    }
-
-    public void run(final String[] args) {
-
-        final OptionParser parser = new OptionParser();
-
-        final OptionSpec<Class> appManifestClassOptSpec =
-                parser.acceptsAll( Arrays.asList("m", "manifest", "appManifest"), "AppManifest implementation" )
-                        .withRequiredArg()
-                        .withValuesConvertedBy(new ValueConverter<Class>() {
-                            @Override public Class convert(final String className) {
-                                try {
-                                    final Class<?> aClass = _Context.getDefaultClassLoader().loadClass(className);
-                                    _Exceptions.throwNotImplemented();
-//                                    if(!AppManifest.class.isAssignableFrom(aClass)) {
-//                                        throw new ValueConversionException("not a subclass of " + AppManifest.class.getName() );
-//                                    }
-                                    return aClass;
-                                } catch (ClassNotFoundException e) {
-                                    throw new ValueConversionException("not recognised as a class");
-                                }
-                            }
-
-                            @Override public Class<? extends Class> valueType() {
-                                return Class.class;
-                            }
-
-                            @Override public String valuePattern() {
-                                return null;
-                            }
-                        });
-
-        final OptionSpec<Integer> portOptSpec =
-                parser.acceptsAll( Arrays.asList("p", "port"), "port to listen on" )
-                        .withRequiredArg()
-                        .ofType( Integer.class )
-                        .defaultsTo(8080);
-        final OptionSpec<Void> prototypeOptSpec =
-                parser.acceptsAll( Arrays.asList("d", "dev", "prototype"), "Prototype mode" );
-
-        final OptionSet optionSet = parser.parse(args);
-        try {
-            optionSet.valueOfOptional(appManifestClassOptSpec).ifPresent(
-                    appManifestClass -> System.setProperty("isis.appManifest", appManifestClass.getName()));
-            if(optionSet.has(prototypeOptSpec)) {
-                System.setProperty("isis.deploymentType", "PROTOTYPING");
-            }
-        } catch (Exception ex) {
-            try {
-                parser.printHelpOn(System.err);
-                System.err.println();
-                System.err.print(ex.getMessage());
-                final Throwable cause = ex.getCause();
-                if(cause != null) {
-                    System.err.println(": " + cause.getMessage());
-                    System.err.println();
-                }
-            } catch (IOException e) {
-                // ignore
-            }
-            System.exit(1);
-        }
-
-        final int port = optionSet.valueOf(portOptSpec);
-        // create and start
-        log.info("Running Jetty on port '{}' to serve the web application", port);
-
-        final Server jettyServer = new Server(port);
-        final WebAppContext context = new WebAppContext("src/main/webapp", "");
-        jettyServer.setHandler(context);
-
-        start(jettyServer);
-    }
-
-    private void start(final Server jettyServer) {
-        long start = System.currentTimeMillis();
-        try {
-            jettyServer.start();
-            log.info("Started the application in {}ms", System.currentTimeMillis() - start);
-
-        } catch (final Exception ex) {
-            try {
-                jettyServer.stop();
-                jettyServer.join();
-            } catch (Exception e) {
-                // ignore
-            }
-            throw new IsisException("Unable to start Jetty server", ex);
-        }
-        try {
-            System.in.read();
-            System.out.println(">>> STOPPING EMBEDDED JETTY SERVER");
-            jettyServer.stop();
-            jettyServer.join();
-
-        } catch (final Exception ex) {
-            throw new IsisException("Unable to stop Jetty server", ex);
-        }
-    }
-}
diff --git a/core/legacy/webserver/src/test/java/org/apache/isis/core/webserver/HelloWorldAppConfigTest.java b/core/legacy/webserver/src/test/java/org/apache/isis/core/webserver/HelloWorldAppConfigTest.java
deleted file mode 100644
index 1e9ac1b..0000000
--- a/core/legacy/webserver/src/test/java/org/apache/isis/core/webserver/HelloWorldAppConfigTest.java
+++ /dev/null
@@ -1,59 +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.core.webserver;
-
-import java.util.Map;
-
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-
-import org.apache.isis.config.IsisConfiguration;
-import org.apache.isis.config.internal._Config;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-class HelloWorldAppConfigTest {
-
-    @BeforeEach
-    void setUp() throws Exception {
-    }
-
-    @AfterEach
-    void tearDown() throws Exception {
-    }
-
-    @Test @Disabled("TODO[2112] AppConfigLocator is deprecated")
-    void test() {
-
-        // when
-        IsisConfiguration isisConfiguration = _Config.getConfiguration();
-
-        // then
-        Assertions.assertNotNull(isisConfiguration);
-        
-        Map<String, String> config = isisConfiguration.copyToMap();
-        Assertions.assertNotNull(config);
-        assertThat(config).hasSize(1);
-        //assertThat(config.get("isis.appManifest")).isEqualTo(DummyAppManifest.class.getName());
-    }
-
-}