Skip to content

Commit

Permalink
build(deps): bump io.cryostat:cryostat-core from 2.24.0 to 2.25.0 (#1808
Browse files Browse the repository at this point in the history
)

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

Bumps [io.cryostat:cryostat-core](https://github.com/cryostatio/cryostat-core) from 2.24.0 to 2.25.0.
- [Release notes](https://github.com/cryostatio/cryostat-core/releases)
- [Commits](cryostatio/cryostat-core@v2.24.0...v2.25.0)

---
updated-dependencies:
- dependency-name: io.cryostat:cryostat-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* implement new interface method

* cleanup

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Azores <[email protected]>
  • Loading branch information
dependabot[bot] and andrewazores authored Dec 5, 2023
1 parent 723894f commit f7b16a6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 30 deletions.
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

0 comments on commit f7b16a6

Please sign in to comment.