gh-yzou commented on code in PR #1505: URL: https://github.com/apache/polaris/pull/1505#discussion_r2080605159
########## service/common/src/main/java/org/apache/polaris/service/config/DefaultConfigurationStoreDecorator.java: ########## @@ -0,0 +1,79 @@ +/* + * 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.polaris.service.config; + +import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; +import jakarta.annotation.Priority; +import jakarta.decorator.Decorator; +import jakarta.decorator.Delegate; +import jakarta.inject.Inject; +import java.util.Map; +import org.apache.polaris.core.PolarisCallContext; +import org.apache.polaris.core.config.PolarisConfigurationStore; +import org.apache.polaris.core.context.CallContext; + +@Decorator +@Priority(1) +public class DefaultConfigurationStoreDecorator implements PolarisConfigurationStore { Review Comment: @collado-mike I am not able to mark this class as Request scoped, if I mark the class as request scoped, I encounter error like the following ``` [error]: Build step io.quarkus.arc.deployment.ArcProcessor#registerBeans threw an exception: jakarta.enterprise.inject.spi.DefinitionException: A decorator must be @Dependent but org.apache.polaris.service.config.DefaultConfigurationStoreDecorator declares jakarta.enterprise.context.RequestScoped at io.quarkus.arc.processor.Decorators.createDecorator(Decorators.java:69) at io.quarkus.arc.processor.BeanDeployment.findDecorators(BeanDeployment.java:1640) ``` According to the doc ``` In CDI, decorators must have the same scope or a compatible scope as the beans they decorate. ``` so if the DefaultConfigurationStore is Application scoped, the DefaultConfigurationStoreDecorator is also Application scoped. If that is the case does that mean i can not have the callContext to be injected as part of the constructor? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
