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
<dependencies> | |
<dependency> | |
<groupId>com.foobar</groupId> | |
<artifactId>cdi-specification-pom</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<type>pom</type> | |
<scope>provided</scope> | |
</dependency> | |
</dependencies> |
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
<groupId>com.foobar</groupId> | |
<artifactId>cdi-specification-pom</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>pom</packaging> | |
<dependencies> | |
<dependency> | |
<groupId>javax.annotation</groupId> | |
<artifactId>javax.annotation-api</artifactId> | |
<version>1.3</version> |
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
import java.io.BufferedInputStream; | |
import java.io.BufferedOutputStream; | |
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.InputStream; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.util.HashSet; | |
import java.util.Properties; |
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
<dependencies> | |
<dependency> | |
<groupId>javax.annotation</groupId> | |
<artifactId>javax.annotation-api</artifactId> | |
<version>1.3</version> | |
<type>jar</type> | |
<scope>provided</scope> | |
</dependency> | |
<dependency> |
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
private final void stopControllers(@Observes @BeforeDestroyed(ApplicationScoped.class) @Priority(LIBRARY_BEFORE) final Object ignored) throws IOException { | |
Exception exception = null; | |
for (final Controller<?> controller : this.controllers) { | |
assert controller != null; | |
try { | |
controller.close(); | |
} catch (final IOException | RuntimeException closeException) { | |
if (exception == null) { | |
exception = closeException; |
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
private static final class CDIEventDistributor<T extends HasMetadata> implements Consumer<AbstractEvent<? extends T>> { | |
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0]; | |
private final Annotation[] qualifiers; | |
private final NotificationOptions notificationOptions; | |
private final boolean syncNeeded; |
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
private final <T extends HasMetadata, X extends Listable<? extends KubernetesResourceList> & VersionWatchable<? extends Closeable, Watcher<T>>> void startControllers(@Observes @Initialized(ApplicationScoped.class) @Priority(LIBRARY_AFTER) final Object ignored, final BeanManager beanManager) { | |
if (beanManager != null) { | |
for (final Bean<?> bean : this.beans) { | |
assert bean != null; | |
final Set<Annotation> qualifiers = bean.getQualifiers(); | |
final Map<Object, T> knownObjects = new HashMap<>(); | |
final EventDistributor<T> eventDistributor = new EventDistributor<>(knownObjects); |
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
import javax.enterprise.context.ApplicationScoped; | |
import javax.enterprise.inject.Produces; | |
import io.fabric8.kubernetes.api.model.ConfigMap; | |
import io.fabric8.kubernetes.api.model.ConfigMapList; | |
import io.fabric8.kubernetes.api.model.DoneableConfigMap; | |
import io.fabric8.kubernetes.api.model.HasMetadata; | |
import io.fabric8.kubernetes.client.KubernetesClient; | |
import io.fabric8.kubernetes.client.dsl.Operation; | |
import io.fabric8.kubernetes.client.dsl.Resource; |
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
import javax.enterprise.event.Observes; | |
import io.fabric8.kubernetes.api.model.HasMetadata; | |
import org.microbean.kubernetes.controller.Event; | |
private final void onConfigMapEvent(@Observes @AllConfigMapEvents final Event<? extends HasMetadata> event) { | |
} |
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
@Documented | |
@KubernetesEventSelector | |
@Qualifier | |
@Retention(value = RetentionPolicy.RUNTIME) | |
@Target({ ElementType.METHOD, ElementType.PARAMETER }) | |
public @interface AllConfigMapEvents { | |
} |