Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
System.currentTimeMillis()タイムスタンプのカスタマイズされた値を返すために、JDK メソッドのポイントカット + アドバイスが必要です。Springフレームワークでこれが可能かどうか知りたいです。
System.currentTimeMillis()
いいえ。これを行うには、AspectJ を使用して JDK を計測し、独自のカスタム JDK バージョンを作成する必要があります。Spring AOP は Spring Bean のみをプロキシできます。java.lang.instrumentBCEL や ASM などのツールを介した代替アプローチも機能する可能性があります。
java.lang.instrument
ところで:私はあなたが望むものを達成するためのより簡単な方法があると約90%確信しています. システム関数の結果を改ざんする理由を説明できますか?