This is an automated email from the ASF dual-hosted git repository.
udo pushed a commit to branch feature/GEODE-8067
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/feature/GEODE-8067 by this
push:
new 424fb4d GEODE-8067: Reverting bad rebase
424fb4d is described below
commit 424fb4d9d363f3fc413aba1529a36482c07095d1
Author: Udo Kohlmeyer <[email protected]>
AuthorDate: Tue May 19 09:23:24 2020 -0700
GEODE-8067: Reverting bad rebase
---
geode-common-services/build.gradle | 33 +++++++
.../geode/services/module/ModuleDescriptor.java | 100 +++++++++++++++++++++
.../geode/services/module/ModuleService.java | 70 +++++++++++++++
.../src/test/resources/expected-pom.xml | 60 +++++++++++++
4 files changed, 263 insertions(+)
diff --git a/geode-common-services/build.gradle
b/geode-common-services/build.gradle
new file mode 100644
index 0000000..da983cf
--- /dev/null
+++ b/geode-common-services/build.gradle
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"
+
+apply from: "${project.projectDir}/../gradle/publish-java.gradle"
+apply from: "${project.projectDir}/../gradle/warnings.gradle"
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ compile(platform(project(':boms:geode-all-bom')))
+
+ compile(project(':geode-common'))
+
+ compile(project(':geode-core'))
+}
diff --git
a/geode-common-services/src/main/java/org/apache/geode/services/module/ModuleDescriptor.java
b/geode-common-services/src/main/java/org/apache/geode/services/module/ModuleDescriptor.java
new file mode 100644
index 0000000..3b84130
--- /dev/null
+++
b/geode-common-services/src/main/java/org/apache/geode/services/module/ModuleDescriptor.java
@@ -0,0 +1,100 @@
+/*
+ * 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.geode.services.module;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.geode.annotations.Experimental;
+
+/**
+ * Holds information to describe a classloader-isolated module including how
to create it.
+ *
+ * @see Builder
+ * @see ModuleService
+ *
+ * @since Geode 1.13.0
+ */
+@Experimental
+public class ModuleDescriptor {
+
+ private String name;
+
+ private String version;
+
+ private List<String> sources;
+
+ private List<String> dependencies;
+
+ private ModuleDescriptor(String name, String version, List<String> sources,
+ List<String> dependencies) {
+ this.name = name;
+ this.version = version;
+ this.sources = sources;
+ this.dependencies = dependencies;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public List<String> getSources() {
+ return sources;
+ }
+
+ public List<String> getDependedOnModules() {
+ return dependencies;
+ }
+
+ public String getVersionedName() {
+ return name + ":" + version;
+ }
+
+ /**
+ * A Builder used to construct a {@link ModuleDescriptor}
+ */
+ public static class Builder {
+
+ private final String name;
+ private final String version;
+ private List<String> dependencies = Collections.emptyList();
+ private List<String> sources = Collections.emptyList();
+
+ public Builder(String name, String version) {
+ this.name = name;
+ this.version = version;
+ }
+
+ public Builder fromSources(String... sources) {
+ this.sources = Arrays.asList(sources);
+ return this;
+ }
+
+ public Builder dependsOnModules(String... dependencies) {
+ this.dependencies = Arrays.asList(dependencies);
+ return this;
+ }
+
+ public ModuleDescriptor build() {
+ return new ModuleDescriptor(name, version, sources, dependencies);
+ }
+ }
+}
diff --git
a/geode-common-services/src/main/java/org/apache/geode/services/module/ModuleService.java
b/geode-common-services/src/main/java/org/apache/geode/services/module/ModuleService.java
new file mode 100644
index 0000000..823c73e
--- /dev/null
+++
b/geode-common-services/src/main/java/org/apache/geode/services/module/ModuleService.java
@@ -0,0 +1,70 @@
+/*
+ * 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.geode.services.module;
+
+import java.util.List;
+
+import org.apache.geode.annotations.Experimental;
+
+/**
+ * Loads and unloads modules and services in a classloader-isolated manner.
+ *
+ * @since Geode 1.13.0
+ */
+@Experimental
+public interface ModuleService {
+
+ /**
+ * Loads a module from a resource.
+ *
+ * @param moduleDescriptor description of the module to be loaded and
information necessary to
+ * load it.
+ * @return true on success, false if the module could not be loaded.
+ */
+ boolean loadModule(ModuleDescriptor moduleDescriptor);
+
+ /**
+ * Unloads a previously loaded module.
+ *
+ * @param moduleName name of the module to be unloaded.
+ * @return true on success, false if the module could not be unloaded.
+ */
+ boolean unloadModule(String moduleName);
+
+ /**
+ * Loads and returns a service instance for an interface.
+ *
+ * @param service interface type to load and instantiate an implementation
of.
+ * @return An instance of an implementation of service
+ */
+ <T> List<T> loadService(Class<T> service);
+
+ /**
+ * Loads a class from a loaded module by name and returns an instance.
+ *
+ * @param serviceName name of the class to be loaded and instantiated.
+ * @return An instance of an implementation of serviceName
+ */
+ <T> List<T> loadService(String serviceName);
+
+ /**
+ * Unloads and shuts down a previously loaded service.
+ *
+ * @param serviceName name of the class to be loaded and instantiated.
+ * @return true on success, false if service cannot be shutdown.
+ */
+ boolean unloadService(String serviceName);
+}
diff --git a/geode-common-services/src/test/resources/expected-pom.xml
b/geode-common-services/src/test/resources/expected-pom.xml
new file mode 100644
index 0000000..26f1cdd
--- /dev/null
+++ b/geode-common-services/src/test/resources/expected-pom.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <!--
+ 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.
+ -->
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.geode</groupId>
+ <artifactId>geode-common-services</artifactId>
+ <version>1.13.0-SNAPSHOT</version>
+ <name>Apache Geode</name>
+ <description>Apache Geode provides a database-like consistency model,
reliable transaction processing and a shared-nothing architecture to maintain
very low latency performance with high concurrency processing</description>
+ <url>http://geode.apache.org</url>
+ <licenses>
+ <license>
+ <name>The Apache Software License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ </license>
+ </licenses>
+ <scm>
+ <connection>scm:git:https://github.com:apache/geode.git</connection>
+
<developerConnection>scm:git:https://github.com:apache/geode.git</developerConnection>
+ <url>https://github.com/apache/geode</url>
+ </scm>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geode</groupId>
+ <artifactId>geode-all-bom</artifactId>
+ <version>1.13.0-SNAPSHOT</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geode</groupId>
+ <artifactId>geode-common</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geode</groupId>
+ <artifactId>geode-core</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+</project>