-
Notifications
You must be signed in to change notification settings - Fork 683
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GEODE-6280: Create new public module for the Management API
- This moves the classes under `org.apache.geode.cache.configuration` package into a public module: `geode-managament-api`. The intent is that this module will have no dependencies to `geode-core` but will allow consumers to perform administration tasks (creating regions, etc.). - `geode-core` will now depend on both `geode-management-api` as well as `geode-common` (transitively). Suggestions on how to improve these new dependencies are welcome. Signed-off-by: Peter Tran <ptran@pivotal.io> Signed-off-by: Aditya Anchuri <aanchuri@pivotal.io>
- Loading branch information
1 parent
a15136a
commit 7916389
Showing
53 changed files
with
1,100 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 54 additions & 53 deletions
107
geode-assembly/src/integrationTest/resources/dependency_classpath.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,76 @@ | ||
HikariCP-3.2.0.jar | ||
antlr-2.7.7.jar | ||
classgraph-4.0.6.jar | ||
commons-beanutils-1.9.3.jar | ||
commons-codec-1.10.jar | ||
commons-collections-3.2.2.jar | ||
commons-io-2.6.jar | ||
commons-lang3-3.8.1.jar | ||
commons-logging-1.2.jar | ||
commons-math3-3.2.jar | ||
commons-validator-1.6.jar | ||
fastutil-8.2.2.jar | ||
geo-0.7.1.jar | ||
geode-common-0.0.0.jar | ||
geode-json-0.0.0.jar | ||
geode-core-0.0.0.jar | ||
geode-connectors-0.0.0.jar | ||
geode-core-0.0.0.jar | ||
geode-cq-0.0.0.jar | ||
geode-json-0.0.0.jar | ||
geode-lucene-0.0.0.jar | ||
geode-management-0.0.0.jar | ||
geode-old-client-support-0.0.0.jar | ||
geode-protobuf-0.0.0.jar | ||
geode-protobuf-messages-0.0.0.jar | ||
geode-wan-0.0.0.jar | ||
geode-cq-0.0.0.jar | ||
geode-rebalancer-0.0.0.jar | ||
antlr-2.7.7.jar | ||
jgroups-3.6.14.Final.jar | ||
jackson-databind-2.9.7.jar | ||
geode-wan-0.0.0.jar | ||
grumpy-core-0.2.2.jar | ||
istack-commons-runtime-2.2.jar | ||
jackson-annotations-2.9.7.jar | ||
spring-shell-1.2.0.RELEASE.jar | ||
commons-io-2.6.jar | ||
commons-validator-1.6.jar | ||
jackson-core-2.9.7.jar | ||
jackson-databind-2.9.7.jar | ||
jansi-1.17.1.jar | ||
javax.activation-1.2.0.jar | ||
javax.activation-api-1.2.0.jar | ||
javax.resource-api-1.7.1.jar | ||
javax.servlet-api-3.1.0.jar | ||
javax.transaction-api-1.3.jar | ||
jaxb-api-2.3.1.jar | ||
jaxb-impl-2.3.1.jar | ||
commons-lang3-3.8.1.jar | ||
netty-all-4.1.31.Final.jar | ||
fastutil-8.2.2.jar | ||
javax.resource-api-1.7.1.jar | ||
jetty-http-9.4.12.v20180830.jar | ||
jetty-io-9.4.12.v20180830.jar | ||
jetty-security-9.4.12.v20180830.jar | ||
jetty-server-9.4.12.v20180830.jar | ||
jetty-servlet-9.4.12.v20180830.jar | ||
jetty-util-9.4.12.v20180830.jar | ||
jetty-webapp-9.4.12.v20180830.jar | ||
jetty-xml-9.4.12.v20180830.jar | ||
jgroups-3.6.14.Final.jar | ||
jline-2.12.jar | ||
jna-4.1.0.jar | ||
jopt-simple-5.0.4.jar | ||
log4j-slf4j-impl-2.11.1.jar | ||
log4j-api-2.11.1.jar | ||
log4j-core-2.11.1.jar | ||
log4j-jcl-2.11.1.jar | ||
log4j-jul-2.11.1.jar | ||
log4j-api-2.11.1.jar | ||
geo-0.7.1.jar | ||
jetty-webapp-9.4.12.v20180830.jar | ||
spring-core-4.3.20.RELEASE.jar | ||
snappy-0.4.jar | ||
shiro-core-1.4.0.jar | ||
classgraph-4.0.6.jar | ||
log4j-slf4j-impl-2.11.1.jar | ||
lucene-analyzers-common-6.6.2.jar | ||
lucene-analyzers-phonetic-6.6.2.jar | ||
lucene-core-6.6.2.jar | ||
lucene-queries-6.6.2.jar | ||
lucene-queryparser-6.6.2.jar | ||
netty-all-4.1.31.Final.jar | ||
protobuf-java-3.6.1.jar | ||
rmiio-2.1.2.jar | ||
istack-commons-runtime-2.2.jar | ||
jansi-1.17.1.jar | ||
shiro-cache-1.4.0.jar | ||
shiro-crypto-hash-1.4.0.jar | ||
shiro-crypto-cipher-1.4.0.jar | ||
shiro-config-ogdl-1.4.0.jar | ||
shiro-config-core-1.4.0.jar | ||
shiro-event-1.4.0.jar | ||
shiro-config-ogdl-1.4.0.jar | ||
shiro-core-1.4.0.jar | ||
shiro-crypto-cipher-1.4.0.jar | ||
shiro-crypto-core-1.4.0.jar | ||
shiro-crypto-hash-1.4.0.jar | ||
shiro-event-1.4.0.jar | ||
shiro-lang-1.4.0.jar | ||
slf4j-api-1.7.25.jar | ||
jackson-core-2.9.7.jar | ||
commons-beanutils-1.9.3.jar | ||
commons-logging-1.2.jar | ||
commons-collections-3.2.2.jar | ||
javax.activation-api-1.2.0.jar | ||
javax.transaction-api-1.3.jar | ||
grumpy-core-0.2.2.jar | ||
jetty-xml-9.4.12.v20180830.jar | ||
jetty-servlet-9.4.12.v20180830.jar | ||
jline-2.12.jar | ||
commons-math3-3.2.jar | ||
jetty-security-9.4.12.v20180830.jar | ||
jetty-server-9.4.12.v20180830.jar | ||
jetty-http-9.4.12.v20180830.jar | ||
jetty-io-9.4.12.v20180830.jar | ||
jetty-util-9.4.12.v20180830.jar | ||
javax.servlet-api-3.1.0.jar | ||
HikariCP-3.2.0.jar | ||
lucene-analyzers-phonetic-6.6.2.jar | ||
lucene-analyzers-common-6.6.2.jar | ||
lucene-queryparser-6.6.2.jar | ||
lucene-core-6.6.2.jar | ||
lucene-queries-6.6.2.jar | ||
commons-codec-1.10.jar | ||
protobuf-java-3.6.1.jar | ||
snappy-0.4.jar | ||
spring-core-4.3.20.RELEASE.jar | ||
spring-shell-1.2.0.RELEASE.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...org/apache/geode/management/internal/configuration/domain/DeclarableTypeInstantiator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* 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.management.internal.configuration.domain; | ||
|
||
import java.util.Properties; | ||
|
||
import org.apache.geode.cache.Cache; | ||
import org.apache.geode.cache.Declarable; | ||
import org.apache.geode.cache.configuration.DeclarableType; | ||
import org.apache.geode.cache.configuration.ObjectType; | ||
import org.apache.geode.cache.configuration.ParameterType; | ||
import org.apache.geode.internal.ClassPathLoader; | ||
import org.apache.geode.management.internal.cli.domain.ClassName; | ||
|
||
public abstract class DeclarableTypeInstantiator { | ||
|
||
public static <T extends Declarable> T newInstance(DeclarableType declarableType, Cache cache) { | ||
try { | ||
Class<T> loadedClass = | ||
(Class<T>) ClassPathLoader.getLatest().forName(declarableType.getClassName()); | ||
T declarable = loadedClass.newInstance(); | ||
Properties initProperties = new Properties(); | ||
for (ParameterType parameter : declarableType.getParameters()) { | ||
initProperties.put(parameter.getName(), newInstance(parameter, cache)); | ||
} | ||
declarable.initialize(cache, initProperties); | ||
return declarable; | ||
} catch (Exception e) { | ||
throw new RuntimeException( | ||
"Error instantiating class: <" + declarableType.getClassName() + ">", e); | ||
} | ||
} | ||
|
||
public static <T> T newInstance(ObjectType objectType, Cache cache) { | ||
if (objectType.getString() != null) { | ||
return (T) objectType.getString(); | ||
} | ||
|
||
if (objectType.getDeclarable() != null) { | ||
return newInstance(objectType.getDeclarable(), cache); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
public static <V> V newInstance(ClassName<?> type, Cache cache) { | ||
try { | ||
Class<V> loadedClass = (Class<V>) ClassPathLoader.getLatest().forName(type.getClassName()); | ||
V object = loadedClass.newInstance(); | ||
if (object instanceof Declarable) { | ||
Declarable declarable = (Declarable) object; | ||
declarable.initialize(cache, type.getInitProperties()); | ||
declarable.init(type.getInitProperties()); // for backwards compatibility | ||
} | ||
return object; | ||
} catch (Exception e) { | ||
throw new RuntimeException("Error instantiating class: <" + type.getClassName() + ">", e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.