Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Merge pull request #285 from DataDog/prognant/fix-RMI-socket-… #288

Merged
merged 1 commit into from
Apr 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ target/*

# jenv
.java_version
.factorypath
16 changes: 0 additions & 16 deletions src/main/java/org/datadog/jmxfetch/RemoteConnection.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.datadog.jmxfetch;

import static java.rmi.server.RMISocketFactory.setSocketFactory;

import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
Expand Down Expand Up @@ -29,8 +27,6 @@ public class RemoteConnection extends Connection {
private static final String KEY_STORE_PASSWORD_KEY = "key_store_password";
private static final String DEFAULT_RMI_RESPONSE_TIMEOUT =
"15000"; // Match the collection period default
// The default behaviour is to wait indefinitely, we change that and only wait for 15sec.
private static final Integer DEFAULT_RMI_CONNECTION_TIMEOUT = Integer.valueOf(15000);

/** RemoteConnection constructor for specified remote connection parameters. */
public RemoteConnection(Map<String, Object> connectionParams) throws IOException {
Expand Down Expand Up @@ -93,18 +89,6 @@ public RemoteConnection(Map<String, Object> connectionParams) throws IOException
// Set an RMI timeout so we don't get stuck waiting for a bean to report a value
System.setProperty("sun.rmi.transport.tcp.responseTimeout", rmiTimeout);

Integer rmiConnectionTimeout = DEFAULT_RMI_CONNECTION_TIMEOUT;
try {
rmiConnectionTimeout = (Integer) connectionParams.get("rmi_connection_timeout");
} catch (final ClassCastException e) {
rmiConnectionTimeout =
Integer.parseInt((String) connectionParams.get("rmi_connection_timeout"));
}
if (rmiConnectionTimeout == null) {
rmiConnectionTimeout = DEFAULT_RMI_CONNECTION_TIMEOUT;
}
setSocketFactory(new SocketFactory(rmiConnectionTimeout));

createConnection();
}

Expand Down
27 changes: 0 additions & 27 deletions src/main/java/org/datadog/jmxfetch/SocketFactory.java

This file was deleted.