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

build(deps): bump io.cryostat:cryostat-core from 2.24.0 to 2.25.0 #1808

Merged
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<com.google.dagger.version>2.47</com.google.dagger.version>
<com.google.dagger.compiler.version>${com.google.dagger.version}</com.google.dagger.compiler.version>

<io.cryostat.core.version>2.24.0</io.cryostat.core.version>
<io.cryostat.core.version>2.25.0</io.cryostat.core.version>

<org.openjdk.nashorn.core.version>15.4</org.openjdk.nashorn.core.version>
<org.apache.commons.lang3.version>3.13.0</org.apache.commons.lang3.version>
Expand Down
32 changes: 10 additions & 22 deletions src/main/java/io/cryostat/net/AgentConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.openjdk.jmc.rjmx.IConnectionHandle;
import org.openjdk.jmc.rjmx.ServiceNotAvailableException;

import io.cryostat.core.JvmIdentifier;
import io.cryostat.core.log.Logger;
import io.cryostat.core.net.CryostatFlightRecorderService;
import io.cryostat.core.net.IDException;
Expand All @@ -39,26 +40,18 @@
import io.cryostat.core.sys.FileSystem;
import io.cryostat.core.templates.MergedTemplateService;
import io.cryostat.core.templates.TemplateService;
import io.cryostat.recordings.JvmIdHelper;

import org.apache.commons.lang3.exception.ExceptionUtils;

public class AgentConnection implements JFRConnection {

private final AgentClient client;
private final JvmIdHelper idHelper;
private final FileSystem fs;
private final Environment env;
private final Logger logger;

AgentConnection(
AgentClient client,
JvmIdHelper idHelper,
FileSystem fs,
Environment env,
Logger logger) {
AgentConnection(AgentClient client, FileSystem fs, Environment env, Logger logger) {
this.client = client;
this.idHelper = idHelper;
this.fs = fs;
this.env = env;
this.logger = logger;
Expand Down Expand Up @@ -111,10 +104,12 @@ public JMXServiceURL getJMXURL() throws IOException {
}

@Override
public String getJvmId() throws IDException, IOException {
// this should have already been populated when the agent published itself to the Discovery
// API. If not, then this will fail, but we were in a bad state to begin with.
return idHelper.getJvmId(getUri().toString());
public JvmIdentifier getJvmIdentifier() throws IDException, IOException {
try {
return JvmIdentifier.from(getMBeanMetrics().getRuntime());
} catch (IntrospectionException | InstanceNotFoundException | ReflectionException e) {
throw new IDException(e);
}
}

@Override
Expand Down Expand Up @@ -154,26 +149,19 @@ public MBeanMetrics getMBeanMetrics()

public static class Factory {
private final AgentClient.Factory clientFactory;
private final JvmIdHelper idHelper;
private final FileSystem fs;
private final Environment env;
private final Logger logger;

Factory(
AgentClient.Factory clientFactory,
JvmIdHelper idHelper,
FileSystem fs,
Environment env,
Logger logger) {
Factory(AgentClient.Factory clientFactory, FileSystem fs, Environment env, Logger logger) {
this.clientFactory = clientFactory;
this.idHelper = idHelper;
this.fs = fs;
this.env = env;
this.logger = logger;
}

AgentConnection createConnection(URI agentUri) {
return new AgentConnection(clientFactory.create(agentUri), idHelper, fs, env, logger);
return new AgentConnection(clientFactory.create(agentUri), fs, env, logger);
}
}
}
9 changes: 2 additions & 7 deletions src/main/java/io/cryostat/net/NetworkModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import io.cryostat.net.security.SecurityModule;
import io.cryostat.net.web.WebModule;
import io.cryostat.net.web.http.HttpModule;
import io.cryostat.recordings.JvmIdHelper;

import com.github.benmanes.caffeine.cache.Scheduler;
import com.google.gson.Gson;
Expand Down Expand Up @@ -97,12 +96,8 @@ static Duration provideMaxTargetTTL(Environment env) {
@Provides
@Singleton
static AgentConnection.Factory provideAgentConnectionFactory(
AgentClient.Factory clientFactory,
JvmIdHelper idHelper,
FileSystem fs,
Environment env,
Logger logger) {
return new AgentConnection.Factory(clientFactory, idHelper, fs, env, logger);
AgentClient.Factory clientFactory, FileSystem fs, Environment env, Logger logger) {
return new AgentConnection.Factory(clientFactory, fs, env, logger);
}

@Provides
Expand Down
Loading