You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2017/08/28 19:10:51 UTC
geode git commit: GEODE-3508: Remove three unused internal deprecated
classes.
Repository: geode
Updated Branches:
refs/heads/develop a2fffd4ef -> e0ece3315
GEODE-3508: Remove three unused internal deprecated classes.
* Update ClusterConfigurationNotAvailableException to extend Exception directly, rather than the deprecated class.
Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/e0ece331
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/e0ece331
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/e0ece331
Branch: refs/heads/develop
Commit: e0ece3315117f3d25a4023c69da392ce6e3efc9c
Parents: a2fffd4
Author: Patrick Rhomberg <pr...@pivotal.io>
Authored: Wed Aug 23 10:49:32 2017 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Mon Aug 28 12:05:36 2017 -0700
----------------------------------------------------------------------
.../distributed/internal/MessageFactory.java | 62 -------------
...usterConfigurationNotAvailableException.java | 3 +-
...usterConfigurationNotAvailableException.java | 33 -------
.../configuration/utils/DtdResolver.java | 91 --------------------
4 files changed, 1 insertion(+), 188 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/geode/blob/e0ece331/geode-core/src/main/java/org/apache/geode/distributed/internal/MessageFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/MessageFactory.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/MessageFactory.java
deleted file mode 100644
index a7e8a9d..0000000
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/MessageFactory.java
+++ /dev/null
@@ -1,62 +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.geode.distributed.internal;
-
-import org.apache.geode.InternalGemFireException;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
-/**
- * This class is a factory that creates instances of {@link DistributionMessage}.
- *
- * @deprecated use a constructor instead
- */
-@Deprecated
-public class MessageFactory {
-
- ////////////////////// Static Methods //////////////////////
-
- /**
- * Returns a message of the given type.
- */
- public static DistributionMessage getMessage(Class messageType) {
-
- // DistributionMessage message;
- // create a new message
- try {
- Object o = messageType.newInstance();
- if (!(o instanceof DistributionMessage)) {
- throw new InternalGemFireException(
- LocalizedStrings.MessageFactory_CLASS_0_IS_NOT_A_DISTRIBUTIONMESSAGE
- .toLocalizedString(messageType.getName()));
-
- } else {
- // no need for further processing on the new message, so return it
- return (DistributionMessage) o;
- }
-
- } catch (InstantiationException ex) {
- throw new InternalGemFireException(
- LocalizedStrings.MessageFactory_AN_INSTANTIATIONEXCEPTION_WAS_THROWN_WHILE_INSTANTIATING_A_0
- .toLocalizedString(messageType.getName()),
- ex);
-
- } catch (IllegalAccessException ex) {
- throw new InternalGemFireException(
- LocalizedStrings.MessageFactory_COULD_NOT_ACCESS_ZEROARG_CONSTRUCTOR_OF_0
- .toLocalizedString(messageType.getName()),
- ex);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/geode/blob/e0ece331/geode-core/src/main/java/org/apache/geode/internal/config/ClusterConfigurationNotAvailableException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/config/ClusterConfigurationNotAvailableException.java b/geode-core/src/main/java/org/apache/geode/internal/config/ClusterConfigurationNotAvailableException.java
index b22f13f..dc73e6b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/config/ClusterConfigurationNotAvailableException.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/config/ClusterConfigurationNotAvailableException.java
@@ -18,8 +18,7 @@ package org.apache.geode.internal.config;
* Exception thrown during server startup when it requests the locators for shared configuration and
* does not receive it.
*/
-public class ClusterConfigurationNotAvailableException
- extends org.apache.geode.internal.process.ClusterConfigurationNotAvailableException {
+public class ClusterConfigurationNotAvailableException extends Exception {
private static final long serialVersionUID = 771319836094239284L;
http://git-wip-us.apache.org/repos/asf/geode/blob/e0ece331/geode-core/src/main/java/org/apache/geode/internal/process/ClusterConfigurationNotAvailableException.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/process/ClusterConfigurationNotAvailableException.java b/geode-core/src/main/java/org/apache/geode/internal/process/ClusterConfigurationNotAvailableException.java
deleted file mode 100644
index 981c460..0000000
--- a/geode-core/src/main/java/org/apache/geode/internal/process/ClusterConfigurationNotAvailableException.java
+++ /dev/null
@@ -1,33 +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.geode.internal.process;
-
-/**
- * Exception thrown during server startup when it requests the locators for shared configuration and
- * does not receive it.
- *
- * @since GemFire 8.0
- * @deprecated Please use
- * {@link org.apache.geode.internal.config.ClusterConfigurationNotAvailableException}
- * instead.
- */
-@Deprecated
-public class ClusterConfigurationNotAvailableException extends Exception {
- private static final long serialVersionUID = -3448160213553925462L;
-
- public ClusterConfigurationNotAvailableException(String message) {
- super(message);
- }
-}
http://git-wip-us.apache.org/repos/asf/geode/blob/e0ece331/geode-core/src/main/java/org/apache/geode/management/internal/configuration/utils/DtdResolver.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/utils/DtdResolver.java b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/utils/DtdResolver.java
deleted file mode 100644
index f415412..0000000
--- a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/utils/DtdResolver.java
+++ /dev/null
@@ -1,91 +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.geode.management.internal.configuration.utils;
-
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.internal.cache.xmlcache.CacheXml;
-import org.apache.commons.io.FileUtils;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-/******
- * This class is used to resolve the location of DTD. During development time the dtd for the latest
- * version is not published on the www.gemstone.com , then the dtd should be picked up as a resource
- * from the Jar file.
- *
- * @deprecated As of 8.1 use {@link CacheXml}
- */
-@Deprecated
-public class DtdResolver implements EntityResolver {
-
- @Deprecated
- public InputSource resolveEntity(String publicId, String systemId) throws IOException {
- if (!isHttpUrlOK(systemId)) {
- URL dtdURL = getClass().getResource(CacheXml.LATEST_DTD_LOCATION);
- File dtd = new File(DistributionConfig.GEMFIRE_PREFIX + "dtd");
- FileUtils.copyURLToFile(dtdURL, dtd);
- InputSource inputSource = new InputSource(FileUtils.openInputStream(dtd));
- FileUtils.deleteQuietly(dtd);
- return inputSource;
- } else {
- return null;
- }
- }
-
- /****
- * Checks if the url passed , can be contacted or not.
- *
- * @param urlString
- * @return true if the URL is up and can be contacted.
- */
- @Deprecated
- public boolean isHttpUrlOK(String urlString) {
- try {
- URL e = new URL(urlString);
- HttpURLConnection urlConnection = (HttpURLConnection) e.openConnection();
- urlConnection.setRequestMethod("HEAD");
- int responseCode = urlConnection.getResponseCode();
- if (responseCode == 200) {
- return true;
- } else {
- return false;
- }
- } catch (Exception e) {
- return false;
- }
- }
-
- /***
- * Gets the URL for Cache dtd
- *
- * @return dtd url as string
- * @throws MalformedURLException
- */
- @Deprecated
- public URL getDtdUrl() throws MalformedURLException {
- if (isHttpUrlOK(CacheXml.LATEST_SYSTEM_ID)) {
- return new URL(CacheXml.LATEST_SYSTEM_ID);
- } else {
- URL dtdURL = getClass().getResource(CacheXml.LATEST_DTD_LOCATION);
- return dtdURL;
- }
- }
-}