use of jakarta.enterprise.inject.Produces in project vertx-sandbox by hantsy.
the class Resources method vertx.
@Produces
@Singleton
public Vertx vertx(VerticleFactory verticleFactory) {
Vertx vertx = Vertx.vertx();
vertx.registerVerticleFactory(verticleFactory);
return vertx;
}
use of jakarta.enterprise.inject.Produces in project myfaces by apache.
the class FacesArtifactProducer method getPushContext.
@Produces
@Push
public PushContext getPushContext(InjectionPoint ip) {
Push push = ip.getAnnotated().getAnnotation(Push.class);
String channel = push.channel().isEmpty() ? ip.getMember().getName() : push.channel();
return new PushContextImpl(channel);
}
use of jakarta.enterprise.inject.Produces in project mojarra by eclipse-ee4j.
the class WebsocketPushContextProducer method produce.
// Actions --------------------------------------------------------------------------------------------------------
@Produces
@Push
public PushContext produce(InjectionPoint injectionPoint) {
Push push = getQualifier(injectionPoint, Push.class);
String channel = push.channel().isEmpty() ? injectionPoint.getMember().getName() : push.channel();
return new WebsocketPushContext(channel, socketSessions, socketUsers);
}
use of jakarta.enterprise.inject.Produces in project helidon by oracle.
the class ChannelProducer method get.
/**
* Produces a gRPC {@link io.grpc.Channel}.
*
* @param injectionPoint the injection point
* @return a gRPC {@link io.grpc.Channel}
*/
@Produces
@GrpcChannel(name = GrpcChannelsProvider.DEFAULT_CHANNEL_NAME)
public Channel get(InjectionPoint injectionPoint) {
GrpcChannel qualifier = injectionPoint.getQualifiers().stream().filter(q -> q.annotationType().equals(GrpcChannel.class)).map(q -> (GrpcChannel) q).findFirst().orElse(null);
String name = qualifier == null ? GrpcChannelsProvider.DEFAULT_CHANNEL_NAME : qualifier.name();
return findChannel(name);
}
use of jakarta.enterprise.inject.Produces in project core by weld.
the class CodeFragmentManagerImpl method getRecentCodeFragments.
@Produces
@Named
public List<CodeFragment> getRecentCodeFragments() {
Query query = entityManager.createQuery("SELECT c FROM CodeFragment c WHERE c.hash=null ORDER BY datetime DESC ");
query.setMaxResults(MAX_RECENT_FRAGMENTS);
@SuppressWarnings("unchecked") List<CodeFragment> codes = query.getResultList();
return codes;
}
Aggregations