Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/w 11706194 #1037

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com
* The software in this package is published under the terms of the CPAL v1.0
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/
package org.mule.runtime.api.metadata;

import org.mule.metadata.api.ListableTypeLoader;
import org.mule.runtime.api.exception.MuleException;

import java.util.Map;

/**
* Interface to retrieve all the available {@link ListableTypeLoader} instances, or by a particular prefix.
*
* @since 1.5.0
*/
public interface ListableTypeLoadersRepository {

/**
* Retrieves all the available {@link ListableTypeLoader} for the different extensions, classified by the extension prefix. If
* you need a particular {@link ListableTypeLoader}, you should use {@link #getTypeLoaderByPrefix(String)} instead, so you take
* advantage of a possible optimization that only builds the {@link ListableTypeLoader} lazily, when it's requested.
*
* @return all the available {@link ListableTypeLoader} for the different extensions, classified by the extension prefix.
*/
Map<String, ListableTypeLoader> getAllTypeLoaders();

/**
* Retrieves a particular {@link ListableTypeLoader} for the passed {@code prefix}.
*
* @param prefix the extension's prefix.
* @return the corresponding instance of {@link ListableTypeLoader}.
* @throws MuleException if a type loader couldn't be found for the passed prefix.
*/
ListableTypeLoader getTypeLoaderByPrefix(String prefix) throws MuleException;
}