-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev console commands and UI for listing dev services
Exclude junit from keycloak test server dependency
- Loading branch information
1 parent
c5db541
commit 7e517c9
Showing
68 changed files
with
1,478 additions
and
634 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
.../deployment/src/main/java/io/quarkus/deployment/builditem/DevServicesResultBuildItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
package io.quarkus.deployment.builditem; | ||
|
||
import java.io.Closeable; | ||
import java.io.IOException; | ||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
|
||
/** | ||
* BuildItem for running dev services | ||
* Combines injected configs to the application with container id (if it exists). | ||
* | ||
* Processors are expected to return this build item not only when the dev service first starts, | ||
* but also if a running dev service already exists. | ||
* | ||
* {@link RunningDevService} helps to manage the lifecycle of the running dev service | ||
*/ | ||
public final class DevServicesResultBuildItem extends MultiBuildItem { | ||
|
||
private final String name; | ||
private final String containerId; | ||
private final Map<String, String> config; | ||
|
||
public DevServicesResultBuildItem(String name, String containerId, Map<String, String> config) { | ||
this.name = name; | ||
this.containerId = containerId; | ||
this.config = config; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public String getContainerId() { | ||
return containerId; | ||
} | ||
|
||
public Map<String, String> getConfig() { | ||
return config; | ||
} | ||
|
||
public static class RunningDevService implements Closeable { | ||
|
||
private final String name; | ||
private final String containerId; | ||
private final Map<String, String> config; | ||
private final Closeable closeable; | ||
|
||
private static Map<String, String> mapOf(String key, String value) { | ||
Map<String, String> map = new HashMap<>(); | ||
map.put(key, value); | ||
return map; | ||
} | ||
|
||
public RunningDevService(String name, String containerId, Closeable closeable, String key, String value) { | ||
this(name, containerId, closeable, mapOf(key, value)); | ||
} | ||
|
||
public RunningDevService(String name, String containerId, Closeable closeable, Map<String, String> config) { | ||
this.name = name; | ||
this.containerId = containerId; | ||
this.closeable = closeable; | ||
this.config = Collections.unmodifiableMap(config); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public String getContainerId() { | ||
return containerId; | ||
} | ||
|
||
public Map<String, String> getConfig() { | ||
return config; | ||
} | ||
|
||
public Closeable getCloseable() { | ||
return closeable; | ||
} | ||
|
||
public boolean isOwner() { | ||
return closeable != null; | ||
} | ||
|
||
@Override | ||
public void close() throws IOException { | ||
this.closeable.close(); | ||
} | ||
|
||
public DevServicesResultBuildItem toBuildItem() { | ||
return new DevServicesResultBuildItem(name, containerId, config); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.