Search in sources :

Example 1 with Produces

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;
}
Also used : Vertx(io.vertx.core.Vertx) Produces(jakarta.enterprise.inject.Produces) Singleton(jakarta.inject.Singleton)

Example 2 with Produces

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);
}
Also used : Push(jakarta.faces.push.Push) PushContextImpl(org.apache.myfaces.push.cdi.PushContextImpl) Produces(jakarta.enterprise.inject.Produces) Push(jakarta.faces.push.Push)

Example 3 with Produces

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);
}
Also used : WebsocketPushContext(com.sun.faces.push.WebsocketPushContext) Push(jakarta.faces.push.Push) Produces(jakarta.enterprise.inject.Produces) Push(jakarta.faces.push.Push)

Example 4 with Produces

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);
}
Also used : InProcessGrpcChannel(io.helidon.microprofile.grpc.core.InProcessGrpcChannel) Config(io.helidon.config.Config) Map(java.util.Map) InjectionPoint(jakarta.enterprise.inject.spi.InjectionPoint) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) ApplicationScoped(jakarta.enterprise.context.ApplicationScoped) GrpcChannelsProvider(io.helidon.grpc.client.GrpcChannelsProvider) Channel(io.grpc.Channel) Inject(jakarta.inject.Inject) Instance(jakarta.enterprise.inject.Instance) Produces(jakarta.enterprise.inject.Produces) BeanManager(jakarta.enterprise.inject.spi.BeanManager) InProcessGrpcChannel(io.helidon.microprofile.grpc.core.InProcessGrpcChannel) Produces(jakarta.enterprise.inject.Produces) InProcessGrpcChannel(io.helidon.microprofile.grpc.core.InProcessGrpcChannel)

Example 5 with Produces

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;
}
Also used : Query(jakarta.persistence.Query) CriteriaQuery(jakarta.persistence.criteria.CriteriaQuery) CodeFragment(org.jboss.weld.examples.pastecode.model.CodeFragment) Named(jakarta.inject.Named) Produces(jakarta.enterprise.inject.Produces)

Aggregations

Produces (jakarta.enterprise.inject.Produces)8 ApplicationScoped (jakarta.enterprise.context.ApplicationScoped)2 Push (jakarta.faces.push.Push)2 Inject (jakarta.inject.Inject)2 WebsocketPushContext (com.sun.faces.push.WebsocketPushContext)1 Channel (io.grpc.Channel)1 Reflected (io.helidon.common.Reflected)1 HelidonServiceLoader (io.helidon.common.serviceloader.HelidonServiceLoader)1 Config (io.helidon.config.Config)1 GrpcChannelsProvider (io.helidon.grpc.client.GrpcChannelsProvider)1 CoordinatorClient (io.helidon.lra.coordinator.client.CoordinatorClient)1 CONF_DEFAULT_COORDINATOR_URL (io.helidon.lra.coordinator.client.CoordinatorClient.CONF_DEFAULT_COORDINATOR_URL)1 CONF_KEY_COORDINATOR_TIMEOUT (io.helidon.lra.coordinator.client.CoordinatorClient.CONF_KEY_COORDINATOR_TIMEOUT)1 CONF_KEY_COORDINATOR_TIMEOUT_UNIT (io.helidon.lra.coordinator.client.CoordinatorClient.CONF_KEY_COORDINATOR_TIMEOUT_UNIT)1 CONF_KEY_COORDINATOR_URL (io.helidon.lra.coordinator.client.CoordinatorClient.CONF_KEY_COORDINATOR_URL)1 InProcessGrpcChannel (io.helidon.microprofile.grpc.core.InProcessGrpcChannel)1 Vertx (io.vertx.core.Vertx)1 PgConnectOptions (io.vertx.pgclient.PgConnectOptions)1 PgPool (io.vertx.pgclient.PgPool)1 PoolOptions (io.vertx.sqlclient.PoolOptions)1