001package io.avaje.inject.spi; 002 003import java.lang.reflect.Type; 004 005import io.avaje.inject.InjectModule; 006 007/** 008 * A Module that can be included in BeanScope. 009 * 010 * @deprecated migrate to {@link AvajeModule} 011 */ 012@Deprecated(forRemoval = true) 013public interface Module extends AvajeModule { 014 015 /** 016 * Return the set of types this module explicitly provides to other modules. 017 */ 018 @Override 019 default Class<?>[] provides() { 020 return EMPTY_CLASSES; 021 } 022 023 /** 024 * Return the types this module needs to be provided externally or via other modules. 025 */ 026 @Override 027 default Class<?>[] requires() { 028 return EMPTY_CLASSES; 029 } 030 031 /** 032 * Return the packages this module needs to be provided via other modules. 033 */ 034 @Override 035 default Class<?>[] requiresPackages() { 036 return EMPTY_CLASSES; 037 } 038 039 /** 040 * Return the classes that this module provides that we allow other modules to auto depend on. 041 * <p> 042 * This is a convenience when using multiple modules that is otherwise controlled manually by 043 * explicitly using {@link InjectModule#provides()}. 044 */ 045 @Override 046 default Class<?>[] autoProvides() { 047 return EMPTY_CLASSES; 048 } 049 050 /** 051 * Return the aspects that this module provides. 052 * <p> 053 * This is a convenience when using multiple modules that we otherwise manually specify via 054 * {@link InjectModule#provides()}. 055 */ 056 @Override 057 default Class<?>[] autoProvidesAspects() { 058 return EMPTY_CLASSES; 059 } 060 061 /** 062 * These are the classes that this module requires for wiring that are provided by other 063 * external modules (that are in the classpath at compile time). 064 * <p> 065 * This is a convenience when using multiple modules that is otherwise controlled manually by 066 * explicitly using {@link InjectModule#requires()} or {@link InjectModule#requiresPackages()}. 067 */ 068 @Override 069 default Class<?>[] autoRequires() { 070 return EMPTY_CLASSES; 071 } 072 073 /** 074 * These are the apects that this module requires whose implementations are provided by other external 075 * modules (that are in the classpath at compile time). 076 */ 077 @Override 078 default Class<?>[] autoRequiresAspects() { 079 return EMPTY_CLASSES; 080 } 081 082 /** 083 * Return public classes of the beans that would be registered by this module. 084 * <p> 085 * This method allows code to use reflection to inspect the modules classes 086 * before the module is wired. This method is not required for DI wiring. 087 */ 088 @Override 089 Class<?>[] classes(); 090 091 /** 092 * Build all the beans. 093 */ 094 @Override 095 void build(Builder builder); 096 097 /** 098 * Marker for custom scoped modules. 099 */ 100 interface Custom extends Module { 101 102 } 103}