You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2020/08/12 20:42:55 UTC

[maven-resolver] branch redisson updated: Add Class Loader output

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch redisson
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git


The following commit(s) were added to refs/heads/redisson by this push:
     new b77991c  Add Class Loader output
b77991c is described below

commit b77991c2c665a95cb847ecfdeedaebe739c45fb6
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Wed Aug 12 22:42:31 2020 +0200

    Add Class Loader output
---
 .../aether/internal/impl/DefaultSyncContextFactory.java     | 13 +++++++++++++
 .../aether/synccontext/RedissonSyncContextFactory.java      |  9 +++++++++
 2 files changed, 22 insertions(+)

diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultSyncContextFactory.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultSyncContextFactory.java
index 01c861f..45677c2 100644
--- a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultSyncContextFactory.java
+++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultSyncContextFactory.java
@@ -29,6 +29,8 @@ import org.eclipse.aether.SyncContext;
 import org.eclipse.aether.artifact.Artifact;
 import org.eclipse.aether.impl.SyncContextFactory;
 import org.eclipse.aether.metadata.Metadata;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A factory to create synchronization contexts. This default implementation actually does not provide any real
@@ -40,8 +42,19 @@ public class DefaultSyncContextFactory
     implements SyncContextFactory
 {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger( DefaultSyncContextFactory.class );
+
+    public DefaultSyncContextFactory()
+    {
+        LOGGER.trace( "TCCL '{}', id '{}'", Thread.currentThread().getContextClassLoader(),
+                      System.identityHashCode(Thread.currentThread().getContextClassLoader()));
+        LOGGER.trace( "CCL '{}', id '{}'", getClass().getClassLoader(),
+                      System.identityHashCode( getClass().getClassLoader() ) );
+    }
+
     public SyncContext newInstance( RepositorySystemSession session, boolean shared )
     {
+        LOGGER.trace( "Instance: {}, identity: {}", this, System.identityHashCode( getClass() ) );
         return new DefaultSyncContext();
     }
 
diff --git a/maven-resolver-synccontext-redisson/src/main/java/org/eclipse/aether/synccontext/RedissonSyncContextFactory.java b/maven-resolver-synccontext-redisson/src/main/java/org/eclipse/aether/synccontext/RedissonSyncContextFactory.java
index e3cd170..8fd239e 100644
--- a/maven-resolver-synccontext-redisson/src/main/java/org/eclipse/aether/synccontext/RedissonSyncContextFactory.java
+++ b/maven-resolver-synccontext-redisson/src/main/java/org/eclipse/aether/synccontext/RedissonSyncContextFactory.java
@@ -82,6 +82,14 @@ public class RedissonSyncContextFactory
     private static RedissonClient redissonClient = createRedissonClient();
     private static String localhostDiscriminator = createLocalhostDiscriminator();
 
+    public RedissonSyncContextFactory()
+    {
+        LOGGER.trace( "TCCL '{}', id '{}'", Thread.currentThread().getContextClassLoader(),
+                      System.identityHashCode(Thread.currentThread().getContextClassLoader()));
+        LOGGER.trace( "CCL '{}', id '{}'", getClass().getClassLoader(),
+                      System.identityHashCode( getClass().getClassLoader() ) );
+    }
+
     private static RedissonClient createRedissonClient()
     {
         Path configFilePath = null;
@@ -154,6 +162,7 @@ public class RedissonSyncContextFactory
 
     public SyncContext newInstance( RepositorySystemSession session, boolean shared )
     {
+        LOGGER.trace( "Instance: {}, identity: {}", this, System.identityHashCode( getClass() ) );
         return new RedissonSyncContext( session, localhostDiscriminator, redissonClient, shared );
     }