class AuthenticationService {

    @CachePut(value = "validationJwtToken", key = "#jwtToken", condition = "#jwtToken != null")
    public TokenAuthentication createTokenAuthentication(String user, String jwtToken) {
        final TokenAuthentication out = new TokenAuthentication(user, jwtToken);
        // without a proxy cache aspect is not working, thus it is necessary get bean from application context
        final boolean authenticated = !meAsProxy.isInvalidated(jwtToken);
        out.setAuthenticated(authenticated);
        return out;
    }

}