cstamas commented on a change in pull request #77:
URL: https://github.com/apache/maven-resolver/pull/77#discussion_r524470046



##########
File path: 
maven-resolver-synccontext-named/src/main/java/org/eclipse/aether/synccontext/NamedSyncContextFactory.java
##########
@@ -0,0 +1,84 @@
+package org.eclipse.aether.synccontext;
+
+/*
+ * 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.
+ */
+
+import java.util.Map;
+
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.SyncContext;
+import org.eclipse.aether.impl.SyncContextFactory;
+import org.eclipse.aether.internal.named.NamedLockFactory;
+import org.eclipse.aether.internal.named.SyncContextFactoryAdapter;
+
+import javax.annotation.PreDestroy;
+import javax.annotation.Priority;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+/**
+ * Named {@link SyncContextFactory} implementation that selects underlying 
{@link NamedLockFactory} implementation
+ * at creation. Known factory names are:
+ * <ul>
+ *   <li>rwlock-local - uses JVM ReentrantReadWriteLock, suitable for MT 
builds</li>
+ *   <li>rwlock-redisson - uses JVM ReentrantReadWriteLock, suitable for MT 
builds</li>
+ *   <li>semaphore-local - uses JVM Semaphore, suitable for MT builds</li>
+ *   <li>semaphore-hazelcast - uses Hazelcast (that would form cluster with 
other discovered instances),
+ *   suitable for MT and MP builds</li>
+ *   <li>semaphore-hazelcast-client - uses Hazelcast Client (that would 
connect to some existing cluster),
+ *   suitable for MT and MP builds</li>
+ *   <li>semaphore-cp-hazelcast-client - uses Hazelcast Client (that would 
connect to some existing cluster),
+ *   suitable for MT and MP builds. Uses CP subsystem to get semaphore and 
does NOT destroy them.</li>
+ * </ul>
+ * Read Hazelcast documentation how to configure it, but tests does provide 
some examples.
+ */
+@Named
+@Priority( Integer.MAX_VALUE )
+@Singleton
+public final class NamedSyncContextFactory
+        implements SyncContextFactory
+{
+    private final SyncContextFactoryAdapter syncContextFactoryAdapter;
+
+    @Inject
+    public NamedSyncContextFactory( final Map<String, 
Provider<NamedLockFactory>> factories )
+    {
+        String name = System.getProperty( "synccontext.named,factory", "local" 
);

Review comment:
       Fixing

##########
File path: 
maven-resolver-synccontext-named/src/main/java/org/eclipse/aether/synccontext/NamedSyncContextFactory.java
##########
@@ -0,0 +1,84 @@
+package org.eclipse.aether.synccontext;
+
+/*
+ * 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.
+ */
+
+import java.util.Map;
+
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.SyncContext;
+import org.eclipse.aether.impl.SyncContextFactory;
+import org.eclipse.aether.internal.named.NamedLockFactory;
+import org.eclipse.aether.internal.named.SyncContextFactoryAdapter;
+
+import javax.annotation.PreDestroy;
+import javax.annotation.Priority;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+/**
+ * Named {@link SyncContextFactory} implementation that selects underlying 
{@link NamedLockFactory} implementation
+ * at creation. Known factory names are:
+ * <ul>
+ *   <li>rwlock-local - uses JVM ReentrantReadWriteLock, suitable for MT 
builds</li>
+ *   <li>rwlock-redisson - uses JVM ReentrantReadWriteLock, suitable for MT 
builds</li>

Review comment:
       Fixing




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to