0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CDIの勉強(その3)

0
Posted at

CDIの勉強(その3)

前回の記事の続きです。

インターセプターの利用

インターセプターは、アノテーションを準備し、インターセプトしたい実装を作成し、アノテーションを追加し、bean.xmlを設定するだけでOKです。

pic001.png

デコレーターの利用

デコレーターは、業務ロジックに横断的な実装をしたい場合に使用するようです。
デコレーターとして、追加したい処理を行うクラスを抽象クラスとして定義して、@Decoratorアノテーションを付与します。
フィールド等に、@Delegate アノテーションを付与し、実体のクラス実装に対し、追加する処理をオバーライドします。

デコレーターを有効にするには、beans.xml にクラス情報を登録する必要があります。

2020-05-24 (2).png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?