Search in sources :

Example 1 with AlternativePriority

use of io.quarkus.arc.AlternativePriority in project quarkus by quarkusio.

the class MockTracerProvider method createInMemoryExporter.

@Produces
@Singleton
@AlternativePriority(1)
public MockTracer createInMemoryExporter() {
    MockTracer tracer = new MockTracer();
    GlobalTracer.registerIfAbsent(tracer);
    return tracer;
}
Also used : MockTracer(io.opentracing.mock.MockTracer) AlternativePriority(io.quarkus.arc.AlternativePriority) Produces(javax.enterprise.inject.Produces) Singleton(javax.inject.Singleton)

Example 2 with AlternativePriority

use of io.quarkus.arc.AlternativePriority in project quarkus by quarkusio.

the class OidcTokenCredentialProducer method currentAccessToken.

@Produces
@RequestScoped
@AlternativePriority(1)
AccessTokenCredential currentAccessToken() {
    AccessTokenCredential cred = identity.getCredential(AccessTokenCredential.class);
    if (cred == null || cred.getToken() == null) {
        LOG.trace("AccessToken is null");
        cred = new AccessTokenCredential();
    }
    return cred;
}
Also used : AccessTokenCredential(io.quarkus.oidc.AccessTokenCredential) AlternativePriority(io.quarkus.arc.AlternativePriority) Produces(javax.enterprise.inject.Produces) RequestScoped(javax.enterprise.context.RequestScoped)

Aggregations

AlternativePriority (io.quarkus.arc.AlternativePriority)2 Produces (javax.enterprise.inject.Produces)2 MockTracer (io.opentracing.mock.MockTracer)1 AccessTokenCredential (io.quarkus.oidc.AccessTokenCredential)1 RequestScoped (javax.enterprise.context.RequestScoped)1 Singleton (javax.inject.Singleton)1