/** * Whether DNS should be used to resolve the discovery servers. * * @return True if DNS should be used. */ @Experimental public boolean isShouldUseDns() { return shouldUseDns; }
/** * Whether DNS should be used to resolve the discovery servers. * * @param shouldUseDns True if DNS should be used. */ @Experimental public void setShouldUseDns(boolean shouldUseDns) { this.shouldUseDns = shouldUseDns; }
@Experimental public interface FileCustomizableResponseType extends CustomizableResponseType {
/** * A special type for files specific to Netty. * * @author James Kleeh * @since 1.0 */ @Internal @Experimental public interface NettyFileCustomizableResponseType extends FileCustomizableResponseType, NettyCustomizableResponseType { }
@Experimental public class GraalClassLoadingReporter implements ClassLoadingReporter {
/** * A special type that allows writing data in Netty. * * @author James Kleeh * @since 1.0 */ @Internal @Experimental public interface NettyCustomizableResponseType extends CustomizableResponseType { /** * Write this instance to Netty. * * @param request The request * @param response The response * @param context The Netty {@link ChannelHandlerContext} */ void write(HttpRequest<?> request, MutableHttpResponse<?> response, ChannelHandlerContext context); }
/** * Represents a registry of {@link NettyCustomizableResponseTypeHandler} and finds the correct handler based on * the type. * * @author James Kleeh * @since 1.0 */ @Internal @Experimental public interface NettyCustomizableResponseTypeHandlerRegistry { /** * Finds the first type handler that supports the given type. * * @param type The type to search for * @return An optional {@link NettyCustomizableResponseTypeHandler} * @see NettyCustomizableResponseTypeHandler#supports(Class) */ Optional<NettyCustomizableResponseTypeHandler> findTypeHandler(Class<?> type); }
/** * Represents a class that is designed to handle specific types that are returned from routes in a netty specific way. * * @param <T> The type to be handled * @author James Kleeh * @since 1.0 */ @Internal @Experimental public interface NettyCustomizableResponseTypeHandler<T> extends Ordered { /** * Responsible for fully handling the response, including any closing of the channel. * * @param object The object to be handled * @param request The native Netty request * @param response The mutable Micronaut response * @param context The channel context */ void handle(T object, HttpRequest<?> request, NettyMutableHttpResponse<?> response, ChannelHandlerContext context); /** * @param type The type to check * @return True if the handler supports handling the given type */ boolean supports(Class<?> type); }
/** * Visit a file that will be located within the generated source directory. * * @param path The path to the file * @return An optional file it was possible to create it */ @Experimental Optional<GeneratedFile> visitGeneratedFile(String path);
/** * Visit a file that will be located within the generated source directory. * * @param path The path to the file * @return An optional file it was possible to create it */ @Experimental Optional<GeneratedFile> visitGeneratedFile(String path);
/** * Visit a file within the META-INF directory. * * @param path The path to the file * @return An optional file it was possible to create it */ @Experimental Optional<GeneratedFile> visitMetaInfFile(String path);
/** * Visit a file within the META-INF directory. * * @param path The path to the file * @return An optional file it was possible to create it */ @Experimental Optional<GeneratedFile> visitMetaInfFile(String path);
/** * A special type for file handling. * * @author James Kleeh * @since 1.0 */ @Experimental public interface FileCustomizableResponseType extends CustomizableResponseType { /** * @return The last modified date of the file */ long getLastModified(); /** * @return The length of the file */ long getLength(); /** * @return The name of the file */ String getName(); }