Skip to content

Commit

Permalink
Remember artifact handlers after they've been used once
Browse files Browse the repository at this point in the history
Otherwise we have to go through the whole sisu engine again,
which is very slow, because it does a linear scan.
  • Loading branch information
oehme committed Apr 10, 2019
1 parent a48f6e4 commit 571da0e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public class DefaultArtifactHandlerManager
@Requirement( role = ArtifactHandler.class )
private Map<String, ArtifactHandler> artifactHandlers;

private Map<String, ArtifactHandler> unmanagedHandlers = new ConcurrentHashMap<>();
private Map<String, ArtifactHandler> allHandlers = new ConcurrentHashMap<>();

public ArtifactHandler getArtifactHandler( String type )
{
ArtifactHandler handler = unmanagedHandlers.get( type );
ArtifactHandler handler = allHandlers.get( type );

if ( handler == null )
{
Expand All @@ -53,6 +53,7 @@ public ArtifactHandler getArtifactHandler( String type )
{
handler = new DefaultArtifactHandler( type );
}
allHandlers.put( type, handler );
}

return handler;
Expand All @@ -61,7 +62,7 @@ public ArtifactHandler getArtifactHandler( String type )
public void addHandlers( Map<String, ArtifactHandler> handlers )
{
// legacy support for maven-gpg-plugin:1.0
unmanagedHandlers.putAll( handlers );
allHandlers.putAll( handlers );
}

@Deprecated
Expand Down

0 comments on commit 571da0e

Please sign in to comment.