collado-mike commented on code in PR #493:
URL: https://github.com/apache/polaris/pull/493#discussion_r1873857927


##########
polaris-service/src/main/java/org/apache/polaris/service/context/RealmScopeContext.java:
##########
@@ -0,0 +1,82 @@
+/*
+ * 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.context;
+
+import jakarta.inject.Singleton;
+import java.lang.annotation.Annotation;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import org.apache.polaris.core.context.CallContext;
+import org.apache.polaris.core.context.RealmContext;
+import org.apache.polaris.core.context.RealmScope;
+import org.glassfish.hk2.api.ActiveDescriptor;
+import org.glassfish.hk2.api.Context;
+import org.glassfish.hk2.api.ServiceHandle;
+
+@Singleton
+public class RealmScopeContext implements Context<RealmScope> {

Review Comment:
   This particular `RealmScopeContext` is HK2-specific and won't be portable to 
Quarkus. The annotation, however, can be. I experimented with this briefly with 
another CDI impl and I was able to write basically the same code without 
relying on thread-locals (except as used by the underlying framework). Maybe we 
can chat about the specific impl in the Quarkus PR? For now, I think we get the 
functionality we want without the need to add a bunch of new factories to this 
PR and there's nothing in the core logic that ties anything to HK2 in particular



-- 
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]

Reply via email to