Skip to content

Commit

Permalink
TOMEE-4350 add qualifier for produced Jsonb
Browse files Browse the repository at this point in the history
  • Loading branch information
jungm authored and rzo1 committed Jun 6, 2024
1 parent f0982d5 commit f235c68
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class ClaimBean<T> implements Bean<T>, PassivationCapable {
}

@Inject
@TomeeMpJwt
private Jsonb jsonb;

private final BeanManager bm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
import java.util.logging.Logger;

@ApplicationScoped
// todo add a qualifier here so we isolate our instance from what applications would do
public class JsonbProducer {

private static final Logger log = Logger.getLogger(MPJWTCDIExtension.class.getName());

@Produces
@TomeeMpJwt
public Jsonb create() {
return JsonbProvider.provider().create().build();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.tomee.microprofile.jwt.cdi;

import jakarta.inject.Qualifier;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PARAMETER, ElementType.FIELD, ElementType.METHOD })
public @interface TomeeMpJwt {
}

0 comments on commit f235c68

Please sign in to comment.