private static <K, V> Cache<K, V> buildCache(long maxSize, @Nullable Duration maxAge,
                                                 @Nullable Duration maxIdle, int concurrencyLevel) {
        final CacheBuilder<Object, Object> cacheBuilder = CacheBuilder.newBuilder()
                                                                      .maximumSize(maxSize)
                                                                      .concurrencyLevel(concurrencyLevel);
        if (maxAge != null) {
            cacheBuilder.expireAfterWrite(maxAge);
        }
        if (maxIdle != null) {
            cacheBuilder.expireAfterAccess(maxIdle);
        }
        return cacheBuilder.build();
    }
This handler available to execute custom shutdown sequence.
resteasy/src/main/java/com/linecorp/armeria/server/resteasy/ResteasyService.java