use of jakarta.enterprise.inject.spi.ProcessInjectionPoint in project helidon by oracle.
the class JedisExtension method processJedisPoolProviderInjectionPoint.
@SuppressWarnings("checkstyle:linelength")
private <T extends Provider<JedisPool>> void processJedisPoolProviderInjectionPoint(@Observes final ProcessInjectionPoint<?, T> e) {
if (e != null) {
final InjectionPoint injectionPoint = e.getInjectionPoint();
if (injectionPoint != null) {
final Type type = injectionPoint.getType();
assert type instanceof Class;
assert Provider.class.isAssignableFrom((Class<?>) type);
final Set<Annotation> qualifiers = injectionPoint.getQualifiers();
for (final Annotation qualifier : qualifiers) {
final String instanceName;
if (qualifier instanceof Default) {
instanceName = "default";
} else if (qualifier instanceof Named) {
instanceName = ((Named) qualifier).value();
} else {
instanceName = null;
}
if (instanceName != null && !instanceName.isEmpty()) {
this.instanceNames.add(instanceName);
}
}
}
}
}
use of jakarta.enterprise.inject.spi.ProcessInjectionPoint in project helidon by oracle.
the class JedisExtension method processJedisPoolInjectionPoint.
private <T extends JedisPool> void processJedisPoolInjectionPoint(@Observes final ProcessInjectionPoint<?, T> e) {
if (e != null) {
final InjectionPoint injectionPoint = e.getInjectionPoint();
if (injectionPoint != null) {
final Type type = injectionPoint.getType();
assert type instanceof Class;
assert JedisPool.class.isAssignableFrom((Class<?>) type);
final Set<Annotation> qualifiers = injectionPoint.getQualifiers();
for (final Annotation qualifier : qualifiers) {
final String instanceName;
if (qualifier instanceof Default) {
instanceName = "default";
} else if (qualifier instanceof Named) {
instanceName = ((Named) qualifier).value();
} else {
instanceName = null;
}
if (instanceName != null && !instanceName.isEmpty()) {
this.instanceNames.add(instanceName);
}
}
}
}
}
use of jakarta.enterprise.inject.spi.ProcessInjectionPoint in project helidon by oracle.
the class JedisExtension method processJedisPoolConfigProviderInjectionPoint.
@SuppressWarnings("checkstyle:linelength")
private <T extends Provider<JedisPoolConfig>> void processJedisPoolConfigProviderInjectionPoint(@Observes final ProcessInjectionPoint<?, T> e) {
if (e != null) {
final InjectionPoint injectionPoint = e.getInjectionPoint();
if (injectionPoint != null) {
final Type type = injectionPoint.getType();
assert type instanceof Class;
assert Provider.class.isAssignableFrom((Class<?>) type);
final Set<Annotation> qualifiers = injectionPoint.getQualifiers();
for (final Annotation qualifier : qualifiers) {
final String instanceName;
if (qualifier instanceof Default) {
instanceName = "default";
} else if (qualifier instanceof Named) {
instanceName = ((Named) qualifier).value();
} else {
instanceName = null;
}
if (instanceName != null && !instanceName.isEmpty()) {
this.instanceNames.add(instanceName);
}
}
}
}
}
use of jakarta.enterprise.inject.spi.ProcessInjectionPoint in project core by weld.
the class ModifyingExtension method overrideDelegateInjectionPoint.
public void overrideDelegateInjectionPoint(@Observes ProcessInjectionPoint<AnimalDecorator, Object> event) {
final InjectionPoint delegate = event.getInjectionPoint();
event.setInjectionPoint(new ForwardingInjectionPoint() {
@Override
protected InjectionPoint delegate() {
return delegate;
}
@Override
public boolean isDelegate() {
return true;
}
@Override
public Type getType() {
return Animal.class;
}
});
}
use of jakarta.enterprise.inject.spi.ProcessInjectionPoint in project helidon by oracle.
the class VaultCdiExtension method updateInjectionPoints.
/**
* Add internal qualifier.
*
* @param event CDI event
*/
void updateInjectionPoints(@Observes ProcessInjectionPoint<?, ?> event) {
InjectionPoint injectionPoint = event.getInjectionPoint();
Annotated annotated = injectionPoint.getAnnotated();
Type type = injectionPoint.getType();
if (supportedTypes.contains(type)) {
VaultName vault = annotated.getAnnotation(VaultName.class);
VaultPath vaultPath = annotated.getAnnotation(VaultPath.class);
VaultInternal internal = VaultInternal.Literal.create((vault == null ? "" : vault.value()), (vaultPath == null ? "" : vaultPath.value()));
event.configureInjectionPoint().addQualifier(internal);
}
}
Aggregations