-
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 and UI for listing dev services
- Loading branch information
1 parent
0ffce57
commit 742a6b7
Showing
58 changed files
with
1,235 additions
and
632 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
91 changes: 91 additions & 0 deletions
91
.../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,91 @@ | ||
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; | ||
|
||
/** | ||
* TODO | ||
*/ | ||
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
Oops, something went wrong.