ramu11 commented on code in PR #30945:
URL: https://github.com/apache/camel/pull/30945#discussion_r4726753661


##########
components/camel-pqc/src/main/java/org/apache/camel/component/pqc/BouncyCastlePqcAdapterSupport.java:
##########
@@ -0,0 +1,110 @@
+/*
+ * 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.camel.component.pqc;
+
+import java.security.GeneralSecurityException;
+import java.security.Provider;
+import java.util.ServiceConfigurationError;
+import java.util.ServiceLoader;
+
+import org.apache.camel.component.pqc.spi.Bc186PqcAdapter;
+import org.apache.camel.component.pqc.spi.Bc187PqcAdapter;
+import org.apache.camel.component.pqc.spi.PqcBouncyCastleAdapter;
+
+/** Selects a typed, version-specific Bouncy Castle adapter using the 
installed provider version. */
+public final class BouncyCastlePqcAdapterSupport {
+
+    private BouncyCastlePqcAdapterSupport() {
+    }
+
+    public static PqcBouncyCastleAdapter adapter() {

Review Comment:
   Addressed in commit `1c3fdb93bd0c`.
   
   The compatibility lookup is now performed once and cached in 
`BouncyCastlePqcCompatibility.ApiHolder.API`. Subsequent calls reuse the 
selected API path, rather than repeating provider lookups or scanning with 
`ServiceLoader` on every signing operation.
   
   I also removed the `ServiceLoader`-based adapter mechanism and the separate 
version-specific adapter modules. The compatibility implementation now uses 
typed API capability detection and a cached result.
   
   Thanks for catching the repeated lookup overhead.



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