Skip to content

Commit

Permalink
Merge pull request #18367 from karesti/dev-ui-quarkus
Browse files Browse the repository at this point in the history
Infinispan extension adds some useful links to the dev ui
  • Loading branch information
geoand authored Jul 6, 2021
2 parents 50bd587 + 98db475 commit 5ed30ad
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.quarkus.infinispan.client.deployment.devconsole;

import io.quarkus.deployment.IsDevelopment;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.devconsole.spi.DevConsoleRuntimeTemplateInfoBuildItem;
import io.quarkus.infinispan.client.runtime.InfinispanClientSupplier;

public class InfinispanDevConsoleProcessor {

@BuildStep(onlyIf = IsDevelopment.class)
public DevConsoleRuntimeTemplateInfoBuildItem remoteCacheManager() {
return new DevConsoleRuntimeTemplateInfoBuildItem("remoteCacheManager", new InfinispanClientSupplier());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<a target="_blank" href="http://{info:remoteCacheManager.getConfiguration().servers().get(0).host()}:{info:remoteCacheManager.getConfiguration().servers().get(0).port()}" class="badge badge-light">
<i class="fa fa-external-link-alt fa-fw"></i> Web Console</a>
<br>
<a target="_blank" href="http://infinispan.org" class="badge badge-light">
<i class="fas fa-info fa-fw"></i> Documentation</a>
<br>
<a target="_blank" href="https://github.com/infinispan/infinispan-simple-tutorials" class="badge badge-light">
<i class="fa fa-hand-point-right fa-fw"></i> Simple Tutorials</a>
<br>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package io.quarkus.infinispan.client.runtime;

import java.util.function.Supplier;

import org.infinispan.client.hotrod.RemoteCacheManager;

import io.quarkus.arc.Arc;

public class InfinispanClientSupplier implements Supplier<RemoteCacheManager> {

@Override
public RemoteCacheManager get() {
RemoteCacheManager cacheManager = cacheManager();
return cacheManager;
}

public static RemoteCacheManager cacheManager() {
return Arc.container().instance(RemoteCacheManager.class).get();
}
}

0 comments on commit 5ed30ad

Please sign in to comment.