Locked History Actions

Diff for "guice/Manual/BestPractices/BeCarefulAboutIoInProviders"

Differences between revisions 1 and 2
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
 * プロバイダはチェック例外を提供しない。もし特定のタイプのエラーから復旧する必要のあるコードを記述している場合、TransactionRolledbackExceptionをキャッチすることはできない. ProvisionException allows you to recover from general provision failures, and you can iterate its causes, but you can't specify what those causes may be.  * プロバイダはチェック例外を提供しない。もし特定のタイプのエラーから復旧する必要のあるコードを記述している場合、TransactionRolledbackExceptionをキャッチすることはできない. ProvisionExceptionは一般的なプロバイダ例外から復旧するためのものであり、その原因を数えることもできるが、しかし何が原因なのかはわからない(訳注:?)。
Line 9: Line 9:
ThrowingProviders はGuice-Extensionであり、Exceptionを投げるプロバイダである。It allows failures to be scoped, so a failed lookup only happens once per request or session. ThrowingProviders はGuice-Extensionであり、Exceptionを投げるプロバイダである。
It allows failures to be scoped, so a failed lookup only happens once per request or session.

プロバイダ内でのI/Oに注意

プロバイダインターフェースは呼び出し側にとって便利なものであるが、しかしセマンティックスを欠いている。

  • プロバイダはチェック例外を提供しない。もし特定のタイプのエラーから復旧する必要のあるコードを記述している場合、TransactionRolledbackExceptionをキャッチすることはできない. ProvisionExceptionは一般的なプロバイダ例外から復旧するためのものであり、その原因を数えることもできるが、しかし何が原因なのかはわからない(訳注:?)。

  • プロバイダはタイムアウトをサポートしない。
  • プロバイダは再試行ストラテジを持たない。値が容易されていないときに、get()を複数回呼び出すことは複数のエラーを起こすことになる。

ThrowingProviders はGuice-Extensionであり、Exceptionを投げるプロバイダである。 It allows failures to be scoped, so a failed lookup only happens once per request or session.