Dear all, I proposed a patch for [CXF-2676] "JMX InstanceAlreadyExistsException under high load initialization". I made a design choice that some may find a bit to pessimistic. However, the impact of this pessimistic choice is limited to the initialization phase and would not impact performances after.
Can you tell me if you see any problem with this choice. I also proposed other design choices but I find them complex and with a limited gain. https://issues.apache.org/jira/browse/CXF-2676 Here is the description of the patch and the alternative scenarios : Patch proposal : use an instance scope counterCreationLock (java.util.concurrent.locks.ReentrantLock). Pros : simple code Cons : slightly pessimistic. Simultaneous initialization of many clients and/or endpoints is not very efficient, Other solutions : * use a synchronized block on ObjectName.toString().intern() : ** understanding intern() is tricky :-( * register counters at startup ** requires a lot of changes in the code :-( ** does not deal with hot activation of the ResponsetimeFeature :-( Cyrille
