001package io.avaje.inject.spi;
002
003import io.avaje.inject.BeanScopeBuilder;
004
005import java.lang.reflect.Type;
006
007/**
008 * A Plugin that can be applied when creating a bean scope.
009 *
010 * <p>Typically, a plugin might provide a default dependency via {@link
011 * BeanScopeBuilder#provideDefault(Type, java.util.function.Supplier)}.
012 */
013public interface Plugin {
014
015  /**
016   * Empty array of classes.
017   */
018  Class<?>[] EMPTY_CLASSES = {};
019
020  /**
021   * Apply the plugin to the scope builder.
022   */
023  void apply(BeanScopeBuilder builder);
024
025  /**
026   * Return the classes that the plugin provides.
027   */
028  default Class<?>[] provides() {
029    return EMPTY_CLASSES;
030  }
031
032  /**
033   * Return the aspect classes that the plugin provides.
034   */
035  default Class<?>[] providesAspects() {
036    return EMPTY_CLASSES;
037  }
038}