例外処理のためのアスペクト指向言語

Bibliographic Information

Other Title
  • レイガイ ショリ ノ タメノ アスペクト シコウ ゲンゴ
  • An Aspect-oriented Language for Exception Handling

Search this article

Abstract

プログラムの実行環境の問題によって例外が発生した場合,その例外に対して適切な処理をすべきである.例外が発生したことを見落として正常時の動作を継続してしまうと,より深刻で致命的な異常事態を招いてしまう恐れがある.しかし,プログラムを記述する際には,例外処理に関してより,ロジックを書くのに集中できた方がよい.また,ロジックを記述した後に必要に応じて例外処理を記述したい場合もある.たとえば,サーバに負荷をかけて性能を測定するという大規模な実験を行うために複数クライアントを起動させる制御プログラムを作成する場合,必要に応じて例外処理を変更できるとよい.このような例外処理記述を可能にするために,我々はアスペクト指向システムGluonJ/Rを提案する.GluonJ/R が持つblock ポイントカット指定子を用いることでプログラム中の範囲を指定することができ,recover アドバイスを用いて指定した範囲内で例外が発生した場合の処理を記述できる.これにより,例外処理をプログラムロジックから分離して記述することができ,後から容易に追加削除できるようになる.また,GluonJ/R は指定した範囲の先頭に戻ってその範囲の処理を再実行することができるという,アドバイスの中で使える特殊なメソッドも提供している.

We must often handle exceptions raised due to a problem of the execution environment. If the exceptions are not handled, they will cause more serious problems. However, when developers are writing a main part of their program, they want to focus on the program logic rather than the exceptions. They may also want to add the code for handling exceptions after they finish writing the program logic. For example, such late extension will be needed when they are writing a program for experimenting the execution performance of their software. To address this problem, we propose an aspect-oriented system named GluonJ/R. GluonJ/R provides a block pointcut for selecting a code block in a given program. The selected code block is associated with a recover advice, which can handle an exception raised in the code block. Developers can thereby describe an exception handler separately from the program logic and they can add and remove it on demand. This enables the programming style we mentioned above. Furthermore, a recover advice can call a special method, which re-executes the code block associated with that advice.

Journal

References(13)*help

See more

Related Projects

See more

Keywords

Details 詳細情報について

Report a problem

Back to top