class DefaultArtifactHandlerManager extends AbstractEventSpy implements ArtifactHandlerManager {
    private final TypeRegistry typeRegistry;

    private final ConcurrentHashMap<String, ArtifactHandler> allHandlers;

    @Inject
    public DefaultArtifactHandlerManager(TypeRegistry typeRegistry) {
        this.typeRegistry = requireNonNull(typeRegistry, "null typeRegistry");
        this.allHandlers = new ConcurrentHashMap<>();
    }

    @Override
    public void onEvent(Object event) {<FILL_FUNCTION_BODY>}

    @Override
    public ArtifactHandler getArtifactHandler(String id) {
        return allHandlers.computeIfAbsent(id, k -> {
            Type type = typeRegistry.require(id);
            return new DefaultArtifactHandler(
                    id,
                    type.getExtension(),
                    type.getClassifier(),
                    null,
                    null,
                    type.isIncludesDependencies(),
                    type.getLanguage().id(),
                    type.getPathTypes().contains(JavaPathType.CLASSES));
            // TODO: watch out for module path
        });

        // Note: here, type decides is artifact added to "build path" (for example during resolution)
        // and "build path" is intermediate data that is used to create actual Java classpath/modulepath
        // but to create those, proper filtering should happen via Type properties.
    }

    @Override
    public void addHandlers(Map<String, ArtifactHandler> handlers) {
        throw new UnsupportedOperationException("Adding handlers programmatically is not supported anymore");
    }

    @Deprecated
    public Set<String> getHandlerTypes() {
        throw new UnsupportedOperationException("Querying handlers programmatically is not supported anymore");
    }
}

        if (event instanceof ExecutionEvent) {
            ExecutionEvent executionEvent = (ExecutionEvent) event;
            if (executionEvent.getType() == ExecutionEvent.Type.SessionEnded) {
                allHandlers.clear();
            }
        }
    
<methods>public non-sealed void <init>() ,public void close() throws java.lang.Exception,public void init(org.apache.maven.eventspy.EventSpy.Context) throws java.lang.Exception,public void onEvent(java.lang.Object) throws java.lang.Exception<variables>