/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ package org.opensearch.dataprepper.model.plugin; import java.util.Optional; /** * An interface to be provided by extensions which wish to provide classes to plugins. * * @param The type of class provided. * @since 2.3 */ public interface ExtensionProvider { /** * Returns an instance of the class being provided. *

* This is called everytime a plugin requires an instance. The implementor can re-use * instances, or create them on-demand depending on the intention of the extension * author. * * @param context The context for the request. This is currently a placeholder. * @return An instance as requested. */ Optional provideInstance(Context context); /** * Returns the Java {@link Class} which this extension is providing. * * @return A {@link Class}. */ Class supportedClass(); /** * The context for creating a new instance. * * @since 2.3 */ interface Context { } }